nomoreide 0.1.41 → 0.1.42

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.
@@ -1,143 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function i(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(a){if(a.ep)return;a.ep=!0;const l=i(a);fetch(a.href,l)}})();function ET(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},nc={};var Tx;function CT(){if(Tx)return nc;Tx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,a,l){var c=null;if(l!==void 0&&(c=""+l),a.key!==void 0&&(c=""+a.key),"key"in a){l={};for(var h in a)h!=="key"&&(l[h]=a[h])}else l=a;return a=l.ref,{$$typeof:e,type:s,key:c,ref:a!==void 0?a:null,props:l}}return nc.Fragment=t,nc.jsx=i,nc.jsxs=i,nc}var Ax;function kT(){return Ax||(Ax=1,Fm.exports=CT()),Fm.exports}var u=kT(),$m={exports:{}},Ue={};var Mx;function NT(){if(Mx)return Ue;Mx=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"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),v=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function N(D,te,ue){this.props=D,this.context=te,this.refs=C,this.updater=ue||y}N.prototype.isReactComponent={},N.prototype.setState=function(D,te){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,te,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=N.prototype;function A(D,te,ue){this.props=D,this.context=te,this.refs=C,this.updater=ue||y}var M=A.prototype=new T;M.constructor=A,w(M,N.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function K(){}var B={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function H(D,te,ue){var $=ue.ref;return{$$typeof:e,type:D,key:te,ref:$!==void 0?$:null,props:ue}}function P(D,te){return H(D.type,te,D.props)}function q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function J(D){var te={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ue){return te[ue]})}var F=/\/+/g;function ie(D,te){return typeof D=="object"&&D!==null&&D.key!=null?J(""+D.key):te.toString(36)}function V(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(K,K):(D.status="pending",D.then(function(te){D.status==="pending"&&(D.status="fulfilled",D.value=te)},function(te){D.status==="pending"&&(D.status="rejected",D.reason=te)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function O(D,te,ue,$,se){var fe=typeof D;(fe==="undefined"||fe==="boolean")&&(D=null);var ve=!1;if(D===null)ve=!0;else switch(fe){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(D.$$typeof){case e:case t:ve=!0;break;case g:return ve=D._init,O(ve(D._payload),te,ue,$,se)}}if(ve)return se=se(D),ve=$===""?"."+ie(D,0):$,L(se)?(ue="",ve!=null&&(ue=ve.replace(F,"$&/")+"/"),O(se,te,ue,"",function(st){return st})):se!=null&&(q(se)&&(se=P(se,ue+(se.key==null||D&&D.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+ve)),te.push(se)),1;ve=0;var Oe=$===""?".":$+":";if(L(D))for(var ye=0;ye<D.length;ye++)$=D[ye],fe=Oe+ie($,ye),ve+=O($,te,ue,fe,se);else if(ye=x(D),typeof ye=="function")for(D=ye.call(D),ye=0;!($=D.next()).done;)$=$.value,fe=Oe+ie($,ye++),ve+=O($,te,ue,fe,se);else if(fe==="object"){if(typeof D.then=="function")return O(V(D),te,ue,$,se);throw te=String(D),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return ve}function Y(D,te,ue){if(D==null)return D;var $=[],se=0;return O(D,$,"","",function(fe){return te.call(ue,fe,se++)}),$}function X(D){if(D._status===-1){var te=D._result;te=te(),te.then(function(ue){(D._status===0||D._status===-1)&&(D._status=1,D._result=ue)},function(ue){(D._status===0||D._status===-1)&&(D._status=2,D._result=ue)}),D._status===-1&&(D._status=0,D._result=te)}if(D._status===1)return D._result.default;throw D._result}var j=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},W={map:Y,forEach:function(D,te,ue){Y(D,function(){te.apply(this,arguments)},ue)},count:function(D){var te=0;return Y(D,function(){te++}),te},toArray:function(D){return Y(D,function(te){return te})||[]},only:function(D){if(!q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ue.Activity=_,Ue.Children=W,Ue.Component=N,Ue.Fragment=i,Ue.Profiler=a,Ue.PureComponent=A,Ue.StrictMode=s,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(D){return B.H.useMemoCache(D)}},Ue.cache=function(D){return function(){return D.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(D,te,ue){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var $=w({},D.props),se=D.key;if(te!=null)for(fe in te.key!==void 0&&(se=""+te.key),te)!R.call(te,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&te.ref===void 0||($[fe]=te[fe]);var fe=arguments.length-2;if(fe===1)$.children=ue;else if(1<fe){for(var ve=Array(fe),Oe=0;Oe<fe;Oe++)ve[Oe]=arguments[Oe+2];$.children=ve}return H(D.type,se,$)},Ue.createContext=function(D){return D={$$typeof:c,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Ue.createElement=function(D,te,ue){var $,se={},fe=null;if(te!=null)for($ in te.key!==void 0&&(fe=""+te.key),te)R.call(te,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(se[$]=te[$]);var ve=arguments.length-2;if(ve===1)se.children=ue;else if(1<ve){for(var Oe=Array(ve),ye=0;ye<ve;ye++)Oe[ye]=arguments[ye+2];se.children=Oe}if(D&&D.defaultProps)for($ in ve=D.defaultProps,ve)se[$]===void 0&&(se[$]=ve[$]);return H(D,fe,se)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(D){return{$$typeof:h,render:D}},Ue.isValidElement=q,Ue.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:X}},Ue.memo=function(D,te){return{$$typeof:f,type:D,compare:te===void 0?null:te}},Ue.startTransition=function(D){var te=B.T,ue={};B.T=ue;try{var $=D(),se=B.S;se!==null&&se(ue,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(K,j)}catch(fe){j(fe)}finally{te!==null&&ue.types!==null&&(te.types=ue.types),B.T=te}},Ue.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ue.use=function(D){return B.H.use(D)},Ue.useActionState=function(D,te,ue){return B.H.useActionState(D,te,ue)},Ue.useCallback=function(D,te){return B.H.useCallback(D,te)},Ue.useContext=function(D){return B.H.useContext(D)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(D,te){return B.H.useDeferredValue(D,te)},Ue.useEffect=function(D,te){return B.H.useEffect(D,te)},Ue.useEffectEvent=function(D){return B.H.useEffectEvent(D)},Ue.useId=function(){return B.H.useId()},Ue.useImperativeHandle=function(D,te,ue){return B.H.useImperativeHandle(D,te,ue)},Ue.useInsertionEffect=function(D,te){return B.H.useInsertionEffect(D,te)},Ue.useLayoutEffect=function(D,te){return B.H.useLayoutEffect(D,te)},Ue.useMemo=function(D,te){return B.H.useMemo(D,te)},Ue.useOptimistic=function(D,te){return B.H.useOptimistic(D,te)},Ue.useReducer=function(D,te,ue){return B.H.useReducer(D,te,ue)},Ue.useRef=function(D){return B.H.useRef(D)},Ue.useState=function(D){return B.H.useState(D)},Ue.useSyncExternalStore=function(D,te,ue){return B.H.useSyncExternalStore(D,te,ue)},Ue.useTransition=function(){return B.H.useTransition()},Ue.version="19.2.6",Ue}var Rx;function U0(){return Rx||(Rx=1,$m.exports=NT()),$m.exports}var E=U0(),Vm={exports:{}},sc={},qm={exports:{}},Km={};var Dx;function TT(){return Dx||(Dx=1,(function(e){function t(O,Y){var X=O.length;O.push(Y);e:for(;0<X;){var j=X-1>>>1,W=O[j];if(0<a(W,Y))O[j]=Y,O[X]=W,X=j;else break e}}function i(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var Y=O[0],X=O.pop();if(X!==Y){O[0]=X;e:for(var j=0,W=O.length,D=W>>>1;j<D;){var te=2*(j+1)-1,ue=O[te],$=te+1,se=O[$];if(0>a(ue,X))$<W&&0>a(se,ue)?(O[j]=se,O[$]=X,j=$):(O[j]=ue,O[te]=X,j=te);else if($<W&&0>a(se,X))O[j]=se,O[$]=X,j=$;else break e}}return Y}function a(O,Y){var X=O.sortIndex-Y.sortIndex;return X!==0?X:O.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,h=c.now();e.unstable_now=function(){return c.now()-h}}var m=[],f=[],g=1,_=null,v=3,x=!1,y=!1,w=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var Y=i(f);Y!==null;){if(Y.callback===null)s(f);else if(Y.startTime<=O)s(f),Y.sortIndex=Y.expirationTime,t(m,Y);else break;Y=i(f)}}function L(O){if(w=!1,M(O),!y)if(i(m)!==null)y=!0,K||(K=!0,J());else{var Y=i(f);Y!==null&&V(L,Y.startTime-O)}}var K=!1,B=-1,R=5,H=-1;function P(){return C?!0:!(e.unstable_now()-H<R)}function q(){if(C=!1,K){var O=e.unstable_now();H=O;var Y=!0;try{e:{y=!1,w&&(w=!1,T(B),B=-1),x=!0;var X=v;try{t:{for(M(O),_=i(m);_!==null&&!(_.expirationTime>O&&P());){var j=_.callback;if(typeof j=="function"){_.callback=null,v=_.priorityLevel;var W=j(_.expirationTime<=O);if(O=e.unstable_now(),typeof W=="function"){_.callback=W,M(O),Y=!0;break t}_===i(m)&&s(m),M(O)}else s(m);_=i(m)}if(_!==null)Y=!0;else{var D=i(f);D!==null&&V(L,D.startTime-O),Y=!1}}break e}finally{_=null,v=X,x=!1}Y=void 0}}finally{Y?J():K=!1}}}var J;if(typeof A=="function")J=function(){A(q)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,ie=F.port2;F.port1.onmessage=q,J=function(){ie.postMessage(null)}}else J=function(){N(q,0)};function V(O,Y){B=N(function(){O(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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var X=v;v=Y;try{return O()}finally{v=X}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,Y){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var X=v;v=O;try{return Y()}finally{v=X}},e.unstable_scheduleCallback=function(O,Y,X){var j=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?j+X:j):X=j,O){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=X+W,O={id:g++,callback:Y,priorityLevel:O,startTime:X,expirationTime:W,sortIndex:-1},X>j?(O.sortIndex=X,t(f,O),i(m)===null&&O===i(f)&&(w?(T(B),B=-1):w=!0,V(L,X-j))):(O.sortIndex=W,t(m,O),y||x||(y=!0,K||(K=!0,J()))),O},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(O){var Y=v;return function(){var X=v;v=Y;try{return O.apply(this,arguments)}finally{v=X}}}})(Km)),Km}var Ox;function AT(){return Ox||(Ox=1,qm.exports=TT()),qm.exports}var Gm={exports:{}},ji={};var jx;function MT(){if(jx)return ji;jx=1;var e=U0();function t(m){var f="https://react.dev/errors/"+m;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}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 l(m,f,g){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:_==null?null:""+_,children:m,containerInfo:f,implementation:g}}var c=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 ji.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ji.createPortal=function(m,f){var g=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 l(m,f,null,g)},ji.flushSync=function(m){var f=c.T,g=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=f,s.p=g,s.d.f()}},ji.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))},ji.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},ji.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var g=f.as,_=h(g,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?s.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:_,integrity:v,fetchPriority:x}):g==="script"&&s.d.X(m,{crossOrigin:_,integrity:v,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ji.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=h(f.as,f.crossOrigin);s.d.M(m,{crossOrigin:g,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)},ji.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,_=h(g,f.crossOrigin);s.d.L(m,g,{crossOrigin:_,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})}},ji.preloadModule=function(m,f){if(typeof m=="string")if(f){var g=h(f.as,f.crossOrigin);s.d.m(m,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(m)},ji.requestFormReset=function(m){s.d.r(m)},ji.unstable_batchedUpdates=function(m,f){return m(f)},ji.useFormState=function(m,f,g){return c.H.useFormState(m,f,g)},ji.useFormStatus=function(){return c.H.useHostTransitionStatus()},ji.version="19.2.6",ji}var Lx;function F2(){if(Lx)return Gm.exports;Lx=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(),Gm.exports=MT(),Gm.exports}var Bx;function RT(){if(Bx)return sc;Bx=1;var e=AT(),t=U0(),i=F2();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}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 l(n){var r=n,o=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(o=r.return),n=r.return;while(n)}return r.tag===3?o:null}function c(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(l(n)!==n)throw Error(s(188))}function f(n){var r=n.alternate;if(!r){if(r=l(n),r===null)throw Error(s(188));return r!==n?null:n}for(var o=n,d=r;;){var p=o.return;if(p===null)break;var b=p.alternate;if(b===null){if(d=p.return,d!==null){o=d;continue}break}if(p.child===b.child){for(b=p.child;b;){if(b===o)return m(p),n;if(b===d)return m(p),r;b=b.sibling}throw Error(s(188))}if(o.return!==d.return)o=p,d=b;else{for(var S=!1,k=p.child;k;){if(k===o){S=!0,o=p,d=b;break}if(k===d){S=!0,d=p,o=b;break}k=k.sibling}if(!S){for(k=b.child;k;){if(k===o){S=!0,o=b,d=p;break}if(k===d){S=!0,d=b,o=p;break}k=k.sibling}if(!S)throw Error(s(189))}}if(o.alternate!==d)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?n:r}function g(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=g(n),r!==null)return r;n=n.sibling}return null}var _=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function J(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var F=Symbol.for("react.client.reference");function ie(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===F?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case w:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case K:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case y:return"Portal";case A:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case M:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case B:return r=n.displayName||null,r!==null?r:ie(n.type)||"Memo";case R:r=n._payload,n=n._init;try{return ie(n(r))}catch{}}return null}var V=Array.isArray,O=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},j=[],W=-1;function D(n){return{current:n}}function te(n){0>W||(n.current=j[W],j[W]=null,W--)}function ue(n,r){W++,j[W]=n.current,n.current=r}var $=D(null),se=D(null),fe=D(null),ve=D(null);function Oe(n,r){switch(ue(fe,r),ue(se,n),ue($,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?Z1(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=Z1(r),n=Q1(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}te($),ue($,n)}function ye(){te($),te(se),te(fe)}function st(n){n.memoizedState!==null&&ue(ve,n);var r=$.current,o=Q1(r,n.type);r!==o&&(ue(se,n),ue($,o))}function lt(n){se.current===n&&(te($),te(se)),ve.current===n&&(te(ve),Jl._currentValue=X)}var ct,ze;function Ft(n){if(ct===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);ct=r&&r[1]||"",ze=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ct+n+ze}var ea=!1;function vs(n,r){if(!n||ea)return"";ea=!0;var o=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(ne){var ee=ne}Reflect.construct(n,[],le)}else{try{le.call()}catch(ne){ee=ne}n.call(le.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(le=n())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),S=b[0],k=b[1];if(S&&k){var z=S.split(`
4
- `),Q=k.split(`
5
- `);for(p=d=0;d<z.length&&!z[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;if(d===z.length||p===Q.length)for(d=z.length-1,p=Q.length-1;1<=d&&0<=p&&z[d]!==Q[p];)p--;for(;1<=d&&0<=p;d--,p--)if(z[d]!==Q[p]){if(d!==1||p!==1)do if(d--,p--,0>p||z[d]!==Q[p]){var re=`
6
- `+z[d].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=d&&0<=p);break}}}finally{ea=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Ft(o):""}function Ka(n,r){switch(n.tag){case 26:case 27:case 5:return Ft(n.type);case 16:return Ft("Lazy");case 13:return n.child!==r&&r!==null?Ft("Suspense Fallback"):Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 15:return vs(n.type,!1);case 11:return vs(n.type.render,!1);case 1:return vs(n.type,!0);case 31:return Ft("Activity");default:return""}}function ta(n){try{var r="",o=null;do r+=Ka(n,o),o=n,n=n.return;while(n);return r}catch(d){return`
7
- Error generating stack: `+d.message+`
8
- `+d.stack}}var ia=Object.prototype.hasOwnProperty,sr=e.unstable_scheduleCallback,xs=e.unstable_cancelCallback,ol=e.unstable_shouldYield,Ga=e.unstable_requestPaint,Ot=e.unstable_now,ys=e.unstable_getCurrentPriorityLevel,xi=e.unstable_ImmediatePriority,Ss=e.unstable_UserBlockingPriority,ws=e.unstable_NormalPriority,Wa=e.unstable_LowPriority,rr=e.unstable_IdlePriority,ll=e.log,Ya=e.unstable_setDisableYieldValue,Es=null,fi=null;function Sn(n){if(typeof ll=="function"&&Ya(n),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(Es,n)}catch{}}var yi=Math.clz32?Math.clz32:Xa,cl=Math.log,na=Math.LN2;function Xa(n){return n>>>=0,n===0?32:31-(cl(n)/na|0)|0}var it=256,qn=262144,ln=4194304;function Ri(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function I(n,r,o){var d=n.pendingLanes;if(d===0)return 0;var p=0,b=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var k=d&134217727;return k!==0?(d=k&~b,d!==0?p=Ri(d):(S&=k,S!==0?p=Ri(S):o||(o=k&~n,o!==0&&(p=Ri(o))))):(k=d&~b,k!==0?p=Ri(k):S!==0?p=Ri(S):o||(o=d&~n,o!==0&&(p=Ri(o)))),p===0?0:r!==0&&r!==p&&(r&b)===0&&(b=p&-p,o=r&-r,b>=o||b===32&&(o&4194048)!==0)?r:p}function ae(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function be(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 Ie(){var n=ln;return ln<<=1,(ln&62914560)===0&&(ln=4194304),n}function Ct(n){for(var r=[],o=0;31>o;o++)r.push(n);return r}function yt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Ne(n,r,o,d,p,b){var S=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var k=n.entanglements,z=n.expirationTimes,Q=n.hiddenUpdates;for(o=S&~o;0<o;){var re=31-yi(o),le=1<<re;k[re]=0,z[re]=-1;var ee=Q[re];if(ee!==null)for(Q[re]=null,re=0;re<ee.length;re++){var ne=ee[re];ne!==null&&(ne.lane&=-536870913)}o&=~le}d!==0&&Se(n,d,0),b!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=b&~(S&~r))}function Se(n,r,o){n.pendingLanes|=r,n.suspendedLanes&=~r;var d=31-yi(r);n.entangledLanes|=r,n.entanglements[d]=n.entanglements[d]|1073741824|o&261930}function Be(n,r){var o=n.entangledLanes|=r;for(n=n.entanglements;o;){var d=31-yi(o),p=1<<d;p&r|n[d]&r&&(n[d]|=r),o&=~p}}function $t(n,r){var o=r&-r;return o=(o&42)!==0?1:Mt(o),(o&(n.suspendedLanes|r))!==0?0:o}function Mt(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 Cs(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Za(){var n=Y.p;return n!==0?n:(n=window.event,n===void 0?32:yx(n.type))}function Qa(n,r){var o=Y.p;try{return Y.p=n,r()}finally{Y.p=o}}var ts=Math.random().toString(36).slice(2),Vt="__reactFiber$"+ts,Di="__reactProps$"+ts,ar="__reactContainer$"+ts,ul="__reactEvents$"+ts,ru="__reactListeners$"+ts,Ja="__reactHandles$"+ts,au="__reactResources$"+ts,sa="__reactMarker$"+ts;function dl(n){delete n[Vt],delete n[Di],delete n[ul],delete n[ru],delete n[Ja]}function Ui(n){var r=n[Vt];if(r)return r;for(var o=n.parentNode;o;){if(r=o[ar]||o[Vt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(n=rx(n);n!==null;){if(o=n[Vt])return o;n=rx(n)}return r}n=o,o=n.parentNode}return null}function ks(n){if(n=n[Vt]||n[ar]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function or(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function lr(n){var r=n[au];return r||(r=n[au]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Yt(n){n[sa]=!0}var ou=new Set,ra={};function Ns(n,r){me(n,r),me(n+"Capture",r)}function me(n,r){for(ra[n]=r,n=0;n<r.length;n++)ou.add(r[n])}var Me=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]*$"),Ye={},ht={};function qt(n){return ia.call(ht,n)?!0:ia.call(Ye,n)?!1:Me.test(n)?ht[n]=!0:(Ye[n]=!0,!1)}function Oi(n,r,o){if(qt(r))if(o===null)n.removeAttribute(r);else{switch(typeof o){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,""+o)}}function cn(n,r,o){if(o===null)n.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+o)}}function Xi(n,r,o,d){if(d===null)n.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(r,o,""+d)}}function Et(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function un(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function lu(n,r,o){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,b=d.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,b.call(this,S)}}),Object.defineProperty(n,r,{enumerable:d.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function eo(n){if(!n._valueTracker){var r=un(n)?"checked":"value";n._valueTracker=lu(n,r,""+n[r])}}function hl(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var o=r.getValue(),d="";return n&&(d=un(n)?n.checked?"true":"false":n.value),n=d,n!==o?(r.setValue(n),!0):!1}function to(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 Uh=/[\n"\\]/g;function Zi(n){return n.replace(Uh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function fl(n,r,o,d,p,b,S,k){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),r!=null?S==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Et(r)):n.value!==""+Et(r)&&(n.value=""+Et(r)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),r!=null?io(n,S,Et(r)):o!=null?io(n,S,Et(o)):d!=null&&n.removeAttribute("value"),p==null&&b!=null&&(n.defaultChecked=!!b),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+Et(k):n.removeAttribute("name")}function aa(n,r,o,d,p,b,S,k){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.type=b),r!=null||o!=null){if(!(b!=="submit"&&b!=="reset"||r!=null)){eo(n);return}o=o!=null?""+Et(o):"",r=r!=null?""+Et(r):o,k||r===n.value||(n.value=r),n.defaultValue=r}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=k?n.checked:!!d,n.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),eo(n)}function io(n,r,o){r==="number"&&to(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Si(n,r,o,d){if(n=n.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<n.length;o++)p=r.hasOwnProperty("$"+n[o].value),n[o].selected!==p&&(n[o].selected=p),p&&d&&(n[o].defaultSelected=!0)}else{for(o=""+Et(o),r=null,p=0;p<n.length;p++){if(n[p].value===o){n[p].selected=!0,d&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function cu(n,r,o){if(r!=null&&(r=""+Et(r),r!==n.value&&(n.value=r),o==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=o!=null?""+Et(o):""}function no(n,r,o,d){if(r==null){if(d!=null){if(o!=null)throw Error(s(92));if(V(d)){if(1<d.length)throw Error(s(93));d=d[0]}o=d}o==null&&(o=""),r=o}o=Et(r),n.defaultValue=o,d=n.textContent,d===o&&d!==""&&d!==null&&(n.value=d),eo(n)}function Le(n,r){if(r){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=r;return}}n.textContent=r}var uu=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 Xt(n,r,o){var d=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":d?n.setProperty(r,o):typeof o!="number"||o===0||uu.has(r)?r==="float"?n.cssFloat=o:n[r]=(""+o).trim():n[r]=o+"px"}function ft(n,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||r!=null&&r.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var p in r)d=r[p],r.hasOwnProperty(p)&&o[p]!==d&&Xt(n,p,d)}else for(var b in r)r.hasOwnProperty(b)&&Xt(n,b,r[b])}function cr(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 Ts=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"]]),ml=/^[\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 ur(n){return ml.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ge(){}var Te=null;function He(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Qe=null,jt=null;function wn(n){var r=ks(n);if(r&&(n=r.stateNode)){var o=n[Di]||null;e:switch(n=r.stateNode,r.type){case"input":if(fl(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Zi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var d=o[r];if(d!==n&&d.form===n.form){var p=d[Di]||null;if(!p)throw Error(s(90));fl(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)d=o[r],d.form===n.form&&hl(d)}break e;case"textarea":cu(n,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Si(n,!!o.multiple,r,!1)}}}var pl=!1;function du(n,r,o){if(pl)return n(r,o);pl=!0;try{var d=n(r);return d}finally{if(pl=!1,(Qe!==null||jt!==null)&&(Qu(),Qe&&(r=Qe,n=jt,jt=Qe=null,wn(r),n)))for(r=0;r<n.length;r++)wn(n[r])}}function gl(n,r){var o=n.stateNode;if(o===null)return null;var d=o[Di]||null;if(d===null)return null;o=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(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var As=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hh=!1;if(As)try{var _l={};Object.defineProperty(_l,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",_l,_l),window.removeEventListener("test",_l,_l)}catch{Hh=!1}var dr=null,Fh=null,hu=null;function Q_(){if(hu)return hu;var n,r=Fh,o=r.length,d,p="value"in dr?dr.value:dr.textContent,b=p.length;for(n=0;n<o&&r[n]===p[n];n++);var S=o-n;for(d=1;d<=S&&r[o-d]===p[b-d];d++);return hu=p.slice(n,1<d?1-d:void 0)}function fu(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 mu(){return!0}function J_(){return!1}function Qi(n){function r(o,d,p,b,S){this._reactName=o,this._targetInst=p,this.type=d,this.nativeEvent=b,this.target=S,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(o=n[k],this[k]=o?o(b):b[k]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?mu:J_,this.isPropagationStopped=J_,this}return _(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),r}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pu=Qi(oa),bl=_({},oa,{view:0,detail:0}),SN=Qi(bl),$h,Vh,vl,gu=_({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kh,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!==vl&&(vl&&n.type==="mousemove"?($h=n.screenX-vl.screenX,Vh=n.screenY-vl.screenY):Vh=$h=0,vl=n),$h)},movementY:function(n){return"movementY"in n?n.movementY:Vh}}),eb=Qi(gu),wN=_({},gu,{dataTransfer:0}),EN=Qi(wN),CN=_({},bl,{relatedTarget:0}),qh=Qi(CN),kN=_({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),NN=Qi(kN),TN=_({},oa,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),AN=Qi(TN),MN=_({},oa,{data:0}),tb=Qi(MN),RN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DN={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"},ON={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jN(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=ON[n])?!!r[n]:!1}function Kh(){return jN}var LN=_({},bl,{key:function(n){if(n.key){var r=RN[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=fu(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?DN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kh,charCode:function(n){return n.type==="keypress"?fu(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?fu(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),BN=Qi(LN),zN=_({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ib=Qi(zN),IN=_({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kh}),PN=Qi(IN),UN=_({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),HN=Qi(UN),FN=_({},gu,{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}),$N=Qi(FN),VN=_({},oa,{newState:0,oldState:0}),qN=Qi(VN),KN=[9,13,27,32],Gh=As&&"CompositionEvent"in window,xl=null;As&&"documentMode"in document&&(xl=document.documentMode);var GN=As&&"TextEvent"in window&&!xl,nb=As&&(!Gh||xl&&8<xl&&11>=xl),sb=" ",rb=!1;function ab(n,r){switch(n){case"keyup":return KN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ob(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var so=!1;function WN(n,r){switch(n){case"compositionend":return ob(r);case"keypress":return r.which!==32?null:(rb=!0,sb);case"textInput":return n=r.data,n===sb&&rb?null:n;default:return null}}function YN(n,r){if(so)return n==="compositionend"||!Gh&&ab(n,r)?(n=Q_(),hu=Fh=dr=null,so=!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 nb&&r.locale!=="ko"?null:r.data;default:return null}}var XN={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 lb(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!XN[n.type]:r==="textarea"}function cb(n,r,o,d){Qe?jt?jt.push(d):jt=[d]:Qe=d,r=rd(r,"onChange"),0<r.length&&(o=new pu("onChange","change",null,o,d),n.push({event:o,listeners:r}))}var yl=null,Sl=null;function ZN(n){q1(n,0)}function _u(n){var r=or(n);if(hl(r))return n}function ub(n,r){if(n==="change")return r}var db=!1;if(As){var Wh;if(As){var Yh="oninput"in document;if(!Yh){var hb=document.createElement("div");hb.setAttribute("oninput","return;"),Yh=typeof hb.oninput=="function"}Wh=Yh}else Wh=!1;db=Wh&&(!document.documentMode||9<document.documentMode)}function fb(){yl&&(yl.detachEvent("onpropertychange",mb),Sl=yl=null)}function mb(n){if(n.propertyName==="value"&&_u(Sl)){var r=[];cb(r,Sl,n,He(n)),du(ZN,r)}}function QN(n,r,o){n==="focusin"?(fb(),yl=r,Sl=o,yl.attachEvent("onpropertychange",mb)):n==="focusout"&&fb()}function JN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return _u(Sl)}function e5(n,r){if(n==="click")return _u(r)}function t5(n,r){if(n==="input"||n==="change")return _u(r)}function i5(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var dn=typeof Object.is=="function"?Object.is:i5;function wl(n,r){if(dn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var o=Object.keys(n),d=Object.keys(r);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var p=o[d];if(!ia.call(r,p)||!dn(n[p],r[p]))return!1}return!0}function pb(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function gb(n,r){var o=pb(n);n=0;for(var d;o;){if(o.nodeType===3){if(d=n+o.textContent.length,n<=r&&d>=r)return{node:o,offset:r-n};n=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=pb(o)}}function _b(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?_b(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function bb(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=to(n.document);r instanceof n.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)n=r.contentWindow;else break;r=to(n.document)}return r}function Xh(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 n5=As&&"documentMode"in document&&11>=document.documentMode,ro=null,Zh=null,El=null,Qh=!1;function vb(n,r,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Qh||ro==null||ro!==to(d)||(d=ro,"selectionStart"in d&&Xh(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}),El&&wl(El,d)||(El=d,d=rd(Zh,"onSelect"),0<d.length&&(r=new pu("onSelect","select",null,r,o),n.push({event:r,listeners:d}),r.target=ro)))}function la(n,r){var o={};return o[n.toLowerCase()]=r.toLowerCase(),o["Webkit"+n]="webkit"+r,o["Moz"+n]="moz"+r,o}var ao={animationend:la("Animation","AnimationEnd"),animationiteration:la("Animation","AnimationIteration"),animationstart:la("Animation","AnimationStart"),transitionrun:la("Transition","TransitionRun"),transitionstart:la("Transition","TransitionStart"),transitioncancel:la("Transition","TransitionCancel"),transitionend:la("Transition","TransitionEnd")},Jh={},xb={};As&&(xb=document.createElement("div").style,"AnimationEvent"in window||(delete ao.animationend.animation,delete ao.animationiteration.animation,delete ao.animationstart.animation),"TransitionEvent"in window||delete ao.transitionend.transition);function ca(n){if(Jh[n])return Jh[n];if(!ao[n])return n;var r=ao[n],o;for(o in r)if(r.hasOwnProperty(o)&&o in xb)return Jh[n]=r[o];return n}var yb=ca("animationend"),Sb=ca("animationiteration"),wb=ca("animationstart"),s5=ca("transitionrun"),r5=ca("transitionstart"),a5=ca("transitioncancel"),Eb=ca("transitionend"),Cb=new Map,ef="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(" ");ef.push("scrollEnd");function Kn(n,r){Cb.set(n,r),Ns(r,[n])}var bu=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)},En=[],oo=0,tf=0;function vu(){for(var n=oo,r=tf=oo=0;r<n;){var o=En[r];En[r++]=null;var d=En[r];En[r++]=null;var p=En[r];En[r++]=null;var b=En[r];if(En[r++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}b!==0&&kb(o,p,b)}}function xu(n,r,o,d){En[oo++]=n,En[oo++]=r,En[oo++]=o,En[oo++]=d,tf|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function nf(n,r,o,d){return xu(n,r,o,d),yu(n)}function ua(n,r){return xu(n,null,null,r),yu(n)}function kb(n,r,o){n.lanes|=o;var d=n.alternate;d!==null&&(d.lanes|=o);for(var p=!1,b=n.return;b!==null;)b.childLanes|=o,d=b.alternate,d!==null&&(d.childLanes|=o),b.tag===22&&(n=b.stateNode,n===null||n._visibility&1||(p=!0)),n=b,b=b.return;return n.tag===3?(b=n.stateNode,p&&r!==null&&(p=31-yi(o),n=b.hiddenUpdates,d=n[p],d===null?n[p]=[r]:d.push(r),r.lane=o|536870912),b):null}function yu(n){if(50<Kl)throw Kl=0,hm=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var lo={};function o5(n,r,o,d){this.tag=n,this.key=o,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 hn(n,r,o,d){return new o5(n,r,o,d)}function sf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ms(n,r){var o=n.alternate;return o===null?(o=hn(n.tag,r,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=r,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,r=n.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Nb(n,r){n.flags&=65011714;var o=n.alternate;return o===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=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,r=o.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Su(n,r,o,d,p,b){var S=0;if(d=n,typeof n=="function")sf(n)&&(S=1);else if(typeof n=="string")S=hT(n,o,$.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=hn(31,o,r,p),n.elementType=H,n.lanes=b,n;case w:return da(o.children,p,b,r);case C:S=8,p|=24;break;case N:return n=hn(12,o,r,p|2),n.elementType=N,n.lanes=b,n;case L:return n=hn(13,o,r,p),n.elementType=L,n.lanes=b,n;case K:return n=hn(19,o,r,p),n.elementType=K,n.lanes=b,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:S=10;break e;case T:S=9;break e;case M:S=11;break e;case B:S=14;break e;case R:S=16,d=null;break e}S=29,o=Error(s(130,n===null?"null":typeof n,"")),d=null}return r=hn(S,o,r,p),r.elementType=n,r.type=d,r.lanes=b,r}function da(n,r,o,d){return n=hn(7,n,d,r),n.lanes=o,n}function rf(n,r,o){return n=hn(6,n,null,r),n.lanes=o,n}function Tb(n){var r=hn(18,null,null,0);return r.stateNode=n,r}function af(n,r,o){return r=hn(4,n.children!==null?n.children:[],n.key,r),r.lanes=o,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Ab=new WeakMap;function Cn(n,r){if(typeof n=="object"&&n!==null){var o=Ab.get(n);return o!==void 0?o:(r={value:n,source:r,stack:ta(r)},Ab.set(n,r),r)}return{value:n,source:r,stack:ta(r)}}var co=[],uo=0,wu=null,Cl=0,kn=[],Nn=0,hr=null,is=1,ns="";function Rs(n,r){co[uo++]=Cl,co[uo++]=wu,wu=n,Cl=r}function Mb(n,r,o){kn[Nn++]=is,kn[Nn++]=ns,kn[Nn++]=hr,hr=n;var d=is;n=ns;var p=32-yi(d)-1;d&=~(1<<p),o+=1;var b=32-yi(r)+p;if(30<b){var S=p-p%5;b=(d&(1<<S)-1).toString(32),d>>=S,p-=S,is=1<<32-yi(r)+p|o<<p|d,ns=b+n}else is=1<<b|o<<p|d,ns=n}function of(n){n.return!==null&&(Rs(n,1),Mb(n,1,0))}function lf(n){for(;n===wu;)wu=co[--uo],co[uo]=null,Cl=co[--uo],co[uo]=null;for(;n===hr;)hr=kn[--Nn],kn[Nn]=null,ns=kn[--Nn],kn[Nn]=null,is=kn[--Nn],kn[Nn]=null}function Rb(n,r){kn[Nn++]=is,kn[Nn++]=ns,kn[Nn++]=hr,is=r.id,ns=r.overflow,hr=n}var wi=null,kt=null,tt=!1,fr=null,Tn=!1,cf=Error(s(519));function mr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kl(Cn(r,n)),cf}function Db(n){var r=n.stateNode,o=n.type,d=n.memoizedProps;switch(r[Vt]=n,r[Di]=d,o){case"dialog":Ze("cancel",r),Ze("close",r);break;case"iframe":case"object":case"embed":Ze("load",r);break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ze(Wl[o],r);break;case"source":Ze("error",r);break;case"img":case"image":case"link":Ze("error",r),Ze("load",r);break;case"details":Ze("toggle",r);break;case"input":Ze("invalid",r),aa(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ze("invalid",r);break;case"textarea":Ze("invalid",r),no(r,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||d.suppressHydrationWarning===!0||Y1(r.textContent,o)?(d.popover!=null&&(Ze("beforetoggle",r),Ze("toggle",r)),d.onScroll!=null&&Ze("scroll",r),d.onScrollEnd!=null&&Ze("scrollend",r),d.onClick!=null&&(r.onclick=ge),r=!0):r=!1,r||mr(n,!0)}function Ob(n){for(wi=n.return;wi;)switch(wi.tag){case 5:case 31:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:wi=wi.return}}function ho(n){if(n!==wi)return!1;if(!tt)return Ob(n),tt=!0,!1;var r=n.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||Nm(n.type,n.memoizedProps)),o=!o),o&&kt&&mr(n),Ob(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=sx(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=sx(n)}else r===27?(r=kt,Tr(n.type)?(n=Dm,Dm=null,kt=n):kt=r):kt=wi?Mn(n.stateNode.nextSibling):null;return!0}function ha(){kt=wi=null,tt=!1}function uf(){var n=fr;return n!==null&&(nn===null?nn=n:nn.push.apply(nn,n),fr=null),n}function kl(n){fr===null?fr=[n]:fr.push(n)}var df=D(null),fa=null,Ds=null;function pr(n,r,o){ue(df,r._currentValue),r._currentValue=o}function Os(n){n._currentValue=df.current,te(df)}function hf(n,r,o){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===o)break;n=n.return}}function ff(n,r,o,d){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var b=p.dependencies;if(b!==null){var S=p.child;b=b.firstContext;e:for(;b!==null;){var k=b;b=p;for(var z=0;z<r.length;z++)if(k.context===r[z]){b.lanes|=o,k=b.alternate,k!==null&&(k.lanes|=o),hf(b.return,o,n),d||(S=null);break e}b=k.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(s(341));S.lanes|=o,b=S.alternate,b!==null&&(b.lanes|=o),hf(S,o,n),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===n){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function fo(n,r,o,d){n=null;for(var p=r,b=!1;p!==null;){if(!b){if((p.flags&524288)!==0)b=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var k=p.type;dn(p.pendingProps.value,S.value)||(n!==null?n.push(k):n=[k])}}else if(p===ve.current){if(S=p.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Jl):n=[Jl])}p=p.return}n!==null&&ff(r,n,o,d),r.flags|=262144}function Eu(n){for(n=n.firstContext;n!==null;){if(!dn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ma(n){fa=n,Ds=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ei(n){return jb(fa,n)}function Cu(n,r){return fa===null&&ma(n),jb(n,r)}function jb(n,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},Ds===null){if(n===null)throw Error(s(308));Ds=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Ds=Ds.next=r;return o}var l5=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(o,d){n.push(d)}};this.abort=function(){r.aborted=!0,n.forEach(function(o){return o()})}},c5=e.unstable_scheduleCallback,u5=e.unstable_NormalPriority,Zt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new l5,data:new Map,refCount:0}}function Nl(n){n.refCount--,n.refCount===0&&c5(u5,function(){n.controller.abort()})}var Tl=null,pf=0,mo=0,po=null;function d5(n,r){if(Tl===null){var o=Tl=[];pf=0,mo=bm(),po={status:"pending",value:void 0,then:function(d){o.push(d)}}}return pf++,r.then(Lb,Lb),r}function Lb(){if(--pf===0&&Tl!==null){po!==null&&(po.status="fulfilled");var n=Tl;Tl=null,mo=0,po=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function h5(n,r){var o=[],d={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return n.then(function(){d.status="fulfilled",d.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(d.status="rejected",d.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),d}var Bb=O.S;O.S=function(n,r){v1=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&d5(n,r),Bb!==null&&Bb(n,r)};var pa=D(null);function gf(){var n=pa.current;return n!==null?n:St.pooledCache}function ku(n,r){r===null?ue(pa,pa.current):ue(pa,r.pool)}function zb(){var n=gf();return n===null?null:{parent:Zt._currentValue,pool:n}}var go=Error(s(460)),_f=Error(s(474)),Nu=Error(s(542)),Tu={then:function(){}};function Ib(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Pb(n,r,o){switch(o=n[o],o===void 0?n.push(r):o!==r&&(r.then(ge,ge),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Hb(n),n;default:if(typeof r.status=="string")r.then(ge,ge);else{if(n=St,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(d){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=d}},function(d){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=d}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Hb(n),n}throw _a=r,go}}function ga(n){try{var r=n._init;return r(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(_a=o,go):o}}var _a=null;function Ub(){if(_a===null)throw Error(s(459));var n=_a;return _a=null,n}function Hb(n){if(n===go||n===Nu)throw Error(s(483))}var _o=null,Al=0;function Au(n){var r=Al;return Al+=1,_o===null&&(_o=[]),Pb(_o,n,r)}function Ml(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Mu(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 Fb(n){function r(G,U){if(n){var Z=G.deletions;Z===null?(G.deletions=[U],G.flags|=16):Z.push(U)}}function o(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 p(G,U){return G=Ms(G,U),G.index=0,G.sibling=null,G}function b(G,U,Z){return G.index=Z,n?(Z=G.alternate,Z!==null?(Z=Z.index,Z<U?(G.flags|=67108866,U):Z):(G.flags|=67108866,U)):(G.flags|=1048576,U)}function S(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function k(G,U,Z,oe){return U===null||U.tag!==6?(U=rf(Z,G.mode,oe),U.return=G,U):(U=p(U,Z),U.return=G,U)}function z(G,U,Z,oe){var De=Z.type;return De===w?re(G,U,Z.props.children,oe,Z.key):U!==null&&(U.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===R&&ga(De)===U.type)?(U=p(U,Z.props),Ml(U,Z),U.return=G,U):(U=Su(Z.type,Z.key,Z.props,null,G.mode,oe),Ml(U,Z),U.return=G,U)}function Q(G,U,Z,oe){return U===null||U.tag!==4||U.stateNode.containerInfo!==Z.containerInfo||U.stateNode.implementation!==Z.implementation?(U=af(Z,G.mode,oe),U.return=G,U):(U=p(U,Z.children||[]),U.return=G,U)}function re(G,U,Z,oe,De){return U===null||U.tag!==7?(U=da(Z,G.mode,oe,De),U.return=G,U):(U=p(U,Z),U.return=G,U)}function le(G,U,Z){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=rf(""+U,G.mode,Z),U.return=G,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return Z=Su(U.type,U.key,U.props,null,G.mode,Z),Ml(Z,U),Z.return=G,Z;case y:return U=af(U,G.mode,Z),U.return=G,U;case R:return U=ga(U),le(G,U,Z)}if(V(U)||J(U))return U=da(U,G.mode,Z,null),U.return=G,U;if(typeof U.then=="function")return le(G,Au(U),Z);if(U.$$typeof===A)return le(G,Cu(G,U),Z);Mu(G,U)}return null}function ee(G,U,Z,oe){var De=U!==null?U.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return De!==null?null:k(G,U,""+Z,oe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return Z.key===De?z(G,U,Z,oe):null;case y:return Z.key===De?Q(G,U,Z,oe):null;case R:return Z=ga(Z),ee(G,U,Z,oe)}if(V(Z)||J(Z))return De!==null?null:re(G,U,Z,oe,null);if(typeof Z.then=="function")return ee(G,U,Au(Z),oe);if(Z.$$typeof===A)return ee(G,U,Cu(G,Z),oe);Mu(G,Z)}return null}function ne(G,U,Z,oe,De){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return G=G.get(Z)||null,k(U,G,""+oe,De);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return G=G.get(oe.key===null?Z:oe.key)||null,z(U,G,oe,De);case y:return G=G.get(oe.key===null?Z:oe.key)||null,Q(U,G,oe,De);case R:return oe=ga(oe),ne(G,U,Z,oe,De)}if(V(oe)||J(oe))return G=G.get(Z)||null,re(U,G,oe,De,null);if(typeof oe.then=="function")return ne(G,U,Z,Au(oe),De);if(oe.$$typeof===A)return ne(G,U,Z,Cu(U,oe),De);Mu(U,oe)}return null}function Ce(G,U,Z,oe){for(var De=null,rt=null,Ae=U,$e=U=0,et=null;Ae!==null&&$e<Z.length;$e++){Ae.index>$e?(et=Ae,Ae=null):et=Ae.sibling;var at=ee(G,Ae,Z[$e],oe);if(at===null){Ae===null&&(Ae=et);break}n&&Ae&&at.alternate===null&&r(G,Ae),U=b(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at,Ae=et}if($e===Z.length)return o(G,Ae),tt&&Rs(G,$e),De;if(Ae===null){for(;$e<Z.length;$e++)Ae=le(G,Z[$e],oe),Ae!==null&&(U=b(Ae,U,$e),rt===null?De=Ae:rt.sibling=Ae,rt=Ae);return tt&&Rs(G,$e),De}for(Ae=d(Ae);$e<Z.length;$e++)et=ne(Ae,G,$e,Z[$e],oe),et!==null&&(n&&et.alternate!==null&&Ae.delete(et.key===null?$e:et.key),U=b(et,U,$e),rt===null?De=et:rt.sibling=et,rt=et);return n&&Ae.forEach(function(Or){return r(G,Or)}),tt&&Rs(G,$e),De}function je(G,U,Z,oe){if(Z==null)throw Error(s(151));for(var De=null,rt=null,Ae=U,$e=U=0,et=null,at=Z.next();Ae!==null&&!at.done;$e++,at=Z.next()){Ae.index>$e?(et=Ae,Ae=null):et=Ae.sibling;var Or=ee(G,Ae,at.value,oe);if(Or===null){Ae===null&&(Ae=et);break}n&&Ae&&Or.alternate===null&&r(G,Ae),U=b(Or,U,$e),rt===null?De=Or:rt.sibling=Or,rt=Or,Ae=et}if(at.done)return o(G,Ae),tt&&Rs(G,$e),De;if(Ae===null){for(;!at.done;$e++,at=Z.next())at=le(G,at.value,oe),at!==null&&(U=b(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at);return tt&&Rs(G,$e),De}for(Ae=d(Ae);!at.done;$e++,at=Z.next())at=ne(Ae,G,$e,at.value,oe),at!==null&&(n&&at.alternate!==null&&Ae.delete(at.key===null?$e:at.key),U=b(at,U,$e),rt===null?De=at:rt.sibling=at,rt=at);return n&&Ae.forEach(function(wT){return r(G,wT)}),tt&&Rs(G,$e),De}function vt(G,U,Z,oe){if(typeof Z=="object"&&Z!==null&&Z.type===w&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:e:{for(var De=Z.key;U!==null;){if(U.key===De){if(De=Z.type,De===w){if(U.tag===7){o(G,U.sibling),oe=p(U,Z.props.children),oe.return=G,G=oe;break e}}else if(U.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===R&&ga(De)===U.type){o(G,U.sibling),oe=p(U,Z.props),Ml(oe,Z),oe.return=G,G=oe;break e}o(G,U);break}else r(G,U);U=U.sibling}Z.type===w?(oe=da(Z.props.children,G.mode,oe,Z.key),oe.return=G,G=oe):(oe=Su(Z.type,Z.key,Z.props,null,G.mode,oe),Ml(oe,Z),oe.return=G,G=oe)}return S(G);case y:e:{for(De=Z.key;U!==null;){if(U.key===De)if(U.tag===4&&U.stateNode.containerInfo===Z.containerInfo&&U.stateNode.implementation===Z.implementation){o(G,U.sibling),oe=p(U,Z.children||[]),oe.return=G,G=oe;break e}else{o(G,U);break}else r(G,U);U=U.sibling}oe=af(Z,G.mode,oe),oe.return=G,G=oe}return S(G);case R:return Z=ga(Z),vt(G,U,Z,oe)}if(V(Z))return Ce(G,U,Z,oe);if(J(Z)){if(De=J(Z),typeof De!="function")throw Error(s(150));return Z=De.call(Z),je(G,U,Z,oe)}if(typeof Z.then=="function")return vt(G,U,Au(Z),oe);if(Z.$$typeof===A)return vt(G,U,Cu(G,Z),oe);Mu(G,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,U!==null&&U.tag===6?(o(G,U.sibling),oe=p(U,Z),oe.return=G,G=oe):(o(G,U),oe=rf(Z,G.mode,oe),oe.return=G,G=oe),S(G)):o(G,U)}return function(G,U,Z,oe){try{Al=0;var De=vt(G,U,Z,oe);return _o=null,De}catch(Ae){if(Ae===go||Ae===Nu)throw Ae;var rt=hn(29,Ae,null,G.mode);return rt.lanes=oe,rt.return=G,rt}}}var ba=Fb(!0),$b=Fb(!1),gr=!1;function bf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vf(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 _r(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function br(n,r,o){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(ut&2)!==0){var p=d.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),d.pending=r,r=yu(n),kb(n,null,o),r}return xu(n,d,r,o),yu(n)}function Rl(n,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var d=r.lanes;d&=n.pendingLanes,o|=d,r.lanes=o,Be(n,o)}}function xf(n,r){var o=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var p=null,b=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};b===null?p=b=S:b=b.next=S,o=o.next}while(o!==null);b===null?p=b=r:b=b.next=r}else p=b=r;o={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=r:n.next=r,o.lastBaseUpdate=r}var yf=!1;function Dl(){if(yf){var n=po;if(n!==null)throw n}}function Ol(n,r,o,d){yf=!1;var p=n.updateQueue;gr=!1;var b=p.firstBaseUpdate,S=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var z=k,Q=z.next;z.next=null,S===null?b=Q:S.next=Q,S=z;var re=n.alternate;re!==null&&(re=re.updateQueue,k=re.lastBaseUpdate,k!==S&&(k===null?re.firstBaseUpdate=Q:k.next=Q,re.lastBaseUpdate=z))}if(b!==null){var le=p.baseState;S=0,re=Q=z=null,k=b;do{var ee=k.lane&-536870913,ne=ee!==k.lane;if(ne?(Je&ee)===ee:(d&ee)===ee){ee!==0&&ee===mo&&(yf=!0),re!==null&&(re=re.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ce=n,je=k;ee=r;var vt=o;switch(je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){le=Ce.call(vt,le,ee);break e}le=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,ee=typeof Ce=="function"?Ce.call(vt,le,ee):Ce,ee==null)break e;le=_({},le,ee);break e;case 2:gr=!0}}ee=k.callback,ee!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:k.tag,payload:k.payload,callback:k.callback,next:null},re===null?(Q=re=ne,z=le):re=re.next=ne,S|=ee;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);re===null&&(z=le),p.baseState=z,p.firstBaseUpdate=Q,p.lastBaseUpdate=re,b===null&&(p.shared.lanes=0),wr|=S,n.lanes=S,n.memoizedState=le}}function Vb(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function qb(n,r){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Vb(o[n],r)}var bo=D(null),Ru=D(0);function Kb(n,r){n=Fs,ue(Ru,n),ue(bo,r),Fs=n|r.baseLanes}function Sf(){ue(Ru,Fs),ue(bo,bo.current)}function wf(){Fs=Ru.current,te(bo),te(Ru)}var fn=D(null),An=null;function vr(n){var r=n.alternate;ue(Kt,Kt.current&1),ue(fn,n),An===null&&(r===null||bo.current!==null||r.memoizedState!==null)&&(An=n)}function Ef(n){ue(Kt,Kt.current),ue(fn,n),An===null&&(An=n)}function Gb(n){n.tag===22?(ue(Kt,Kt.current),ue(fn,n),An===null&&(An=n)):xr()}function xr(){ue(Kt,Kt.current),ue(fn,fn.current)}function mn(n){te(fn),An===n&&(An=null),te(Kt)}var Kt=D(0);function Du(n){for(var r=n;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Mm(o)||Rm(o)))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 js=0,Fe=null,_t=null,Qt=null,Ou=!1,vo=!1,va=!1,ju=0,jl=0,xo=null,f5=0;function zt(){throw Error(s(321))}function Cf(n,r){if(r===null)return!1;for(var o=0;o<r.length&&o<n.length;o++)if(!dn(n[o],r[o]))return!1;return!0}function kf(n,r,o,d,p,b){return js=b,Fe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?Mv:Hf,va=!1,b=o(d,p),va=!1,vo&&(b=Yb(r,o,d,p)),Wb(n),b}function Wb(n){O.H=zl;var r=_t!==null&&_t.next!==null;if(js=0,Qt=_t=Fe=null,Ou=!1,jl=0,xo=null,r)throw Error(s(300));n===null||Jt||(n=n.dependencies,n!==null&&Eu(n)&&(Jt=!0))}function Yb(n,r,o,d){Fe=n;var p=0;do{if(vo&&(xo=null),jl=0,vo=!1,25<=p)throw Error(s(301));if(p+=1,Qt=_t=null,n.updateQueue!=null){var b=n.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}O.H=Rv,b=r(o,d)}while(vo);return b}function m5(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?Ll(r):r,n=n.useState()[0],(_t!==null?_t.memoizedState:null)!==n&&(Fe.flags|=1024),r}function Nf(){var n=ju!==0;return ju=0,n}function Tf(n,r,o){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~o}function Af(n){if(Ou){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Ou=!1}js=0,Qt=_t=Fe=null,vo=!1,jl=ju=0,xo=null}function Hi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Fe.memoizedState=Qt=n:Qt=Qt.next=n,Qt}function Gt(){if(_t===null){var n=Fe.alternate;n=n!==null?n.memoizedState:null}else n=_t.next;var r=Qt===null?Fe.memoizedState:Qt.next;if(r!==null)Qt=r,_t=n;else{if(n===null)throw Fe.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},Qt===null?Fe.memoizedState=Qt=n:Qt=Qt.next=n}return Qt}function Lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ll(n){var r=jl;return jl+=1,xo===null&&(xo=[]),n=Pb(xo,n,r),r=Fe,(Qt===null?r.memoizedState:Qt.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?Mv:Hf),n}function Bu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Ll(n);if(n.$$typeof===A)return Ei(n)}throw Error(s(438,String(n)))}function Mf(n){var r=null,o=Fe.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var d=Fe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(r={data:d.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Lu(),Fe.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(n),d=0;d<n;d++)o[d]=P;return r.index++,o}function Ls(n,r){return typeof r=="function"?r(n):r}function zu(n){var r=Gt();return Rf(r,_t,n)}function Rf(n,r,o){var d=n.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=o;var p=n.baseQueue,b=d.pending;if(b!==null){if(p!==null){var S=p.next;p.next=b.next,b.next=S}r.baseQueue=p=b,d.pending=null}if(b=n.baseState,p===null)n.memoizedState=b;else{r=p.next;var k=S=null,z=null,Q=r,re=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(Je&le)===le:(js&le)===le){var ee=Q.revertLane;if(ee===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===mo&&(re=!0);else if((js&ee)===ee){Q=Q.next,ee===mo&&(re=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},z===null?(k=z=le,S=b):z=z.next=le,Fe.lanes|=ee,wr|=ee;le=Q.action,va&&o(b,le),b=Q.hasEagerState?Q.eagerState:o(b,le)}else ee={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},z===null?(k=z=ee,S=b):z=z.next=ee,Fe.lanes|=le,wr|=le;Q=Q.next}while(Q!==null&&Q!==r);if(z===null?S=b:z.next=k,!dn(b,n.memoizedState)&&(Jt=!0,re&&(o=po,o!==null)))throw o;n.memoizedState=b,n.baseState=S,n.baseQueue=z,d.lastRenderedState=b}return p===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function Df(n){var r=Gt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=n;var d=o.dispatch,p=o.pending,b=r.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do b=n(b,S.action),S=S.next;while(S!==p);dn(b,r.memoizedState)||(Jt=!0),r.memoizedState=b,r.baseQueue===null&&(r.baseState=b),o.lastRenderedState=b}return[b,d]}function Xb(n,r,o){var d=Fe,p=Gt(),b=tt;if(b){if(o===void 0)throw Error(s(407));o=o()}else o=r();var S=!dn((_t||p).memoizedState,o);if(S&&(p.memoizedState=o,Jt=!0),p=p.queue,Lf(Jb.bind(null,d,p,n),[n]),p.getSnapshot!==r||S||Qt!==null&&Qt.memoizedState.tag&1){if(d.flags|=2048,yo(9,{destroy:void 0},Qb.bind(null,d,p,o,r),null),St===null)throw Error(s(349));b||(js&127)!==0||Zb(d,r,o)}return o}function Zb(n,r,o){n.flags|=16384,n={getSnapshot:r,value:o},r=Fe.updateQueue,r===null?(r=Lu(),Fe.updateQueue=r,r.stores=[n]):(o=r.stores,o===null?r.stores=[n]:o.push(n))}function Qb(n,r,o,d){r.value=o,r.getSnapshot=d,ev(r)&&tv(n)}function Jb(n,r,o){return o(function(){ev(r)&&tv(n)})}function ev(n){var r=n.getSnapshot;n=n.value;try{var o=r();return!dn(n,o)}catch{return!0}}function tv(n){var r=ua(n,2);r!==null&&sn(r,n,2)}function Of(n){var r=Hi();if(typeof n=="function"){var o=n;if(n=o(),va){Sn(!0);try{o()}finally{Sn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:n},r}function iv(n,r,o,d){return n.baseState=o,Rf(n,_t,typeof d=="function"?d:Ls)}function p5(n,r,o,d,p){if(Uu(n))throw Error(s(485));if(n=r.action,n!==null){var b={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){b.listeners.push(S)}};O.T!==null?o(!0):b.isTransition=!1,d(b),o=r.pending,o===null?(b.next=r.pending=b,nv(r,b)):(b.next=o.next,r.pending=o.next=b)}}function nv(n,r){var o=r.action,d=r.payload,p=n.state;if(r.isTransition){var b=O.T,S={};O.T=S;try{var k=o(p,d),z=O.S;z!==null&&z(S,k),sv(n,r,k)}catch(Q){jf(n,r,Q)}finally{b!==null&&S.types!==null&&(b.types=S.types),O.T=b}}else try{b=o(p,d),sv(n,r,b)}catch(Q){jf(n,r,Q)}}function sv(n,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){rv(n,r,d)},function(d){return jf(n,r,d)}):rv(n,r,o)}function rv(n,r,o){r.status="fulfilled",r.value=o,av(r),n.state=o,r=n.pending,r!==null&&(o=r.next,o===r?n.pending=null:(o=o.next,r.next=o,nv(n,o)))}function jf(n,r,o){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=o,av(r),r=r.next;while(r!==d)}n.action=null}function av(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function ov(n,r){return r}function lv(n,r){if(tt){var o=St.formState;if(o!==null){e:{var d=Fe;if(tt){if(kt){t:{for(var p=kt,b=Tn;p.nodeType!==8;){if(!b){p=null;break t}if(p=Mn(p.nextSibling),p===null){p=null;break t}}b=p.data,p=b==="F!"||b==="F"?p:null}if(p){kt=Mn(p.nextSibling),d=p.data==="F!";break e}}mr(d)}d=!1}d&&(r=o[0])}}return o=Hi(),o.memoizedState=o.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ov,lastRenderedState:r},o.queue=d,o=Nv.bind(null,Fe,d),d.dispatch=o,d=Of(!1),b=Uf.bind(null,Fe,!1,d.queue),d=Hi(),p={state:r,dispatch:null,action:n,pending:null},d.queue=p,o=p5.bind(null,Fe,p,b,o),p.dispatch=o,d.memoizedState=n,[r,o,!1]}function cv(n){var r=Gt();return uv(r,_t,n)}function uv(n,r,o){if(r=Rf(n,r,ov)[0],n=zu(Ls)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=Ll(r)}catch(S){throw S===go?Nu:S}else d=r;r=Gt();var p=r.queue,b=p.dispatch;return o!==r.memoizedState&&(Fe.flags|=2048,yo(9,{destroy:void 0},g5.bind(null,p,o),null)),[d,b,n]}function g5(n,r){n.action=r}function dv(n){var r=Gt(),o=_t;if(o!==null)return uv(r,o,n);Gt(),r=r.memoizedState,o=Gt();var d=o.queue.dispatch;return o.memoizedState=n,[r,d,!1]}function yo(n,r,o,d){return n={tag:n,create:o,deps:d,inst:r,next:null},r=Fe.updateQueue,r===null&&(r=Lu(),Fe.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=n.next=n:(d=o.next,o.next=n,n.next=d,r.lastEffect=n),n}function hv(){return Gt().memoizedState}function Iu(n,r,o,d){var p=Hi();Fe.flags|=n,p.memoizedState=yo(1|r,{destroy:void 0},o,d===void 0?null:d)}function Pu(n,r,o,d){var p=Gt();d=d===void 0?null:d;var b=p.memoizedState.inst;_t!==null&&d!==null&&Cf(d,_t.memoizedState.deps)?p.memoizedState=yo(r,b,o,d):(Fe.flags|=n,p.memoizedState=yo(1|r,b,o,d))}function fv(n,r){Iu(8390656,8,n,r)}function Lf(n,r){Pu(2048,8,n,r)}function _5(n){Fe.flags|=4;var r=Fe.updateQueue;if(r===null)r=Lu(),Fe.updateQueue=r,r.events=[n];else{var o=r.events;o===null?r.events=[n]:o.push(n)}}function mv(n){var r=Gt().memoizedState;return _5({ref:r,nextImpl:n}),function(){if((ut&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function pv(n,r){return Pu(4,2,n,r)}function gv(n,r){return Pu(4,4,n,r)}function _v(n,r){if(typeof r=="function"){n=n();var o=r(n);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function bv(n,r,o){o=o!=null?o.concat([n]):null,Pu(4,4,_v.bind(null,r,n),o)}function Bf(){}function vv(n,r){var o=Gt();r=r===void 0?null:r;var d=o.memoizedState;return r!==null&&Cf(r,d[1])?d[0]:(o.memoizedState=[n,r],n)}function xv(n,r){var o=Gt();r=r===void 0?null:r;var d=o.memoizedState;if(r!==null&&Cf(r,d[1]))return d[0];if(d=n(),va){Sn(!0);try{n()}finally{Sn(!1)}}return o.memoizedState=[d,r],d}function zf(n,r,o){return o===void 0||(js&1073741824)!==0&&(Je&261930)===0?n.memoizedState=r:(n.memoizedState=o,n=y1(),Fe.lanes|=n,wr|=n,o)}function yv(n,r,o,d){return dn(o,r)?o:bo.current!==null?(n=zf(n,o,d),dn(n,r)||(Jt=!0),n):(js&42)===0||(js&1073741824)!==0&&(Je&261930)===0?(Jt=!0,n.memoizedState=o):(n=y1(),Fe.lanes|=n,wr|=n,r)}function Sv(n,r,o,d,p){var b=Y.p;Y.p=b!==0&&8>b?b:8;var S=O.T,k={};O.T=k,Uf(n,!1,r,o);try{var z=p(),Q=O.S;if(Q!==null&&Q(k,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=h5(z,d);Bl(n,r,re,_n(n))}else Bl(n,r,d,_n(n))}catch(le){Bl(n,r,{then:function(){},status:"rejected",reason:le},_n())}finally{Y.p=b,S!==null&&k.types!==null&&(S.types=k.types),O.T=S}}function b5(){}function If(n,r,o,d){if(n.tag!==5)throw Error(s(476));var p=wv(n).queue;Sv(n,p,r,X,o===null?b5:function(){return Ev(n),o(d)})}function wv(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:Ls,lastRenderedState:X},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:o},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Ev(n){var r=wv(n);r.next===null&&(r=n.alternate.memoizedState),Bl(n,r.next.queue,{},_n())}function Pf(){return Ei(Jl)}function Cv(){return Gt().memoizedState}function kv(){return Gt().memoizedState}function v5(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var o=_n();n=_r(o);var d=br(r,n,o);d!==null&&(sn(d,r,o),Rl(d,r,o)),r={cache:mf()},n.payload=r;return}r=r.return}}function x5(n,r,o){var d=_n();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Uu(n)?Tv(r,o):(o=nf(n,r,o,d),o!==null&&(sn(o,n,d),Av(o,r,d)))}function Nv(n,r,o){var d=_n();Bl(n,r,o,d)}function Bl(n,r,o,d){var p={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Uu(n))Tv(r,p);else{var b=n.alternate;if(n.lanes===0&&(b===null||b.lanes===0)&&(b=r.lastRenderedReducer,b!==null))try{var S=r.lastRenderedState,k=b(S,o);if(p.hasEagerState=!0,p.eagerState=k,dn(k,S))return xu(n,r,p,0),St===null&&vu(),!1}catch{}if(o=nf(n,r,p,d),o!==null)return sn(o,n,d),Av(o,r,d),!0}return!1}function Uf(n,r,o,d){if(d={lane:2,revertLane:bm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Uu(n)){if(r)throw Error(s(479))}else r=nf(n,o,d,2),r!==null&&sn(r,n,2)}function Uu(n){var r=n.alternate;return n===Fe||r!==null&&r===Fe}function Tv(n,r){vo=Ou=!0;var o=n.pending;o===null?r.next=r:(r.next=o.next,o.next=r),n.pending=r}function Av(n,r,o){if((o&4194048)!==0){var d=r.lanes;d&=n.pendingLanes,o|=d,r.lanes=o,Be(n,o)}}var zl={readContext:Ei,use:Bu,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};zl.useEffectEvent=zt;var Mv={readContext:Ei,use:Bu,useCallback:function(n,r){return Hi().memoizedState=[n,r===void 0?null:r],n},useContext:Ei,useEffect:fv,useImperativeHandle:function(n,r,o){o=o!=null?o.concat([n]):null,Iu(4194308,4,_v.bind(null,r,n),o)},useLayoutEffect:function(n,r){return Iu(4194308,4,n,r)},useInsertionEffect:function(n,r){Iu(4,2,n,r)},useMemo:function(n,r){var o=Hi();r=r===void 0?null:r;var d=n();if(va){Sn(!0);try{n()}finally{Sn(!1)}}return o.memoizedState=[d,r],d},useReducer:function(n,r,o){var d=Hi();if(o!==void 0){var p=o(r);if(va){Sn(!0);try{o(r)}finally{Sn(!1)}}}else p=r;return d.memoizedState=d.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},d.queue=n,n=n.dispatch=x5.bind(null,Fe,n),[d.memoizedState,n]},useRef:function(n){var r=Hi();return n={current:n},r.memoizedState=n},useState:function(n){n=Of(n);var r=n.queue,o=Nv.bind(null,Fe,r);return r.dispatch=o,[n.memoizedState,o]},useDebugValue:Bf,useDeferredValue:function(n,r){var o=Hi();return zf(o,n,r)},useTransition:function(){var n=Of(!1);return n=Sv.bind(null,Fe,n.queue,!0,!1),Hi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,o){var d=Fe,p=Hi();if(tt){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),St===null)throw Error(s(349));(Je&127)!==0||Zb(d,r,o)}p.memoizedState=o;var b={value:o,getSnapshot:r};return p.queue=b,fv(Jb.bind(null,d,b,n),[n]),d.flags|=2048,yo(9,{destroy:void 0},Qb.bind(null,d,b,o,r),null),o},useId:function(){var n=Hi(),r=St.identifierPrefix;if(tt){var o=ns,d=is;o=(d&~(1<<32-yi(d)-1)).toString(32)+o,r="_"+r+"R_"+o,o=ju++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=f5++,r="_"+r+"r_"+o.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Pf,useFormState:lv,useActionState:lv,useOptimistic:function(n){var r=Hi();r.memoizedState=r.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Uf.bind(null,Fe,!0,o),o.dispatch=r,[n,r]},useMemoCache:Mf,useCacheRefresh:function(){return Hi().memoizedState=v5.bind(null,Fe)},useEffectEvent:function(n){var r=Hi(),o={impl:n};return r.memoizedState=o,function(){if((ut&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},Hf={readContext:Ei,use:Bu,useCallback:vv,useContext:Ei,useEffect:Lf,useImperativeHandle:bv,useInsertionEffect:pv,useLayoutEffect:gv,useMemo:xv,useReducer:zu,useRef:hv,useState:function(){return zu(Ls)},useDebugValue:Bf,useDeferredValue:function(n,r){var o=Gt();return yv(o,_t.memoizedState,n,r)},useTransition:function(){var n=zu(Ls)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:Ll(n),r]},useSyncExternalStore:Xb,useId:Cv,useHostTransitionStatus:Pf,useFormState:cv,useActionState:cv,useOptimistic:function(n,r){var o=Gt();return iv(o,_t,n,r)},useMemoCache:Mf,useCacheRefresh:kv};Hf.useEffectEvent=mv;var Rv={readContext:Ei,use:Bu,useCallback:vv,useContext:Ei,useEffect:Lf,useImperativeHandle:bv,useInsertionEffect:pv,useLayoutEffect:gv,useMemo:xv,useReducer:Df,useRef:hv,useState:function(){return Df(Ls)},useDebugValue:Bf,useDeferredValue:function(n,r){var o=Gt();return _t===null?zf(o,n,r):yv(o,_t.memoizedState,n,r)},useTransition:function(){var n=Df(Ls)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:Ll(n),r]},useSyncExternalStore:Xb,useId:Cv,useHostTransitionStatus:Pf,useFormState:dv,useActionState:dv,useOptimistic:function(n,r){var o=Gt();return _t!==null?iv(o,_t,n,r):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:Mf,useCacheRefresh:kv};Rv.useEffectEvent=mv;function Ff(n,r,o,d){r=n.memoizedState,o=o(d,r),o=o==null?r:_({},r,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var $f={enqueueSetState:function(n,r,o){n=n._reactInternals;var d=_n(),p=_r(d);p.payload=r,o!=null&&(p.callback=o),r=br(n,p,d),r!==null&&(sn(r,n,d),Rl(r,n,d))},enqueueReplaceState:function(n,r,o){n=n._reactInternals;var d=_n(),p=_r(d);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=br(n,p,d),r!==null&&(sn(r,n,d),Rl(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var o=_n(),d=_r(o);d.tag=2,r!=null&&(d.callback=r),r=br(n,d,o),r!==null&&(sn(r,n,o),Rl(r,n,o))}};function Dv(n,r,o,d,p,b,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,b,S):r.prototype&&r.prototype.isPureReactComponent?!wl(o,d)||!wl(p,b):!0}function Ov(n,r,o,d){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,d),r.state!==n&&$f.enqueueReplaceState(r,r.state,null)}function xa(n,r){var o=r;if("ref"in r){o={};for(var d in r)d!=="ref"&&(o[d]=r[d])}if(n=n.defaultProps){o===r&&(o=_({},o));for(var p in n)o[p]===void 0&&(o[p]=n[p])}return o}function jv(n){bu(n)}function Lv(n){console.error(n)}function Bv(n){bu(n)}function Hu(n,r){try{var o=n.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function zv(n,r,o){try{var d=n.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Vf(n,r,o){return o=_r(o),o.tag=3,o.payload={element:null},o.callback=function(){Hu(n,r)},o}function Iv(n){return n=_r(n),n.tag=3,n}function Pv(n,r,o,d){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var b=d.value;n.payload=function(){return p(b)},n.callback=function(){zv(r,o,d)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){zv(r,o,d),typeof p!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function y5(n,r,o,d,p){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=o.alternate,r!==null&&fo(r,o,p,!0),o=fn.current,o!==null){switch(o.tag){case 31:case 13:return An===null?Ju():o.alternate===null&&It===0&&(It=3),o.flags&=-257,o.flags|=65536,o.lanes=p,d===Tu?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([d]):r.add(d),pm(n,d,p)),!1;case 22:return o.flags|=65536,d===Tu?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([d]):o.add(d)),pm(n,d,p)),!1}throw Error(s(435,o.tag))}return pm(n,d,p),Ju(),!1}if(tt)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,d!==cf&&(n=Error(s(422),{cause:d}),kl(Cn(n,o)))):(d!==cf&&(r=Error(s(423),{cause:d}),kl(Cn(r,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,d=Cn(d,o),p=Vf(n.stateNode,d,p),xf(n,p),It!==4&&(It=2)),!1;var b=Error(s(520),{cause:d});if(b=Cn(b,o),ql===null?ql=[b]:ql.push(b),It!==4&&(It=2),r===null)return!0;d=Cn(d,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=Vf(o.stateNode,d,n),xf(o,n),!1;case 1:if(r=o.type,b=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Er===null||!Er.has(b))))return o.flags|=65536,p&=-p,o.lanes|=p,p=Iv(p),Pv(p,n,o,d),xf(o,p),!1}o=o.return}while(o!==null);return!1}var qf=Error(s(461)),Jt=!1;function Ci(n,r,o,d){r.child=n===null?$b(r,null,o,d):ba(r,n.child,o,d)}function Uv(n,r,o,d,p){o=o.render;var b=r.ref;if("ref"in d){var S={};for(var k in d)k!=="ref"&&(S[k]=d[k])}else S=d;return ma(r),d=kf(n,r,o,S,b,p),k=Nf(),n!==null&&!Jt?(Tf(n,r,p),Bs(n,r,p)):(tt&&k&&of(r),r.flags|=1,Ci(n,r,d,p),r.child)}function Hv(n,r,o,d,p){if(n===null){var b=o.type;return typeof b=="function"&&!sf(b)&&b.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=b,Fv(n,r,b,d,p)):(n=Su(o.type,null,d,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(b=n.child,!Jf(n,p)){var S=b.memoizedProps;if(o=o.compare,o=o!==null?o:wl,o(S,d)&&n.ref===r.ref)return Bs(n,r,p)}return r.flags|=1,n=Ms(b,d),n.ref=r.ref,n.return=r,r.child=n}function Fv(n,r,o,d,p){if(n!==null){var b=n.memoizedProps;if(wl(b,d)&&n.ref===r.ref)if(Jt=!1,r.pendingProps=d=b,Jf(n,p))(n.flags&131072)!==0&&(Jt=!0);else return r.lanes=n.lanes,Bs(n,r,p)}return Kf(n,r,o,d,p)}function $v(n,r,o,d){var p=d.children,b=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(b=b!==null?b.baseLanes|o:o,n!==null){for(d=r.child=n.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~b}else d=0,r.child=null;return Vv(n,r,b,o,d)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&ku(r,b!==null?b.cachePool:null),b!==null?Kb(r,b):Sf(),Gb(r);else return d=r.lanes=536870912,Vv(n,r,b!==null?b.baseLanes|o:o,o,d)}else b!==null?(ku(r,b.cachePool),Kb(r,b),xr(),r.memoizedState=null):(n!==null&&ku(r,null),Sf(),xr());return Ci(n,r,p,o),r.child}function Il(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Vv(n,r,o,d,p){var b=gf();return b=b===null?null:{parent:Zt._currentValue,pool:b},r.memoizedState={baseLanes:o,cachePool:b},n!==null&&ku(r,null),Sf(),Gb(r),n!==null&&fo(n,r,d,!0),r.childLanes=p,null}function Fu(n,r){return r=Vu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function qv(n,r,o){return ba(r,n.child,null,o),n=Fu(r,r.pendingProps),n.flags|=2,mn(r),r.memoizedState=null,n}function S5(n,r,o){var d=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(tt){if(d.mode==="hidden")return n=Fu(r,d),r.lanes=536870912,Il(null,n);if(Ef(r),(n=kt)?(n=nx(n,Tn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:hr!==null?{id:is,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},o=Tb(n),o.return=r,r.child=o,wi=r,kt=null)):n=null,n===null)throw mr(r);return r.lanes=536870912,null}return Fu(r,d)}var b=n.memoizedState;if(b!==null){var S=b.dehydrated;if(Ef(r),p)if(r.flags&256)r.flags&=-257,r=qv(n,r,o);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(Jt||fo(n,r,o,!1),p=(o&n.childLanes)!==0,Jt||p){if(d=St,d!==null&&(S=$t(d,o),S!==0&&S!==b.retryLane))throw b.retryLane=S,ua(n,S),sn(d,n,S),qf;Ju(),r=qv(n,r,o)}else n=b.treeContext,kt=Mn(S.nextSibling),wi=r,tt=!0,fr=null,Tn=!1,n!==null&&Rb(r,n),r=Fu(r,d),r.flags|=4096;return r}return n=Ms(n.child,{mode:d.mode,children:d.children}),n.ref=r.ref,r.child=n,n.return=r,n}function $u(n,r){var o=r.ref;if(o===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(n===null||n.ref!==o)&&(r.flags|=4194816)}}function Kf(n,r,o,d,p){return ma(r),o=kf(n,r,o,d,void 0,p),d=Nf(),n!==null&&!Jt?(Tf(n,r,p),Bs(n,r,p)):(tt&&d&&of(r),r.flags|=1,Ci(n,r,o,p),r.child)}function Kv(n,r,o,d,p,b){return ma(r),r.updateQueue=null,o=Yb(r,d,o,p),Wb(n),d=Nf(),n!==null&&!Jt?(Tf(n,r,b),Bs(n,r,b)):(tt&&d&&of(r),r.flags|=1,Ci(n,r,o,b),r.child)}function Gv(n,r,o,d,p){if(ma(r),r.stateNode===null){var b=lo,S=o.contextType;typeof S=="object"&&S!==null&&(b=Ei(S)),b=new o(d,b),r.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=$f,r.stateNode=b,b._reactInternals=r,b=r.stateNode,b.props=d,b.state=r.memoizedState,b.refs={},bf(r),S=o.contextType,b.context=typeof S=="object"&&S!==null?Ei(S):lo,b.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(Ff(r,o,S,d),b.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(S=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),S!==b.state&&$f.enqueueReplaceState(b,b.state,null),Ol(r,d,b,p),Dl(),b.state=r.memoizedState),typeof b.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){b=r.stateNode;var k=r.memoizedProps,z=xa(o,k);b.props=z;var Q=b.context,re=o.contextType;S=lo,typeof re=="object"&&re!==null&&(S=Ei(re));var le=o.getDerivedStateFromProps;re=typeof le=="function"||typeof b.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,re||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k||Q!==S)&&Ov(r,b,d,S),gr=!1;var ee=r.memoizedState;b.state=ee,Ol(r,d,b,p),Dl(),Q=r.memoizedState,k||ee!==Q||gr?(typeof le=="function"&&(Ff(r,o,le,d),Q=r.memoizedState),(z=gr||Dv(r,o,z,d,ee,Q,S))?(re||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(r.flags|=4194308)):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=Q),b.props=d,b.state=Q,b.context=S,d=z):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{b=r.stateNode,vf(n,r),S=r.memoizedProps,re=xa(o,S),b.props=re,le=r.pendingProps,ee=b.context,Q=o.contextType,z=lo,typeof Q=="object"&&Q!==null&&(z=Ei(Q)),k=o.getDerivedStateFromProps,(Q=typeof k=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==le||ee!==z)&&Ov(r,b,d,z),gr=!1,ee=r.memoizedState,b.state=ee,Ol(r,d,b,p),Dl();var ne=r.memoizedState;S!==le||ee!==ne||gr||n!==null&&n.dependencies!==null&&Eu(n.dependencies)?(typeof k=="function"&&(Ff(r,o,k,d),ne=r.memoizedState),(re=gr||Dv(r,o,re,d,ee,ne,z)||n!==null&&n.dependencies!==null&&Eu(n.dependencies))?(Q||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,ne,z),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,ne,z)),typeof b.componentDidUpdate=="function"&&(r.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===n.memoizedProps&&ee===n.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&ee===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=ne),b.props=d,b.state=ne,b.context=z,d=re):(typeof b.componentDidUpdate!="function"||S===n.memoizedProps&&ee===n.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&ee===n.memoizedState||(r.flags|=1024),d=!1)}return b=d,$u(n,r),d=(r.flags&128)!==0,b||d?(b=r.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:b.render(),r.flags|=1,n!==null&&d?(r.child=ba(r,n.child,null,p),r.child=ba(r,null,o,p)):Ci(n,r,o,p),r.memoizedState=b.state,n=r.child):n=Bs(n,r,p),n}function Wv(n,r,o,d){return ha(),r.flags|=256,Ci(n,r,o,d),r.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wf(n){return{baseLanes:n,cachePool:zb()}}function Yf(n,r,o){return n=n!==null?n.childLanes&~o:0,r&&(n|=gn),n}function Yv(n,r,o){var d=r.pendingProps,p=!1,b=(r.flags&128)!==0,S;if((S=b)||(S=n!==null&&n.memoizedState===null?!1:(Kt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,n===null){if(tt){if(p?vr(r):xr(),(n=kt)?(n=nx(n,Tn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:hr!==null?{id:is,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},o=Tb(n),o.return=r,r.child=o,wi=r,kt=null)):n=null,n===null)throw mr(r);return Rm(n)?r.lanes=32:r.lanes=536870912,null}var k=d.children;return d=d.fallback,p?(xr(),p=r.mode,k=Vu({mode:"hidden",children:k},p),d=da(d,p,o,null),k.return=r,d.return=r,k.sibling=d,r.child=k,d=r.child,d.memoizedState=Wf(o),d.childLanes=Yf(n,S,o),r.memoizedState=Gf,Il(null,d)):(vr(r),Xf(r,k))}var z=n.memoizedState;if(z!==null&&(k=z.dehydrated,k!==null)){if(b)r.flags&256?(vr(r),r.flags&=-257,r=Zf(n,r,o)):r.memoizedState!==null?(xr(),r.child=n.child,r.flags|=128,r=null):(xr(),k=d.fallback,p=r.mode,d=Vu({mode:"visible",children:d.children},p),k=da(k,p,o,null),k.flags|=2,d.return=r,k.return=r,d.sibling=k,r.child=d,ba(r,n.child,null,o),d=r.child,d.memoizedState=Wf(o),d.childLanes=Yf(n,S,o),r.memoizedState=Gf,r=Il(null,d));else if(vr(r),Rm(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var Q=S.dgst;S=Q,d=Error(s(419)),d.stack="",d.digest=S,kl({value:d,source:null,stack:null}),r=Zf(n,r,o)}else if(Jt||fo(n,r,o,!1),S=(o&n.childLanes)!==0,Jt||S){if(S=St,S!==null&&(d=$t(S,o),d!==0&&d!==z.retryLane))throw z.retryLane=d,ua(n,d),sn(S,n,d),qf;Mm(k)||Ju(),r=Zf(n,r,o)}else Mm(k)?(r.flags|=192,r.child=n.child,r=null):(n=z.treeContext,kt=Mn(k.nextSibling),wi=r,tt=!0,fr=null,Tn=!1,n!==null&&Rb(r,n),r=Xf(r,d.children),r.flags|=4096);return r}return p?(xr(),k=d.fallback,p=r.mode,z=n.child,Q=z.sibling,d=Ms(z,{mode:"hidden",children:d.children}),d.subtreeFlags=z.subtreeFlags&65011712,Q!==null?k=Ms(Q,k):(k=da(k,p,o,null),k.flags|=2),k.return=r,d.return=r,d.sibling=k,r.child=d,Il(null,d),d=r.child,k=n.child.memoizedState,k===null?k=Wf(o):(p=k.cachePool,p!==null?(z=Zt._currentValue,p=p.parent!==z?{parent:z,pool:z}:p):p=zb(),k={baseLanes:k.baseLanes|o,cachePool:p}),d.memoizedState=k,d.childLanes=Yf(n,S,o),r.memoizedState=Gf,Il(n.child,d)):(vr(r),o=n.child,n=o.sibling,o=Ms(o,{mode:"visible",children:d.children}),o.return=r,o.sibling=null,n!==null&&(S=r.deletions,S===null?(r.deletions=[n],r.flags|=16):S.push(n)),r.child=o,r.memoizedState=null,o)}function Xf(n,r){return r=Vu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Vu(n,r){return n=hn(22,n,null,r),n.lanes=0,n}function Zf(n,r,o){return ba(r,n.child,null,o),n=Xf(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function Xv(n,r,o){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r),hf(n.return,r,o)}function Qf(n,r,o,d,p,b){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:p,treeForkCount:b}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=o,S.tailMode=p,S.treeForkCount=b)}function Zv(n,r,o){var d=r.pendingProps,p=d.revealOrder,b=d.tail;d=d.children;var S=Kt.current,k=(S&2)!==0;if(k?(S=S&1|2,r.flags|=128):S&=1,ue(Kt,S),Ci(n,r,d,o),d=tt?Cl:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Xv(n,o,r);else if(n.tag===19)Xv(n,o,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(p){case"forwards":for(o=r.child,p=null;o!==null;)n=o.alternate,n!==null&&Du(n)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),Qf(r,!1,p,o,b,d);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&Du(n)===null){r.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}Qf(r,!0,o,null,b,d);break;case"together":Qf(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function Bs(n,r,o){if(n!==null&&(r.dependencies=n.dependencies),wr|=r.lanes,(o&r.childLanes)===0)if(n!==null){if(fo(n,r,o,!1),(o&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,o=Ms(n,n.pendingProps),r.child=o,o.return=r;n.sibling!==null;)n=n.sibling,o=o.sibling=Ms(n,n.pendingProps),o.return=r;o.sibling=null}return r.child}function Jf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Eu(n)))}function w5(n,r,o){switch(r.tag){case 3:Oe(r,r.stateNode.containerInfo),pr(r,Zt,n.memoizedState.cache),ha();break;case 27:case 5:st(r);break;case 4:Oe(r,r.stateNode.containerInfo);break;case 10:pr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ef(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(vr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Yv(n,r,o):(vr(r),n=Bs(n,r,o),n!==null?n.sibling:null);vr(r);break;case 19:var p=(n.flags&128)!==0;if(d=(o&r.childLanes)!==0,d||(fo(n,r,o,!1),d=(o&r.childLanes)!==0),p){if(d)return Zv(n,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ue(Kt,Kt.current),d)break;return null;case 22:return r.lanes=0,$v(n,r,o,r.pendingProps);case 24:pr(r,Zt,n.memoizedState.cache)}return Bs(n,r,o)}function Qv(n,r,o){if(n!==null)if(n.memoizedProps!==r.pendingProps)Jt=!0;else{if(!Jf(n,o)&&(r.flags&128)===0)return Jt=!1,w5(n,r,o);Jt=(n.flags&131072)!==0}else Jt=!1,tt&&(r.flags&1048576)!==0&&Mb(r,Cl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=ga(r.elementType),r.type=n,typeof n=="function")sf(n)?(d=xa(n,d),r.tag=1,r=Gv(null,r,n,d,o)):(r.tag=0,r=Kf(null,r,n,d,o));else{if(n!=null){var p=n.$$typeof;if(p===M){r.tag=11,r=Uv(null,r,n,d,o);break e}else if(p===B){r.tag=14,r=Hv(null,r,n,d,o);break e}}throw r=ie(n)||n,Error(s(306,r,""))}}return r;case 0:return Kf(n,r,r.type,r.pendingProps,o);case 1:return d=r.type,p=xa(d,r.pendingProps),Gv(n,r,d,p,o);case 3:e:{if(Oe(r,r.stateNode.containerInfo),n===null)throw Error(s(387));d=r.pendingProps;var b=r.memoizedState;p=b.element,vf(n,r),Ol(r,d,null,o);var S=r.memoizedState;if(d=S.cache,pr(r,Zt,d),d!==b.cache&&ff(r,[Zt],o,!0),Dl(),d=S.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=b,r.memoizedState=b,r.flags&256){r=Wv(n,r,d,o);break e}else if(d!==p){p=Cn(Error(s(424)),r),kl(p),r=Wv(n,r,d,o);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,kt=Mn(n.firstChild),wi=r,tt=!0,fr=null,Tn=!0,o=$b(r,null,d,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ha(),d===p){r=Bs(n,r,o);break e}Ci(n,r,d,o)}r=r.child}return r;case 26:return $u(n,r),n===null?(o=cx(r.type,null,r.pendingProps,null))?r.memoizedState=o:tt||(o=r.type,n=r.pendingProps,d=ad(fe.current).createElement(o),d[Vt]=r,d[Di]=n,ki(d,o,n),Yt(d),r.stateNode=d):r.memoizedState=cx(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return st(r),n===null&&tt&&(d=r.stateNode=ax(r.type,r.pendingProps,fe.current),wi=r,Tn=!0,p=kt,Tr(r.type)?(Dm=p,kt=Mn(d.firstChild)):kt=p),Ci(n,r,r.pendingProps.children,o),$u(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&tt&&((p=d=kt)&&(d=J5(d,r.type,r.pendingProps,Tn),d!==null?(r.stateNode=d,wi=r,kt=Mn(d.firstChild),Tn=!1,p=!0):p=!1),p||mr(r)),st(r),p=r.type,b=r.pendingProps,S=n!==null?n.memoizedProps:null,d=b.children,Nm(p,b)?d=null:S!==null&&Nm(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=kf(n,r,m5,null,null,o),Jl._currentValue=p),$u(n,r),Ci(n,r,d,o),r.child;case 6:return n===null&&tt&&((n=o=kt)&&(o=eT(o,r.pendingProps,Tn),o!==null?(r.stateNode=o,wi=r,kt=null,n=!0):n=!1),n||mr(r)),null;case 13:return Yv(n,r,o);case 4:return Oe(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=ba(r,null,d,o):Ci(n,r,d,o),r.child;case 11:return Uv(n,r,r.type,r.pendingProps,o);case 7:return Ci(n,r,r.pendingProps,o),r.child;case 8:return Ci(n,r,r.pendingProps.children,o),r.child;case 12:return Ci(n,r,r.pendingProps.children,o),r.child;case 10:return d=r.pendingProps,pr(r,r.type,d.value),Ci(n,r,d.children,o),r.child;case 9:return p=r.type._context,d=r.pendingProps.children,ma(r),p=Ei(p),d=d(p),r.flags|=1,Ci(n,r,d,o),r.child;case 14:return Hv(n,r,r.type,r.pendingProps,o);case 15:return Fv(n,r,r.type,r.pendingProps,o);case 19:return Zv(n,r,o);case 31:return S5(n,r,o);case 22:return $v(n,r,o,r.pendingProps);case 24:return ma(r),d=Ei(Zt),n===null?(p=gf(),p===null&&(p=St,b=mf(),p.pooledCache=b,b.refCount++,b!==null&&(p.pooledCacheLanes|=o),p=b),r.memoizedState={parent:d,cache:p},bf(r),pr(r,Zt,p)):((n.lanes&o)!==0&&(vf(n,r),Ol(r,null,null,o),Dl()),p=n.memoizedState,b=r.memoizedState,p.parent!==d?(p={parent:d,cache:d},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),pr(r,Zt,d)):(d=b.cache,pr(r,Zt,d),d!==p.cache&&ff(r,[Zt],o,!0))),Ci(n,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function zs(n){n.flags|=4}function em(n,r,o,d,p){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(C1())n.flags|=8192;else throw _a=Tu,_f}else n.flags&=-16777217}function Jv(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!mx(r))if(C1())n.flags|=8192;else throw _a=Tu,_f}function qu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ie():536870912,n.lanes|=r,Co|=r)}function Pl(n,r){if(!tt)switch(n.tailMode){case"hidden":r=n.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function Nt(n){var r=n.alternate!==null&&n.alternate.child===n.child,o=0,d=0;if(r)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=d,n.childLanes=o,r}function E5(n,r,o){var d=r.pendingProps;switch(lf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(r),null;case 1:return Nt(r),null;case 3:return o=r.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),Os(Zt),ye(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(ho(r)?zs(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,uf())),Nt(r),null;case 26:var p=r.type,b=r.memoizedState;return n===null?(zs(r),b!==null?(Nt(r),Jv(r,b)):(Nt(r),em(r,p,null,d,o))):b?b!==n.memoizedState?(zs(r),Nt(r),Jv(r,b)):(Nt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==d&&zs(r),Nt(r),em(r,p,n,d,o)),null;case 27:if(lt(r),o=fe.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&zs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return Nt(r),null}n=$.current,ho(r)?Db(r):(n=ax(p,d,o),r.stateNode=n,zs(r))}return Nt(r),null;case 5:if(lt(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&zs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return Nt(r),null}if(b=$.current,ho(r))Db(r);else{var S=ad(fe.current);switch(b){case 1:b=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:b=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":b=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":b=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":b=S.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}b[Vt]=r,b[Di]=d;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)b.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=b;e:switch(ki(b,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&zs(r)}}return Nt(r),em(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,o),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==d&&zs(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(s(166));if(n=fe.current,ho(r)){if(n=r.stateNode,o=r.memoizedProps,d=null,p=wi,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}n[Vt]=r,n=!!(n.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||Y1(n.nodeValue,o)),n||mr(r,!0)}else n=ad(n).createTextNode(d),n[Vt]=r,r.stateNode=n}return Nt(r),null;case 31:if(o=r.memoizedState,n===null||n.memoizedState!==null){if(d=ho(r),o!==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[Vt]=r}else ha(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),n=!1}else o=uf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return r.flags&256?(mn(r),r):(mn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Nt(r),null;case 13:if(d=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=ho(r),d!==null&&d.dehydrated!==null){if(n===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[Vt]=r}else ha(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),p=!1}else p=uf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(mn(r),r):(mn(r),null)}return mn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=d!==null,n=n!==null&&n.memoizedState!==null,o&&(d=r.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==p&&(d.flags|=2048)),o!==n&&o&&(r.child.flags|=8192),qu(r,r.updateQueue),Nt(r),null);case 4:return ye(),n===null&&Sm(r.stateNode.containerInfo),Nt(r),null;case 10:return Os(r.type),Nt(r),null;case 19:if(te(Kt),d=r.memoizedState,d===null)return Nt(r),null;if(p=(r.flags&128)!==0,b=d.rendering,b===null)if(p)Pl(d,!1);else{if(It!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(b=Du(n),b!==null){for(r.flags|=128,Pl(d,!1),n=b.updateQueue,r.updateQueue=n,qu(r,n),r.subtreeFlags=0,n=o,o=r.child;o!==null;)Nb(o,n),o=o.sibling;return ue(Kt,Kt.current&1|2),tt&&Rs(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Ot()>Xu&&(r.flags|=128,p=!0,Pl(d,!1),r.lanes=4194304)}else{if(!p)if(n=Du(b),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,qu(r,n),Pl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!tt)return Nt(r),null}else 2*Ot()-d.renderingStartTime>Xu&&o!==536870912&&(r.flags|=128,p=!0,Pl(d,!1),r.lanes=4194304);d.isBackwards?(b.sibling=r.child,r.child=b):(n=d.last,n!==null?n.sibling=b:r.child=b,d.last=b)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Ot(),n.sibling=null,o=Kt.current,ue(Kt,p?o&1|2:o&1),tt&&Rs(r,d.treeForkCount),n):(Nt(r),null);case 22:case 23:return mn(r),wf(),d=r.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(o&536870912)!==0&&(r.flags&128)===0&&(Nt(r),r.subtreeFlags&6&&(r.flags|=8192)):Nt(r),o=r.updateQueue,o!==null&&qu(r,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==o&&(r.flags|=2048),n!==null&&te(pa),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Os(Zt),Nt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function C5(n,r){switch(lf(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Os(Zt),ye(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return lt(r),null;case 31:if(r.memoizedState!==null){if(mn(r),r.alternate===null)throw Error(s(340));ha()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(mn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ha()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return te(Kt),null;case 4:return ye(),null;case 10:return Os(r.type),null;case 22:case 23:return mn(r),wf(),n!==null&&te(pa),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Os(Zt),null;case 25:return null;default:return null}}function e1(n,r){switch(lf(r),r.tag){case 3:Os(Zt),ye();break;case 26:case 27:case 5:lt(r);break;case 4:ye();break;case 31:r.memoizedState!==null&&mn(r);break;case 13:mn(r);break;case 19:te(Kt);break;case 10:Os(r.type);break;case 22:case 23:mn(r),wf(),n!==null&&te(pa);break;case 24:Os(Zt)}}function Ul(n,r){try{var o=r.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var p=d.next;o=p;do{if((o.tag&n)===n){d=void 0;var b=o.create,S=o.inst;d=b(),S.destroy=d}o=o.next}while(o!==p)}}catch(k){pt(r,r.return,k)}}function yr(n,r,o){try{var d=r.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&n)===n){var S=d.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,p=r;var z=o,Q=k;try{Q()}catch(re){pt(p,z,re)}}}d=d.next}while(d!==b)}}catch(re){pt(r,r.return,re)}}function t1(n){var r=n.updateQueue;if(r!==null){var o=n.stateNode;try{qb(r,o)}catch(d){pt(n,n.return,d)}}}function i1(n,r,o){o.props=xa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(d){pt(n,r,d)}}function Hl(n,r){try{var o=n.ref;if(o!==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 o=="function"?n.refCleanup=o(d):o.current=d}}catch(p){pt(n,r,p)}}function ss(n,r){var o=n.ref,d=n.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(p){pt(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){pt(n,r,p)}else o.current=null}function n1(n){var r=n.type,o=n.memoizedProps,d=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(p){pt(n,n.return,p)}}function tm(n,r,o){try{var d=n.stateNode;G5(d,n.type,o,r),d[Di]=r}catch(p){pt(n,n.return,p)}}function s1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Tr(n.type)||n.tag===4}function im(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||s1(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&&Tr(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 nm(n,r,o){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(n),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=ge));else if(d!==4&&(d===27&&Tr(n.type)&&(o=n.stateNode,r=null),n=n.child,n!==null))for(nm(n,r,o),n=n.sibling;n!==null;)nm(n,r,o),n=n.sibling}function Ku(n,r,o){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?o.insertBefore(n,r):o.appendChild(n);else if(d!==4&&(d===27&&Tr(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(Ku(n,r,o),n=n.sibling;n!==null;)Ku(n,r,o),n=n.sibling}function r1(n){var r=n.stateNode,o=n.memoizedProps;try{for(var d=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);ki(r,d,o),r[Vt]=n,r[Di]=o}catch(b){pt(n,n.return,b)}}var Is=!1,ei=!1,sm=!1,a1=typeof WeakSet=="function"?WeakSet:Set,mi=null;function k5(n,r){if(n=n.containerInfo,Cm=fd,n=bb(n),Xh(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var p=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{o.nodeType,b.nodeType}catch{o=null;break e}var S=0,k=-1,z=-1,Q=0,re=0,le=n,ee=null;t:for(;;){for(var ne;le!==o||p!==0&&le.nodeType!==3||(k=S+p),le!==b||d!==0&&le.nodeType!==3||(z=S+d),le.nodeType===3&&(S+=le.nodeValue.length),(ne=le.firstChild)!==null;)ee=le,le=ne;for(;;){if(le===n)break t;if(ee===o&&++Q===p&&(k=S),ee===b&&++re===d&&(z=S),(ne=le.nextSibling)!==null)break;le=ee,ee=le.parentNode}le=ne}o=k===-1||z===-1?null:{start:k,end:z}}else o=null}o=o||{start:0,end:0}}else o=null;for(km={focusedElem:n,selectionRange:o},fd=!1,mi=r;mi!==null;)if(r=mi,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,mi=n;else for(;mi!==null;){switch(r=mi,b=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(o=0;o<n.length;o++)p=n[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&b!==null){n=void 0,o=r,p=b.memoizedProps,b=b.memoizedState,d=o.stateNode;try{var Ce=xa(o.type,p);n=d.getSnapshotBeforeUpdate(Ce,b),d.__reactInternalSnapshotBeforeUpdate=n}catch(je){pt(o,o.return,je)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,o=n.nodeType,o===9)Am(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Am(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,mi=n;break}mi=r.return}}function o1(n,r,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:Us(n,o),d&4&&Ul(5,o);break;case 1:if(Us(n,o),d&4)if(n=o.stateNode,r===null)try{n.componentDidMount()}catch(S){pt(o,o.return,S)}else{var p=xa(o.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(S){pt(o,o.return,S)}}d&64&&t1(o),d&512&&Hl(o,o.return);break;case 3:if(Us(n,o),d&64&&(n=o.updateQueue,n!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{qb(n,r)}catch(S){pt(o,o.return,S)}}break;case 27:r===null&&d&4&&r1(o);case 26:case 5:Us(n,o),r===null&&d&4&&n1(o),d&512&&Hl(o,o.return);break;case 12:Us(n,o);break;case 31:Us(n,o),d&4&&u1(n,o);break;case 13:Us(n,o),d&4&&d1(n,o),d&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=L5.bind(null,o),tT(n,o))));break;case 22:if(d=o.memoizedState!==null||Is,!d){r=r!==null&&r.memoizedState!==null||ei,p=Is;var b=ei;Is=d,(ei=r)&&!b?Hs(n,o,(o.subtreeFlags&8772)!==0):Us(n,o),Is=p,ei=b}break;case 30:break;default:Us(n,o)}}function l1(n){var r=n.alternate;r!==null&&(n.alternate=null,l1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&dl(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 Rt=null,Ji=!1;function Ps(n,r,o){for(o=o.child;o!==null;)c1(n,r,o),o=o.sibling}function c1(n,r,o){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(Es,o)}catch{}switch(o.tag){case 26:ei||ss(o,r),Ps(n,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ei||ss(o,r);var d=Rt,p=Ji;Tr(o.type)&&(Rt=o.stateNode,Ji=!1),Ps(n,r,o),Xl(o.stateNode),Rt=d,Ji=p;break;case 5:ei||ss(o,r);case 6:if(d=Rt,p=Ji,Rt=null,Ps(n,r,o),Rt=d,Ji=p,Rt!==null)if(Ji)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(o.stateNode)}catch(b){pt(o,r,b)}else try{Rt.removeChild(o.stateNode)}catch(b){pt(o,r,b)}break;case 18:Rt!==null&&(Ji?(n=Rt,tx(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),Oo(n)):tx(Rt,o.stateNode));break;case 4:d=Rt,p=Ji,Rt=o.stateNode.containerInfo,Ji=!0,Ps(n,r,o),Rt=d,Ji=p;break;case 0:case 11:case 14:case 15:yr(2,o,r),ei||yr(4,o,r),Ps(n,r,o);break;case 1:ei||(ss(o,r),d=o.stateNode,typeof d.componentWillUnmount=="function"&&i1(o,r,d)),Ps(n,r,o);break;case 21:Ps(n,r,o);break;case 22:ei=(d=ei)||o.memoizedState!==null,Ps(n,r,o),ei=d;break;default:Ps(n,r,o)}}function u1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Oo(n)}catch(o){pt(r,r.return,o)}}}function d1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Oo(n)}catch(o){pt(r,r.return,o)}}function N5(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new a1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new a1),r;default:throw Error(s(435,n.tag))}}function Gu(n,r){var o=N5(n);r.forEach(function(d){if(!o.has(d)){o.add(d);var p=B5.bind(null,n,d);d.then(p,p)}})}function en(n,r){var o=r.deletions;if(o!==null)for(var d=0;d<o.length;d++){var p=o[d],b=n,S=r,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(Tr(k.type)){Rt=k.stateNode,Ji=!1;break e}break;case 5:Rt=k.stateNode,Ji=!1;break e;case 3:case 4:Rt=k.stateNode.containerInfo,Ji=!0;break e}k=k.return}if(Rt===null)throw Error(s(160));c1(b,S,p),Rt=null,Ji=!1,b=p.alternate,b!==null&&(b.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)h1(r,n),r=r.sibling}var Gn=null;function h1(n,r){var o=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:en(r,n),tn(n),d&4&&(yr(3,n,n.return),Ul(3,n),yr(5,n,n.return));break;case 1:en(r,n),tn(n),d&512&&(ei||o===null||ss(o,o.return)),d&64&&Is&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var p=Gn;if(en(r,n),tn(n),d&512&&(ei||o===null||ss(o,o.return)),d&4){var b=o!==null?o.memoizedState:null;if(d=n.memoizedState,o===null)if(d===null)if(n.stateNode===null){e:{d=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":b=p.getElementsByTagName("title")[0],(!b||b[sa]||b[Vt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=p.createElement(d),p.head.insertBefore(b,p.querySelector("head > title"))),ki(b,d,o),b[Vt]=n,Yt(b),d=b;break e;case"link":var S=hx("link","href",p).get(d+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(b=S[k],b.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&b.getAttribute("rel")===(o.rel==null?null:o.rel)&&b.getAttribute("title")===(o.title==null?null:o.title)&&b.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}b=p.createElement(d),ki(b,d,o),p.head.appendChild(b);break;case"meta":if(S=hx("meta","content",p).get(d+(o.content||""))){for(k=0;k<S.length;k++)if(b=S[k],b.getAttribute("content")===(o.content==null?null:""+o.content)&&b.getAttribute("name")===(o.name==null?null:o.name)&&b.getAttribute("property")===(o.property==null?null:o.property)&&b.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&b.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}b=p.createElement(d),ki(b,d,o),p.head.appendChild(b);break;default:throw Error(s(468,d))}b[Vt]=n,Yt(b),d=b}n.stateNode=d}else fx(p,n.type,n.stateNode);else n.stateNode=dx(p,d,n.memoizedProps);else b!==d?(b===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):b.count--,d===null?fx(p,n.type,n.stateNode):dx(p,d,n.memoizedProps)):d===null&&n.stateNode!==null&&tm(n,n.memoizedProps,o.memoizedProps)}break;case 27:en(r,n),tn(n),d&512&&(ei||o===null||ss(o,o.return)),o!==null&&d&4&&tm(n,n.memoizedProps,o.memoizedProps);break;case 5:if(en(r,n),tn(n),d&512&&(ei||o===null||ss(o,o.return)),n.flags&32){p=n.stateNode;try{Le(p,"")}catch(Ce){pt(n,n.return,Ce)}}d&4&&n.stateNode!=null&&(p=n.memoizedProps,tm(n,p,o!==null?o.memoizedProps:p)),d&1024&&(sm=!0);break;case 6:if(en(r,n),tn(n),d&4){if(n.stateNode===null)throw Error(s(162));d=n.memoizedProps,o=n.stateNode;try{o.nodeValue=d}catch(Ce){pt(n,n.return,Ce)}}break;case 3:if(cd=null,p=Gn,Gn=od(r.containerInfo),en(r,n),Gn=p,tn(n),d&4&&o!==null&&o.memoizedState.isDehydrated)try{Oo(r.containerInfo)}catch(Ce){pt(n,n.return,Ce)}sm&&(sm=!1,f1(n));break;case 4:d=Gn,Gn=od(n.stateNode.containerInfo),en(r,n),tn(n),Gn=d;break;case 12:en(r,n),tn(n);break;case 31:en(r,n),tn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Gu(n,d)));break;case 13:en(r,n),tn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Yu=Ot()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Gu(n,d)));break;case 22:p=n.memoizedState!==null;var z=o!==null&&o.memoizedState!==null,Q=Is,re=ei;if(Is=Q||p,ei=re||z,en(r,n),ei=re,Is=Q,tn(n),d&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||z||Is||ei||ya(n)),o=null,r=n;;){if(r.tag===5||r.tag===26){if(o===null){z=o=r;try{if(b=z.stateNode,p)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=z.stateNode;var le=z.memoizedProps.style,ee=le!=null&&le.hasOwnProperty("display")?le.display:null;k.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ce){pt(z,z.return,Ce)}}}else if(r.tag===6){if(o===null){z=r;try{z.stateNode.nodeValue=p?"":z.memoizedProps}catch(Ce){pt(z,z.return,Ce)}}}else if(r.tag===18){if(o===null){z=r;try{var ne=z.stateNode;p?ix(ne,!0):ix(z.stateNode,!1)}catch(Ce){pt(z,z.return,Ce)}}}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;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=n.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,Gu(n,o))));break;case 19:en(r,n),tn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Gu(n,d)));break;case 30:break;case 21:break;default:en(r,n),tn(n)}}function tn(n){var r=n.flags;if(r&2){try{for(var o,d=n.return;d!==null;){if(s1(d)){o=d;break}d=d.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var p=o.stateNode,b=im(n);Ku(n,b,p);break;case 5:var S=o.stateNode;o.flags&32&&(Le(S,""),o.flags&=-33);var k=im(n);Ku(n,k,S);break;case 3:case 4:var z=o.stateNode.containerInfo,Q=im(n);nm(n,Q,z);break;default:throw Error(s(161))}}catch(re){pt(n,n.return,re)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function f1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;f1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function Us(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)o1(n,r.alternate,r),r=r.sibling}function ya(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:yr(4,r,r.return),ya(r);break;case 1:ss(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&i1(r,r.return,o),ya(r);break;case 27:Xl(r.stateNode);case 26:case 5:ss(r,r.return),ya(r);break;case 22:r.memoizedState===null&&ya(r);break;case 30:ya(r);break;default:ya(r)}n=n.sibling}}function Hs(n,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,p=n,b=r,S=b.flags;switch(b.tag){case 0:case 11:case 15:Hs(p,b,o),Ul(4,b);break;case 1:if(Hs(p,b,o),d=b,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Q){pt(d,d.return,Q)}if(d=b,p=d.updateQueue,p!==null){var k=d.stateNode;try{var z=p.shared.hiddenCallbacks;if(z!==null)for(p.shared.hiddenCallbacks=null,p=0;p<z.length;p++)Vb(z[p],k)}catch(Q){pt(d,d.return,Q)}}o&&S&64&&t1(b),Hl(b,b.return);break;case 27:r1(b);case 26:case 5:Hs(p,b,o),o&&d===null&&S&4&&n1(b),Hl(b,b.return);break;case 12:Hs(p,b,o);break;case 31:Hs(p,b,o),o&&S&4&&u1(p,b);break;case 13:Hs(p,b,o),o&&S&4&&d1(p,b);break;case 22:b.memoizedState===null&&Hs(p,b,o),Hl(b,b.return);break;case 30:break;default:Hs(p,b,o)}r=r.sibling}}function rm(n,r){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Nl(o))}function am(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Nl(n))}function Wn(n,r,o,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)m1(n,r,o,d),r=r.sibling}function m1(n,r,o,d){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Wn(n,r,o,d),p&2048&&Ul(9,r);break;case 1:Wn(n,r,o,d);break;case 3:Wn(n,r,o,d),p&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Nl(n)));break;case 12:if(p&2048){Wn(n,r,o,d),n=r.stateNode;try{var b=r.memoizedProps,S=b.id,k=b.onPostCommit;typeof k=="function"&&k(S,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(z){pt(r,r.return,z)}}else Wn(n,r,o,d);break;case 31:Wn(n,r,o,d);break;case 13:Wn(n,r,o,d);break;case 23:break;case 22:b=r.stateNode,S=r.alternate,r.memoizedState!==null?b._visibility&2?Wn(n,r,o,d):Fl(n,r):b._visibility&2?Wn(n,r,o,d):(b._visibility|=2,So(n,r,o,d,(r.subtreeFlags&10256)!==0||!1)),p&2048&&rm(S,r);break;case 24:Wn(n,r,o,d),p&2048&&am(r.alternate,r);break;default:Wn(n,r,o,d)}}function So(n,r,o,d,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var b=n,S=r,k=o,z=d,Q=S.flags;switch(S.tag){case 0:case 11:case 15:So(b,S,k,z,p),Ul(8,S);break;case 23:break;case 22:var re=S.stateNode;S.memoizedState!==null?re._visibility&2?So(b,S,k,z,p):Fl(b,S):(re._visibility|=2,So(b,S,k,z,p)),p&&Q&2048&&rm(S.alternate,S);break;case 24:So(b,S,k,z,p),p&&Q&2048&&am(S.alternate,S);break;default:So(b,S,k,z,p)}r=r.sibling}}function Fl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=n,d=r,p=d.flags;switch(d.tag){case 22:Fl(o,d),p&2048&&rm(d.alternate,d);break;case 24:Fl(o,d),p&2048&&am(d.alternate,d);break;default:Fl(o,d)}r=r.sibling}}var $l=8192;function wo(n,r,o){if(n.subtreeFlags&$l)for(n=n.child;n!==null;)p1(n,r,o),n=n.sibling}function p1(n,r,o){switch(n.tag){case 26:wo(n,r,o),n.flags&$l&&n.memoizedState!==null&&fT(o,Gn,n.memoizedState,n.memoizedProps);break;case 5:wo(n,r,o);break;case 3:case 4:var d=Gn;Gn=od(n.stateNode.containerInfo),wo(n,r,o),Gn=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=$l,$l=16777216,wo(n,r,o),$l=d):wo(n,r,o));break;default:wo(n,r,o)}}function g1(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 Vl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var d=r[o];mi=d,b1(d,n)}g1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_1(n),n=n.sibling}function _1(n){switch(n.tag){case 0:case 11:case 15:Vl(n),n.flags&2048&&yr(9,n,n.return);break;case 3:Vl(n);break;case 12:Vl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Wu(n)):Vl(n);break;default:Vl(n)}}function Wu(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var d=r[o];mi=d,b1(d,n)}g1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:yr(8,r,r.return),Wu(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Wu(r));break;default:Wu(r)}n=n.sibling}}function b1(n,r){for(;mi!==null;){var o=mi;switch(o.tag){case 0:case 11:case 15:yr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Nl(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,mi=d;else e:for(o=n;mi!==null;){d=mi;var p=d.sibling,b=d.return;if(l1(d),d===o){mi=null;break e}if(p!==null){p.return=b,mi=p;break e}mi=b}}}var T5={getCacheForType:function(n){var r=Ei(Zt),o=r.data.get(n);return o===void 0&&(o=n(),r.data.set(n,o)),o},cacheSignal:function(){return Ei(Zt).controller.signal}},A5=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Xe=null,Je=0,mt=0,pn=null,Sr=!1,Eo=!1,om=!1,Fs=0,It=0,wr=0,Sa=0,lm=0,gn=0,Co=0,ql=null,nn=null,cm=!1,Yu=0,v1=0,Xu=1/0,Zu=null,Er=null,ai=0,Cr=null,ko=null,$s=0,um=0,dm=null,x1=null,Kl=0,hm=null;function _n(){return(ut&2)!==0&&Je!==0?Je&-Je:O.T!==null?bm():Za()}function y1(){if(gn===0)if((Je&536870912)===0||tt){var n=qn;qn<<=1,(qn&3932160)===0&&(qn=262144),gn=n}else gn=536870912;return n=fn.current,n!==null&&(n.flags|=32),gn}function sn(n,r,o){(n===St&&(mt===2||mt===9)||n.cancelPendingCommit!==null)&&(No(n,0),kr(n,Je,gn,!1)),yt(n,o),((ut&2)===0||n!==St)&&(n===St&&((ut&2)===0&&(Sa|=o),It===4&&kr(n,Je,gn,!1)),rs(n))}function S1(n,r,o){if((ut&6)!==0)throw Error(s(327));var d=!o&&(r&127)===0&&(r&n.expiredLanes)===0||ae(n,r),p=d?D5(n,r):mm(n,r,!0),b=d;do{if(p===0){Eo&&!d&&kr(n,r,0,!1);break}else{if(o=n.current.alternate,b&&!M5(o)){p=mm(n,r,!1),b=!1;continue}if(p===2){if(b=r,n.errorRecoveryDisabledLanes&b)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var k=n;p=ql;var z=k.current.memoizedState.isDehydrated;if(z&&(No(k,S).flags|=256),S=mm(k,S,!1),S!==2){if(om&&!z){k.errorRecoveryDisabledLanes|=b,Sa|=b,p=4;break e}b=nn,nn=p,b!==null&&(nn===null?nn=b:nn.push.apply(nn,b))}p=S}if(b=!1,p!==2)continue}}if(p===1){No(n,0),kr(n,r,0,!0);break}e:{switch(d=n,b=p,b){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:kr(d,r,gn,!Sr);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=Yu+300-Ot(),10<p)){if(kr(d,r,gn,!Sr),I(d,0,!0)!==0)break e;$s=r,d.timeoutHandle=J1(w1.bind(null,d,o,nn,Zu,cm,r,gn,Sa,Co,Sr,b,"Throttled",-0,0),p);break e}w1(d,o,nn,Zu,cm,r,gn,Sa,Co,Sr,b,null,-0,0)}}break}while(!0);rs(n)}function w1(n,r,o,d,p,b,S,k,z,Q,re,le,ee,ne){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:ge},p1(r,b,le);var Ce=(b&62914560)===b?Yu-Ot():(b&4194048)===b?v1-Ot():0;if(Ce=mT(le,Ce),Ce!==null){$s=b,n.cancelPendingCommit=Ce(R1.bind(null,n,r,b,o,d,p,S,k,z,re,le,null,ee,ne)),kr(n,b,S,!Q);return}}R1(n,r,b,o,d,p,S,k,z)}function M5(n){for(var r=n;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var p=o[d],b=p.getSnapshot;p=p.value;try{if(!dn(b(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;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 kr(n,r,o,d){r&=~lm,r&=~Sa,n.suspendedLanes|=r,n.pingedLanes&=~r,d&&(n.warmLanes|=r),d=n.expirationTimes;for(var p=r;0<p;){var b=31-yi(p),S=1<<b;d[b]=-1,p&=~S}o!==0&&Se(n,o,r)}function Qu(){return(ut&6)===0?(Gl(0),!1):!0}function fm(){if(Xe!==null){if(mt===0)var n=Xe.return;else n=Xe,Ds=fa=null,Af(n),_o=null,Al=0,n=Xe;for(;n!==null;)e1(n.alternate,n),n=n.return;Xe=null}}function No(n,r){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,X5(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),$s=0,fm(),St=n,Xe=o=Ms(n.current,null),Je=r,mt=0,pn=null,Sr=!1,Eo=ae(n,r),om=!1,Co=gn=lm=Sa=wr=It=0,nn=ql=null,cm=!1,(r&8)!==0&&(r|=r&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=r;0<d;){var p=31-yi(d),b=1<<p;r|=n[p],d&=~b}return Fs=r,vu(),o}function E1(n,r){Fe=null,O.H=zl,r===go||r===Nu?(r=Ub(),mt=3):r===_f?(r=Ub(),mt=4):mt=r===qf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,pn=r,Xe===null&&(It=1,Hu(n,Cn(r,n.current)))}function C1(){var n=fn.current;return n===null?!0:(Je&4194048)===Je?An===null:(Je&62914560)===Je||(Je&536870912)!==0?n===An:!1}function k1(){var n=O.H;return O.H=zl,n===null?zl:n}function N1(){var n=O.A;return O.A=T5,n}function Ju(){It=4,Sr||(Je&4194048)!==Je&&fn.current!==null||(Eo=!0),(wr&134217727)===0&&(Sa&134217727)===0||St===null||kr(St,Je,gn,!1)}function mm(n,r,o){var d=ut;ut|=2;var p=k1(),b=N1();(St!==n||Je!==r)&&(Zu=null,No(n,r)),r=!1;var S=It;e:do try{if(mt!==0&&Xe!==null){var k=Xe,z=pn;switch(mt){case 8:fm(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var Q=mt;if(mt=0,pn=null,To(n,k,z,Q),o&&Eo){S=0;break e}break;default:Q=mt,mt=0,pn=null,To(n,k,z,Q)}}R5(),S=It;break}catch(re){E1(n,re)}while(!0);return r&&n.shellSuspendCounter++,Ds=fa=null,ut=d,O.H=p,O.A=b,Xe===null&&(St=null,Je=0,vu()),S}function R5(){for(;Xe!==null;)T1(Xe)}function D5(n,r){var o=ut;ut|=2;var d=k1(),p=N1();St!==n||Je!==r?(Zu=null,Xu=Ot()+500,No(n,r)):Eo=ae(n,r);e:do try{if(mt!==0&&Xe!==null){r=Xe;var b=pn;t:switch(mt){case 1:mt=0,pn=null,To(n,r,b,1);break;case 2:case 9:if(Ib(b)){mt=0,pn=null,A1(r);break}r=function(){mt!==2&&mt!==9||St!==n||(mt=7),rs(n)},b.then(r,r);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:Ib(b)?(mt=0,pn=null,A1(r)):(mt=0,pn=null,To(n,r,b,7));break;case 5:var S=null;switch(Xe.tag){case 26:S=Xe.memoizedState;case 5:case 27:var k=Xe;if(S?mx(S):k.stateNode.complete){mt=0,pn=null;var z=k.sibling;if(z!==null)Xe=z;else{var Q=k.return;Q!==null?(Xe=Q,ed(Q)):Xe=null}break t}}mt=0,pn=null,To(n,r,b,5);break;case 6:mt=0,pn=null,To(n,r,b,6);break;case 8:fm(),It=6;break e;default:throw Error(s(462))}}O5();break}catch(re){E1(n,re)}while(!0);return Ds=fa=null,O.H=d,O.A=p,ut=o,Xe!==null?0:(St=null,Je=0,vu(),It)}function O5(){for(;Xe!==null&&!ol();)T1(Xe)}function T1(n){var r=Qv(n.alternate,n,Fs);n.memoizedProps=n.pendingProps,r===null?ed(n):Xe=r}function A1(n){var r=n,o=r.alternate;switch(r.tag){case 15:case 0:r=Kv(o,r,r.pendingProps,r.type,void 0,Je);break;case 11:r=Kv(o,r,r.pendingProps,r.type.render,r.ref,Je);break;case 5:Af(r);default:e1(o,r),r=Xe=Nb(r,Fs),r=Qv(o,r,Fs)}n.memoizedProps=n.pendingProps,r===null?ed(n):Xe=r}function To(n,r,o,d){Ds=fa=null,Af(r),_o=null,Al=0;var p=r.return;try{if(y5(n,p,r,o,Je)){It=1,Hu(n,Cn(o,n.current)),Xe=null;return}}catch(b){if(p!==null)throw Xe=p,b;It=1,Hu(n,Cn(o,n.current)),Xe=null;return}r.flags&32768?(tt||d===1?n=!0:Eo||(Je&536870912)!==0?n=!1:(Sr=n=!0,(d===2||d===9||d===3||d===6)&&(d=fn.current,d!==null&&d.tag===13&&(d.flags|=16384))),M1(r,n)):ed(r)}function ed(n){var r=n;do{if((r.flags&32768)!==0){M1(r,Sr);return}n=r.return;var o=E5(r.alternate,r,Fs);if(o!==null){Xe=o;return}if(r=r.sibling,r!==null){Xe=r;return}Xe=r=n}while(r!==null);It===0&&(It=5)}function M1(n,r){do{var o=C5(n.alternate,n);if(o!==null){o.flags&=32767,Xe=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(n=n.sibling,n!==null)){Xe=n;return}Xe=n=o}while(n!==null);It=6,Xe=null}function R1(n,r,o,d,p,b,S,k,z){n.cancelPendingCommit=null;do td();while(ai!==0);if((ut&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(b=r.lanes|r.childLanes,b|=tf,Ne(n,o,b,S,k,z),n===St&&(Xe=St=null,Je=0),ko=r,Cr=n,$s=o,um=b,dm=p,x1=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,z5(ws,function(){return B1(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=O.T,O.T=null,p=Y.p,Y.p=2,S=ut,ut|=4;try{k5(n,r,o)}finally{ut=S,Y.p=p,O.T=d}}ai=1,D1(),O1(),j1()}}function D1(){if(ai===1){ai=0;var n=Cr,r=ko,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=O.T,O.T=null;var d=Y.p;Y.p=2;var p=ut;ut|=4;try{h1(r,n);var b=km,S=bb(n.containerInfo),k=b.focusedElem,z=b.selectionRange;if(S!==k&&k&&k.ownerDocument&&_b(k.ownerDocument.documentElement,k)){if(z!==null&&Xh(k)){var Q=z.start,re=z.end;if(re===void 0&&(re=Q),"selectionStart"in k)k.selectionStart=Q,k.selectionEnd=Math.min(re,k.value.length);else{var le=k.ownerDocument||document,ee=le&&le.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Ce=k.textContent.length,je=Math.min(z.start,Ce),vt=z.end===void 0?je:Math.min(z.end,Ce);!ne.extend&&je>vt&&(S=vt,vt=je,je=S);var G=gb(k,je),U=gb(k,vt);if(G&&U&&(ne.rangeCount!==1||ne.anchorNode!==G.node||ne.anchorOffset!==G.offset||ne.focusNode!==U.node||ne.focusOffset!==U.offset)){var Z=le.createRange();Z.setStart(G.node,G.offset),ne.removeAllRanges(),je>vt?(ne.addRange(Z),ne.extend(U.node,U.offset)):(Z.setEnd(U.node,U.offset),ne.addRange(Z))}}}}for(le=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<le.length;k++){var oe=le[k];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}fd=!!Cm,km=Cm=null}finally{ut=p,Y.p=d,O.T=o}}n.current=r,ai=2}}function O1(){if(ai===2){ai=0;var n=Cr,r=ko,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=O.T,O.T=null;var d=Y.p;Y.p=2;var p=ut;ut|=4;try{o1(n,r.alternate,r)}finally{ut=p,Y.p=d,O.T=o}}ai=3}}function j1(){if(ai===4||ai===3){ai=0,Ga();var n=Cr,r=ko,o=$s,d=x1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?ai=5:(ai=0,ko=Cr=null,L1(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Er=null),Cs(o),r=r.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(Es,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=O.T,p=Y.p,Y.p=2,O.T=null;try{for(var b=n.onRecoverableError,S=0;S<d.length;S++){var k=d[S];b(k.value,{componentStack:k.stack})}}finally{O.T=r,Y.p=p}}($s&3)!==0&&td(),rs(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===hm?Kl++:(Kl=0,hm=n):Kl=0,Gl(0)}}function L1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Nl(r)))}function td(){return D1(),O1(),j1(),B1()}function B1(){if(ai!==5)return!1;var n=Cr,r=um;um=0;var o=Cs($s),d=O.T,p=Y.p;try{Y.p=32>o?32:o,O.T=null,o=dm,dm=null;var b=Cr,S=$s;if(ai=0,ko=Cr=null,$s=0,(ut&6)!==0)throw Error(s(331));var k=ut;if(ut|=4,_1(b.current),m1(b,b.current,S,o),ut=k,Gl(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(Es,b)}catch{}return!0}finally{Y.p=p,O.T=d,L1(n,r)}}function z1(n,r,o){r=Cn(o,r),r=Vf(n.stateNode,r,2),n=br(n,r,2),n!==null&&(yt(n,2),rs(n))}function pt(n,r,o){if(n.tag===3)z1(n,n,o);else for(;r!==null;){if(r.tag===3){z1(r,n,o);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Er===null||!Er.has(d))){n=Cn(o,n),o=Iv(2),d=br(r,o,2),d!==null&&(Pv(o,d,r,n),yt(d,2),rs(d));break}}r=r.return}}function pm(n,r,o){var d=n.pingCache;if(d===null){d=n.pingCache=new A5;var p=new Set;d.set(r,p)}else p=d.get(r),p===void 0&&(p=new Set,d.set(r,p));p.has(o)||(om=!0,p.add(o),n=j5.bind(null,n,r,o),r.then(n,n))}function j5(n,r,o){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,St===n&&(Je&o)===o&&(It===4||It===3&&(Je&62914560)===Je&&300>Ot()-Yu?(ut&2)===0&&No(n,0):lm|=o,Co===Je&&(Co=0)),rs(n)}function I1(n,r){r===0&&(r=Ie()),n=ua(n,r),n!==null&&(yt(n,r),rs(n))}function L5(n){var r=n.memoizedState,o=0;r!==null&&(o=r.retryLane),I1(n,o)}function B5(n,r){var o=0;switch(n.tag){case 31:case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(o=p.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),I1(n,o)}function z5(n,r){return sr(n,r)}var id=null,Ao=null,gm=!1,nd=!1,_m=!1,Nr=0;function rs(n){n!==Ao&&n.next===null&&(Ao===null?id=Ao=n:Ao=Ao.next=n),nd=!0,gm||(gm=!0,P5())}function Gl(n,r){if(!_m&&nd){_m=!0;do for(var o=!1,d=id;d!==null;){if(n!==0){var p=d.pendingLanes;if(p===0)var b=0;else{var S=d.suspendedLanes,k=d.pingedLanes;b=(1<<31-yi(42|n)+1)-1,b&=p&~(S&~k),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(o=!0,F1(d,b))}else b=Je,b=I(d,d===St?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||ae(d,b)||(o=!0,F1(d,b));d=d.next}while(o);_m=!1}}function I5(){P1()}function P1(){nd=gm=!1;var n=0;Nr!==0&&Y5()&&(n=Nr);for(var r=Ot(),o=null,d=id;d!==null;){var p=d.next,b=U1(d,r);b===0?(d.next=null,o===null?id=p:o.next=p,p===null&&(Ao=o)):(o=d,(n!==0||(b&3)!==0)&&(nd=!0)),d=p}ai!==0&&ai!==5||Gl(n),Nr!==0&&(Nr=0)}function U1(n,r){for(var o=n.suspendedLanes,d=n.pingedLanes,p=n.expirationTimes,b=n.pendingLanes&-62914561;0<b;){var S=31-yi(b),k=1<<S,z=p[S];z===-1?((k&o)===0||(k&d)!==0)&&(p[S]=be(k,r)):z<=r&&(n.expiredLanes|=k),b&=~k}if(r=St,o=Je,o=I(n,n===r?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,o===0||n===r&&(mt===2||mt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&xs(d),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||ae(n,o)){if(r=o&-o,r===n.callbackPriority)return r;switch(d!==null&&xs(d),Cs(o)){case 2:case 8:o=Ss;break;case 32:o=ws;break;case 268435456:o=rr;break;default:o=ws}return d=H1.bind(null,n),o=sr(o,d),n.callbackPriority=r,n.callbackNode=o,r}return d!==null&&d!==null&&xs(d),n.callbackPriority=2,n.callbackNode=null,2}function H1(n,r){if(ai!==0&&ai!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(td()&&n.callbackNode!==o)return null;var d=Je;return d=I(n,n===St?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(S1(n,d,r),U1(n,Ot()),n.callbackNode!=null&&n.callbackNode===o?H1.bind(null,n):null)}function F1(n,r){if(td())return null;S1(n,r,!0)}function P5(){Z5(function(){(ut&6)!==0?sr(xi,I5):P1()})}function bm(){if(Nr===0){var n=mo;n===0&&(n=it,it<<=1,(it&261888)===0&&(it=256)),Nr=n}return Nr}function $1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:ur(""+n)}function V1(n,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,n.id&&o.setAttribute("form",n.id),r.parentNode.insertBefore(o,r),n=new FormData(n),o.parentNode.removeChild(o),n}function U5(n,r,o,d,p){if(r==="submit"&&o&&o.stateNode===p){var b=$1((p[Di]||null).action),S=d.submitter;S&&(r=(r=S[Di]||null)?$1(r.formAction):S.getAttribute("formAction"),r!==null&&(b=r,S=null));var k=new pu("action","action",null,d,p);n.push({event:k,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Nr!==0){var z=S?V1(p,S):new FormData(p);If(o,{pending:!0,data:z,method:p.method,action:b},null,z)}}else typeof b=="function"&&(k.preventDefault(),z=S?V1(p,S):new FormData(p),If(o,{pending:!0,data:z,method:p.method,action:b},b,z))},currentTarget:p}]})}}for(var vm=0;vm<ef.length;vm++){var xm=ef[vm],H5=xm.toLowerCase(),F5=xm[0].toUpperCase()+xm.slice(1);Kn(H5,"on"+F5)}Kn(yb,"onAnimationEnd"),Kn(Sb,"onAnimationIteration"),Kn(wb,"onAnimationStart"),Kn("dblclick","onDoubleClick"),Kn("focusin","onFocus"),Kn("focusout","onBlur"),Kn(s5,"onTransitionRun"),Kn(r5,"onTransitionStart"),Kn(a5,"onTransitionCancel"),Kn(Eb,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ns("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),$5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function q1(n,r){r=(r&4)!==0;for(var o=0;o<n.length;o++){var d=n[o],p=d.event;d=d.listeners;e:{var b=void 0;if(r)for(var S=d.length-1;0<=S;S--){var k=d[S],z=k.instance,Q=k.currentTarget;if(k=k.listener,z!==b&&p.isPropagationStopped())break e;b=k,p.currentTarget=Q;try{b(p)}catch(re){bu(re)}p.currentTarget=null,b=z}else for(S=0;S<d.length;S++){if(k=d[S],z=k.instance,Q=k.currentTarget,k=k.listener,z!==b&&p.isPropagationStopped())break e;b=k,p.currentTarget=Q;try{b(p)}catch(re){bu(re)}p.currentTarget=null,b=z}}}}function Ze(n,r){var o=r[ul];o===void 0&&(o=r[ul]=new Set);var d=n+"__bubble";o.has(d)||(K1(r,n,2,!1),o.add(d))}function ym(n,r,o){var d=0;r&&(d|=4),K1(o,n,d,r)}var sd="_reactListening"+Math.random().toString(36).slice(2);function Sm(n){if(!n[sd]){n[sd]=!0,ou.forEach(function(o){o!=="selectionchange"&&($5.has(o)||ym(o,!1,n),ym(o,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[sd]||(r[sd]=!0,ym("selectionchange",!1,r))}}function K1(n,r,o,d){switch(yx(r)){case 2:var p=_T;break;case 8:p=bT;break;default:p=zm}o=p.bind(null,r,o,n),p=void 0,!Hh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),d?p!==void 0?n.addEventListener(r,o,{capture:!0,passive:p}):n.addEventListener(r,o,!0):p!==void 0?n.addEventListener(r,o,{passive:p}):n.addEventListener(r,o,!1)}function wm(n,r,o,d,p){var b=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var k=d.stateNode.containerInfo;if(k===p)break;if(S===4)for(S=d.return;S!==null;){var z=S.tag;if((z===3||z===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;k!==null;){if(S=Ui(k),S===null)return;if(z=S.tag,z===5||z===6||z===26||z===27){d=b=S;continue e}k=k.parentNode}}d=d.return}du(function(){var Q=b,re=He(o),le=[];e:{var ee=Cb.get(n);if(ee!==void 0){var ne=pu,Ce=n;switch(n){case"keypress":if(fu(o)===0)break e;case"keydown":case"keyup":ne=BN;break;case"focusin":Ce="focus",ne=qh;break;case"focusout":Ce="blur",ne=qh;break;case"beforeblur":case"afterblur":ne=qh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=eb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=EN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=PN;break;case yb:case Sb:case wb:ne=NN;break;case Eb:ne=HN;break;case"scroll":case"scrollend":ne=SN;break;case"wheel":ne=$N;break;case"copy":case"cut":case"paste":ne=AN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=ib;break;case"toggle":case"beforetoggle":ne=qN}var je=(r&4)!==0,vt=!je&&(n==="scroll"||n==="scrollend"),G=je?ee!==null?ee+"Capture":null:ee;je=[];for(var U=Q,Z;U!==null;){var oe=U;if(Z=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Z===null||G===null||(oe=gl(U,G),oe!=null&&je.push(Yl(U,oe,Z))),vt)break;U=U.return}0<je.length&&(ee=new ne(ee,Ce,null,o,re),le.push({event:ee,listeners:je}))}}if((r&7)===0){e:{if(ee=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",ee&&o!==Te&&(Ce=o.relatedTarget||o.fromElement)&&(Ui(Ce)||Ce[ar]))break e;if((ne||ee)&&(ee=re.window===re?re:(ee=re.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Ce=o.relatedTarget||o.toElement,ne=Q,Ce=Ce?Ui(Ce):null,Ce!==null&&(vt=l(Ce),je=Ce.tag,Ce!==vt||je!==5&&je!==27&&je!==6)&&(Ce=null)):(ne=null,Ce=Q),ne!==Ce)){if(je=eb,oe="onMouseLeave",G="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(je=ib,oe="onPointerLeave",G="onPointerEnter",U="pointer"),vt=ne==null?ee:or(ne),Z=Ce==null?ee:or(Ce),ee=new je(oe,U+"leave",ne,o,re),ee.target=vt,ee.relatedTarget=Z,oe=null,Ui(re)===Q&&(je=new je(G,U+"enter",Ce,o,re),je.target=Z,je.relatedTarget=vt,oe=je),vt=oe,ne&&Ce)t:{for(je=V5,G=ne,U=Ce,Z=0,oe=G;oe;oe=je(oe))Z++;oe=0;for(var De=U;De;De=je(De))oe++;for(;0<Z-oe;)G=je(G),Z--;for(;0<oe-Z;)U=je(U),oe--;for(;Z--;){if(G===U||U!==null&&G===U.alternate){je=G;break t}G=je(G),U=je(U)}je=null}else je=null;ne!==null&&G1(le,ee,ne,je,!1),Ce!==null&&vt!==null&&G1(le,vt,Ce,je,!0)}}e:{if(ee=Q?or(Q):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var rt=ub;else if(lb(ee))if(db)rt=t5;else{rt=JN;var Ae=QN}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?Q&&cr(Q.elementType)&&(rt=ub):rt=e5;if(rt&&(rt=rt(n,Q))){cb(le,rt,o,re);break e}Ae&&Ae(n,ee,Q),n==="focusout"&&Q&&ee.type==="number"&&Q.memoizedProps.value!=null&&io(ee,"number",ee.value)}switch(Ae=Q?or(Q):window,n){case"focusin":(lb(Ae)||Ae.contentEditable==="true")&&(ro=Ae,Zh=Q,El=null);break;case"focusout":El=Zh=ro=null;break;case"mousedown":Qh=!0;break;case"contextmenu":case"mouseup":case"dragend":Qh=!1,vb(le,o,re);break;case"selectionchange":if(n5)break;case"keydown":case"keyup":vb(le,o,re)}var $e;if(Gh)e:{switch(n){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else so?ab(n,o)&&(et="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(et="onCompositionStart");et&&(nb&&o.locale!=="ko"&&(so||et!=="onCompositionStart"?et==="onCompositionEnd"&&so&&($e=Q_()):(dr=re,Fh="value"in dr?dr.value:dr.textContent,so=!0)),Ae=rd(Q,et),0<Ae.length&&(et=new tb(et,n,null,o,re),le.push({event:et,listeners:Ae}),$e?et.data=$e:($e=ob(o),$e!==null&&(et.data=$e)))),($e=GN?WN(n,o):YN(n,o))&&(et=rd(Q,"onBeforeInput"),0<et.length&&(Ae=new tb("onBeforeInput","beforeinput",null,o,re),le.push({event:Ae,listeners:et}),Ae.data=$e)),U5(le,n,Q,o,re)}q1(le,r)})}function Yl(n,r,o){return{instance:n,listener:r,currentTarget:o}}function rd(n,r){for(var o=r+"Capture",d=[];n!==null;){var p=n,b=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||b===null||(p=gl(n,o),p!=null&&d.unshift(Yl(n,p,b)),p=gl(n,r),p!=null&&d.push(Yl(n,p,b))),n.tag===3)return d;n=n.return}return[]}function V5(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function G1(n,r,o,d,p){for(var b=r._reactName,S=[];o!==null&&o!==d;){var k=o,z=k.alternate,Q=k.stateNode;if(k=k.tag,z!==null&&z===d)break;k!==5&&k!==26&&k!==27||Q===null||(z=Q,p?(Q=gl(o,b),Q!=null&&S.unshift(Yl(o,Q,z))):p||(Q=gl(o,b),Q!=null&&S.push(Yl(o,Q,z)))),o=o.return}S.length!==0&&n.push({event:r,listeners:S})}var q5=/\r\n?/g,K5=/\u0000|\uFFFD/g;function W1(n){return(typeof n=="string"?n:""+n).replace(q5,`
9
- `).replace(K5,"")}function Y1(n,r){return r=W1(r),W1(n)===r}function bt(n,r,o,d,p,b){switch(o){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||Le(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&Le(n,""+d);break;case"className":cn(n,"class",d);break;case"tabIndex":cn(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":cn(n,o,d);break;case"style":ft(n,d,b);break;case"data":if(r!=="object"){cn(n,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||o!=="href")){n.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(o);break}d=ur(""+d),n.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(o,"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 b=="function"&&(o==="formAction"?(r!=="input"&&bt(n,r,"name",p.name,p,null),bt(n,r,"formEncType",p.formEncType,p,null),bt(n,r,"formMethod",p.formMethod,p,null),bt(n,r,"formTarget",p.formTarget,p,null)):(bt(n,r,"encType",p.encType,p,null),bt(n,r,"method",p.method,p,null),bt(n,r,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(o);break}d=ur(""+d),n.setAttribute(o,d);break;case"onClick":d!=null&&(n.onclick=ge);break;case"onScroll":d!=null&&Ze("scroll",n);break;case"onScrollEnd":d!=null&&Ze("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}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}o=ur(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);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(o,""+d):n.removeAttribute(o);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(o,""):n.removeAttribute(o);break;case"capture":case"download":d===!0?n.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(o,d):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(o,d):n.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(o):n.setAttribute(o,d);break;case"popover":Ze("beforetoggle",n),Ze("toggle",n),Oi(n,"popover",d);break;case"xlinkActuate":Xi(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Xi(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Xi(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Xi(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Xi(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Xi(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Xi(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Xi(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Xi(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Oi(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Ts.get(o)||o,Oi(n,o,d))}}function Em(n,r,o,d,p,b){switch(o){case"style":ft(n,d,b);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}break;case"children":typeof d=="string"?Le(n,d):(typeof d=="number"||typeof d=="bigint")&&Le(n,""+d);break;case"onScroll":d!=null&&Ze("scroll",n);break;case"onScrollEnd":d!=null&&Ze("scrollend",n);break;case"onClick":d!=null&&(n.onclick=ge);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ra.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),b=n[Di]||null,b=b!=null?b[o]:null,typeof b=="function"&&n.removeEventListener(r,b,p),typeof d=="function")){typeof b!="function"&&b!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(r,d,p);break e}o in n?n[o]=d:d===!0?n.setAttribute(o,""):Oi(n,o,d)}}}function ki(n,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",n),Ze("load",n);var d=!1,p=!1,b;for(b in o)if(o.hasOwnProperty(b)){var S=o[b];if(S!=null)switch(b){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:bt(n,r,b,S,o,null)}}p&&bt(n,r,"srcSet",o.srcSet,o,null),d&&bt(n,r,"src",o.src,o,null);return;case"input":Ze("invalid",n);var k=b=S=p=null,z=null,Q=null;for(d in o)if(o.hasOwnProperty(d)){var re=o[d];if(re!=null)switch(d){case"name":p=re;break;case"type":S=re;break;case"checked":z=re;break;case"defaultChecked":Q=re;break;case"value":b=re;break;case"defaultValue":k=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,r));break;default:bt(n,r,d,re,o,null)}}aa(n,b,k,z,Q,S,p,!1);return;case"select":Ze("invalid",n),d=S=b=null;for(p in o)if(o.hasOwnProperty(p)&&(k=o[p],k!=null))switch(p){case"value":b=k;break;case"defaultValue":S=k;break;case"multiple":d=k;default:bt(n,r,p,k,o,null)}r=b,o=S,n.multiple=!!d,r!=null?Si(n,!!d,r,!1):o!=null&&Si(n,!!d,o,!0);return;case"textarea":Ze("invalid",n),b=p=d=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":d=k;break;case"defaultValue":p=k;break;case"children":b=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:bt(n,r,S,k,o,null)}no(n,d,p,b);return;case"option":for(z in o)o.hasOwnProperty(z)&&(d=o[z],d!=null)&&(z==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":bt(n,r,z,d,o,null));return;case"dialog":Ze("beforetoggle",n),Ze("toggle",n),Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":Ze("load",n);break;case"video":case"audio":for(d=0;d<Wl.length;d++)Ze(Wl[d],n);break;case"image":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"embed":case"source":case"link":Ze("error",n),Ze("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(Q in o)if(o.hasOwnProperty(Q)&&(d=o[Q],d!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:bt(n,r,Q,d,o,null)}return;default:if(cr(r)){for(re in o)o.hasOwnProperty(re)&&(d=o[re],d!==void 0&&Em(n,r,re,d,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(d=o[k],d!=null&&bt(n,r,k,d,o,null))}function G5(n,r,o,d){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,b=null,S=null,k=null,z=null,Q=null,re=null;for(ne in o){var le=o[ne];if(o.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=le;default:d.hasOwnProperty(ne)||bt(n,r,ne,null,d,le)}}for(var ee in d){var ne=d[ee];if(le=o[ee],d.hasOwnProperty(ee)&&(ne!=null||le!=null))switch(ee){case"type":b=ne;break;case"name":p=ne;break;case"checked":Q=ne;break;case"defaultChecked":re=ne;break;case"value":S=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,r));break;default:ne!==le&&bt(n,r,ee,ne,d,le)}}fl(n,S,k,z,Q,re,b,p);return;case"select":ne=S=k=ee=null;for(b in o)if(z=o[b],o.hasOwnProperty(b)&&z!=null)switch(b){case"value":break;case"multiple":ne=z;default:d.hasOwnProperty(b)||bt(n,r,b,null,d,z)}for(p in d)if(b=d[p],z=o[p],d.hasOwnProperty(p)&&(b!=null||z!=null))switch(p){case"value":ee=b;break;case"defaultValue":k=b;break;case"multiple":S=b;default:b!==z&&bt(n,r,p,b,d,z)}r=k,o=S,d=ne,ee!=null?Si(n,!!o,ee,!1):!!d!=!!o&&(r!=null?Si(n,!!o,r,!0):Si(n,!!o,o?[]:"",!1));return;case"textarea":ne=ee=null;for(k in o)if(p=o[k],o.hasOwnProperty(k)&&p!=null&&!d.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:bt(n,r,k,null,d,p)}for(S in d)if(p=d[S],b=o[S],d.hasOwnProperty(S)&&(p!=null||b!=null))switch(S){case"value":ee=p;break;case"defaultValue":ne=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==b&&bt(n,r,S,p,d,b)}cu(n,ee,ne);return;case"option":for(var Ce in o)ee=o[Ce],o.hasOwnProperty(Ce)&&ee!=null&&!d.hasOwnProperty(Ce)&&(Ce==="selected"?n.selected=!1:bt(n,r,Ce,null,d,ee));for(z in d)ee=d[z],ne=o[z],d.hasOwnProperty(z)&&ee!==ne&&(ee!=null||ne!=null)&&(z==="selected"?n.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":bt(n,r,z,ee,d,ne));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 je in o)ee=o[je],o.hasOwnProperty(je)&&ee!=null&&!d.hasOwnProperty(je)&&bt(n,r,je,null,d,ee);for(Q in d)if(ee=d[Q],ne=o[Q],d.hasOwnProperty(Q)&&ee!==ne&&(ee!=null||ne!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(s(137,r));break;default:bt(n,r,Q,ee,d,ne)}return;default:if(cr(r)){for(var vt in o)ee=o[vt],o.hasOwnProperty(vt)&&ee!==void 0&&!d.hasOwnProperty(vt)&&Em(n,r,vt,void 0,d,ee);for(re in d)ee=d[re],ne=o[re],!d.hasOwnProperty(re)||ee===ne||ee===void 0&&ne===void 0||Em(n,r,re,ee,d,ne);return}}for(var G in o)ee=o[G],o.hasOwnProperty(G)&&ee!=null&&!d.hasOwnProperty(G)&&bt(n,r,G,null,d,ee);for(le in d)ee=d[le],ne=o[le],!d.hasOwnProperty(le)||ee===ne||ee==null&&ne==null||bt(n,r,le,ee,d,ne)}function X1(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function W5(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var p=o[d],b=p.transferSize,S=p.initiatorType,k=p.duration;if(b&&k&&X1(S)){for(S=0,k=p.responseEnd,d+=1;d<o.length;d++){var z=o[d],Q=z.startTime;if(Q>k)break;var re=z.transferSize,le=z.initiatorType;re&&X1(le)&&(z=z.responseEnd,S+=re*(z<k?1:(k-Q)/(z-Q)))}if(--d,r+=8*(b+S)/(p.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 Cm=null,km=null;function ad(n){return n.nodeType===9?n:n.ownerDocument}function Z1(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 Q1(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 Nm(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 Tm=null;function Y5(){var n=window.event;return n&&n.type==="popstate"?n===Tm?!1:(Tm=n,!0):(Tm=null,!1)}var J1=typeof setTimeout=="function"?setTimeout:void 0,X5=typeof clearTimeout=="function"?clearTimeout:void 0,ex=typeof Promise=="function"?Promise:void 0,Z5=typeof queueMicrotask=="function"?queueMicrotask:typeof ex<"u"?function(n){return ex.resolve(null).then(n).catch(Q5)}:J1;function Q5(n){setTimeout(function(){throw n})}function Tr(n){return n==="head"}function tx(n,r){var o=r,d=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(d===0){n.removeChild(p),Oo(r);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")Xl(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Xl(o);for(var b=o.firstChild;b;){var S=b.nextSibling,k=b.nodeName;b[sa]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=S}}else o==="body"&&Xl(n.ownerDocument.body);o=p}while(o);Oo(r)}function ix(n,r){var o=n;n=0;do{var d=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=d}while(o)}function Am(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Am(o),dl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function J5(n,r,o,d){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[sa])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(b=n.getAttribute("rel"),b==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(b!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(b=n.getAttribute("src"),(b!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&b&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var b=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===b)return n}else return n;if(n=Mn(n.nextSibling),n===null)break}return null}function eT(n,r,o){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Mn(n.nextSibling),n===null))return null;return n}function nx(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Mn(n.nextSibling),n===null))return null;return n}function Mm(n){return n.data==="$?"||n.data==="$~"}function Rm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function tT(n,r){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||o.readyState!=="loading")r();else{var d=function(){r(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Mn(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 Dm=null;function sx(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(r===0)return Mn(n.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}n=n.nextSibling}return null}function rx(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return n;r--}else o!=="/$"&&o!=="/&"||r++}n=n.previousSibling}return null}function ax(n,r,o){switch(r=ad(o),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 Xl(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);dl(n)}var Rn=new Map,ox=new Set;function od(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Vs=Y.d;Y.d={f:iT,r:nT,D:sT,C:rT,L:aT,m:oT,X:cT,S:lT,M:uT};function iT(){var n=Vs.f(),r=Qu();return n||r}function nT(n){var r=ks(n);r!==null&&r.tag===5&&r.type==="form"?Ev(r):Vs.r(n)}var Mo=typeof document>"u"?null:document;function lx(n,r,o){var d=Mo;if(d&&typeof r=="string"&&r){var p=Zi(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),ox.has(p)||(ox.add(p),n={rel:n,crossOrigin:o,href:r},d.querySelector(p)===null&&(r=d.createElement("link"),ki(r,"link",n),Yt(r),d.head.appendChild(r)))}}function sT(n){Vs.D(n),lx("dns-prefetch",n,null)}function rT(n,r){Vs.C(n,r),lx("preconnect",n,r)}function aT(n,r,o){Vs.L(n,r,o);var d=Mo;if(d&&n&&r){var p='link[rel="preload"][as="'+Zi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Zi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Zi(o.imageSizes)+'"]')):p+='[href="'+Zi(n)+'"]';var b=p;switch(r){case"style":b=Ro(n);break;case"script":b=Do(n)}Rn.has(b)||(n=_({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:n,as:r},o),Rn.set(b,n),d.querySelector(p)!==null||r==="style"&&d.querySelector(Zl(b))||r==="script"&&d.querySelector(Ql(b))||(r=d.createElement("link"),ki(r,"link",n),Yt(r),d.head.appendChild(r)))}}function oT(n,r){Vs.m(n,r);var o=Mo;if(o&&n){var d=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Zi(d)+'"][href="'+Zi(n)+'"]',b=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Do(n)}if(!Rn.has(b)&&(n=_({rel:"modulepreload",href:n},r),Rn.set(b,n),o.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ql(b)))return}d=o.createElement("link"),ki(d,"link",n),Yt(d),o.head.appendChild(d)}}}function lT(n,r,o){Vs.S(n,r,o);var d=Mo;if(d&&n){var p=lr(d).hoistableStyles,b=Ro(n);r=r||"default";var S=p.get(b);if(!S){var k={loading:0,preload:null};if(S=d.querySelector(Zl(b)))k.loading=5;else{n=_({rel:"stylesheet",href:n,"data-precedence":r},o),(o=Rn.get(b))&&Om(n,o);var z=S=d.createElement("link");Yt(z),ki(z,"link",n),z._p=new Promise(function(Q,re){z.onload=Q,z.onerror=re}),z.addEventListener("load",function(){k.loading|=1}),z.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ld(S,r,d)}S={type:"stylesheet",instance:S,count:1,state:k},p.set(b,S)}}}function cT(n,r){Vs.X(n,r);var o=Mo;if(o&&n){var d=lr(o).hoistableScripts,p=Do(n),b=d.get(p);b||(b=o.querySelector(Ql(p)),b||(n=_({src:n,async:!0},r),(r=Rn.get(p))&&jm(n,r),b=o.createElement("script"),Yt(b),ki(b,"link",n),o.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(p,b))}}function uT(n,r){Vs.M(n,r);var o=Mo;if(o&&n){var d=lr(o).hoistableScripts,p=Do(n),b=d.get(p);b||(b=o.querySelector(Ql(p)),b||(n=_({src:n,async:!0,type:"module"},r),(r=Rn.get(p))&&jm(n,r),b=o.createElement("script"),Yt(b),ki(b,"link",n),o.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(p,b))}}function cx(n,r,o,d){var p=(p=fe.current)?od(p):null;if(!p)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Ro(o.href),o=lr(p).hoistableStyles,d=o.get(r),d||(d={type:"style",instance:null,count:0,state:null},o.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=Ro(o.href);var b=lr(p).hoistableStyles,S=b.get(n);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(n,S),(b=p.querySelector(Zl(n)))&&!b._p&&(S.instance=b,S.state.loading=5),Rn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Rn.set(n,o),b||dT(p,n,o,S.state))),r&&d===null)throw Error(s(528,""));return S}if(r&&d!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Do(o),o=lr(p).hoistableScripts,d=o.get(r),d||(d={type:"script",instance:null,count:0,state:null},o.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Ro(n){return'href="'+Zi(n)+'"'}function Zl(n){return'link[rel="stylesheet"]['+n+"]"}function ux(n){return _({},n,{"data-precedence":n.precedence,precedence:null})}function dT(n,r,o,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}),ki(r,"link",o),Yt(r),n.head.appendChild(r))}function Do(n){return'[src="'+Zi(n)+'"]'}function Ql(n){return"script[async]"+n}function dx(n,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var d=n.querySelector('style[data-href~="'+Zi(o.href)+'"]');if(d)return r.instance=d,Yt(d),d;var p=_({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Yt(d),ki(d,"style",p),ld(d,o.precedence,n),r.instance=d;case"stylesheet":p=Ro(o.href);var b=n.querySelector(Zl(p));if(b)return r.state.loading|=4,r.instance=b,Yt(b),b;d=ux(o),(p=Rn.get(p))&&Om(d,p),b=(n.ownerDocument||n).createElement("link"),Yt(b);var S=b;return S._p=new Promise(function(k,z){S.onload=k,S.onerror=z}),ki(b,"link",d),r.state.loading|=4,ld(b,o.precedence,n),r.instance=b;case"script":return b=Do(o.src),(p=n.querySelector(Ql(b)))?(r.instance=p,Yt(p),p):(d=o,(p=Rn.get(b))&&(d=_({},o),jm(d,p)),n=n.ownerDocument||n,p=n.createElement("script"),Yt(p),ki(p,"link",d),n.head.appendChild(p),r.instance=p);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,ld(d,o.precedence,n));return r.instance}function ld(n,r,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,b=p,S=0;S<d.length;S++){var k=d[S];if(k.dataset.precedence===r)b=k;else if(b!==p)break}b?b.parentNode.insertBefore(n,b.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(n,r.firstChild))}function Om(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function jm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var cd=null;function hx(n,r,o){if(cd===null){var d=new Map,p=cd=new Map;p.set(o,d)}else p=cd,d=p.get(o),d||(d=new Map,p.set(o,d));if(d.has(n))return d;for(d.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var b=o[p];if(!(b[sa]||b[Vt]||n==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var S=b.getAttribute(r)||"";S=n+S;var k=d.get(S);k?k.push(b):d.set(S,[b])}}return d}function fx(n,r,o){n=n.ownerDocument||n,n.head.insertBefore(o,r==="title"?n.querySelector("head > title"):null)}function hT(n,r,o){if(o===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 mx(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function fT(n,r,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Ro(d.href),b=r.querySelector(Zl(p));if(b){r=b._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=ud.bind(n),r.then(n,n)),o.state.loading|=4,o.instance=b,Yt(b);return}b=r.ownerDocument||r,d=ux(d),(p=Rn.get(p))&&Om(d,p),b=b.createElement("link"),Yt(b);var S=b;S._p=new Promise(function(k,z){S.onload=k,S.onerror=z}),ki(b,"link",d),o.instance=b}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=ud.bind(n),r.addEventListener("load",o),r.addEventListener("error",o))}}var Lm=0;function mT(n,r){return n.stylesheets&&n.count===0&&hd(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var d=setTimeout(function(){if(n.stylesheets&&hd(n,n.stylesheets),n.unsuspend){var b=n.unsuspend;n.unsuspend=null,b()}},6e4+r);0<n.imgBytes&&Lm===0&&(Lm=62500*W5());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&hd(n,n.stylesheets),n.unsuspend)){var b=n.unsuspend;n.unsuspend=null,b()}},(n.imgBytes>Lm?50:800)+r);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ud(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var dd=null;function hd(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,dd=new Map,r.forEach(pT,n),dd=null,ud.call(n))}function pT(n,r){if(!(r.state.loading&4)){var o=dd.get(n);if(o)var d=o.get(null);else{o=new Map,dd.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<p.length;b++){var S=p[b];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),d=S)}d&&o.set(null,d)}p=r.instance,S=p.getAttribute("data-precedence"),b=o.get(S)||d,b===d&&o.set(null,p),o.set(S,p),this.count++,d=ud.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),b?b.parentNode.insertBefore(p,b.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Jl={$$typeof:A,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function gT(n,r,o,d,p,b,S,k,z){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=Ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ct(0),this.hiddenUpdates=Ct(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=b,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function px(n,r,o,d,p,b,S,k,z,Q,re,le){return n=new gT(n,r,o,S,z,Q,re,le,k),r=1,b===!0&&(r|=24),b=hn(3,null,null,r),n.current=b,b.stateNode=n,r=mf(),r.refCount++,n.pooledCache=r,r.refCount++,b.memoizedState={element:d,isDehydrated:o,cache:r},bf(b),n}function gx(n){return n?(n=lo,n):lo}function _x(n,r,o,d,p,b){p=gx(p),d.context===null?d.context=p:d.pendingContext=p,d=_r(r),d.payload={element:o},b=b===void 0?null:b,b!==null&&(d.callback=b),o=br(n,d,r),o!==null&&(sn(o,n,r),Rl(o,n,r))}function bx(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<r?o:r}}function Bm(n,r){bx(n,r),(n=n.alternate)&&bx(n,r)}function vx(n){if(n.tag===13||n.tag===31){var r=ua(n,67108864);r!==null&&sn(r,n,67108864),Bm(n,67108864)}}function xx(n){if(n.tag===13||n.tag===31){var r=_n();r=Mt(r);var o=ua(n,r);o!==null&&sn(o,n,r),Bm(n,r)}}var fd=!0;function _T(n,r,o,d){var p=O.T;O.T=null;var b=Y.p;try{Y.p=2,zm(n,r,o,d)}finally{Y.p=b,O.T=p}}function bT(n,r,o,d){var p=O.T;O.T=null;var b=Y.p;try{Y.p=8,zm(n,r,o,d)}finally{Y.p=b,O.T=p}}function zm(n,r,o,d){if(fd){var p=Im(d);if(p===null)wm(n,r,d,md,o),Sx(n,d);else if(xT(p,n,r,o,d))d.stopPropagation();else if(Sx(n,d),r&4&&-1<vT.indexOf(n)){for(;p!==null;){var b=ks(p);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var S=Ri(b.pendingLanes);if(S!==0){var k=b;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var z=1<<31-yi(S);k.entanglements[1]|=z,S&=~z}rs(b),(ut&6)===0&&(Xu=Ot()+500,Gl(0))}}break;case 31:case 13:k=ua(b,2),k!==null&&sn(k,b,2),Qu(),Bm(b,2)}if(b=Im(d),b===null&&wm(n,r,d,md,o),b===p)break;p=b}p!==null&&d.stopPropagation()}else wm(n,r,d,null,o)}}function Im(n){return n=He(n),Pm(n)}var md=null;function Pm(n){if(md=null,n=Ui(n),n!==null){var r=l(n);if(r===null)n=null;else{var o=r.tag;if(o===13){if(n=c(r),n!==null)return n;n=null}else if(o===31){if(n=h(r),n!==null)return n;n=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return md=n,null}function yx(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(ys()){case xi:return 2;case Ss:return 8;case ws:case Wa:return 32;case rr:return 268435456;default:return 32}default:return 32}}var Um=!1,Ar=null,Mr=null,Rr=null,ec=new Map,tc=new Map,Dr=[],vT="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 Sx(n,r){switch(n){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Rr=null;break;case"pointerover":case"pointerout":ec.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":tc.delete(r.pointerId)}}function ic(n,r,o,d,p,b){return n===null||n.nativeEvent!==b?(n={blockedOn:r,domEventName:o,eventSystemFlags:d,nativeEvent:b,targetContainers:[p]},r!==null&&(r=ks(r),r!==null&&vx(r)),n):(n.eventSystemFlags|=d,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function xT(n,r,o,d,p){switch(r){case"focusin":return Ar=ic(Ar,n,r,o,d,p),!0;case"dragenter":return Mr=ic(Mr,n,r,o,d,p),!0;case"mouseover":return Rr=ic(Rr,n,r,o,d,p),!0;case"pointerover":var b=p.pointerId;return ec.set(b,ic(ec.get(b)||null,n,r,o,d,p)),!0;case"gotpointercapture":return b=p.pointerId,tc.set(b,ic(tc.get(b)||null,n,r,o,d,p)),!0}return!1}function wx(n){var r=Ui(n.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=c(o),r!==null){n.blockedOn=r,Qa(n.priority,function(){xx(o)});return}}else if(r===31){if(r=h(o),r!==null){n.blockedOn=r,Qa(n.priority,function(){xx(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function pd(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var o=Im(n.nativeEvent);if(o===null){o=n.nativeEvent;var d=new o.constructor(o.type,o);Te=d,o.target.dispatchEvent(d),Te=null}else return r=ks(o),r!==null&&vx(r),n.blockedOn=o,!1;r.shift()}return!0}function Ex(n,r,o){pd(n)&&o.delete(r)}function yT(){Um=!1,Ar!==null&&pd(Ar)&&(Ar=null),Mr!==null&&pd(Mr)&&(Mr=null),Rr!==null&&pd(Rr)&&(Rr=null),ec.forEach(Ex),tc.forEach(Ex)}function gd(n,r){n.blockedOn===r&&(n.blockedOn=null,Um||(Um=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yT)))}var _d=null;function Cx(n){_d!==n&&(_d=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_d===n&&(_d=null);for(var r=0;r<n.length;r+=3){var o=n[r],d=n[r+1],p=n[r+2];if(typeof d!="function"){if(Pm(d||o)===null)continue;break}var b=ks(o);b!==null&&(n.splice(r,3),r-=3,If(b,{pending:!0,data:p,method:o.method,action:d},d,p))}}))}function Oo(n){function r(z){return gd(z,n)}Ar!==null&&gd(Ar,n),Mr!==null&&gd(Mr,n),Rr!==null&&gd(Rr,n),ec.forEach(r),tc.forEach(r);for(var o=0;o<Dr.length;o++){var d=Dr[o];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Dr.length&&(o=Dr[0],o.blockedOn===null);)wx(o),o.blockedOn===null&&Dr.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var p=o[d],b=o[d+1],S=p[Di]||null;if(typeof b=="function")S||Cx(o);else if(S){var k=null;if(b&&b.hasAttribute("formAction")){if(p=b,S=b[Di]||null)k=S.formAction;else if(Pm(p)!==null)continue}else k=S.action;typeof k=="function"?o[d+1]=k:(o.splice(d,3),d-=3),Cx(o)}}}function kx(){function n(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),d||setTimeout(o,20)}function o(){if(!d&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Hm(n){this._internalRoot=n}bd.prototype.render=Hm.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,d=_n();_x(o,d,n,r,null,null)},bd.prototype.unmount=Hm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;_x(n.current,2,null,n,null,null),Qu(),r[ar]=null}};function bd(n){this._internalRoot=n}bd.prototype.unstable_scheduleHydration=function(n){if(n){var r=Za();n={blockedOn:null,target:n,priority:r};for(var o=0;o<Dr.length&&r!==0&&r<Dr[o].priority;o++);Dr.splice(o,0,n),o===0&&wx(n)}};var Nx=t.version;if(Nx!=="19.2.6")throw Error(s(527,Nx,"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?g(n):null,n=n===null?null:n.stateNode,n};var ST={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vd.isDisabled&&vd.supportsFiber)try{Es=vd.inject(ST),fi=vd}catch{}}return sc.createRoot=function(n,r){if(!a(n))throw Error(s(299));var o=!1,d="",p=jv,b=Lv,S=Bv;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=px(n,1,!1,null,null,o,d,null,p,b,S,kx),n[ar]=r.current,Sm(n),new Hm(r)},sc.hydrateRoot=function(n,r,o){if(!a(n))throw Error(s(299));var d=!1,p="",b=jv,S=Lv,k=Bv,z=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(z=o.formState)),r=px(n,1,!0,r,o??null,d,p,z,b,S,k,kx),r.context=gx(null),o=r.current,d=_n(),d=Mt(d),p=_r(d),p.callback=null,br(o,p,d),o=d,r.current.lanes=o,yt(r,o),rs(r),n[ar]=r.current,Sm(n),new bd(r)},sc.version="19.2.6",sc}var zx;function DT(){if(zx)return Vm.exports;zx=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(),Vm.exports=RT(),Vm.exports}var $2=DT();const V2=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();const OT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const jT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());const Ix=e=>{const t=jT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Wm={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 LT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},BT=E.createContext({}),zT=()=>E.useContext(BT),IT=E.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...h},m)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:_=!1,color:v="currentColor",className:x=""}=zT()??{},y=s??_?Number(i??g)*24/Number(t??f):i??g;return E.createElement("svg",{ref:m,...Wm,width:t??f??Wm.width,height:t??f??Wm.height,stroke:e??v,strokeWidth:y,className:V2("lucide",x,a),...!l&&!LT(h)&&{"aria-hidden":"true"},...h},[...c.map(([w,C])=>E.createElement(w,C)),...Array.isArray(l)?l:[l]])});const _e=(e,t)=>{const i=E.forwardRef(({className:s,...a},l)=>E.createElement(IT,{ref:l,iconNode:t,className:V2(`lucide-${OT(Ix(e))}`,`lucide-${e}`,s),...a}));return i.displayName=Ix(e),i};const PT=[["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"}]],ja=_e("activity",PT);const UT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],HT=_e("arrow-down",UT);const FT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],$T=_e("arrow-up",FT);const VT=[["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"}]],Zd=_e("bot",VT);const qT=[["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",qT);const KT=[["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"}]],GT=_e("braces",KT);const WT=[["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"}]],K2=_e("brain",WT);const YT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jo=_e("check",YT);const XT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],es=_e("chevron-down",XT);const ZT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],QT=_e("chevron-left",ZT);const JT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xr=_e("chevron-right",JT);const eA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],H0=_e("chevron-up",eA);const tA=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],iA=_e("clipboard-copy",tA);const nA=[["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"}]],G2=_e("code-xml",nA);const sA=[["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"}]],W2=_e("copy",sA);const rA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],aA=_e("corner-down-left",rA);const oA=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],lA=_e("corner-down-right",oA);const cA=[["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"}]],uA=_e("cpu",cA);const dA=[["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"}]],Kr=_e("database",dA);const hA=[["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"}]],fA=_e("download",hA);const mA=[["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"}]],pA=_e("earth",mA);const gA=[["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"}]],_A=_e("ellipsis",gA);const bA=[["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"}]],F0=_e("external-link",bA);const vA=[["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"}]],Y2=_e("eye-off",vA);const xA=[["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"}]],$0=_e("eye",xA);const yA=[["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"}]],SA=_e("file-code-corner",yA);const wA=[["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"}]],X2=_e("file-exclamation-point",wA);const EA=[["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"}]],CA=_e("file-spreadsheet",EA);const kA=[["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"}]],NA=_e("file-text",kA);const TA=[["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"}]],Z2=_e("file",TA);const AA=[["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"}]],MA=_e("flask-conical",AA);const RA=[["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"}]],DA=_e("folder-git-2",RA);const OA=[["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"}]],Ch=_e("folder-open",OA);const jA=[["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"}]],LA=_e("folder-plus",jA);const BA=[["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"}]],Fa=_e("folder",BA);const zA=[["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"}]],IA=_e("funnel",zA);const PA=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Q2=_e("gauge",PA);const UA=[["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"}]],Mc=_e("git-branch",UA);const HA=[["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"}]],FA=_e("git-pull-request-create",HA);const $A=[["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"}]],VA=_e("heart",$A);const qA=[["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"}]],KA=_e("image",qA);const GA=[["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"}]],vg=_e("inbox",GA);const WA=[["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"}]],YA=_e("key-round",WA);const XA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Gi=_e("loader-circle",XA);const ZA=[["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"}]],QA=_e("lock-keyhole",ZA);const JA=[["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"}]],J2=_e("maximize-2",JA);const e4=[["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"}]],t4=_e("memory-stick",e4);const i4=[["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"}]],eE=_e("minimize-2",i4);const n4=[["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"}]],s4=_e("moon",n4);const r4=[["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"}]],a4=_e("network",r4);const o4=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],l4=_e("package",o4);const c4=[["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"}]],u4=_e("palette",c4);const d4=[["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"}]],h4=_e("panel-left-close",d4);const f4=[["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"}]],m4=_e("panel-left-open",f4);const p4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],g4=_e("panel-left",p4);const _4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],b4=_e("panel-top",_4);const v4=[["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"}]],x4=_e("paperclip",v4);const y4=[["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"}]],Rc=_e("pencil",y4);const S4=[["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"}]],V0=_e("play",S4);const w4=[["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"}]],tE=_e("plug",w4);const E4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],In=_e("plus",E4);const C4=[["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"}]],k4=_e("radio",C4);const N4=[["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"}]],kh=_e("refresh-cw",N4);const T4=[["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"}]],iE=_e("rotate-ccw",T4);const A4=[["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"}]],q0=_e("save",A4);const M4=[["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"}]],nE=_e("scroll-text",M4);const R4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],D4=_e("search",R4);const O4=[["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"}]],j4=_e("server",O4);const L4=[["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"}]],B4=_e("settings-2",L4);const z4=[["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"}]],I4=_e("shield-alert",z4);const P4=[["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"}]],K0=_e("sparkles",P4);const U4=[["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"}]],H4=_e("square-terminal",U4);const F4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Nh=_e("square",F4);const $4=[["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"}]],V4=_e("sun",$4);const q4=[["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"}]],K4=_e("table-2",q4);const G4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],sE=_e("terminal",G4);const W4=[["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"}]],Kc=_e("trash-2",W4);const Y4=[["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"}]],X4=_e("triangle-alert",Y4);const Z4=[["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"}]],Q4=_e("wand-sparkles",Z4);const J4=[["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"}]],eM=_e("wrench",J4);const tM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hn=_e("x",tM);const iM=[["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"}]],nM=_e("zap",iM);class rE extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function We(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 rE(s?.error||"Port already in use",s.conflict):new Error(s?.error||i.statusText);return s}async function Ki(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 We(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function Gc(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 We(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function sM(){return(await We("/api/agent")).agent}async function rM(e){return(await We(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function aM(){return(await We("/api/agent/usage")).usage}async function oM(){return(await We("/api/agent/claude-settings")).settings}async function lM(e){return(await We("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function cM(){const e=await We("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function uM(e,t,i){await We("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:i})})}async function dM(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 l=a.body.getReader(),c=new TextDecoder;let h="";for(;;){const{done:m,value:f}=await l.read();if(m)break;h+=c.decode(f,{stream:!0});let g=h.indexOf(`
10
-
11
- `);for(;g!==-1;){const _=h.slice(0,g);h=h.slice(g+2);const v=_.split(`
12
- `).find(x=>x.startsWith("data:"));if(v){const x=v.slice(5).trim();if(x)try{i(JSON.parse(x))}catch{}}g=h.indexOf(`
13
-
14
- `)}}}async function hM(){return(await We("/api/databases")).connections}async function fM(){return(await We("/api/databases/detect")).detected}async function mM(e){await Gc("/api/databases",e)}async function pM(e){return Gc("/api/databases/test",e)}async function gM(e){await We(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function _M(e){return(await We(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function bM(e,t,i=100,s=0){return We(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}&offset=${s}`)}async function vM(e=100){return(await We(`/api/errors?limit=${e}`)).incidents}async function xM(e){return We(`/api/errors/${e}/prompt`)}async function yM(e,t=!1){return We(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function SM(e=200){return(await We(`/api/git/graph?limit=${e}`)).commits}async function wM(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 EM(e){return(await We(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function CM(){return(await We("/api/git/files")).files}async function kM(){return(await We("/api/git/file-sizes")).files}async function NM(e){const t=await We(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function TM(e,t){await We("/api/git/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,content:t})})}async function AM(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 MM(e){await We(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function RM(){return(await We("/api/log-sources")).sources}async function DM(e){return(await Gc("/api/log-sources",e)).sources}async function aE(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 We(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}async function OM(){return We("/api/dashboard")}async function jM(e){await We(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function LM(e,t,i){t.includes(i)||await Ki("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function BM(e,t,i){t.includes(i)&&await Ki("/api/bundles",{name:e,originalName:e,services:t.filter(s=>s!==i).join(",")})}async function oE(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),We(`/api/fs/directories?${i.toString()}`)}async function lE(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 We(`/api/services/${encodeURIComponent(e)}/logs?${i.toString()}`);return{logs:s.logs,queryable:!!s.queryable}}async function zM(e,t){const i=t?`?path=${encodeURIComponent(t)}`:"";return We(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function IM(e){const t=await We(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function Px(e,t){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function PM(e,t,i){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:i})})}async function UM(e,t,i){return We(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:i})})}async function HM(e){return(await We(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function FM(e){return Gc("/api/services/test",e)}async function $M(e,t){return Gc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function VM(){return(await We("/api/terminal/sessions")).sessions}async function Bd(e){return(await We("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function qM(e){await We(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function cE(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=cE(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Dc(){for(var e,t,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(t=cE(e))&&(s&&(s+=" "),s+=t);return s}const Ux=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hx=Dc,uE=(e,t)=>i=>{var s;if(t?.variants==null)return Hx(e,i?.class,i?.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(f=>{const g=i?.[f],_=l?.[f];if(g===null)return null;const v=Ux(g)||Ux(_);return a[f][v]}),h=i&&Object.entries(i).reduce((f,g)=>{let[_,v]=g;return v===void 0||(f[_]=v),f},{}),m=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((f,g)=>{let{class:_,className:v,...x}=g;return Object.entries(x).every(y=>{let[w,C]=y;return Array.isArray(C)?C.includes({...l,...h}[w]):{...l,...h}[w]===C})?[...f,_,v]:f},[]);return Hx(e,c,m,i?.class,i?.className)},KM=(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},GM=(e,t)=>({classGroupId:e,validator:t}),dE=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Qd="-",Fx=[],WM="arbitrary..",YM=e=>{const t=ZM(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return XM(c);const h=c.split(Qd),m=h[0]===""&&h.length>1?1:0;return hE(h,m,t)},getConflictingClassGroupIds:(c,h)=>{if(h){const m=s[c],f=i[c];return m?f?KM(f,m):m:f||Fx}return i[c]||Fx}}},hE=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],l=i.nextPart.get(a);if(l){const f=hE(e,t+1,l);if(f)return f}const c=i.validators;if(c===null)return;const h=t===0?e.join(Qd):e.slice(t).join(Qd),m=c.length;for(let f=0;f<m;f++){const g=c[f];if(g.validator(h))return g.classGroupId}},XM=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?WM+s:void 0})(),ZM=e=>{const{theme:t,classGroups:i}=e;return QM(i,t)},QM=(e,t)=>{const i=dE();for(const s in e){const a=e[s];G0(a,i,s,t)}return i},G0=(e,t,i,s)=>{const a=e.length;for(let l=0;l<a;l++){const c=e[l];JM(c,t,i,s)}},JM=(e,t,i,s)=>{if(typeof e=="string"){e6(e,t,i);return}if(typeof e=="function"){t6(e,t,i,s);return}i6(e,t,i,s)},e6=(e,t,i)=>{const s=e===""?t:fE(t,e);s.classGroupId=i},t6=(e,t,i,s)=>{if(n6(e)){G0(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(GM(i,e))},i6=(e,t,i,s)=>{const a=Object.entries(e),l=a.length;for(let c=0;c<l;c++){const[h,m]=a[c];G0(m,fE(t,h),i,s)}},fE=(e,t)=>{let i=e;const s=t.split(Qd),a=s.length;for(let l=0;l<a;l++){const c=s[l];let h=i.nextPart.get(c);h||(h=dE(),i.nextPart.set(c,h)),i=h}return i},n6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,s6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),s=Object.create(null);const a=(l,c)=>{i[l]=c,t++,t>e&&(t=0,s=i,i=Object.create(null))};return{get(l){let c=i[l];if(c!==void 0)return c;if((c=s[l])!==void 0)return a(l,c),c},set(l,c){l in i?i[l]=c:a(l,c)}}},xg="!",$x=":",r6=[],Vx=(e,t,i,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),a6=e=>{const{prefix:t,experimentalParseClassName:i}=e;let s=a=>{const l=[];let c=0,h=0,m=0,f;const g=a.length;for(let w=0;w<g;w++){const C=a[w];if(c===0&&h===0){if(C===$x){l.push(a.slice(m,w)),m=w+1;continue}if(C==="/"){f=w;continue}}C==="["?c++:C==="]"?c--:C==="("?h++:C===")"&&h--}const _=l.length===0?a:a.slice(m);let v=_,x=!1;_.endsWith(xg)?(v=_.slice(0,-1),x=!0):_.startsWith(xg)&&(v=_.slice(1),x=!0);const y=f&&f>m?f-m:void 0;return Vx(l,x,v,y)};if(t){const a=t+$x,l=s;s=c=>c.startsWith(a)?l(c.slice(a.length)):Vx(r6,!1,c,void 0,!0)}if(i){const a=s;s=l=>i({className:l,parseClassName:a})}return s},o6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{t.set(i,1e6+s)}),i=>{const s=[];let a=[];for(let l=0;l<i.length;l++){const c=i[l],h=c[0]==="[",m=t.has(c);h||m?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(c)):a.push(c)}return a.length>0&&(a.sort(),s.push(...a)),s}},l6=e=>({cache:s6(e.cacheSize),parseClassName:a6(e),sortModifiers:o6(e),postfixLookupClassGroupIds:c6(e),...YM(e)}),c6=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},u6=/\s+/,d6=(e,t)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:l,postfixLookupClassGroupIds:c}=t,h=[],m=e.trim().split(u6);let f="";for(let g=m.length-1;g>=0;g-=1){const _=m[g],{isExternal:v,modifiers:x,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:C}=i(_);if(v){f=_+(f.length>0?" "+f:f);continue}let N=!!C,T;if(N){const B=w.substring(0,C);T=s(B);const R=T&&c[T]?s(w):void 0;R&&R!==T&&(T=R,N=!1)}else T=s(w);if(!T){if(!N){f=_+(f.length>0?" "+f:f);continue}if(T=s(w),!T){f=_+(f.length>0?" "+f:f);continue}N=!1}const A=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=y?A+xg:A,L=M+T;if(h.indexOf(L)>-1)continue;h.push(L);const K=a(T,N);for(let B=0;B<K.length;++B){const R=K[B];h.push(M+R)}f=_+(f.length>0?" "+f:f)}return f},h6=(...e)=>{let t=0,i,s,a="";for(;t<e.length;)(i=e[t++])&&(s=mE(i))&&(a&&(a+=" "),a+=s);return a},mE=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=mE(e[s]))&&(i&&(i+=" "),i+=t);return i},f6=(e,...t)=>{let i,s,a,l;const c=m=>{const f=t.reduce((g,_)=>_(g),e());return i=l6(f),s=i.cache.get,a=i.cache.set,l=h,h(m)},h=m=>{const f=s(m);if(f)return f;const g=d6(m,i);return a(m,g),g};return l=c,(...m)=>l(h6(...m))},m6=[],oi=e=>{const t=i=>i[e]||m6;return t.isThemeGetter=!0,t},pE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,p6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,g6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_6=/\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$/,b6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,v6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jr=e=>p6.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),as=e=>!!e&&Number.isInteger(Number(e)),Ym=e=>e.endsWith("%")&&qe(e.slice(0,-1)),qs=e=>g6.test(e),_E=()=>!0,y6=e=>_6.test(e)&&!b6.test(e),W0=()=>!1,S6=e=>v6.test(e),w6=e=>x6.test(e),E6=e=>!we(e)&&!Ee(e),C6=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)),k6=e=>Zr(e,xE,W0),we=e=>pE.test(e),wa=e=>Zr(e,yE,y6),qx=e=>Zr(e,j6,qe),N6=e=>Zr(e,wE,_E),T6=e=>Zr(e,SE,W0),Kx=e=>Zr(e,bE,W0),A6=e=>Zr(e,vE,w6),xd=e=>Zr(e,EE,S6),Ee=e=>gE.test(e),rc=e=>$a(e,yE),M6=e=>$a(e,SE),Gx=e=>$a(e,bE),R6=e=>$a(e,xE),D6=e=>$a(e,vE),yd=e=>$a(e,EE,!0),O6=e=>$a(e,wE,!0),Zr=(e,t,i)=>{const s=pE.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},$a=(e,t,i=!1)=>{const s=gE.exec(e);return s?s[1]?t(s[1]):i:!1},bE=e=>e==="position"||e==="percentage",vE=e=>e==="image"||e==="url",xE=e=>e==="length"||e==="size"||e==="bg-size",yE=e=>e==="length",j6=e=>e==="number",SE=e=>e==="family-name",wE=e=>e==="number"||e==="weight",EE=e=>e==="shadow",L6=()=>{const e=oi("color"),t=oi("font"),i=oi("text"),s=oi("font-weight"),a=oi("tracking"),l=oi("leading"),c=oi("breakpoint"),h=oi("container"),m=oi("spacing"),f=oi("radius"),g=oi("shadow"),_=oi("inset-shadow"),v=oi("text-shadow"),x=oi("drop-shadow"),y=oi("blur"),w=oi("perspective"),C=oi("aspect"),N=oi("ease"),T=oi("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...M(),Ee,we],K=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],R=()=>[Ee,we,m],H=()=>[jr,"full","auto",...R()],P=()=>[as,"none","subgrid",Ee,we],q=()=>["auto",{span:["full",as,Ee,we]},as,Ee,we],J=()=>[as,"auto",Ee,we],F=()=>["auto","min","max","fr",Ee,we],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...R()],Y=()=>[jr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],X=()=>[jr,"screen","full","dvw","lvw","svw","min","max","fit",...R()],j=()=>[jr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],W=()=>[e,Ee,we],D=()=>[...M(),Gx,Kx,{position:[Ee,we]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",R6,k6,{size:[Ee,we]}],$=()=>[Ym,rc,wa],se=()=>["","none","full",f,Ee,we],fe=()=>["",qe,rc,wa],ve=()=>["solid","dashed","dotted","double"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[qe,Ym,Gx,Kx],st=()=>["","none",y,Ee,we],lt=()=>["none",qe,Ee,we],ct=()=>["none",qe,Ee,we],ze=()=>[qe,Ee,we],Ft=()=>[jr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[_E],container:[qs],"drop-shadow":[qs],ease:["in","out","in-out"],font:[E6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qs],shadow:[qs],spacing:["px",qe],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jr,we,Ee,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Ee,we]}],"container-named":[C6],columns:[{columns:[qe,we,Ee,h]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:L()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[as,"auto",Ee,we]}],basis:[{basis:[jr,"full","auto",h,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,jr,"auto","initial","none",we]}],grow:[{grow:["",qe,Ee,we]}],shrink:[{shrink:["",qe,Ee,we]}],order:[{order:[as,"first","last","none",Ee,we]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"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",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],w:[{w:[h,"screen",...Y()]}],"min-w":[{"min-w":[h,"screen","none",...Y()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[c]},...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,rc,wa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,O6,N6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ym,we]}],"font-family":[{font:[M6,T6,t]}],"font-features":[{"font-features":[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ee,we]}],"line-clamp":[{"line-clamp":[qe,"none",Ee,qx]}],leading:[{leading:[l,...R()]}],"list-image":[{"list-image":["none",Ee,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ee,wa]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[qe,"auto",Ee,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[as,Ee,we]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},as,Ee,we],radial:["",Ee,we],conic:[as,Ee,we]},D6,A6]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ee,we]}],"outline-w":[{outline:["",qe,rc,wa]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",g,yd,xd]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",_,yd,xd]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[qe,wa]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",v,yd,xd]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[qe,Ee,we]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Oe()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ee,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,we]}],filter:[{filter:["","none",Ee,we]}],blur:[{blur:st()}],brightness:[{brightness:[qe,Ee,we]}],contrast:[{contrast:[qe,Ee,we]}],"drop-shadow":[{"drop-shadow":["","none",x,yd,xd]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",qe,Ee,we]}],"hue-rotate":[{"hue-rotate":[qe,Ee,we]}],invert:[{invert:["",qe,Ee,we]}],saturate:[{saturate:[qe,Ee,we]}],sepia:[{sepia:["",qe,Ee,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,we]}],"backdrop-blur":[{"backdrop-blur":st()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ee,we]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ee,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ee,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ee,we]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ee,we]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ee,we]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ee,we]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ee,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ee,we]}],ease:[{ease:["linear","initial",N,Ee,we]}],delay:[{delay:[qe,Ee,we]}],animate:[{animate:["none",T,Ee,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ee,we]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:lt()}],"rotate-x":[{"rotate-x":lt()}],"rotate-y":[{"rotate-y":lt()}],"rotate-z":[{"rotate-z":lt()}],scale:[{scale:ct()}],"scale-x":[{"scale-x":ct()}],"scale-y":[{"scale-y":ct()}],"scale-z":[{"scale-z":ct()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[Ee,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],zoom:[{zoom:[as,Ee,we]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,we]}],"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":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,we]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[qe,rc,wa,qx]}],stroke:[{stroke:["none",...W()]}],"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"]}},B6=f6(L6);function de(...e){return B6(Dc(e))}const CE=uE("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 he({className:e,variant:t,size:i,...s}){return u.jsx("button",{className:de(CE({variant:t,size:i,className:e})),...s})}const kE=E.createContext({});function z6(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const I6=typeof window<"u",P6=I6?E.useLayoutEffect:E.useEffect,Y0=E.createContext(null);function X0(e,t){e.indexOf(t)===-1&&e.push(t)}function Jd(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const _s=(e,t,i)=>i>t?t:i<e?e:i;let Z0=()=>{};const Gr={},NE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function TE(e){return typeof e=="object"&&e!==null}const AE=e=>/^0[^.\s]+$/u.test(e);function ME(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pn=e=>e,U6=(e,t)=>i=>t(e(i)),Wc=(...e)=>e.reduce(U6),Oc=(e,t,i)=>{const s=t-e;return s===0?1:(i-e)/s};class Q0{constructor(){this.subscriptions=[]}add(t){return X0(this.subscriptions,t),()=>Jd(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 l=0;l<a;l++){const c=this.subscriptions[l];c&&c(t,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const yn=e=>e*1e3,zn=e=>e/1e3;function RE(e,t){return t?e*(1e3/t):0}const DE=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,H6=1e-7,F6=12;function $6(e,t,i,s,a){let l,c,h=0;do c=t+(i-t)/2,l=DE(c,s,a)-e,l>0?i=c:t=c;while(Math.abs(l)>H6&&++h<F6);return c}function Yc(e,t,i,s){if(e===t&&i===s)return Pn;const a=l=>$6(l,0,1,e,i);return l=>l===0||l===1?l:DE(a(l),t,s)}const OE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jE=e=>t=>1-e(1-t),LE=Yc(.33,1.53,.69,.99),J0=jE(LE),BE=OE(J0),zE=e=>e>=1?1:(e*=2)<1?.5*J0(e):.5*(2-Math.pow(2,-10*(e-1))),e_=e=>1-Math.sin(Math.acos(e)),IE=jE(e_),PE=OE(e_),V6=Yc(.42,0,1,1),q6=Yc(0,0,.58,1),UE=Yc(.42,0,.58,1),K6=e=>Array.isArray(e)&&typeof e[0]!="number",HE=e=>Array.isArray(e)&&typeof e[0]=="number",G6={linear:Pn,easeIn:V6,easeInOut:UE,easeOut:q6,circIn:e_,circInOut:PE,circOut:IE,backIn:J0,backInOut:BE,backOut:LE,anticipate:zE},W6=e=>typeof e=="string",Wx=e=>{if(HE(e)){Z0(e.length===4);const[t,i,s,a]=e;return Yc(t,i,s,a)}else if(W6(e))return G6[e];return e},Sd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Y6(e,t){let i=new Set,s=new Set,a=!1,l=!1;const c=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(g){c.has(g)&&(f.schedule(g),e()),g(h)}const f={schedule:(g,_=!1,v=!1)=>{const y=v&&a?i:s;return _&&c.add(g),y.add(g),g},cancel:g=>{s.delete(g),c.delete(g)},process:g=>{if(h=g,a){l=!0;return}a=!0;const _=i;i=s,s=_,i.forEach(m),i.clear(),a=!1,l&&(l=!1,f.process(g))}};return f}const X6=40;function FE(e,t){let i=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>i=!0,c=Sd.reduce((A,M)=>(A[M]=Y6(l),A),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:g,update:_,preRender:v,render:x,postRender:y}=c,w=()=>{const A=Gr.useManualTiming,M=A?a.timestamp:performance.now();i=!1,A||(a.delta=s?1e3/60:Math.max(Math.min(M-a.timestamp,X6),1)),a.timestamp=M,a.isProcessing=!0,h.process(a),m.process(a),f.process(a),g.process(a),_.process(a),v.process(a),x.process(a),y.process(a),a.isProcessing=!1,i&&t&&(s=!1,e(w))},C=()=>{i=!0,s=!0,a.isProcessing||e(w)};return{schedule:Sd.reduce((A,M)=>{const L=c[M];return A[M]=(K,B=!1,R=!1)=>(i||C(),L.schedule(K,B,R)),A},{}),cancel:A=>{for(let M=0;M<Sd.length;M++)c[Sd[M]].cancel(A)},state:a,steps:c}}const{schedule:wt,cancel:Wr,state:Ni,steps:Xm}=FE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pn,!0);let zd;function Z6(){zd=void 0}const Vi={now:()=>(zd===void 0&&Vi.set(Ni.isProcessing||Gr.useManualTiming?Ni.timestamp:performance.now()),zd),set:e=>{zd=e,queueMicrotask(Z6)}},$E=e=>t=>typeof t=="string"&&t.startsWith(e),VE=$E("--"),Q6=$E("var(--"),t_=e=>Q6(e)?J6.test(e.split("/*")[0].trim()):!1,J6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const el={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jc={...el,transform:e=>_s(0,1,e)},wd={...el,default:1},Cc=e=>Math.round(e*1e5)/1e5,i_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eR(e){return e==null}const tR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,n_=(e,t)=>i=>!!(typeof i=="string"&&tR.test(i)&&i.startsWith(e)||t&&!eR(i)&&Object.prototype.hasOwnProperty.call(i,t)),qE=(e,t,i)=>s=>{if(typeof s!="string")return s;const[a,l,c,h]=s.match(i_);return{[e]:parseFloat(a),[t]:parseFloat(l),[i]:parseFloat(c),alpha:h!==void 0?parseFloat(h):1}},iR=e=>_s(0,255,e),Zm={...el,transform:e=>Math.round(iR(e))},Ra={test:n_("rgb","red"),parse:qE("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:s=1})=>"rgba("+Zm.transform(e)+", "+Zm.transform(t)+", "+Zm.transform(i)+", "+Cc(jc.transform(s))+")"};function nR(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 yg={test:n_("#"),parse:nR,transform:Ra.transform},Xc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pr=Xc("deg"),ms=Xc("%"),ke=Xc("px"),sR=Xc("vh"),rR=Xc("vw"),Xx={...ms,parse:e=>ms.parse(e)/100,transform:e=>ms.transform(e*100)},Fo={test:n_("hsl","hue"),parse:qE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(e)+", "+ms.transform(Cc(t))+", "+ms.transform(Cc(i))+", "+Cc(jc.transform(s))+")"},ii={test:e=>Ra.test(e)||yg.test(e)||Fo.test(e),parse:e=>Ra.test(e)?Ra.parse(e):Fo.test(e)?Fo.parse(e):yg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ra.transform(e):Fo.transform(e),getAnimatableNone:e=>{const t=ii.parse(e);return t.alpha=0,ii.transform(t)}},aR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oR(e){return isNaN(e)&&typeof e=="string"&&(e.match(i_)?.length||0)+(e.match(aR)?.length||0)>0}const KE="number",GE="color",lR="var",cR="var(",Zx="${}",uR=/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 Yo(e){const t=e.toString(),i=[],s={color:[],number:[],var:[]},a=[];let l=0;const h=t.replace(uR,m=>(ii.test(m)?(s.color.push(l),a.push(GE),i.push(ii.parse(m))):m.startsWith(cR)?(s.var.push(l),a.push(lR),i.push(m)):(s.number.push(l),a.push(KE),i.push(parseFloat(m))),++l,Zx)).split(Zx);return{values:i,split:h,indexes:s,types:a}}function dR(e){return Yo(e).values}function WE({split:e,types:t}){const i=e.length;return s=>{let a="";for(let l=0;l<i;l++)if(a+=e[l],s[l]!==void 0){const c=t[l];c===KE?a+=Cc(s[l]):c===GE?a+=ii.transform(s[l]):a+=s[l]}return a}}function hR(e){return WE(Yo(e))}const fR=e=>typeof e=="number"?0:ii.test(e)?ii.getAnimatableNone(e):e,mR=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:fR(e);function pR(e){const t=Yo(e);return WE(t)(t.values.map((s,a)=>mR(s,t.split[a])))}const Jn={test:oR,parse:dR,createTransformer:hR,getAnimatableNone:pR};function Qm(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 gR({hue:e,saturation:t,lightness:i,alpha:s}){e/=360,t/=100,i/=100;let a=0,l=0,c=0;if(!t)a=l=c=i;else{const h=i<.5?i*(1+t):i+t-i*t,m=2*i-h;a=Qm(m,h,e+1/3),l=Qm(m,h,e),c=Qm(m,h,e-1/3)}return{red:Math.round(a*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:s}}function eh(e,t){return i=>i>0?t:e}const At=(e,t,i)=>e+(t-e)*i,Jm=(e,t,i)=>{const s=e*e,a=i*(t*t-s)+s;return a<0?0:Math.sqrt(a)},_R=[yg,Ra,Fo],bR=e=>_R.find(t=>t.test(e));function Qx(e){const t=bR(e);if(!t)return!1;let i=t.parse(e);return t===Fo&&(i=gR(i)),i}const Jx=(e,t)=>{const i=Qx(e),s=Qx(t);if(!i||!s)return eh(e,t);const a={...i};return l=>(a.red=Jm(i.red,s.red,l),a.green=Jm(i.green,s.green,l),a.blue=Jm(i.blue,s.blue,l),a.alpha=At(i.alpha,s.alpha,l),Ra.transform(a))},Sg=new Set(["none","hidden"]);function vR(e,t){return Sg.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function xR(e,t){return i=>At(e,t,i)}function s_(e){return typeof e=="number"?xR:typeof e=="string"?t_(e)?eh:ii.test(e)?Jx:wR:Array.isArray(e)?YE:typeof e=="object"?ii.test(e)?Jx:yR:eh}function YE(e,t){const i=[...e],s=i.length,a=e.map((l,c)=>s_(l)(l,t[c]));return l=>{for(let c=0;c<s;c++)i[c]=a[c](l);return i}}function yR(e,t){const i={...e,...t},s={};for(const a in i)e[a]!==void 0&&t[a]!==void 0&&(s[a]=s_(e[a])(e[a],t[a]));return a=>{for(const l in s)i[l]=s[l](a);return i}}function SR(e,t){const i=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const l=t.types[a],c=e.indexes[l][s[l]],h=e.values[c]??0;i[a]=h,s[l]++}return i}const wR=(e,t)=>{const i=Jn.createTransformer(t),s=Yo(e),a=Yo(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?Sg.has(e)&&!a.values.length||Sg.has(t)&&!s.values.length?vR(e,t):Wc(YE(SR(s,a),a.values),i):eh(e,t)};function XE(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?At(e,t,i):s_(e)(e,t)}const ER=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>wt.update(t,i),stop:()=>Wr(t),now:()=>Ni.isProcessing?Ni.timestamp:Vi.now()}},ZE=(e,t,i=10)=>{let s="";const a=Math.max(Math.round(t/i),2);for(let l=0;l<a;l++)s+=Math.round(e(l/(a-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},th=2e4;function r_(e){let t=0;const i=50;let s=e.next(t);for(;!s.done&&t<th;)t+=i,s=e.next(t);return t>=th?1/0:t}function CR(e,t=100,i){const s=i({...e,keyframes:[0,t]}),a=Math.min(r_(s),th);return{type:"keyframes",ease:l=>s.next(a*l).value/t,duration:zn(a)}}const Pt={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 wg(e,t){return e*Math.sqrt(1-t*t)}const kR=12;function NR(e,t,i){let s=i;for(let a=1;a<kR;a++)s=s-e(s)/t(s);return s}const ep=.001;function TR({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:i=Pt.velocity,mass:s=Pt.mass}){let a,l,c=1-t;c=_s(Pt.minDamping,Pt.maxDamping,c),e=_s(Pt.minDuration,Pt.maxDuration,zn(e)),c<1?(a=f=>{const g=f*c,_=g*e,v=g-i,x=wg(f,c),y=Math.exp(-_);return ep-v/x*y},l=f=>{const _=f*c*e,v=_*i+i,x=Math.pow(c,2)*Math.pow(f,2)*e,y=Math.exp(-_),w=wg(Math.pow(f,2),c);return(-a(f)+ep>0?-1:1)*((v-x)*y)/w}):(a=f=>{const g=Math.exp(-f*e),_=(f-i)*e+1;return-ep+g*_},l=f=>{const g=Math.exp(-f*e),_=(i-f)*(e*e);return g*_});const h=5/e,m=NR(a,l,h);if(e=yn(e),isNaN(m))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(m,2)*s;return{stiffness:f,damping:c*2*Math.sqrt(s*f),duration:e}}}const AR=["duration","bounce"],MR=["stiffness","damping","mass"];function ey(e,t){return t.some(i=>e[i]!==void 0)}function RR(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!ey(e,MR)&&ey(e,AR))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,s=2*Math.PI/(i*1.2),a=s*s,l=2*_s(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Pt.mass,stiffness:a,damping:l}}else{const i=TR({...e,velocity:0});t={...t,...i,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function ih(e=Pt.visualDuration,t=Pt.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:a}=i;const l=i.keyframes[0],c=i.keyframes[i.keyframes.length-1],h={done:!1,value:l},{stiffness:m,damping:f,mass:g,duration:_,velocity:v,isResolvedFromDuration:x}=RR({...i,velocity:-zn(i.velocity||0)}),y=v||0,w=f/(2*Math.sqrt(m*g)),C=c-l,N=zn(Math.sqrt(m/g)),T=Math.abs(C)<5;s||(s=T?Pt.restSpeed.granular:Pt.restSpeed.default),a||(a=T?Pt.restDelta.granular:Pt.restDelta.default);let A,M,L,K,B,R;if(w<1)L=wg(N,w),K=(y+w*N*C)/L,A=P=>{const q=Math.exp(-w*N*P);return c-q*(K*Math.sin(L*P)+C*Math.cos(L*P))},B=w*N*K+C*L,R=w*N*C-K*L,M=P=>Math.exp(-w*N*P)*(B*Math.sin(L*P)+R*Math.cos(L*P));else if(w===1){A=q=>c-Math.exp(-N*q)*(C+(y+N*C)*q);const P=y+N*C;M=q=>Math.exp(-N*q)*(N*P*q-y)}else{const P=N*Math.sqrt(w*w-1);A=ie=>{const V=Math.exp(-w*N*ie),O=Math.min(P*ie,300);return c-V*((y+w*N*C)*Math.sinh(O)+P*C*Math.cosh(O))/P};const q=(y+w*N*C)/P,J=w*N*q-C*P,F=w*N*C-q*P;M=ie=>{const V=Math.exp(-w*N*ie),O=Math.min(P*ie,300);return V*(J*Math.sinh(O)+F*Math.cosh(O))}}const H={calculatedDuration:x&&_||null,velocity:P=>yn(M(P)),next:P=>{if(!x&&w<1){const J=Math.exp(-w*N*P),F=Math.sin(L*P),ie=Math.cos(L*P),V=c-J*(K*F+C*ie),O=yn(J*(B*F+R*ie));return h.done=Math.abs(O)<=s&&Math.abs(c-V)<=a,h.value=h.done?c:V,h}const q=A(P);if(x)h.done=P>=_;else{const J=yn(M(P));h.done=Math.abs(J)<=s&&Math.abs(c-q)<=a}return h.value=h.done?c:q,h},toString:()=>{const P=Math.min(r_(H),th),q=ZE(J=>H.next(P*J).value,P,30);return P+"ms "+q},toTransition:()=>{}};return H}ih.applyToOptions=e=>{const t=CR(e,100,ih);return e.ease=t.ease,e.duration=yn(t.duration),e.type="keyframes",e};const DR=5;function QE(e,t,i){const s=Math.max(t-DR,0);return RE(i-e(s),t-s)}function Eg({keyframes:e,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:l=500,modifyTarget:c,min:h,max:m,restDelta:f=.5,restSpeed:g}){const _=e[0],v={done:!1,value:_},x=R=>h!==void 0&&R<h||m!==void 0&&R>m,y=R=>h===void 0?m:m===void 0||Math.abs(h-R)<Math.abs(m-R)?h:m;let w=i*t;const C=_+w,N=c===void 0?C:c(C);N!==C&&(w=N-_);const T=R=>-w*Math.exp(-R/s),A=R=>N+T(R),M=R=>{const H=T(R),P=A(R);v.done=Math.abs(H)<=f,v.value=v.done?N:P};let L,K;const B=R=>{x(v.value)&&(L=R,K=ih({keyframes:[v.value,y(v.value)],velocity:QE(A,R,v.value),damping:a,stiffness:l,restDelta:f,restSpeed:g}))};return B(0),{calculatedDuration:null,next:R=>{let H=!1;return!K&&L===void 0&&(H=!0,M(R),B(R)),L!==void 0&&R>=L?K.next(R-L):(!H&&M(R),v)}}}function OR(e,t,i){const s=[],a=i||Gr.mix||XE,l=e.length-1;for(let c=0;c<l;c++){let h=a(e[c],e[c+1]);if(t){const m=Array.isArray(t)?t[c]||Pn:t;h=Wc(m,h)}s.push(h)}return s}function jR(e,t,{clamp:i=!0,ease:s,mixer:a}={}){const l=e.length;if(Z0(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=OR(t,s,a),m=h.length,f=g=>{if(c&&g<e[0])return t[0];let _=0;if(m>1)for(;_<e.length-2&&!(g<e[_+1]);_++);const v=Oc(e[_],e[_+1],g);return h[_](v)};return i?g=>f(_s(e[0],e[l-1],g)):f}function LR(e,t){const i=e[e.length-1];for(let s=1;s<=t;s++){const a=Oc(0,t,s);e.push(At(i,1,a))}}function BR(e){const t=[0];return LR(t,e.length-1),t}function zR(e,t){return e.map(i=>i*t)}function IR(e,t){return e.map(()=>t||UE).splice(0,e.length-1)}function kc({duration:e=300,keyframes:t,times:i,ease:s="easeInOut"}){const a=K6(s)?s.map(Wx):Wx(s),l={done:!1,value:t[0]},c=zR(i&&i.length===t.length?i:BR(t),e),h=jR(c,t,{ease:Array.isArray(a)?a:IR(t,a)});return{calculatedDuration:e,next:m=>(l.value=h(m),l.done=m>=e,l)}}const PR=e=>e!==null;function Th(e,{repeat:t,repeatType:i="loop"},s,a=1){const l=e.filter(PR),h=a<0||t&&i!=="loop"&&t%2===1?0:l.length-1;return!h||s===void 0?l[h]:s}const UR={decay:Eg,inertia:Eg,tween:kc,keyframes:kc,spring:ih};function JE(e){typeof e.type=="string"&&(e.type=UR[e.type])}class a_{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 HR=e=>e/100;class nh extends a_{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!==Vi.now()&&this.tick(Vi.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;JE(t);const{type:i=kc,repeat:s=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:h}=t;const m=i||kc;m!==kc&&typeof h[0]!="number"&&(this.mixKeyframes=Wc(HR,XE(h[0],h[1])),h=[0,100]);const f=m({...t,keyframes:h});l==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...h].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=r_(f));const{calculatedDuration:g}=f;this.calculatedDuration=g,this.resolvedDuration=g+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:l,mirroredGenerator:c,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:f=0,keyframes:g,repeat:_,repeatType:v,repeatDelay:x,type:y,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),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 A=this.currentTime,M=s;if(_){const R=Math.min(this.currentTime,a)/h;let H=Math.floor(R),P=R%1;!P&&R>=1&&(P=1),P===1&&H--,H=Math.min(H,_+1),H%2&&(v==="reverse"?(P=1-P,x&&(P-=x/h)):v==="mirror"&&(M=c)),A=_s(0,1,P)*h}let L;T?(this.delayState.value=g[0],L=this.delayState):L=M.next(A),l&&!T&&(L.value=l(L.value));let{done:K}=L;!T&&m!==null&&(K=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&K);return B&&y!==Eg&&(L.value=Th(g,this.options,C,this.speed)),w&&w(L.value),B&&this.finish(),L}then(t,i){return this.finished.then(t,i)}get duration(){return zn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zn(t)}get time(){return zn(this.currentTime)}set time(t){t=yn(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 QE(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(Vi.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=zn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ER,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(Vi.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 FR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Da=e=>e*180/Math.PI,Cg=e=>{const t=Da(Math.atan2(e[1],e[0]));return kg(t)},$R={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Cg,rotateZ:Cg,skewX:e=>Da(Math.atan(e[1])),skewY:e=>Da(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kg=e=>(e=e%360,e<0&&(e+=360),e),ty=Cg,iy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ny=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),VR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:iy,scaleY:ny,scale:e=>(iy(e)+ny(e))/2,rotateX:e=>kg(Da(Math.atan2(e[6],e[5]))),rotateY:e=>kg(Da(Math.atan2(-e[2],e[0]))),rotateZ:ty,rotate:ty,skewX:e=>Da(Math.atan(e[4])),skewY:e=>Da(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ng(e){return e.includes("scale")?1:0}function Tg(e,t){if(!e||e==="none")return Ng(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(i)s=VR,a=i;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=$R,a=h}if(!a)return Ng(t);const l=s[t],c=a[1].split(",").map(KR);return typeof l=="function"?l(c):c[l]}const qR=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Tg(i,t)};function KR(e){return parseFloat(e.trim())}const tl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],il=new Set(tl),sy=e=>e===el||e===ke,GR=new Set(["x","y","z"]),WR=tl.filter(e=>!GR.has(e));function YR(e){const t=[];return WR.forEach(i=>{const s=e.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Fr={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})=>Tg(t,"x"),y:(e,{transform:t})=>Tg(t,"y")};Fr.translateX=Fr.x;Fr.translateY=Fr.y;const La=new Set;let Ag=!1,Mg=!1,Rg=!1;function eC(){if(Mg){const e=Array.from(La).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),i=new Map;t.forEach(s=>{const a=YR(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(([l,c])=>{s.getValue(l)?.set(c)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Mg=!1,Ag=!1,La.forEach(e=>e.complete(Rg)),La.clear()}function tC(){La.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mg=!0)})}function XR(){Rg=!0,tC(),eC(),Rg=!1}class o_{constructor(t,i,s,a,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=s,this.motionValue=a,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(La.add(this),Ag||(Ag=!0,wt.read(tC),wt.resolveKeyframes(eC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:s,motionValue:a}=this;if(t[0]===null){const l=a?.get(),c=t[t.length-1];if(l!==void 0)t[0]=l;else if(s&&i){const h=s.readValue(i,c);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=c),a&&l===void 0&&a.set(t[0])}FR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),La.delete(this)}cancel(){this.state==="scheduled"&&(La.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ZR=e=>e.startsWith("--");function iC(e,t,i){ZR(t)?e.style.setProperty(t,i):e.style[t]=i}const QR={};function nC(e,t){const i=ME(e);return()=>QR[t]??i()}const JR=nC(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),sC=nC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gc=([e,t,i,s])=>`cubic-bezier(${e}, ${t}, ${i}, ${s})`,ry={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gc([0,.65,.55,1]),circOut:gc([.55,0,1,.45]),backIn:gc([.31,.01,.66,-.59]),backOut:gc([.33,1.53,.69,.99])};function rC(e,t){if(e)return typeof e=="function"?sC()?ZE(e,t):"ease-out":HE(e)?gc(e):Array.isArray(e)?e.map(i=>rC(i,t)||ry.easeOut):ry[e]}function e8(e,t,i,{delay:s=0,duration:a=300,repeat:l=0,repeatType:c="loop",ease:h="easeOut",times:m}={},f=void 0){const g={[t]:i};m&&(g.offset=m);const _=rC(h,a);Array.isArray(_)&&(g.easing=_);const v={delay:s,duration:a,easing:Array.isArray(_)?"linear":_,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),e.animate(g,v)}function aC(e){return typeof e=="function"&&"applyToOptions"in e}function t8({type:e,...t}){return aC(e)&&sC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class oC extends a_{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:s,keyframes:a,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:h,onComplete:m}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,Z0(typeof t.type!="string");const f=t8(t);this.animation=e8(i,s,a,f,l),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const g=Th(a,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(g),iC(i,s,g),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 zn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zn(t)}get time(){return zn(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=yn(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&&JR()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),s&&(this.animation.rangeEnd=s),Pn):a(this)}}const lC={anticipate:zE,backInOut:BE,circInOut:PE};function i8(e){return e in lC}function n8(e){typeof e.ease=="string"&&i8(e.ease)&&(e.ease=lC[e.ease])}const tp=10;class s8 extends oC{constructor(t){n8(t),JE(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:l,...c}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const h=new nh({...c,autoplay:!1}),m=Math.max(tp,Vi.now()-this.startTime),f=_s(0,tp,m-tp),g=h.sample(m).value,{name:_}=this.options;l&&_&&iC(l,_,g),i.setWithVelocity(h.sample(Math.max(0,m-f)).value,g,f),h.stop()}}const ay=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Jn.test(e)||e==="0")&&!e.startsWith("url("));function r8(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 a8(e,t,i,s){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],c=ay(a,t),h=ay(l,t);return!c||!h?!1:r8(e)||(i==="spring"||aC(i))&&s}function Dg(e){e.duration=0,e.type="keyframes"}const cC=new Set(["opacity","clipPath","filter","transform"]),o8=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function l8(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&o8.test(e[t]))return!0;return!1}const c8=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),u8=ME(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function d8(e){const{motionValue:t,name:i,repeatDelay:s,repeatType:a,damping:l,type:c,keyframes:h}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:g}=t.owner.getProps();return u8()&&i&&(cC.has(i)||c8.has(i)&&l8(h))&&(i!=="transform"||!g)&&!f&&!s&&a!=="mirror"&&l!==0&&c!=="inertia"}const h8=40;class f8 extends a_{constructor({autoplay:t=!0,delay:i=0,type:s="keyframes",repeat:a=0,repeatDelay:l=0,repeatType:c="loop",keyframes:h,name:m,motionValue:f,element:g,..._}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vi.now();const v={autoplay:t,delay:i,type:s,repeat:a,repeatDelay:l,repeatType:c,name:m,motionValue:f,element:g,..._},x=g?.KeyframeResolver||o_;this.keyframeResolver=new x(h,(y,w,C)=>this.onKeyframesResolved(y,w,v,!C),m,f,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,a){this.keyframeResolver=void 0;const{name:l,type:c,velocity:h,delay:m,isHandoff:f,onUpdate:g}=s;this.resolvedAt=Vi.now();let _=!0;a8(t,l,c,h)||(_=!1,(Gr.instantAnimations||!m)&&g?.(Th(t,s,i)),t[0]=t[t.length-1],Dg(s),s.repeat=0);const x={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>h8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},y=_&&!f&&d8(x),w=x.motionValue?.owner?.current;let C;if(y)try{C=new s8({...x,element:w})}catch{C=new nh(x)}else C=new nh(x);C.finished.then(()=>{this.notifyFinished()}).catch(Pn),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),XR()),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 uC(e,t,i,s=0,a=1){const l=Array.from(e).sort((f,g)=>f.sortNodePosition(g)).indexOf(t),c=e.size,h=(c-1)*s;return typeof i=="function"?i(l,c):a===1?l*s:h-l*s}const m8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function p8(e){const t=m8.exec(e);if(!t)return[,];const[,i,s,a]=t;return[`--${i??s}`,a]}function dC(e,t,i=1){const[s,a]=p8(e);if(!s)return;const l=window.getComputedStyle(t).getPropertyValue(s);if(l){const c=l.trim();return NE(c)?parseFloat(c):c}return t_(a)?dC(a,t,i+1):a}const g8={type:"spring",stiffness:500,damping:25,restSpeed:10},_8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b8={type:"keyframes",duration:.8},v8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},x8=(e,{keyframes:t})=>t.length>2?b8:il.has(e)?e.startsWith("scale")?_8(t[1]):g8:v8;function hC(e,t){if(e?.inherit&&t){const{inherit:i,...s}=e;return{...t,...s}}return e}function l_(e,t){const i=e?.[t]??e?.default??e;return i!==e?hC(i,e):i}const y8=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function S8(e){for(const t in e)if(!y8.has(t))return!0;return!1}const c_=(e,t,i,s={},a,l)=>c=>{const h=l_(s,e)||{},m=h.delay||s.delay||0;let{elapsed:f=0}=s;f=f-yn(m);const g={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:()=>{c(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:l?void 0:a};S8(h)||Object.assign(g,x8(e,g)),g.duration&&(g.duration=yn(g.duration)),g.repeatDelay&&(g.repeatDelay=yn(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let _=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Dg(g),g.delay===0&&(_=!0)),(Gr.instantAnimations||Gr.skipAnimations||a?.shouldSkipAnimations)&&(_=!0,Dg(g),g.delay=0),g.allowFlatten=!h.type&&!h.ease,_&&!l&&t.get()!==void 0){const v=Th(g.keyframes,h);if(v!==void 0){wt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return h.isSync?new nh(g):new f8(g)};function oy(e){const t=[{},{}];return e?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function u_(e,t,i,s){if(typeof t=="function"){const[a,l]=oy(s);t=t(i!==void 0?i:e.custom,a,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,l]=oy(s);t=t(i!==void 0?i:e.custom,a,l)}return t}function Ba(e,t,i){const s=e.getProps();return u_(s,t,i!==void 0?i:s.custom,e)}const fC=new Set(["width","height","top","left","right","bottom",...tl]),ly=30,w8=e=>!isNaN(parseFloat(e));class E8{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const a=Vi.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 l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=Vi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=w8(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 Q0);const s=this.events[t].add(i);return t==="change"?()=>{s(),wt.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=Vi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ly)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,ly);return RE(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 Xo(e,t){return new E8(e,t)}const Og=e=>Array.isArray(e);function C8(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,Xo(i))}function k8(e){return Og(e)?e[e.length-1]||0:e}function N8(e,t){const i=Ba(e,t);let{transitionEnd:s={},transition:a={},...l}=i||{};l={...l,...s};for(const c in l){const h=k8(l[c]);C8(e,c,h)}}const Ai=e=>!!(e&&e.getVelocity);function T8(e){return!!(Ai(e)&&e.add)}function jg(e,t){const i=e.getValue("willChange");if(T8(i))return i.add(t);if(!i&&Gr.WillChange){const s=new Gr.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function d_(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const A8="framerAppearId",mC="data-"+d_(A8);function pC(e){return e.props[mC]}function M8({protectedKeys:e,needsAnimating:t},i){const s=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function gC(e,t,{delay:i=0,transitionOverride:s,type:a}={}){let{transition:l,transitionEnd:c,...h}=t;const m=e.getDefaultTransition();l=l?hC(l,m):m;const f=l?.reduceMotion;s&&(l=s);const g=[],_=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||_&&M8(_,v))continue;const w={delay:i,...l_(l||{},v)},C=x.get();if(C!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===C&&!w.velocity){wt.update(()=>x.set(y));continue}let N=!1;if(window.MotionHandoffAnimation){const M=pC(e);if(M){const L=window.MotionHandoffAnimation(M,v,wt);L!==null&&(w.startTime=L,N=!0)}}jg(e,v);const T=f??e.shouldReduceMotion;x.start(c_(v,x,y,T&&fC.has(v)?{type:!1}:w,e,N));const A=x.animation;A&&g.push(A)}if(c){const v=()=>wt.update(()=>{c&&N8(e,c)});g.length?Promise.all(g).then(v):v()}return g}function Lg(e,t,i={}){const s=Ba(e,t,i.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(a=i.transitionOverride);const l=s?()=>Promise.all(gC(e,s,i)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:g,staggerDirection:_}=a;return R8(e,t,m,f,g,_,i)}:()=>Promise.resolve(),{when:h}=a;if(h){const[m,f]=h==="beforeChildren"?[l,c]:[c,l];return m().then(()=>f())}else return Promise.all([l(),c(i.delay)])}function R8(e,t,i=0,s=0,a=0,l=1,c){const h=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),h.push(Lg(m,t,{...c,delay:i+(typeof s=="function"?0:s)+uC(e.variantChildren,m,s,a,l)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(h)}function D8(e,t,i={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(l=>Lg(e,l,i));s=Promise.all(a)}else if(typeof t=="string")s=Lg(e,t,i);else{const a=typeof t=="function"?Ba(e,t,i.custom):t;s=Promise.all(gC(e,a,i))}return s.then(()=>{e.notify("AnimationComplete",t)})}const O8={test:e=>e==="auto",parse:e=>e},_C=e=>t=>t.test(e),bC=[el,ke,ms,Pr,rR,sR,O8],cy=e=>bC.find(_C(e));function j8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||AE(e):!0}const L8=new Set(["brightness","contrast","saturate","opacity"]);function B8(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=i.match(i_)||[];if(!s)return e;const a=i.replace(s,"");let l=L8.has(t)?1:0;return s!==i&&(l*=100),t+"("+l+a+")"}const z8=/\b([a-z-]*)\(.*?\)/gu,Bg={...Jn,getAnimatableNone:e=>{const t=e.match(z8);return t?t.map(B8).join(" "):e}},zg={...Jn,getAnimatableNone:e=>{const t=Jn.parse(e);return Jn.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},uy={...el,transform:Math.round},I8={rotate:Pr,rotateX:Pr,rotateY:Pr,rotateZ:Pr,scale:wd,scaleX:wd,scaleY:wd,scaleZ:wd,skew:Pr,skewX:Pr,skewY:Pr,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:jc,originX:Xx,originY:Xx,originZ:ke},h_={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...I8,zIndex:uy,fillOpacity:jc,strokeOpacity:jc,numOctaves:uy},P8={...h_,color:ii,backgroundColor:ii,outlineColor:ii,fill:ii,stroke:ii,borderColor:ii,borderTopColor:ii,borderRightColor:ii,borderBottomColor:ii,borderLeftColor:ii,filter:Bg,WebkitFilter:Bg,mask:zg,WebkitMask:zg},vC=e=>P8[e],U8=new Set([Bg,zg]);function xC(e,t){let i=vC(e);return U8.has(i)||(i=Jn),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const H8=new Set(["auto","none","0"]);function F8(e,t,i){let s=0,a;for(;s<e.length&&!a;){const l=e[s];typeof l=="string"&&!H8.has(l)&&Yo(l).values.length&&(a=e[s]),s++}if(a&&i)for(const l of t)e[l]=xC(i,a)}class $8 extends o_{constructor(t,i,s,a,l){super(t,i,s,a,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let _=t[g];if(typeof _=="string"&&(_=_.trim(),t_(_))){const v=dC(_,i.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=_)}}if(this.resolveNoneKeyframes(),!fC.has(s)||t.length!==2)return;const[a,l]=t,c=cy(a),h=cy(l),m=Yx(a),f=Yx(l);if(m!==f&&Fr[s]){this.needsMeasurement=!0;return}if(c!==h)if(sy(c)&&sy(h))for(let g=0;g<t.length;g++){const _=t[g];typeof _=="string"&&(t[g]=parseFloat(_))}else Fr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||j8(t[a]))&&s.push(a);s.length&&F8(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=Fr[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 l=s.length-1,c=s[l];s[l]=Fr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,m])=>{t.getValue(h).set(m)}),this.resolveNoneKeyframes()}}function yC(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 SC=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function V8(e){return TE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:f_}=FE(queueMicrotask,!1),Xn={x:!1,y:!1};function wC(){return Xn.x||Xn.y}function q8(e){return e==="x"||e==="y"?Xn[e]?null:(Xn[e]=!0,()=>{Xn[e]=!1}):Xn.x||Xn.y?null:(Xn.x=Xn.y=!0,()=>{Xn.x=Xn.y=!1})}function EC(e,t){const i=yC(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[i,a,()=>s.abort()]}function K8(e){return!(e.pointerType==="touch"||wC())}function G8(e,t,i={}){const[s,a,l]=EC(e,i);return s.forEach(c=>{let h=!1,m=!1,f;const g=()=>{c.removeEventListener("pointerleave",y)},_=C=>{f&&(f(C),f=void 0),g()},v=C=>{h=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),m&&(m=!1,_(C))},x=()=>{h=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},y=C=>{if(C.pointerType!=="touch"){if(h){m=!0;return}_(C)}},w=C=>{if(!K8(C))return;m=!1;const N=t(c,C);typeof N=="function"&&(f=N,c.addEventListener("pointerleave",y,a))};c.addEventListener("pointerenter",w,a),c.addEventListener("pointerdown",x,a)}),l}const CC=(e,t)=>t?e===t?!0:CC(e,t.parentElement):!1,m_=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,W8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Y8(e){return W8.has(e.tagName)||e.isContentEditable===!0}const X8=new Set(["INPUT","SELECT","TEXTAREA"]);function Z8(e){return X8.has(e.tagName)||e.isContentEditable===!0}const Id=new WeakSet;function dy(e){return t=>{t.key==="Enter"&&e(t)}}function ip(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Q8=(e,t)=>{const i=e.currentTarget;if(!i)return;const s=dy(()=>{if(Id.has(i))return;ip(i,"down");const a=dy(()=>{ip(i,"up")}),l=()=>ip(i,"cancel");i.addEventListener("keyup",a,t),i.addEventListener("blur",l,t)});i.addEventListener("keydown",s,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),t)};function hy(e){return m_(e)&&!wC()}const fy=new WeakSet;function J8(e,t,i={}){const[s,a,l]=EC(e,i),c=h=>{const m=h.currentTarget;if(!hy(h)||fy.has(h))return;Id.add(m),i.stopPropagation&&fy.add(h);const f=t(m,h),g=(x,y)=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",v),Id.has(m)&&Id.delete(m),hy(x)&&typeof f=="function"&&f(x,{success:y})},_=x=>{g(x,m===window||m===document||i.useGlobalTarget||CC(m,x.target))},v=x=>{g(x,!1)};window.addEventListener("pointerup",_,a),window.addEventListener("pointercancel",v,a)};return s.forEach(h=>{(i.useGlobalTarget?window:h).addEventListener("pointerdown",c,a),V8(h)&&(h.addEventListener("focus",f=>Q8(f,a)),!Y8(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),l}function p_(e){return TE(e)&&"ownerSVGElement"in e}const Pd=new WeakMap;let Ud;const kC=(e,t,i)=>(s,a)=>a&&a[0]?a[0][e+"Size"]:p_(s)&&"getBBox"in s?s.getBBox()[t]:s[i],eD=kC("inline","width","offsetWidth"),tD=kC("block","height","offsetHeight");function iD({target:e,borderBoxSize:t}){Pd.get(e)?.forEach(i=>{i(e,{get width(){return eD(e,t)},get height(){return tD(e,t)}})})}function nD(e){e.forEach(iD)}function sD(){typeof ResizeObserver>"u"||(Ud=new ResizeObserver(nD))}function rD(e,t){Ud||sD();const i=yC(e);return i.forEach(s=>{let a=Pd.get(s);a||(a=new Set,Pd.set(s,a)),a.add(t),Ud?.observe(s)}),()=>{i.forEach(s=>{const a=Pd.get(s);a?.delete(t),a?.size||Ud?.unobserve(s)})}}const Hd=new Set;let $o;function aD(){$o=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hd.forEach(t=>t(e))},window.addEventListener("resize",$o)}function oD(e){return Hd.add(e),$o||aD(),()=>{Hd.delete(e),!Hd.size&&typeof $o=="function"&&(window.removeEventListener("resize",$o),$o=void 0)}}function my(e,t){return typeof e=="function"?oD(e):rD(e,t)}function lD(e){return p_(e)&&e.tagName==="svg"}const cD=[...bC,ii,Jn],uD=e=>cD.find(_C(e)),py=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vo=()=>({x:py(),y:py()}),gy=()=>({min:0,max:0}),ui=()=>({x:gy(),y:gy()}),dD=new WeakMap;function Ah(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Lc(e){return typeof e=="string"||Array.isArray(e)}const g_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],__=["initial",...g_];function Mh(e){return Ah(e.animate)||__.some(t=>Lc(e[t]))}function NC(e){return!!(Mh(e)||e.variants)}function hD(e,t,i){for(const s in t){const a=t[s],l=i[s];if(Ai(a))e.addValue(s,a);else if(Ai(l))e.addValue(s,Xo(a,{owner:e}));else if(l!==a)if(e.hasValue(s)){const c=e.getValue(s);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(s);e.addValue(s,Xo(c!==void 0?c:a,{owner:e}))}}for(const s in i)t[s]===void 0&&e.removeValue(s);return t}const Ig={current:null},TC={current:!1},fD=typeof window<"u";function mD(){if(TC.current=!0,!!fD)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ig.current=e.matches;e.addEventListener("change",t),t()}else Ig.current=!1}const _y=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sh={};function AC(e){sh=e}function pD(){return sh}class gD{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,reducedMotionConfig:a,skipAnimations:l,blockInitialAnimation:c,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=o_,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=Vi.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,wt.render(this.render,!1,!0))};const{latestValues:f,renderState:g}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=i.initial?{...f}:{},this.renderState=g,this.parent=t,this.props=i,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=l,this.options=m,this.blockInitialAnimation=!!c,this.isControllingVariants=Mh(i),this.isVariantNode=NC(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:_,...v}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in v){const y=v[x];f[x]!==void 0&&Ai(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,dD.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:(TC.current||mD(),this.shouldReduceMotion=Ig.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(),Wr(this.notifyUpdate),Wr(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&&cC.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:h,times:m,ease:f,duration:g}=i.accelerate,_=new oC({element:this.current,name:t,keyframes:h,times:m,ease:f,duration:yn(g)}),v=c(_);this.valueSubscriptions.set(t,()=>{v(),_.cancel()});return}const s=il.has(t);s&&this.onBindTransform&&this.onBindTransform();const a=i.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&wt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{a(),l&&l(),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 sh){const i=sh[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 l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ui()}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<_y.length;s++){const a=_y[s];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const l="on"+a,c=t[l];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=hD(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=Xo(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"&&(NE(s)||AE(s))?s=parseFloat(s):!uD(s)&&Jn.test(i)&&(s=xC(t,i)),this.setBaseTarget(t,Ai(s)?s.get():s)),Ai(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 l=u_(this.props,i,this.presenceContext?.custom);l&&(s=l[t])}if(i&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ai(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 Q0),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){f_.render(this.render)}}class MC extends gD{constructor(){super(...arguments),this.KeyframeResolver=$8}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;Ai(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Qr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function RC({top:e,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:e,max:s}}}function _D({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bD(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 np(e){return e===void 0||e===1}function Pg({scale:e,scaleX:t,scaleY:i}){return!np(e)||!np(t)||!np(i)}function Na(e){return Pg(e)||DC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DC(e){return by(e.x)||by(e.y)}function by(e){return e&&e!=="0%"}function rh(e,t,i){const s=e-i,a=t*s;return i+a}function vy(e,t,i,s,a){return a!==void 0&&(e=rh(e,a,s)),rh(e,i,s)+t}function Ug(e,t=0,i=1,s,a){e.min=vy(e.min,t,i,s,a),e.max=vy(e.max,t,i,s,a)}function OC(e,{x:t,y:i}){Ug(e.x,t.translate,t.scale,t.originPoint),Ug(e.y,i.translate,i.scale,i.originPoint)}const xy=.999999999999,yy=1.0000000000001;function vD(e,t,i,s=!1){const a=i.length;if(!a)return;t.x=t.y=1;let l,c;for(let h=0;h<a;h++){l=i[h],c=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(hs(e.x,-l.scroll.offset.x),hs(e.y,-l.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,OC(e,c)),s&&Na(l.latestValues)&&Fd(e,l.latestValues,l.layout?.layoutBox))}t.x<yy&&t.x>xy&&(t.x=1),t.y<yy&&t.y>xy&&(t.y=1)}function hs(e,t){e.min+=t,e.max+=t}function Sy(e,t,i,s,a=.5){const l=At(e.min,e.max,a);Ug(e,t,i,l,s)}function wy(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Fd(e,t,i){const s=i??e;Sy(e.x,wy(t.x,s.x),t.scaleX,t.scale,t.originX),Sy(e.y,wy(t.y,s.y),t.scaleY,t.scale,t.originY)}function jC(e,t){return RC(bD(e.getBoundingClientRect(),t))}function xD(e,t,i){const s=jC(e,i),{scroll:a}=t;return a&&(hs(s.x,a.offset.x),hs(s.y,a.offset.y)),s}const yD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},SD=tl.length;function wD(e,t,i){let s="",a=!0;for(let l=0;l<SD;l++){const c=tl[l],h=e[c];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(c.startsWith("scale")?1:0);else{const f=parseFloat(h);m=c.startsWith("scale")?f===1:f===0}if(!m||i){const f=SC(h,h_[c]);if(!m){a=!1;const g=yD[c]||c;s+=`${g}(${f}) `}i&&(t[c]=f)}}return s=s.trim(),i?s=i(t,a?"":s):a&&(s="none"),s}function b_(e,t,i){const{style:s,vars:a,transformOrigin:l}=e;let c=!1,h=!1;for(const m in t){const f=t[m];if(il.has(m)){c=!0;continue}else if(VE(m)){a[m]=f;continue}else{const g=SC(f,h_[m]);m.startsWith("origin")?(h=!0,l[m]=g):s[m]=g}}if(t.transform||(c||i?s.transform=wD(t,e.transform,i):s.transform&&(s.transform="none")),h){const{originX:m="50%",originY:f="50%",originZ:g=0}=l;s.transformOrigin=`${m} ${f} ${g}`}}function LC(e,{style:t,vars:i},s,a){const l=e.style;let c;for(c in t)l[c]=t[c];a?.applyProjectionStyles(l,s);for(c in i)l.setProperty(c,i[c])}function Ey(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ac={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const i=Ey(e,t.target.x),s=Ey(e,t.target.y);return`${i}% ${s}%`}},ED={correct:(e,{treeScale:t,projectionDelta:i})=>{const s=e,a=Jn.parse(e);if(a.length>5)return s;const l=Jn.createTransformer(e),c=typeof a[0]!="number"?1:0,h=i.x.scale*t.x,m=i.y.scale*t.y;a[0+c]/=h,a[1+c]/=m;const f=At(h,m,.5);return typeof a[2+c]=="number"&&(a[2+c]/=f),typeof a[3+c]=="number"&&(a[3+c]/=f),l(a)}},Hg={borderRadius:{...ac,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ac,borderTopRightRadius:ac,borderBottomLeftRadius:ac,borderBottomRightRadius:ac,boxShadow:ED};function BC(e,{layout:t,layoutId:i}){return il.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!Hg[e]||e==="opacity")}function v_(e,t,i){const s=e.style,a=t?.style,l={};if(!s)return l;for(const c in s)(Ai(s[c])||a&&Ai(a[c])||BC(c,e)||i?.getValue(c)?.liveStyle!==void 0)&&(l[c]=s[c]);return l}function CD(e){return window.getComputedStyle(e)}class kD extends MC{constructor(){super(...arguments),this.type="html",this.renderInstance=LC}readValueFromInstance(t,i){if(il.has(i))return this.projection?.isProjecting?Ng(i):qR(t,i);{const s=CD(t),a=(VE(i)?s.getPropertyValue(i):s[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return jC(t,i)}build(t,i,s){b_(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return v_(t,i,s)}}const ND={offset:"stroke-dashoffset",array:"stroke-dasharray"},TD={offset:"strokeDashoffset",array:"strokeDasharray"};function AD(e,t,i=1,s=0,a=!0){e.pathLength=1;const l=a?ND:TD;e[l.offset]=`${-s}`,e[l.array]=`${t} ${i}`}const MD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zC(e,{attrX:t,attrY:i,attrScale:s,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...h},m,f,g){if(b_(e,h,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:_,style:v}=e;_.transform&&(v.transform=_.transform,delete _.transform),(v.transform||_.transformOrigin)&&(v.transformOrigin=_.transformOrigin??"50% 50%",delete _.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete _.transformBox);for(const x of MD)_[x]!==void 0&&(v[x]=_[x],delete _[x]);t!==void 0&&(_.x=t),i!==void 0&&(_.y=i),s!==void 0&&(_.scale=s),a!==void 0&&AD(_,a,l,c,!1)}const IC=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"]),PC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function RD(e,t,i,s){LC(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(IC.has(a)?a:d_(a),t.attrs[a])}function UC(e,t,i){const s=v_(e,t,i);for(const a in e)if(Ai(e[a])||Ai(t[a])){const l=tl.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[l]=e[a]}return s}class DD extends MC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ui}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(il.has(i)){const s=vC(i);return s&&s.default||0}return i=IC.has(i)?i:d_(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return UC(t,i,s)}build(t,i,s){zC(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,a){RD(t,i,s,a)}mount(t){this.isSVGTag=PC(t.tagName),super.mount(t)}}const OD=__.length;function HC(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?HC(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;i<OD;i++){const s=__[i],a=e.props[s];(Lc(a)||a===!1)&&(t[s]=a)}return t}function FC(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 jD=[...g_].reverse(),LD=g_.length;function BD(e){return t=>Promise.all(t.map(({animation:i,options:s})=>D8(e,i,s)))}function zD(e){let t=BD(e),i=Cy(),s=!0,a=!1;const l=f=>(g,_)=>{const v=Ba(e,_,f==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:x,transitionEnd:y,...w}=v;g={...g,...w,...y}}return g};function c(f){t=f(e)}function h(f){const{props:g}=e,_=HC(e.parent)||{},v=[],x=new Set;let y={},w=1/0;for(let N=0;N<LD;N++){const T=jD[N],A=i[T],M=g[T]!==void 0?g[T]:_[T],L=Lc(M),K=T===f?A.isActive:null;K===!1&&(w=N);let B=M===_[T]&&M!==g[T]&&L;if(B&&(s||a)&&e.manuallyAnimateOnMount&&(B=!1),A.protectedKeys={...y},!A.isActive&&K===null||!M&&!A.prevProp||Ah(M)||typeof M=="boolean")continue;if(T==="exit"&&A.isActive&&K!==!0){A.prevResolvedValues&&(y={...y,...A.prevResolvedValues});continue}const R=ID(A.prevProp,M);let H=R||T===f&&A.isActive&&!B&&L||N>w&&L,P=!1;const q=Array.isArray(M)?M:[M];let J=q.reduce(l(T),{});K===!1&&(J={});const{prevResolvedValues:F={}}=A,ie={...F,...J},V=X=>{H=!0,x.has(X)&&(P=!0,x.delete(X)),A.needsAnimating[X]=!0;const j=e.getValue(X);j&&(j.liveStyle=!1)};for(const X in ie){const j=J[X],W=F[X];if(y.hasOwnProperty(X))continue;let D=!1;Og(j)&&Og(W)?D=!FC(j,W):D=j!==W,D?j!=null?V(X):x.add(X):j!==void 0&&x.has(X)?V(X):A.protectedKeys[X]=!0}A.prevProp=M,A.prevResolvedValues=J,A.isActive&&(y={...y,...J}),(s||a)&&e.blockInitialAnimation&&(H=!1);const O=B&&R;H&&(!O||P)&&v.push(...q.map(X=>{const j={type:T};if(typeof X=="string"&&(s||a)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,D=Ba(W,X);if(W.enteringChildren&&D){const{delayChildren:te}=D.transition||{};j.delay=uC(W.enteringChildren,e,te)}}return{animation:X,options:j}}))}if(x.size){const N={};if(typeof g.initial!="boolean"){const T=Ba(e,Array.isArray(g.initial)?g.initial[0]:g.initial);T&&T.transition&&(N.transition=T.transition)}x.forEach(T=>{const A=e.getBaseTarget(T),M=e.getValue(T);M&&(M.liveStyle=!0),N[T]=A??null}),v.push({animation:N})}let C=!!v.length;return s&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(C=!1),s=!1,a=!1,C?t(v):Promise.resolve()}function m(f,g){if(i[f].isActive===g)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(f,g)),i[f].isActive=g;const _=h(f);for(const v in i)i[v].protectedKeys={};return _}return{animateChanges:h,setActive:m,setAnimateFunction:c,getState:()=>i,reset:()=>{i=Cy(),a=!0}}}function ID(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!FC(t,e):!1}function Ea(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cy(){return{animate:Ea(!0),whileInView:Ea(),whileHover:Ea(),whileTap:Ea(),whileDrag:Ea(),whileFocus:Ea(),exit:Ea()}}function Fg(e,t){e.min=t.min,e.max=t.max}function Yn(e,t){Fg(e.x,t.x),Fg(e.y,t.y)}function ky(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $C=1e-4,PD=1-$C,UD=1+$C,VC=.01,HD=0-VC,FD=0+VC;function qi(e){return e.max-e.min}function $D(e,t,i){return Math.abs(e-t)<=i}function Ny(e,t,i,s=.5){e.origin=s,e.originPoint=At(t.min,t.max,e.origin),e.scale=qi(i)/qi(t),e.translate=At(i.min,i.max,e.origin)-e.originPoint,(e.scale>=PD&&e.scale<=UD||isNaN(e.scale))&&(e.scale=1),(e.translate>=HD&&e.translate<=FD||isNaN(e.translate))&&(e.translate=0)}function Nc(e,t,i,s){Ny(e.x,t.x,i.x,s?s.originX:void 0),Ny(e.y,t.y,i.y,s?s.originY:void 0)}function Ty(e,t,i,s=0){const a=s?At(i.min,i.max,s):i.min;e.min=a+t.min,e.max=e.min+qi(t)}function VD(e,t,i,s){Ty(e.x,t.x,i.x,s?.x),Ty(e.y,t.y,i.y,s?.y)}function Ay(e,t,i,s=0){const a=s?At(i.min,i.max,s):i.min;e.min=t.min-a,e.max=e.min+qi(t)}function ah(e,t,i,s){Ay(e.x,t.x,i.x,s?.x),Ay(e.y,t.y,i.y,s?.y)}function My(e,t,i,s,a){return e-=t,e=rh(e,1/i,s),a!==void 0&&(e=rh(e,1/a,s)),e}function qD(e,t=0,i=1,s=.5,a,l=e,c=e){if(ms.test(t)&&(t=parseFloat(t),t=At(c.min,c.max,t/100)-c.min),typeof t!="number")return;let h=At(l.min,l.max,s);e===l&&(h-=t),e.min=My(e.min,t,i,h,a),e.max=My(e.max,t,i,h,a)}function Ry(e,t,[i,s,a],l,c){qD(e,t[i],t[s],t[a],t.scale,l,c)}const KD=["x","scaleX","originX"],GD=["y","scaleY","originY"];function Dy(e,t,i,s){Ry(e.x,t,KD,i?i.x:void 0,s?s.x:void 0),Ry(e.y,t,GD,i?i.y:void 0,s?s.y:void 0)}function Oy(e){return e.translate===0&&e.scale===1}function qC(e){return Oy(e.x)&&Oy(e.y)}function jy(e,t){return e.min===t.min&&e.max===t.max}function WD(e,t){return jy(e.x,t.x)&&jy(e.y,t.y)}function Ly(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function KC(e,t){return Ly(e.x,t.x)&&Ly(e.y,t.y)}function By(e){return qi(e.x)/qi(e.y)}function zy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ds(e){return[e("x"),e("y")]}function YD(e,t,i){let s="";const a=e.x.translate/t.x,l=e.y.translate/t.y,c=i?.z||0;if((a||l||c)&&(s=`translate3d(${a}px, ${l}px, ${c}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:f,rotate:g,rotateX:_,rotateY:v,skewX:x,skewY:y}=i;f&&(s=`perspective(${f}px) ${s}`),g&&(s+=`rotate(${g}deg) `),_&&(s+=`rotateX(${_}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 GC=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],XD=GC.length,Iy=e=>typeof e=="string"?parseFloat(e):e,Py=e=>typeof e=="number"||ke.test(e);function ZD(e,t,i,s,a,l){a?(e.opacity=At(0,i.opacity??1,QD(s)),e.opacityExit=At(t.opacity??1,0,JD(s))):l&&(e.opacity=At(t.opacity??1,i.opacity??1,s));for(let c=0;c<XD;c++){const h=GC[c];let m=Uy(t,h),f=Uy(i,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||Py(m)===Py(f)?(e[h]=Math.max(At(Iy(m),Iy(f),s),0),(ms.test(f)||ms.test(m))&&(e[h]+="%")):e[h]=f}(t.rotate||i.rotate)&&(e.rotate=At(t.rotate||0,i.rotate||0,s))}function Uy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const QD=WC(0,.5,IE),JD=WC(.5,.95,Pn);function WC(e,t,i){return s=>s<e?0:s>t?1:i(Oc(e,t,s))}function eO(e,t,i){const s=Ai(e)?e:Xo(e);return s.start(c_("",s,t,i)),s.animation}function Bc(e,t,i,s={passive:!0}){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i)}const tO=(e,t)=>e.depth-t.depth;class iO{constructor(){this.children=[],this.isDirty=!1}add(t){X0(this.children,t),this.isDirty=!0}remove(t){Jd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tO),this.isDirty=!1,this.children.forEach(t)}}function nO(e,t){const i=Vi.now(),s=({timestamp:a})=>{const l=a-i;l>=t&&(Wr(s),e(l-t))};return wt.setup(s,!0),()=>Wr(s)}function $d(e){return Ai(e)?e.get():e}class sO{constructor(){this.members=[]}add(t){X0(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&&(Jd(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(Jd(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:l}=t.options;(a===void 0||a!==l)&&(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 Vd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sp=["","X","Y","Z"],rO=1e3;let aO=0;function rp(e,t,i,s){const{latestValues:a}=t;a[e]&&(i[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function YC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=pC(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:a,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",wt,!(a||l))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&YC(s)}function XC({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(c={},h=t?.()){this.id=aO++,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(cO),this.nodes.forEach(pO),this.nodes.forEach(gO),this.nodes.forEach(uO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,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 iO)}addEventListener(c,h){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Q0),this.eventHandlers.get(c).add(h)}notifyListeners(c,...h){const m=this.eventHandlers.get(c);m&&m.notify(...h)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=p_(c)&&!lD(c),this.instance=c;const{layoutId:h,layout:m,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),e){let g,_=0;const v=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{_=window.innerWidth}),e(c,()=>{const x=window.innerWidth;x!==_&&(_=x,this.root.updateBlockedByResize=!0,g&&g(),g=nO(v,250),Vd.hasAnimatedSinceResize&&(Vd.hasAnimatedSinceResize=!1,this.nodes.forEach($y)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||m)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:_,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||yO,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=f.getProps(),N=!this.targetLayout||!KC(this.targetLayout,x),T=!_&&v;if(this.options.layoutRoot||this.resumeFrom||T||_&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const A={...l_(y,"layout"),onPlay:w,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A),this.setAnimationOrigin(g,T)}else _||$y(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Wr(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(_O),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&YC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const _=this.path[g];_.shouldResetTransform=!0,(typeof _.latestValues.x=="string"||typeof _.latestValues.y=="string")&&(_.isLayoutDirty=!0),_.updateScroll("snapshot"),_.options.layoutRoot&&_.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(),c&&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(hO),this.nodes.forEach(Hy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Fy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fO),this.nodes.forEach(mO),this.nodes.forEach(oO),this.nodes.forEach(lO)):this.nodes.forEach(Fy),this.clearAllSnapshots();const h=Vi.now();Ni.delta=_s(0,1e3/60,h-Ni.timestamp),Ni.timestamp=h,Ni.isProcessing=!0,Xm.update.process(Ni),Xm.preRender.process(Ni),Xm.render.process(Ni),Ni.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,f_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(dO),this.sharedNodes.forEach(bO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!qi(this.snapshot.measuredBox.x)&&!qi(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 c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ui()),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,c?c.layoutBox:void 0)}updateScroll(c="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(h=!1),h&&this.instance){const m=s(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!qC(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,g=f!==this.prevTransformTemplateValue;c&&this.instance&&(h||Na(this.latestValues)||g)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return c&&(m=this.removeTransform(m)),SO(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return ui();const h=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(wO))){const{scroll:f}=this.root;f&&(hs(h.x,f.offset.x),hs(h.y,f.offset.y))}return h}removeElementScroll(c){const h=ui();if(Yn(h,c),this.scroll?.wasRoot)return h;for(let m=0;m<this.path.length;m++){const f=this.path[m],{scroll:g,options:_}=f;f!==this.root&&g&&_.layoutScroll&&(g.wasRoot&&Yn(h,c),hs(h.x,g.offset.x),hs(h.y,g.offset.y))}return h}applyTransform(c,h=!1,m){const f=m||ui();Yn(f,c);for(let g=0;g<this.path.length;g++){const _=this.path[g];!h&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(hs(f.x,-_.scroll.offset.x),hs(f.y,-_.scroll.offset.y)),Na(_.latestValues)&&Fd(f,_.latestValues,_.layout?.layoutBox)}return Na(this.latestValues)&&Fd(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const h=ui();Yn(h,c);for(let m=0;m<this.path.length;m++){const f=this.path[m];if(!Na(f.latestValues))continue;let g;f.instance&&(Pg(f.latestValues)&&f.updateSnapshot(),g=ui(),Yn(g,f.measurePageBox())),Dy(h,f.latestValues,f.snapshot?.layoutBox,g)}return Na(this.latestValues)&&Dy(h,this.latestValues),h}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.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!==Ni.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!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(!(c||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:_}=this.options;if(!this.layout||!(g||_))return;this.resolvedRelativeTargetAt=Ni.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=ui(),this.targetWithTransforms=ui()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),VD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Yn(this.target,this.layout.layoutBox),OC(this.target,this.targetDelta)):Yn(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||Pg(this.parent.latestValues)||DC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,h,m){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ui(),this.relativeTargetOrigin=ui(),ah(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),Yn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),h=!!this.resumingFrom||this!==c;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Ni.timestamp&&(m=!1),m)return;const{layout:f,layoutId:g}=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||g))return;Yn(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,v=this.treeScale.y;vD(this.layoutCorrected,this.treeScale,this.path,h),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ui());const{target:x}=c;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ky(this.prevProjectionDelta.x,this.projectionDelta.x),ky(this.prevProjectionDelta.y,this.projectionDelta.y)),Nc(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==v||!zy(this.projectionDelta.x,this.prevProjectionDelta.x)||!zy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Vo(),this.projectionDelta=Vo(),this.projectionDeltaWithTransform=Vo()}setAnimationOrigin(c,h=!1){const m=this.snapshot,f=m?m.latestValues:{},g={...this.latestValues},_=Vo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const v=ui(),x=m?m.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,C=this.getStack(),N=!C||C.members.length<=1,T=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(xO));this.animationProgress=0;let A;this.mixTargetDelta=M=>{const L=M/1e3;Vy(_.x,c.x,L),Vy(_.y,c.y,L),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ah(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),vO(this.relativeTarget,this.relativeTargetOrigin,v,L),A&&WD(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=ui()),Yn(A,this.relativeTarget)),w&&(this.animationValues=g,ZD(g,f,this.latestValues,L,T,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Wr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{Vd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xo(0)),this.motionValue.jump(0,!1),this.currentAnimation=eO(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),c.onUpdate&&c.onUpdate(h)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.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 c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(rO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:h,target:m,layout:f,latestValues:g}=c;if(!(!h||!m||!f)){if(this!==c&&this.layout&&f&&ZC(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||ui();const _=qi(this.layout.layoutBox.x);m.x.min=c.target.x.min,m.x.max=m.x.min+_;const v=qi(this.layout.layoutBox.y);m.y.min=c.target.y.min,m.y.max=m.y.min+v}Yn(h,m),Fd(h,g),Nc(this.projectionDeltaWithTransform,this.layoutCorrected,h,g)}}registerSharedNode(c,h){this.sharedNodes.has(c)||this.sharedNodes.set(c,new sO),this.sharedNodes.get(c).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 c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:h,preserveFollowOpacity:m}={}){const f=this.getStack();f&&f.promote(this,m),c&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let h=!1;const{latestValues:m}=c;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const f={};m.z&&rp("z",c,f,this.animationValues);for(let g=0;g<sp.length;g++)rp(`rotate${sp[g]}`,c,f,this.animationValues),rp(`skew${sp[g]}`,c,f,this.animationValues);c.render();for(const g in f)c.setStaticValue(g,f[g]),this.animationValues&&(this.animationValues[g]=f[g]);c.scheduleRender()}applyProjectionStyles(c,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=$d(h?.pointerEvents)||"",c.transform=m?m(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=$d(h?.pointerEvents)||""),this.hasProjected&&!Na(this.latestValues)&&(c.transform=m?m({},""):"none",this.hasProjected=!1);return}c.visibility="";const g=f.animationValues||f.latestValues;this.applyTransformsToTarget();let _=YD(this.projectionDeltaWithTransform,this.treeScale,g);m&&(_=m(g,_)),c.transform=_;const{x:v,y:x}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${x.origin*100}% 0`,f.animationValues?c.opacity=f===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:c.opacity=f===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const y in Hg){if(g[y]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=Hg[y],T=_==="none"?g[y]:w(g[y],f);if(C){const A=C.length;for(let M=0;M<A;M++)c[C[M]]=T}else N?this.options.visualElement.renderState.vars[y]=T:c[y]=T}this.options.layoutId&&(c.pointerEvents=f===this?$d(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Hy),this.root.sharedNodes.clear()}}}function oO(e){e.updateLayout()}function lO(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,l=t.source!==e.layout.source;if(a==="size")ds(g=>{const _=l?t.measuredBox[g]:t.layoutBox[g],v=qi(_);_.min=i[g].min,_.max=_.min+v});else if(a==="x"||a==="y"){const g=a==="x"?"y":"x";Fg(l?t.measuredBox[g]:t.layoutBox[g],i[g])}else ZC(a,t.layoutBox,i)&&ds(g=>{const _=l?t.measuredBox[g]:t.layoutBox[g],v=qi(i[g]);_.max=_.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const c=Vo();Nc(c,i,t.layoutBox);const h=Vo();l?Nc(h,e.applyTransform(s,!0),t.measuredBox):Nc(h,i,t.layoutBox);const m=!qC(c);let f=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:_,layout:v}=g;if(_&&v){const x=e.options.layoutAnchor||void 0,y=ui();ah(y,t.layoutBox,_.layoutBox,x);const w=ui();ah(w,i,v.layoutBox,x),KC(y,w)||(f=!0),g.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:h,layoutDelta:c,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function cO(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 uO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dO(e){e.clearSnapshot()}function Hy(e){e.clearMeasurements()}function hO(e){e.isLayoutDirty=!0,e.updateLayout()}function Fy(e){e.isLayoutDirty=!1}function fO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function mO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $y(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pO(e){e.resolveTargetDelta()}function gO(e){e.calcProjection()}function _O(e){e.resetSkewAndRotation()}function bO(e){e.removeLeadSnapshot()}function Vy(e,t,i){e.translate=At(t.translate,0,i),e.scale=At(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function qy(e,t,i,s){e.min=At(t.min,i.min,s),e.max=At(t.max,i.max,s)}function vO(e,t,i,s){qy(e.x,t.x,i.x,s),qy(e.y,t.y,i.y,s)}function xO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const yO={duration:.45,ease:[.4,0,.1,1]},Ky=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gy=Ky("applewebkit/")&&!Ky("chrome/")?Math.round:Pn;function Wy(e){e.min=Gy(e.min),e.max=Gy(e.max)}function SO(e){Wy(e.x),Wy(e.y)}function ZC(e,t,i){return e==="position"||e==="preserve-aspect"&&!$D(By(t),By(i),.2)}function wO(e){return e!==e.root&&e.scroll?.wasRoot}const EO=XC({attachResizeListener:(e,t)=>Bc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ap={current:void 0},QC=XC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ap.current){const e=new EO({});e.mount(window),e.setOptions({layoutScroll:!0}),ap.current=e}return ap.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),JC=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function CO(e=!0){const t=E.useContext(Y0);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:a}=t,l=E.useId();E.useEffect(()=>{if(e)return a(l)},[e]);const c=E.useCallback(()=>e&&s&&s(l),[l,s,e]);return!i&&s?[!1,c]:[!0]}const ek=E.createContext({strict:!1}),Yy={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 Xy=!1;function kO(){if(Xy)return;const e={};for(const t in Yy)e[t]={isEnabled:i=>Yy[t].some(s=>!!i[s])};AC(e),Xy=!0}function tk(){return kO(),pD()}function NO(e){const t=tk();for(const i in e)t[i]={...t[i],...e[i]};AC(t)}const TO=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 oh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||TO.has(e)}let ik=e=>!oh(e);function AO(e){typeof e=="function"&&(ik=t=>t.startsWith("on")?!oh(t):e(t))}try{AO(require("@emotion/is-prop-valid").default)}catch{}function MO(e,t,i){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||Ai(e[a])||(ik(a)||i===!0&&oh(a)||!t&&!oh(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const Rh=E.createContext({});function RO(e,t){if(Mh(e)){const{initial:i,animate:s}=e;return{initial:i===!1||Lc(i)?i:void 0,animate:Lc(s)?s:void 0}}return e.inherit!==!1?t:{}}function DO(e){const{initial:t,animate:i}=RO(e,E.useContext(Rh));return E.useMemo(()=>({initial:t,animate:i}),[Zy(t),Zy(i)])}function Zy(e){return Array.isArray(e)?e.join(" "):e}const x_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nk(e,t,i){for(const s in t)!Ai(t[s])&&!BC(s,i)&&(e[s]=t[s])}function OO({transformTemplate:e},t){return E.useMemo(()=>{const i=x_();return b_(i,t,e),Object.assign({},i.vars,i.style)},[t])}function jO(e,t){const i=e.style||{},s={};return nk(s,i,e),Object.assign(s,OO(e,t)),s}function LO(e,t){const i={},s=jO(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 sk=()=>({...x_(),attrs:{}});function BO(e,t,i,s){const a=E.useMemo(()=>{const l=sk();return zC(l,t,PC(s),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};nk(l,e.style,e),a.style={...l,...a.style}}return a}const zO=["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 y_(e){return typeof e!="string"||e.includes("-")?!1:!!(zO.indexOf(e)>-1||/[A-Z]/u.test(e))}function IO(e,t,i,{latestValues:s},a,l=!1,c){const m=(c??y_(e)?BO:LO)(t,s,a,e),f=MO(t,typeof e=="string",l),g=e!==E.Fragment?{...f,...m,ref:i}:{},{children:_}=t,v=E.useMemo(()=>Ai(_)?_.get():_,[_]);return E.createElement(e,{...g,children:v})}function PO({scrapeMotionValuesFromProps:e,createRenderState:t},i,s,a){return{latestValues:UO(i,s,a,e),renderState:t()}}function UO(e,t,i,s){const a={},l=s(e,{});for(const v in l)a[v]=$d(l[v]);let{initial:c,animate:h}=e;const m=Mh(e),f=NC(e);t&&f&&!m&&e.inherit!==!1&&(c===void 0&&(c=t.initial),h===void 0&&(h=t.animate));let g=i?i.initial===!1:!1;g=g||c===!1;const _=g?h:c;if(_&&typeof _!="boolean"&&!Ah(_)){const v=Array.isArray(_)?_:[_];for(let x=0;x<v.length;x++){const y=u_(e,v[x]);if(y){const{transitionEnd:w,transition:C,...N}=y;for(const T in N){let A=N[T];if(Array.isArray(A)){const M=g?A.length-1:0;A=A[M]}A!==null&&(a[T]=A)}for(const T in w)a[T]=w[T]}}}return a}const rk=e=>(t,i)=>{const s=E.useContext(Rh),a=E.useContext(Y0),l=()=>PO(e,t,s,a);return i?l():z6(l)},HO=rk({scrapeMotionValuesFromProps:v_,createRenderState:x_}),FO=rk({scrapeMotionValuesFromProps:UC,createRenderState:sk}),$O=Symbol.for("motionComponentSymbol");function VO(e,t,i){const s=E.useRef(i);E.useInsertionEffect(()=>{s.current=i});const a=E.useRef(null);return E.useCallback(l=>{l&&e.onMount?.(l);const c=s.current;if(typeof c=="function")if(l){const h=c(l);typeof h=="function"&&(a.current=h)}else a.current?(a.current(),a.current=null):c(l);else c&&(c.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const ak=E.createContext({});function Uo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function qO(e,t,i,s,a,l){const{visualElement:c}=E.useContext(Rh),h=E.useContext(ek),m=E.useContext(Y0),f=E.useContext(JC),g=f.reducedMotion,_=f.skipAnimations,v=E.useRef(null),x=E.useRef(!1);s=s||h.renderer,!v.current&&s&&(v.current=s(e,{visualState:t,parent:c,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:g,skipAnimations:_,isSVG:l}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const y=v.current,w=E.useContext(ak);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&KO(v.current,i,a,w);const C=E.useRef(!1);E.useInsertionEffect(()=>{y&&C.current&&y.update(i,m)});const N=i[mC],T=E.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return P6(()=>{x.current=!0,y&&(C.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 KO(e,t,i,s){const{layoutId:a,layout:l,drag:c,dragConstraints:h,layoutScroll:m,layoutRoot:f,layoutAnchor:g,layoutCrossfade:_}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:ok(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||h&&Uo(h),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:s,crossfade:_,layoutScroll:m,layoutRoot:f,layoutAnchor:g})}function ok(e){if(e)return e.options.allowProjection!==!1?e.projection:ok(e.parent)}function op(e,{forwardMotionProps:t=!1,type:i}={},s,a){s&&NO(s);const l=i?i==="svg":y_(e),c=l?FO:HO;function h(f,g){let _;const v={...E.useContext(JC),...f,layoutId:GO(f)},{isStatic:x}=v,y=DO(f),w=c(f,x);if(!x&&typeof window<"u"){WO();const C=YO(v);_=C.MeasureLayout,y.visualElement=qO(e,w,v,a,C.ProjectionNode,l)}return u.jsxs(Rh.Provider,{value:y,children:[_&&y.visualElement?u.jsx(_,{visualElement:y.visualElement,...v}):null,IO(e,f,VO(w,y.visualElement,g),w,x,t,l)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=E.forwardRef(h);return m[$O]=e,m}function GO({layoutId:e}){const t=E.useContext(kE).id;return t&&e!==void 0?t+"-"+e:e}function WO(e,t){E.useContext(ek).strict}function YO(e){const t=tk(),{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 XO(e,t){if(typeof Proxy>"u")return op;const i=new Map,s=(l,c)=>op(l,c,e,t),a=(l,c)=>s(l,c);return new Proxy(a,{get:(l,c)=>c==="create"?s:(i.has(c)||i.set(c,op(c,void 0,e,t)),i.get(c))})}const ZO=(e,t)=>t.isSVG??y_(e)?new DD(t):new kD(t,{allowProjection:e!==E.Fragment});class QO extends Qr{constructor(t){super(t),t.animationState||(t.animationState=zD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ah(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 JO=0;class ej extends Qr{constructor(){super(...arguments),this.id=JO++,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:l,custom:c}=this.node.getProps();if(typeof l=="string"){const h=Ba(this.node,l,c);if(h){const{transition:m,transitionEnd:f,...g}=h;for(const _ in g)this.node.getValue(_)?.jump(g[_])}}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 tj={animation:{Feature:QO},exit:{Feature:ej}};function Zc(e){return{point:{x:e.pageX,y:e.pageY}}}const ij=e=>t=>m_(t)&&e(t,Zc(t));function Tc(e,t,i,s){return Bc(e,t,ij(i),s)}const lk=({current:e})=>e?e.ownerDocument.defaultView:null,Qy=(e,t)=>Math.abs(e-t);function nj(e,t){const i=Qy(e.x,t.x),s=Qy(e.y,t.y);return Math.sqrt(i**2+s**2)}const Jy=new Set(["auto","scroll"]);class ck{constructor(t,i,{transformPagePoint:s,contextWindow:a=window,dragSnapToOrigin:l=!1,distanceThreshold:c=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=Ed(this.lastRawMoveEventInfo,this.transformPagePoint));const x=lp(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=nj(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:C}=x,{timestamp:N}=Ni;this.history.push({...C,timestamp:N});const{onStart:T,onMove:A}=this.handlers;y||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Ed(y,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:C,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=lp(x.type==="pointercancel"?this.lastMoveEventInfo:Ed(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,T),C&&C(x,T)},!m_(t))return;this.dragSnapToOrigin=l,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=c,this.contextWindow=a||window;const m=Zc(t),f=Ed(m,this.transformPagePoint),{point:g}=f,{timestamp:_}=Ni;this.history=[{...g,timestamp:_}];const{onSessionStart:v}=i;v&&v(t,lp(f,this.history)),this.removeListeners=Wc(Tc(this.contextWindow,"pointermove",this.handlePointerMove),Tc(this.contextWindow,"pointerup",this.handlePointerUp),Tc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let i=t.parentElement;for(;i;){const s=getComputedStyle(i);(Jy.has(s.overflowX)||Jy.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},l={x:a.x-i.x,y:a.y-i.y};l.x===0&&l.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,a),wt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Wr(this.updatePoint)}}function Ed(e,t){return t?{point:t(e.point)}:e}function eS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lp({point:e},t){return{point:e,delta:eS(e,uk(t)),offset:eS(e,sj(t)),velocity:rj(t,.1)}}function sj(e){return e[0]}function uk(e){return e[e.length-1]}function rj(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,s=null;const a=uk(e);for(;i>=0&&(s=e[i],!(a.timestamp-s.timestamp>yn(t)));)i--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&a.timestamp-s.timestamp>yn(t)*2&&(s=e[1]);const l=zn(a.timestamp-s.timestamp);if(l===0)return{x:0,y:0};const c={x:(a.x-s.x)/l,y:(a.y-s.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function aj(e,{min:t,max:i},s){return t!==void 0&&e<t?e=s?At(t,e,s.min):Math.max(e,t):i!==void 0&&e>i&&(e=s?At(i,e,s.max):Math.min(e,i)),e}function tS(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 oj(e,{top:t,left:i,bottom:s,right:a}){return{x:tS(e.x,i,a),y:tS(e.y,t,s)}}function iS(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 lj(e,t){return{x:iS(e.x,t.x),y:iS(e.y,t.y)}}function cj(e,t){let i=.5;const s=qi(e),a=qi(t);return a>s?i=Oc(t.min,t.max-s,e.min):s>a&&(i=Oc(e.min,e.max-a,t.min)),_s(0,1,i)}function uj(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 $g=.35;function dj(e=$g){return e===!1?e=0:e===!0&&(e=$g),{x:nS(e,"left","right"),y:nS(e,"top","bottom")}}function nS(e,t,i){return{min:sS(e,t),max:sS(e,i)}}function sS(e,t){return typeof e=="number"?e:e[t]||0}const hj=new WeakMap;class fj{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=ui(),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 l=_=>{i&&this.snapToCursor(Zc(_).point),this.stopAnimation()},c=(_,v)=>{const{drag:x,dragPropagation:y,onDragStart:w}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=q8(x),!this.openDragLock))return;this.latestPointerEvent=_,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),ds(N=>{let T=this.getAxisMotionValue(N).get()||0;if(ms.test(T)){const{projection:A}=this.visualElement;if(A&&A.layout){const M=A.layout.layoutBox[N];M&&(T=qi(M)*(parseFloat(T)/100))}}this.originPoint[N]=T}),w&&wt.update(()=>w(_,v),!1,!0),jg(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},h=(_,v)=>{this.latestPointerEvent=_,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:w,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=v;if(y&&this.currentDirection===null){this.currentDirection=pj(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),C&&wt.update(()=>C(_,v),!1,!0)},m=(_,v)=>{this.latestPointerEvent=_,this.latestPanInfo=v,this.stop(_,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:_}=this.getProps();(_||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new ck(t,{onSessionStart:l,onStart:c,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:s,contextWindow:lk(this.visualElement),element:this.visualElement.current})}stop(t,i){const s=t||this.latestPointerEvent,a=i||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!a||!s)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:h}=this.getProps();h&&wt.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||!Cd(t,a,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(c=aj(c,this.constraints[t],this.elastic[t])),l.set(c)}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&&Uo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=oj(s.layoutBox,t):this.constraints=!1,this.elastic=dj(i),a!==this.constraints&&!Uo(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&ds(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=uj(s.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!Uo(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const l=xD(s,a.root,this.visualElement.getTransformPagePoint());let c=lj(a.layout.layoutBox,l);if(i){const h=i(_D(c));this.hasMutatedConstraints=!!h,h&&(c=RC(h))}return c}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:a,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},f=ds(g=>{if(!Cd(g,i,this.currentDirection))return;let _=m&&m[g]||{};(c===!0||c===g)&&(_={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,y={type:"inertia",velocity:s?t[g]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...l,..._};return this.startAxisValueAnimation(g,y)});return Promise.all(f).then(h)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return jg(this.visualElement,t),s.start(c_(t,s,0,i,this.visualElement,!1))}stopAnimation(){ds(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){ds(i=>{const{drag:s}=this.getProps();if(!Cd(i,s,this.currentDirection))return;const{projection:a}=this.visualElement,l=this.getAxisMotionValue(i);if(a&&a.layout){const{min:c,max:h}=a.layout.layoutBox[i],m=l.get()||0;l.set(t[i]-At(c,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!Uo(i)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ds(c=>{const h=this.getAxisMotionValue(c);if(h&&this.constraints!==!1){const m=h.get();a[c]=cj({min:m,max:m},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),ds(c=>{if(!Cd(c,t,null))return;const h=this.getAxisMotionValue(c),{min:m,max:f}=this.constraints[c];h.set(At(m,f,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hj.set(this.visualElement,this);const t=this.visualElement.current,i=Tc(t,"pointerdown",f=>{const{drag:g,dragListener:_=!0}=this.getProps(),v=f.target,x=v!==t&&Z8(v);g&&_&&!x&&this.start(f)});let s;const a=()=>{const{dragConstraints:f}=this.getProps();Uo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),s||(s=mj(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",a);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),wt.read(a);const h=Bc(window,"resize",()=>this.scalePositionWithinConstraints()),m=l.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:g})=>{this.isDragging&&g&&(ds(_=>{const v=this.getAxisMotionValue(_);v&&(this.originPoint[_]+=f[_].translate,v.set(v.get()+f[_].translate))}),this.visualElement.render())}));return()=>{h(),i(),c(),m&&m(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:a=!1,dragConstraints:l=!1,dragElastic:c=$g,dragMomentum:h=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:h}}}function rS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function mj(e,t,i){const s=my(e,rS(i)),a=my(t,rS(i));return()=>{s(),a()}}function Cd(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function pj(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class gj extends Qr{constructor(t){super(t),this.removeGroupControls=Pn,this.removeListeners=Pn,this.controls=new fj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pn}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 cp=e=>(t,i)=>{e&&wt.update(()=>e(t,i),!1,!0)};class _j extends Qr{constructor(){super(...arguments),this.removePointerDownListener=Pn}onPointerDown(t){this.session=new ck(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:cp(t),onStart:cp(i),onMove:cp(s),onEnd:(l,c)=>{delete this.session,a&&wt.postRender(()=>a(l,c))}}}mount(){this.removePointerDownListener=Tc(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 up=!1;class bj extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s,layoutId:a}=this.props,{projection:l}=t;l&&(i.group&&i.group.add(l),s&&s.register&&a&&s.register(l),up&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:s,drag:a,isPresent:l}=this.props,{projection:c}=s;return c&&(c.isPresent=l,t.layoutDependency!==i&&c.setOptions({...c.options,layoutDependency:i}),up=!0,a||t.layoutDependency!==i||i===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||wt.postRender(()=>{const h=c.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(),f_.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:a}=t;up=!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 dk(e){const[t,i]=CO(),s=E.useContext(kE);return u.jsx(bj,{...e,layoutGroup:s,switchLayoutGroup:E.useContext(ak),isPresent:t,safeToRemove:i})}const vj={pan:{Feature:_j},drag:{Feature:gj,ProjectionNode:QC,MeasureLayout:dk}};function aS(e,t,i){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",i==="Start");const a="onHover"+i,l=s[a];l&&wt.postRender(()=>l(t,Zc(t)))}class xj extends Qr{mount(){const{current:t}=this.node;t&&(this.unmount=G8(t,(i,s)=>(aS(this.node,s,"Start"),a=>aS(this.node,a,"End"))))}unmount(){}}class yj extends Qr{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=Wc(Bc(this.node.current,"focus",()=>this.onFocus()),Bc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function oS(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),l=s[a];l&&wt.postRender(()=>l(t,Zc(t)))}class Sj extends Qr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=J8(t,(a,l)=>(oS(this.node,l,"Start"),(c,{success:h})=>oS(this.node,c,h?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:s?.tap===!1})}unmount(){}}const Vg=new WeakMap,dp=new WeakMap,wj=e=>{const t=Vg.get(e.target);t&&t(e)},Ej=e=>{e.forEach(wj)};function Cj({root:e,...t}){const i=e||document;dp.has(i)||dp.set(i,{});const s=dp.get(i),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver(Ej,{root:e,...t})),s[a]}function kj(e,t,i){const s=Cj(t);return Vg.set(e,i),s.observe(e),()=>{Vg.delete(e),s.unobserve(e)}}const Nj={some:0,all:1};class Tj extends Qr{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:l}=t,c={root:i?i.current:void 0,rootMargin:s,threshold:typeof a=="number"?a:Nj[a]},h=m=>{const{isIntersecting:f}=m;if(this.isInView===f||(this.isInView=f,l&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:g,onViewportLeave:_}=this.node.getProps(),v=f?g:_;v&&v(m)};this.stopObserver=kj(this.node.current,c,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(Aj(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Aj({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const Mj={inView:{Feature:Tj},tap:{Feature:Sj},focus:{Feature:yj},hover:{Feature:xj}},Rj={layout:{ProjectionNode:QC,MeasureLayout:dk}},Dj={...tj,...Mj,...vj,...Rj},hp=XO(Dj,ZO),Ke=({label:e,children:t,variant:i="primary",size:s="medium",icon:a,onClick:l,removable:c=!1,className:h,maxWidth:m,appearance:f,onRemove:g,isLoading:_=!1})=>{const v=Oj(i),x=f??(i==="outline"?"outline":"solid"),y=e??t,w=!!l,C={primary:{solid:"bg-primary text-primary-foreground border border-transparent",outline:"border-2 border-primary/60 text-foreground",subtle:"bg-primary/15 text-foreground border border-transparent"},secondary:{solid:"bg-secondary text-secondary-foreground border border-transparent",outline:"border-2 border-border text-foreground bg-card",subtle:"bg-muted text-foreground border border-border"},success:{solid:"bg-emerald-600 text-white border border-transparent",outline:"border-2 border-emerald-600 text-emerald-700 dark:text-emerald-400",subtle:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border border-transparent"},warning:{solid:"bg-amber-500 text-white border border-transparent",outline:"border-2 border-amber-500 text-amber-700 dark:text-amber-400",subtle:"bg-amber-500/15 text-amber-700 dark:text-amber-300 border border-transparent"},error:{solid:"bg-destructive text-destructive-foreground border border-transparent",outline:"border-2 border-destructive text-destructive dark:text-red-400",subtle:"bg-destructive/20 text-destructive dark:text-red-300 border border-transparent"}},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=M=>{M.stopPropagation(),l?.()},A=M=>{M.stopPropagation(),g?.()};return u.jsxs(hp.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:w?1.04:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:T,style:{maxWidth:m},className:de("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",C[v][x],N[s],w&&"cursor-pointer",h),children:[_?u.jsx(hp.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:u.jsx(Gi,{className:"size-3.5"})}):a&&u.jsx("span",{className:"flex-shrink-0",children:a}),u.jsx("span",{className:"min-w-0 truncate",children:y}),c&&u.jsx(hp.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:A,type:"button",children:u.jsx(Hn,{className:"size-3.5"})})]})};function Oj(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const jj=uE("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 dt({className:e,variant:t,...i}){return u.jsx("div",{className:de(jj({variant:t,className:e})),...i})}function Qs({className:e,...t}){return u.jsx("div",{className:de("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function Js({className:e,...t}){return u.jsx("div",{className:de("grid gap-1.5 p-4",e),...t})}function er({className:e,...t}){return u.jsx("h3",{className:de("text-sm font-semibold tracking-tight",e),...t})}function Jr({className:e,...t}){return u.jsx("p",{className:de("text-sm text-muted-foreground",e),...t})}function tr({className:e,...t}){return u.jsx("div",{className:de("p-4 pt-0",e),...t})}const lS=100;function Lj(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),a=E.useRef(new Set);E.useEffect(()=>{const c=new EventSource("/api/agent/tool-calls/stream");return c.addEventListener("open",()=>s(!0)),c.addEventListener("error",()=>s(!1)),c.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 g=[...f,m];return g.length>lS&&g.splice(0,g.length-lS),g})}catch{}}),()=>{c.close()}},[]);const l=[...e].reverse();return u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ja,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Live MCP Tool Calls"}),u.jsx(Ke,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ke,{variant:"outline",size:"small",icon:u.jsx("span",{className:de("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),u.jsx(Jr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),u.jsx(tr,{className:"p-0",children:l.length?u.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:l.map(c=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:c.tool}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[u.jsxs("span",{children:[c.durationMs," ms"]}),u.jsx(Ke,{variant:c.status==="ok"?"success":"error",appearance:"outline",size:"small",children:c.status})]})]}),c.args?u.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:c.args}):null,c.error?u.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:c.error}):null,u.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(c.startedAt).toLocaleTimeString()})]},c.id))}):u.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 Bj({agent:e}){return u.jsxs(u.Fragment,{children:[u.jsx(Lj,{}),u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ch,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Recent Projects"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:e.projects.length})]}),u.jsx(Jr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),u.jsx(tr,{className:"p-0",children:e.projects.length?u.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>u.jsxs("li",{className:de("flex items-start justify-between gap-3 px-3 py-2",t.current&&"bg-primary/5"),children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:t.path}),t.current?u.jsx(Ke,{variant:"outline",size:"small",children:"current"}):null]}),t.lastSessionFirstPrompt?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:t.lastSessionFirstPrompt}):null]}),u.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[t.mcpServerCount?u.jsxs("div",{children:[t.mcpServerCount," mcp"]}):null,t.lastSessionModified?u.jsx("div",{children:zj(t.lastSessionModified)}):null]})]},t.path))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function zj(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function nl({className:e}){return u.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.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 Qc({className:e}){return u.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:u.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 Ij({className:e}){return u.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.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 Pj({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 u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(K2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Project Memory"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:a})]}),u.jsx(Jr,{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.")})]}),u.jsxs(tr,{className:"space-y-2 p-3",children:[i?u.jsx(cS,{title:i,preview:s,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(l=>u.jsx(cS,{title:l.name,subtitle:`${l.size} B`,preview:l.preview,defaultOpen:l.name==="MEMORY.md"},l.path)):i?null:u.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function cS({title:e,subtitle:t,preview:i,defaultOpen:s=!1}){const[a,l]=E.useState(s);return u.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[u.jsxs("button",{type:"button",onClick:()=>l(!a),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[u.jsx(Xr,{className:de("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),u.jsx("span",{children:e}),t?u.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&i?u.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 Uj=[{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%)"}],Hj=({size:e=20,color:t="#8f8f8f"})=>u.jsx("div",{style:{width:e,height:e},children:u.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:Uj.map(i=>u.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...i}},i.transform))})}),Fj=[{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"}],$j={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"},Vj={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]"}},kd=({size:e="medium",type:t="primary",variant:i="styled",shape:s="square",svgOnly:a=!1,children:l,prefix:c,suffix:h,shadow:m=!1,loading:f=!1,disabled:g=!1,fullWidth:_=!1,className:v,...x})=>u.jsxs("button",{disabled:g,tabIndex:0,className:Dc("flex items-center justify-center gap-0.5 duration-150",Fj[+a][e],g||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":$j[t],Vj[s][e],m&&"shadow-border-small border-none",_&&"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?u.jsx(Hj,{size:e==="large"?24:16}):c,u.jsx("span",{className:Dc("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&i!=="unstyled"&&"px-1.5"),children:l}),!f&&h]}),qj=({className:e})=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:u.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"})}),Kj=()=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:u.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 fp=null,Gj=0;const ni={toasts:[],listeners:new Set,add(e,t,i,s,a,l){const c=Gj++,h={id:c,text:e,preserve:i,action:s,onAction:a,onUndoAction:l,type:t};if(!h.preserve){h.remaining=3e3,h.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(f=>f.id!==c),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){ni.toasts=ni.toasts.filter(t=>t.id!==e),ni.notify()},subscribe(e){return ni.listeners.add(e),()=>{ni.listeners.delete(e)}},notify(){ni.listeners.forEach(e=>{e()})}},Wj=()=>{const[e,t]=E.useState([]),[i,s]=E.useState([]),[a,l]=E.useState(!1),c=y=>w=>{w&&y.measuredHeight==null&&(y.measuredHeight=w.getBoundingClientRect().height,ni.notify())};E.useEffect(()=>(t([...ni.toasts]),ni.subscribe(()=>{t([...ni.toasts])})),[]),E.useEffect(()=>{const y=e.filter(w=>!i.includes(w.id)).map(w=>w.id);y.length>0&&requestAnimationFrame(()=>{s(w=>[...w,...y])})},[i,e]);const m=Math.max(0,e.length-3),f=(y,w)=>{if(y===w-1)return"none";const C=w-1-y;let N=e[w-1]?.measuredHeight||63;for(let M=w-1;M>y;M--)a?N+=(e[M-1]?.measuredHeight||63)+10:N+=20;const T=-C,A=a?1:1-.05*C;return`translate3d(0, calc(100% - ${N}px), ${T}px) scale(${A})`},g=()=>{l(!0),ni.toasts.forEach(y=>{y.pause?.()})},_=()=>{l(!1),ni.toasts.forEach(y=>{y.resume?.()})},x=e.slice(m).reduce((y,w)=>y+(w.measuredHeight??63),0);return u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:x},children:u.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:x},onMouseEnter:g,onMouseLeave:_,children:e.map((y,w)=>{const C=w>=m;return u.jsx("div",{ref:c(y),className:Dc("absolute bottom-0 right-0 h-fit rounded-xl p-4 leading-[21px] shadow-menu",{message:"bg-geist-background text-gray-1000",success:"bg-blue-700 text-contrast-fg",warning:"bg-amber-800 text-gray-1000 dark:text-gray-100",error:"bg-red-800 text-contrast-fg"}[y.type],C?"opacity-100":"opacity-0",w<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:i.includes(y.id)?f(w,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:u.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[u.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[u.jsx("span",{children:y.text}),!y.action&&u.jsxs("div",{className:"flex gap-1",children:[y.onUndoAction&&u.jsx(kd,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{y.onUndoAction?.(),ni.remove(y.id)},children:u.jsx(Kj,{})}),u.jsx(kd,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ni.remove(y.id),children:u.jsx(qj,{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&&u.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[u.jsx(kd,{type:"tertiary",size:"small",onClick:()=>ni.remove(y.id),children:"Dismiss"}),u.jsx(kd,{type:"primary",size:"small",onClick:()=>{y.onAction?.(),ni.remove(y.id)},children:y.action})]})]})},y.id)})})})},Nd=()=>{if(fp)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),fp=$2.createRoot(e),fp.render(u.jsx(Wj,{}))},Ii=()=>({message:E.useCallback(({text:e,preserve:t,action:i,onAction:s,onUndoAction:a})=>{Nd(),ni.add(e,"message",t,i,s,a)},[]),success:E.useCallback(e=>{Nd(),ni.add(e,"success")},[]),warning:E.useCallback(e=>{Nd(),ni.add(e,"warning")},[]),error:E.useCallback(e=>{Nd(),ni.add(e,"error")},[])});function Yj({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,i=t>0?e.cacheReadInputTokens/t*100:0;return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(nl,{className:"size-3.5 text-amber-700"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),u.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),u.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:[u.jsx(Bi,{label:"Input",value:Ln(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:Ln(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:Ln(e.cacheReadInputTokens)}),u.jsx(Bi,{label:"Cache create",value:Ln(e.cacheCreationInputTokens)}),u.jsx(Bi,{label:"Lines +",value:String(e.linesAdded)}),u.jsx(Bi,{label:"Lines −",value:String(e.linesRemoved)}),u.jsx(Bi,{label:"Wall",value:dS(e.durationMs)}),u.jsx(Bi,{label:"API",value:dS(e.apiDurationMs)})]}),u.jsxs("div",{className:"border-t border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:"Cache read share of input"}),u.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,i).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?u.jsx(lh,{label:"5h block",window:e.fiveHour}):null,e.weekly?u.jsx(lh,{label:"This week",window:e.weekly}):null]}):null,e.models.length?u.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(s=>u.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[u.jsx("span",{className:"truncate",children:s.model}),u.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[Ln(s.inputTokens+s.outputTokens)," tok ·"," ",u.jsxs("span",{className:"text-emerald-700",children:["$",s.costUSD.toFixed(4)]})]})]},s.model))]}):null]})}function Xj({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 u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Qc,{className:"size-3.5 text-foreground"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · last session"})]}),e.timestamp?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),u.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:[u.jsx(Bi,{label:"Input",value:Ln(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:Ln(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:Ln(e.cachedInputTokens)}),u.jsx(Bi,{label:"Reasoning",value:Ln(e.reasoningOutputTokens)}),u.jsx(Bi,{label:"Total",value:Ln(e.totalTokens)}),u.jsx(Bi,{label:"Last turn",value:Ln(e.lastTotalTokens)}),u.jsx(Bi,{label:"Context",value:e.contextWindow?Ln(e.contextWindow):"n/a"}),u.jsx(Bi,{label:"Cost",value:"n/a"})]}),u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx(uS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?u.jsx(uS,{label:"Last turn context share",value:i,tone:"bg-sky-500"}):null]}),e.primary||e.secondary?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.primary?u.jsx(lh,{label:"5h window",window:e.primary}):null,e.secondary?u.jsx(lh,{label:"Weekly window",window:e.secondary}):null]}):null]})}function uS({label:e,value:t,tone:i}){const s=Math.min(100,Math.max(0,t));return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:e}),u.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:de("h-full",i),style:{width:`${s.toFixed(2)}%`}})})]})}function lh({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 u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:de("h-full",a),style:{width:`${i.toFixed(2)}%`}})}),s?u.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",s]}):null]})}function Bi({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),u.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function Ln(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function dS(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 Zj(e=1e4){const[t,i]=E.useState(null),[s,a]=E.useState(null);return E.useEffect(()=>{let l=!0;const c=()=>{aM().then(m=>{l&&(i(m),a(null))}).catch(m=>{l&&a(m instanceof Error?m.message:String(m))})};c();const h=window.setInterval(c,e);return()=>{l=!1,window.clearInterval(h)}},[e]),{usage:t,error:s}}const Qj={"claude-code":{label:"Claude Code",icon:u.jsx(nl,{})},codex:{label:"Codex",icon:u.jsx(Qc,{})}};function Jj({agent:e,agentId:t,isDetected:i}){const{usage:s,error:a}=Zj(),l=Qj[t],c=t==="codex";return u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Q2,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:c?"Token Usage & Rate Limits":"Token & Cost Usage"}),u.jsx(Ke,{variant:"outline",size:"small",icon:l.icon,children:l.label}),i?u.jsx(Ke,{variant:"outline",size:"small",children:"active session"}):u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"}),c?null:u.jsx(e7,{className:"ml-auto"})]}),u.jsxs(Jr,{className:"truncate text-xs",children:[c?u.jsxs(u.Fragment,{children:["Session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):u.jsxs(u.Fragment,{children:["Last-session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",u.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),u.jsxs(tr,{className:"p-3",children:[a?u.jsx("p",{className:"text-xs text-destructive",children:a}):null,c?s?.codex?u.jsx(Xj,{usage:s.codex}):a?null:u.jsx(hS,{agent:"Codex CLI"}):s?.claude?u.jsx(Yj,{usage:s.claude}):a?null:u.jsx(hS,{agent:"Claude Code"})]})]})}function e7({className:e}){const[t,i]=E.useState(!0),[s,a]=E.useState(!0),[l,c]=E.useState(!1),h=Ii();E.useEffect(()=>{let f=!0;return oM().then(g=>f&&i(g.coAuthorWithClaude)).catch(()=>{}).finally(()=>f&&a(!1)),()=>{f=!1}},[]);const m=async()=>{const f=!t;c(!0),i(f);try{const g=await lM({coAuthorWithClaude:f});i(g.coAuthorWithClaude),h.success(g.coAuthorWithClaude?"Claude co-author trailer enabled for commits":"Claude co-author trailer disabled for commits")}catch(g){i(!f),h.error(g instanceof Error?g.message:"Failed to update setting")}finally{c(!1)}};return u.jsxs(he,{type:"button",variant:t?"default":"outline",size:"sm",onClick:m,disabled:s||l,"aria-pressed":t,title:t?"Claude will be added as commit co-author. Click to disable.":"Co-author trailer disabled. Click to enable.",className:de("gap-1.5",e),children:[u.jsx(nl,{className:"size-3.5"}),"Co-author"]})}function hS({agent:e}){return u.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function t7({agent:e,agentId:t}){return u.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(K0,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"Skills"})]}),u.jsx(Ke,{variant:"outline",size:"small",children:e.skills.length})]}),u.jsx(Jr,{className:"text-xs",children:t==="codex"?"User, project, and system skills discovered for Codex.":"User, project, and plugin skills discovered for the active agent."})]}),u.jsx(tr,{className:"p-0",children:e.skills.length?u.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(i=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.name}),u.jsx(Ke,{variant:"outline",size:"small",children:i.scope})]}),i.description?u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:i.description}):null]},`${i.scope}:${i.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),u.jsx(i7,{agent:e,agentId:t})]})}function i7({agent:e,agentId:t}){const[i,s]=E.useState([]),[a,l]=E.useState(!1),c=E.useCallback(async()=>{l(!0);try{s(await rM(t))}catch{s([])}finally{l(!1)}},[t]);E.useEffect(()=>{c()},[c]);const h=E.useMemo(()=>{const f={};for(const g of i)f[g.name]=g.state;return f},[i]),m=E.useMemo(()=>{const f=new Set(e.mcpServers.map(_=>_.name)),g=i.filter(_=>!f.has(_.name)).map(_=>({name:_.name,scope:"user",synthetic:!0}));return[...e.mcpServers,...g]},[e.mcpServers,i]);return u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(tE,{className:"size-4 text-muted-foreground"}),u.jsx(er,{children:"MCP Servers"})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ke,{variant:"outline",size:"small",children:m.length}),u.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-6",onClick:()=>{c()},disabled:a,title:"Re-check authentication status","aria-label":"Re-check authentication status",children:u.jsx(kh,{className:a?"animate-spin":void 0})})]})]}),u.jsxs(Jr,{className:"text-xs",children:["From"," ",u.jsx("code",{className:"font-mono",children:t==="codex"?"~/.codex/config.toml":"~/.claude.json"}),t==="codex"?"":" + claude.ai connectors",". Status via"," ",u.jsxs("code",{className:"font-mono",children:[t==="codex"?"codex":"claude"," mcp list"]})," ","(fresh health check)."]})]}),u.jsx(tr,{className:"p-0",children:m.length?u.jsx("ul",{className:"divide-y divide-border",children:m.map(f=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:f.name}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[u.jsx(s7,{state:h[f.name],loading:a}),u.jsx(Ke,{variant:"outline",size:"small",children:f.synthetic?"connector":f.scope})]})]}),u.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:f.synthetic?"claude.ai managed connector":r7(f)})]},`${f.scope}:${f.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})}const n7={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 s7({state:e,loading:t}){if(!e)return t?u.jsx(Gi,{className:"size-3 animate-spin text-muted-foreground"}):null;const i=e==="unknown"?void 0:n7[e];return i?u.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx("span",{className:de("size-1.5 shrink-0 rounded-full",i.dot),"aria-hidden":!0}),i.label]}):null}function r7(e){return e.command?[e.command,...e.args??[]].join(" "):e.url??e.type??"-"}const a7=[{id:"claude-code",label:"Claude Code",icon:u.jsx(nl,{className:"size-4"})},{id:"codex",label:"Codex",icon:u.jsx(Qc,{className:"size-4"})}],o7=[{id:"overview",label:"Overview",icon:u.jsx(Q2,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:u.jsx(K2,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:u.jsx(tE,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:u.jsx(ja,{className:"size-3.5"})}];function l7(){const[e,t]=E.useState(null),[i,s]=E.useState(null),[a,l]=E.useState("claude-code"),[c,h]=E.useState("overview");if(E.useEffect(()=>{let f=!0;return sM().then(g=>{f&&(t(g),g.detected.name==="codex"&&l("codex"))}).catch(g=>{f&&s(g instanceof Error?g.message:String(g))}),()=>{f=!1}},[]),i)return u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",i]})});if(!e)return u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsx(dt,{variant:"muted",children:"Loading agent info…"})});const m=e.agents?.[a]??e;return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:a7.map(f=>{const g=a===f.id,_=e.detected.name===f.id;return u.jsxs("button",{type:"button",onClick:()=>l(f.id),className:de("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",g?"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,_?u.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},f.id)})}),u.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:o7.map(f=>u.jsxs("button",{type:"button",onClick:()=>h(f.id),className:de("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",c===f.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[f.icon,f.label,c===f.id?u.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},f.id))}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[c==="overview"?u.jsx(Jj,{agent:m,agentId:a,isDetected:e.detected.name===a}):null,c==="memory"?u.jsx(Pj,{agent:m,agentId:a}):null,c==="tools"?u.jsx(t7,{agent:m,agentId:a}):null,c==="activity"?u.jsx(Bj,{agent:m,agentId:a}):null]})]})}let fS=0;const mS=()=>(fS+=1,`t${Date.now()}-${fS}`);function c7(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),[a,l]=E.useState(null),[c,h]=E.useState(null),[m,f]=E.useState(null),[g,_]=E.useState([]),v=E.useRef(null),x=E.useRef(void 0);E.useEffect(()=>{cM().then(T=>{h(T.configured),f(T.provider)}).catch(()=>h(!1))},[]);const y=E.useCallback(async(T,A)=>{_(L=>L.filter(K=>K.requestId!==T));const M=x.current;if(M)try{await uM(M,T,A)}catch{}},[]),w=E.useCallback(()=>{v.current?.abort(),v.current=null,s(!1)},[]),C=E.useCallback(async T=>{const A=T.trim();if(!A||i)return;l(null);const M={id:mS(),role:"user",text:A,tools:[]},L=mS(),K={id:L,role:"assistant",text:"",tools:[]};t(H=>[...H,M,K]);const B=H=>t(P=>P.map(q=>q.id===L?H(q):q)),R=new AbortController;v.current=R,s(!0);try{await dM(A,x.current,H=>{switch(H.type){case"session":x.current=H.sessionId;break;case"text":B(P=>({...P,text:P.text+H.text}));break;case"tool_use":B(P=>({...P,tools:[...P.tools,{id:H.id,name:H.name,input:H.input,status:"running"}]}));break;case"tool_result":B(P=>({...P,tools:P.tools.map(q=>q.id===H.id?{...q,preview:H.preview,isError:H.isError,status:"done"}:q)}));break;case"approval_request":_(P=>[...P,{requestId:H.requestId,name:H.name,input:H.input}]);break;case"error":l(H.message);break;case"done":break}},R.signal)}catch(H){R.signal.aborted||l(H instanceof Error?H.message:String(H))}finally{v.current=null,s(!1)}},[i]),N=E.useCallback(()=>{w(),x.current=void 0,t([]),_([]),l(null)},[w]);return{turns:e,streaming:i,error:a,configured:c,provider:m,approvals:g,send:C,stop:w,clear:N,respond:y}}const hk=E.createContext(null);function u7({children:e}){const t=c7(),{streaming:i,send:s}=t,[a,l]=E.useState(!1),[c,h]=E.useState(""),[m,f]=E.useState(null),[g,_]=E.useState(0),v=E.useRef([]),x=E.useCallback(()=>_(A=>A+1),[]),y=E.useCallback(()=>f(null),[]),w=E.useCallback(A=>{l(!0),h(M=>M.trim()?`${M.replace(/\s*$/,"")} ${A} `:`${A} `),x()},[x]);E.useEffect(()=>{if(i)return;const A=v.current.shift();A&&s(A)},[i,s]);const C=E.useCallback(({prompt:A,source:M,mode:L="send"})=>(l(!0),f(M??null),L==="draft"?(h(A),x(),{queued:!1}):i?(v.current.push(A),{queued:!0}):(s(A),{queued:!1})),[i,s,x]),N=E.useCallback(()=>{v.current=[],f(null),t.clear()},[t]),T={...t,clear:N,open:a,setOpen:l,draft:c,setDraft:h,insertPath:w,activeSource:m,clearSource:y,focusNonce:g,sendToAgent:C};return u.jsx(hk.Provider,{value:T,children:e})}function Jc(){const e=E.useContext(hk);if(!e)throw new Error("useAgentDock must be used within an AgentProvider");return e}const S_="application/x-nomoreide-path";function fk(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function mk(e,t){e.setData(S_,t)}function pS(e){return e.types.includes(S_)}function d7(e){return e.getData(S_)||null}function pk(e){return{draggable:!0,onDragStart:t=>{mk(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const h7=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),f7=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),m7=new Set(["conf","config","ini","toml","yaml","yml"]),p7=new Set(["csv","json","sql","xml"]),g7=new Set(["md","mdx","rst","txt"]),_7=new Set(["gif","jpeg","jpg","png","svg","webp"]),b7=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),v7=new Set(["css","less","sass","scss"]);function x7(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return b7.has(t)||t.endsWith(".lock")?"lock":y7(t)?"test":f7.has(t)||m7.has(i)?"config":v7.has(i)?"style":_7.has(i)?"image":g7.has(i)?"document":p7.has(i)?"data":h7.has(i)?"code":"generic"}function y7(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function w_({path:e,className:t}){const i=x7(e),s=S7[i];return u.jsx(s,{"aria-label":`${i} file`,className:de("size-3.5 shrink-0",w7[i],t)})}const S7={code:SA,config:B4,data:Kr,document:NA,generic:Z2,image:KA,lock:QA,style:u4,test:MA},w7={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 E7(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function C7({onPick:e,onClose:t}){const[i,s]=E.useState(""),[a,l]=E.useState(null),[c,h]=E.useState(null),[m,f]=E.useState(!1),g=E.useRef(null),_=a?a.parent!==a.path:!1;return E.useEffect(()=>{function v(x){g.current&&!g.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),oE(i,{files:!0}).then(x=>v&&l(x)).catch(x=>v&&h(x instanceof Error?x.message:String(x))).finally(()=>v&&f(!1)),()=>{v=!1}},[i]),u.jsxs("div",{ref:g,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:[u.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[u.jsx(he,{"aria-label":"Parent folder",className:"size-7",disabled:!_,onClick:()=>a&&s(a.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(H0,{})}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?u.jsx(Gi,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?u.jsxs(he,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[u.jsx(lA,{})," This folder"]}):null,u.jsx(he,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Hn,{})})]}),u.jsx("div",{className:"max-h-64 overflow-auto p-1",children:c?u.jsx(dt,{variant:"destructive",className:"m-1",children:c}):a&&a.entries.length===0?u.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(v=>{const x=v.isDir?"":E7(v.name);return u.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?u.jsx(Fa,{className:"size-3.5 shrink-0 text-amber-600"}):u.jsx(w_,{path:v.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.name}),x?u.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:x}):null]},v.path)})})]})}const k7=/```options[^\n]*\n([\s\S]*?)```/g,N7=/```service[^\n]*\n([\s\S]*?)```/g,T7=/```(?:options|service)[^\n]*\n[\s\S]*$/;function A7(e){const t=[];let i=null,s=e.replace(k7,(a,l)=>{for(const c of l.split(`
15
- `)){const h=c.replace(/^[-*\d.)\s]+/,"").trim();h&&t.push(h)}return""});return s=s.replace(N7,(a,l)=>{const c=l.split(`
16
- `).map(h=>h.trim()).find(Boolean);return c&&(i=c),""}),s=s.replace(T7,""),{body:s.trim(),options:t,service:i}}function M7({options:e,disabled:t,onChoose:i}){return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(s=>u.jsx(he,{className:"h-7",disabled:t,onClick:()=>i(s),size:"sm",type:"button",variant:"outline",children:s},s))})}function R7({service:e,onStart:t,onOpen:i}){return u.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:[u.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Added ",u.jsx("span",{className:"font-medium text-foreground",children:e})]}),u.jsxs("div",{className:"ml-auto flex gap-1.5",children:[u.jsxs(he,{className:"h-7",onClick:()=>t(e),size:"sm",type:"button",children:[u.jsx(V0,{})," Start"]}),i?u.jsxs(he,{className:"h-7",onClick:()=>i(e),size:"sm",type:"button",variant:"outline",children:[u.jsx(F0,{})," Open"]}):null]})]})}function D7(e){return Math.min(e,Math.max(1,Math.ceil(e/22)))}function O7(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 l=requestAnimationFrame(()=>{const c=a.current,h=c.slice(0,s.current.length+D7(c.length-s.current.length));s.current=h,i(h)});return()=>cancelAnimationFrame(l)},[t,e]),t}function j7(){return u.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(Gi,{className:"size-3.5 animate-spin"}),u.jsx("span",{children:"Thinking…"})]})}function L7({onOpenAgentPage:e,onOpenService:t}){const{error:i,success:s}=Ii(),{turns:a,streaming:l,error:c,configured:h,provider:m,approvals:f,send:g,stop:_,clear:v,respond:x,open:y,setOpen:w,draft:C,setDraft:N,insertPath:T,activeSource:A,clearSource:M,focusNonce:L}=Jc(),[K,B]=E.useState(!1),[R,H]=E.useState(!1),[P,q]=E.useState(!1),J=E.useRef(null),F=E.useRef(null),ie=E.useRef(null);E.useEffect(()=>{y&&requestAnimationFrame(()=>F.current?.focus())},[y,L]),E.useEffect(()=>{if(!y)return;const $=se=>{ie.current?.contains(se.target)||w(!1)};return document.addEventListener("pointerdown",$),()=>document.removeEventListener("pointerdown",$)},[y,w]),E.useEffect(()=>{const $=fe=>{fe.dataTransfer&&pS(fe.dataTransfer)&&B(!0)},se=()=>{B(!1),H(!1)};return document.addEventListener("dragstart",$),document.addEventListener("dragend",se),document.addEventListener("drop",se),()=>{document.removeEventListener("dragstart",$),document.removeEventListener("dragend",se),document.removeEventListener("drop",se)}},[]);const V=E.useRef(!0);function O(){const $=J.current;$&&(V.current=$.scrollHeight-$.scrollTop-$.clientHeight<48)}E.useEffect(()=>{const $=J.current;$&&V.current&&($.scrollTop=$.scrollHeight)},[a,y]);async function Y(){const $=C;N(""),V.current=!0,await g($)}function X($){V.current=!0,g($)}async function j($){try{await Ki(`/api/services/${encodeURIComponent($)}/start`,{}),s(`Starting ${$}…`)}catch(se){i(se instanceof Error?se.message:`Could not start ${$}.`)}}function W($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),Y())}function D($){pS($.dataTransfer)&&($.preventDefault(),$.dataTransfer.dropEffect="copy",y||w(!0),H(!0))}function te($){$.currentTarget.contains($.relatedTarget)||H(!1)}function ue($){H(!1);const se=d7($.dataTransfer);se&&($.preventDefault(),T(se))}return u.jsx("div",{ref:ie,className:de("fixed inset-x-0 bottom-0 z-50 flex flex-col border-t border-border bg-card/95 shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.25)] backdrop-blur transition-[height] duration-200",y?"h-[50vh]":K?"h-12":"h-9",K&&!R&&"border-primary/60 bg-primary/5",R&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),onDragOver:D,onDragLeave:te,onDrop:ue,children:y?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-2 border-b border-border px-3",children:[u.jsx(gS,{provider:m,className:"size-4 text-primary"}),u.jsx("span",{className:"text-sm font-medium",children:m?.label??"Agent"}),A?u.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:[u.jsx(K0,{className:"size-3"}),u.jsx("span",{className:"max-w-40 truncate",children:A.label}),u.jsx("button",{"aria-label":"Clear source",className:"opacity-60 hover:opacity-100",onClick:M,type:"button",children:u.jsx(Hn,{className:"size-3"})})]}):null,l?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[u.jsx(Gi,{className:"size-3 animate-spin"})," thinking…"]}):null,u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e?u.jsx(he,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:u.jsx(b4,{})}):null,u.jsx(he,{"aria-label":"Clear conversation",className:"size-7",disabled:a.length===0,onClick:v,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:u.jsx(Kc,{})}),u.jsx(he,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>w(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:u.jsx(es,{})})]})]}),u.jsxs("div",{ref:J,className:"min-h-0 flex-1 space-y-3 overflow-auto px-3 py-3",onScroll:O,children:[a.length===0?u.jsx(B7,{configured:h,provider:m}):a.map(($,se)=>u.jsx(z7,{turn:$,streaming:l&&se===a.length-1,isLast:se===a.length-1,onChoose:X,onStartService:j,onOpenService:t},$.id)),c?u.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:[u.jsx(X4,{className:"mt-px size-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:c})]}):null]}),f.length>0?u.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($=>u.jsx(P7,{prompt:$,onRespond:x},$.requestId))}):null,u.jsxs("div",{className:de("relative shrink-0 border-t border-border p-2 transition-colors",K&&"bg-primary/5"),children:[P?u.jsx(C7,{onClose:()=>q(!1),onPick:$=>{q(!1),T($)}}):null,u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsx(he,{"aria-label":"Attach a file or folder",className:"size-9 shrink-0",disabled:h===!1,onClick:()=>q(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:P?"secondary":"outline",children:u.jsx(x4,{})}),u.jsx("textarea",{ref:F,className:"max-h-32 min-h-9 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",disabled:h===!1,onChange:$=>N($.target.value),onKeyDown:W,placeholder:h===!1?`${m?.label??"Agent"} (\`${m?.commandName??"agent"}\`) is not installed`:`Ask ${m?.label??"the agent"} anything about this project...`,rows:1,value:C}),l?u.jsxs(he,{onClick:_,size:"sm",type:"button",variant:"outline",children:[u.jsx(Nh,{})," Stop"]}):u.jsxs(he,{disabled:!C.trim()||h===!1,onClick:()=>{Y()},size:"sm",type:"button",children:["Send ",u.jsx(aA,{})]})]})]})]}):u.jsx("button",{className:de("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",K?"font-medium text-primary":"text-muted-foreground"),onClick:()=>w(!0),type:"button",children:K?u.jsxs(u.Fragment,{children:[u.jsx(fA,{className:"size-4 animate-bounce text-primary"}),u.jsx("span",{children:"Drop here to add it to your message"})]}):u.jsxs(u.Fragment,{children:[u.jsx(gS,{provider:m,className:"size-4 text-primary"}),l?u.jsxs("span",{className:"flex items-center gap-2 text-foreground",children:[u.jsx(Gi,{className:"size-3.5 animate-spin"})," ",m?.label??"Agent"," is thinking…"]}):u.jsxs("span",{children:["Ask ",m?.label??"the agent","..."]}),u.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function gS({provider:e,className:t}){return e?.id==="claude"?u.jsx(nl,{className:t}):e?.id==="codex"?u.jsx(Qc,{className:t}):u.jsx(K0,{className:t})}function B7({configured:e,provider:t}){return e===!1?u.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 ",u.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):u.jsx("div",{className:"text-xs text-muted-foreground",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".'})}function z7({turn:e,streaming:t,isLast:i,onChoose:s,onStartService:a,onOpenService:l}){const c=O7(e.text);if(e.role==="user")return u.jsx("div",{className:"flex justify-end",children:u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-sm bg-primary px-3 py-1.5 text-sm text-primary-foreground",children:e.text})});const{body:h,options:m,service:f}=A7(c);return u.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(g=>u.jsx(I7,{tool:g},g.id)),h?u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-bl-sm bg-muted px-3 py-1.5 text-sm",children:h}):null,m.length>0&&i&&!t?u.jsx(M7,{options:m,onChoose:s}):null,f&&!t?u.jsx(R7,{service:f,onStart:a,onOpen:l}):null,t&&!h?u.jsx(j7,{}):null]})}function I7({tool:e}){const t=gk(e.input);return u.jsxs("div",{className:de("inline-flex max-w-[85%] items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-[11px]",e.isError?"border-destructive/40 bg-destructive/5 text-destructive":"border-border bg-background text-muted-foreground"),children:[e.status==="running"?u.jsx(Gi,{className:"size-3 animate-spin"}):u.jsx(eM,{className:"size-3"}),u.jsx("span",{className:"font-semibold",children:e.name}),t?u.jsx("span",{className:"truncate",children:t}):null]})}function P7({prompt:e,onRespond:t}){const i=gk(e.input).slice(0,140);return u.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:[u.jsx(I4,{className:"size-4 shrink-0 text-amber-600"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"font-mono font-semibold",children:e.name}),i?u.jsx("span",{className:"ml-1 truncate font-mono text-muted-foreground",children:i}):null]}),u.jsxs(he,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[u.jsx(Hn,{})," Deny"]}),u.jsxs(he,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[u.jsx(Jo,{})," Allow"]})]})}function gk(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}function ot({className:e,type:t,...i}){return u.jsx("input",{type:t,className:de("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...i})}var Dh=F2();function Xs({children:e,icon:t,onClose:i,title:s,size:a="md"}){return E.useEffect(()=>{function l(c){c.key==="Escape"&&i()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),Dh.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:i,children:u.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:l=>l.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),u.jsx(he,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:u.jsx(Hn,{})})]}),u.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const mp={host:"",port:"",user:"",password:"",database:"",ssl:!1},U7="localhost";function qg(e,t,{includePassword:i=!0}={}){const s=e==="mysql"?"mysql":"postgres",a=t.host.trim()||U7,l=t.port.trim(),c=t.database.trim().replace(/^\//,""),h=t.user.trim(),m=i&&t.password,f=h?`${encodeURIComponent(h)}${m?`:${encodeURIComponent(t.password)}`:""}@`:"",g=l?`:${l}`:"",_=e==="postgres"&&t.ssl?"?sslmode=require":"";return`${s}://${f}${a}${g}/${c}${_}`}function Kg(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:_S(t.username),password:_S(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function H7(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 _S(e){try{return decodeURIComponent(e)}catch{return e}}const F7=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function $7({onClose:e,onSaved:t,initial:i}){const{error:s,success:a}=Ii(),l=!!i,c=E.useMemo(()=>V7(i),[i]),[h,m]=E.useState(c.engine),[f,g]=E.useState(c.name),[_,v]=E.useState(c.url),[x,y]=E.useState(c.fields),[w,C]=E.useState([]),[N,T]=E.useState({status:"idle"}),[A,M]=E.useState(!1),[L,K]=E.useState(!1);E.useEffect(()=>{l||fM().then(C).catch(()=>C([]))},[l]);const B=h==="sqlite",R=B?_.trim():qg(h,x),H=B?!!_.trim():!!(x.host.trim()&&x.database.trim());function P(){T({status:"idle"})}function q(j,W){return qg(j,W,{includePassword:!1})}function J(j){m(j),P(),j!=="sqlite"&&v(q(j,x))}function F(j){const W={...x,...j};y(W),v(q(h,W)),P()}function ie(j){P();const W=H7(j),D=W??h;W&&W!==h&&m(W);const te=W==="sqlite"?null:Kg(j);if(!te){v(j);return}te.password?(y(te),v(q(D,te))):(y({...te,password:x.password}),v(j))}function V(j){m(j.engine);const W=j.engine==="sqlite"?null:Kg(j.url);W?(y(W),v(q(j.engine,W))):v(j.url),P(),f.trim()||g(q7(j))}function O(){return f.trim()?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(H){M(!0),P();try{const j=await pM({engine:h,url:R});T(j.ok?{status:"ok",message:"Connected"}:{status:"fail",message:j.error??"Connection failed"})}catch(j){T({status:"fail",message:j instanceof Error?j.message:String(j)})}finally{M(!1)}}}async function X(){const j=O();if(j){s(j);return}K(!0);try{await mM({name:f.trim(),engine:h,url:R}),a(`Saved connection "${f.trim()}".`),t(),e()}catch(W){s(W instanceof Error?W.message:String(W))}finally{K(!1)}}return u.jsx(Xs,{icon:u.jsx(Kr,{}),onClose:e,title:l?"Edit database connection":"Add database connection",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[w.length>0?u.jsxs("section",{children:[u.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[u.jsx(Q4,{className:"size-3.5"}),"Found in your services"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(j=>u.jsxs("button",{type:"button",onClick:()=>V(j),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:j.maskedUrl,children:[u.jsx(Ke,{variant:"outline",size:"small",children:j.engine}),u.jsx("span",{className:"font-mono",children:j.service}),u.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",j.key]})]},`${j.service}:${j.key}`))})]}):null,u.jsxs("section",{children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),u.jsx("div",{className:"flex gap-1.5",children:F7.map(j=>u.jsx(he,{size:"sm",variant:h===j.value?"default":"outline",onClick:()=>J(j.value),disabled:l,type:"button",children:j.label},j.value))})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),u.jsx(ot,{value:f,onChange:j=>g(j.target.value),placeholder:"e.g. shop-db",disabled:l}),l?u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"The name identifies the connection and can't be changed here."}):null]}),B?null:u.jsxs("section",{className:"flex flex-col gap-3",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Host"}),u.jsx(ot,{value:x.host,onChange:j=>F({host:j.target.value}),placeholder:"localhost",className:"font-mono text-xs"})]}),u.jsxs("label",{className:"flex w-24 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Port"}),u.jsx(ot,{value:x.port,onChange:j=>F({port:j.target.value}),placeholder:h==="mysql"?"3306":"5432",className:"font-mono text-xs"})]})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"User"}),u.jsx(ot,{value:x.user,onChange:j=>F({user:j.target.value}),placeholder:"postgres",className:"font-mono text-xs"})]}),u.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Password"}),u.jsx(ot,{type:"password",value:x.password,onChange:j=>F({password:j.target.value}),placeholder:l?"leave blank to keep current":"••••••••",className:"font-mono text-xs"})]})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Database"}),u.jsx(ot,{value:x.database,onChange:j=>F({database:j.target.value}),placeholder:"app",className:"font-mono text-xs"})]}),h==="postgres"?u.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx("input",{type:"checkbox",checked:x.ssl,onChange:j=>F({ssl:j.target.checked}),className:"size-3.5 accent-primary"}),"Require SSL (adds ",u.jsx("span",{className:"font-mono",children:"?sslmode=require"}),")"]}):null]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:B?"Database file path":"Connection URL"}),u.jsx(ot,{value:_,onChange:j=>ie(j.target.value),placeholder:B?"/abs/path/to/app.db":h==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:B?"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"?u.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"?u.jsx(Jo,{className:"size-3.5"}):u.jsx(Hn,{className:"size-3.5"}),u.jsx("span",{className:"break-all font-mono",children:N.message})]}):null,u.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[u.jsxs(he,{variant:"outline",size:"sm",onClick:()=>{Y()},disabled:A||!H,type:"button",children:[A?u.jsx(Gi,{className:"animate-spin"}):null,"Test connection"]}),u.jsxs(he,{size:"sm",onClick:()=>{X()},disabled:L,type:"button",children:[L?u.jsx(Gi,{className:"animate-spin"}):null,l?"Save changes":"Save"]})]})]})})}function V7(e){if(!e)return{engine:"postgres",name:"",fields:mp,url:""};if(e.engine==="sqlite")return{engine:"sqlite",name:e.name,fields:mp,url:e.url};const t=Kg(e.url),i=t?{...t,password:""}:mp;return{engine:e.engine,name:e.name,fields:i,url:qg(e.engine,i,{includePassword:!1})}}function q7(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function K7({connections:e,selected:t,onSelect:i,onAdd:s,onEdit:a,onRemove:l}){const[c,h]=E.useState(!1),m=E.useRef(null),f=e.find(g=>g.name===t);return E.useEffect(()=>{if(!c)return;function g(_){m.current&&_.target instanceof Node&&!m.current.contains(_.target)&&h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]),u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:m,children:[u.jsxs(he,{className:"max-w-[240px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>h(g=>!g),size:"sm",type:"button",variant:"outline",children:[u.jsx(Kr,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:f?.name??"Select connection"}),f?u.jsx(Ke,{variant:"outline",size:"small",children:f.engine}):null,u.jsx(es,{className:de("ml-auto transition-transform",c&&"rotate-180")})]}),c?u.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:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(Kr,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Connections"}),u.jsx(Ke,{className:"ml-auto",variant:"outline",size:"small",children:e.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(g=>{const _=g.name===t;return u.jsxs("div",{className:de("group grid w-full grid-cols-[1fr_auto_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",_&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{i(g.name),h(!1)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:g.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:g.url})]}),_?u.jsx(Jo,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(he,{"aria-label":`Edit ${g.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{a(g),h(!1)},size:"icon",title:`Edit ${g.name}`,type:"button",variant:"ghost",children:u.jsx(Rc,{className:"size-3.5"})}),u.jsx(he,{"aria-label":`Remove ${g.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>l(g.name),size:"icon",title:`Remove ${g.name}`,type:"button",variant:"ghost",children:u.jsx(Kc,{className:"size-3.5 text-destructive"})})]},g.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved connections yet."})}),u.jsx("div",{className:"border-t border-border bg-muted/20 p-2",children:u.jsxs(he,{className:"w-full",onClick:()=>{s(),h(!1)},size:"sm",type:"button",children:[u.jsx(In,{className:"size-3"}),"Add connection"]})})]}):null]})}function _k({id:e,className:t}){return e==="codex"?u.jsx(Qc,{className:de("text-foreground",t)}):e==="gemini"?u.jsx(Ij,{className:de("text-[#1A73E8]",t)}):u.jsx(nl,{className:de("text-[#D97757]",t)})}function G7({className:e}){const{provider:t}=Jc();return u.jsx(_k,{id:t?.id,className:e})}function W7({onAsk:e,label:t,className:i}){const{provider:s}=Jc(),a=t??`Ask ${s?.label??"Claude"}`;return u.jsx("button",{"aria-label":a,className:de("flex size-6 items-center justify-center rounded-md opacity-0 transition-all duration-150 hover:bg-muted group-hover:opacity-100",i),onClick:e,title:a,type:"button",children:u.jsx(_k,{id:s?.id,className:"size-3.5"})})}const Y7=["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(`
17
- `);function X7(e,t,i,s,a){const l=s.map(c=>`- ${c.name}: ${c.dataType}${c.primaryKey?" (PK)":""}${c.nullable?"":" NOT NULL"}`).join(`
18
- `);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${i.qualifiedName}\`).`,"","## Table schema",l,"","## Row","```json",JSON.stringify(a,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
19
- `)}function Z7({items:e,label:t="More actions",className:i}){const[s,a]=E.useState(!1),[l,c]=E.useState({top:0,right:0}),h=E.useRef(null),m=E.useRef(null);function f(){const g=h.current?.getBoundingClientRect();g&&c({top:g.bottom+4,right:window.innerWidth-g.right}),a(_=>!_)}return E.useEffect(()=>{if(!s)return;function g(x){const y=x.target;h.current?.contains(y)||m.current?.contains(y)||a(!1)}function _(x){x.key==="Escape"&&a(!1)}const v=()=>a(!1);return document.addEventListener("mousedown",g),document.addEventListener("keydown",_),window.addEventListener("scroll",v,!0),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",_),window.removeEventListener("scroll",v,!0)}},[s]),u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-label":t,className:de("flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground group-hover:opacity-100",s&&"opacity-100",i),onClick:f,ref:h,title:t,type:"button",children:u.jsx(_A,{className:"size-3.5"})}),s?Dh.createPortal(u.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:l.top,right:l.right},children:e.map(g=>u.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),g.onSelect()},type:"button",children:[g.icon?u.jsx("span",{className:"text-muted-foreground",children:g.icon}):null,g.label]},g.label))}),document.body):null]})}function Q7({connection:e,sample:t}){const{sendToAgent:i}=Jc(),{success:s,error:a}=Ii(),l=t.columns.map(g=>g.name);function c(g){i({prompt:X7(e,t.engine,t.table,t.columns,g),source:{type:"database-row",label:`${t.table} row`},mode:"send"})}async function h(g,_){try{await navigator.clipboard.writeText(g),s(`Copied ${_}.`)}catch(v){a(v instanceof Error?v.message:String(v))}}function m(g){const _=v=>{const x=pp(v);return/[",\n]/.test(x)?`"${x.replace(/"/g,'""')}"`:x};return`${l.join(",")}
20
- ${l.map(v=>_(g[v])).join(",")}`}function f(g){const _=x=>x==null?"NULL":typeof x=="number"||typeof x=="boolean"?String(x):`'${(typeof x=="object"?JSON.stringify(x):String(x)).replace(/'/g,"''")}'`,v=l.map(x=>_(g[x])).join(", ");return`INSERT INTO ${t.table} (${l.join(", ")}) VALUES (${v});`}return t.columns.length===0?u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsxs("table",{className:"w-max min-w-full border-collapse text-left font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:u.jsxs("tr",{className:"border-b border-border",children:[t.columns.map(g=>u.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[g.primaryKey?u.jsx(YA,{className:"size-3 text-amber-500"}):null,g.name]}),u.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:g.dataType})]},g.name)),u.jsx("th",{className:"w-16 px-2 py-2"})]})}),u.jsxs("tbody",{children:[t.rows.map((g,_)=>u.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[t.columns.map(v=>u.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:pp(g[v.name]),children:pp(g[v.name])},v.name)),u.jsx("td",{className:"px-2 py-1 align-top",children:u.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[u.jsx(W7,{label:"Ask AI about this row",onAsk:()=>c(g)}),u.jsx(Z7,{label:"Row actions",items:[{label:"Copy as JSON",icon:u.jsx(GT,{className:"size-3.5"}),onSelect:()=>{h(JSON.stringify(g,null,2),"row as JSON")}},{label:"Copy as CSV",icon:u.jsx(CA,{className:"size-3.5"}),onSelect:()=>{h(m(g),"row as CSV")}},{label:"Copy as SQL INSERT",icon:u.jsx(Kr,{className:"size-3.5"}),onSelect:()=>{h(f(g),"INSERT statement")}}]})]})})]},_)),t.rows.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function pp(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function J7(){const[e,t]=E.useState([]),[i,s]=E.useState(!0),[a,l]=E.useState(null),c=E.useCallback(async()=>{s(!0),l(null);try{t(await hM())}catch(h){l(h instanceof Error?h.message:String(h))}finally{s(!1)}},[]);return E.useEffect(()=>{c()},[c]),{connections:e,loading:i,error:a,refresh:c}}const eL=[50,100,500,1e3];function tL(e){const[t,i]=E.useState([]),[s,a]=E.useState(null),[l,c]=E.useState(null),[h,m]=E.useState(null),[f,g]=E.useState(null),[_,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(100),[N,T]=E.useState(0);E.useEffect(()=>{T(0)},[e,s]),E.useEffect(()=>{if(i([]),a(null),c(null),m(null),g(null),!e)return;let R=!1;return v(!0),_M(e).then(H=>{R||(i(H),a(H[0]?.qualifiedName??null))}).catch(H=>{R||m(H instanceof Error?H.message:String(H))}).finally(()=>{R||v(!1)}),()=>{R=!0}},[e]),E.useEffect(()=>{if(c(null),g(null),!e||!s)return;let R=!1;return y(!0),bM(e,s,w,N).then(H=>{R||c(H)}).catch(H=>{R||g(H instanceof Error?H.message:String(H))}).finally(()=>{R||y(!1)}),()=>{R=!0}},[e,s,w,N]);const A=N>0,M=l?l.rowCount===w:!1;function L(R){C(R),T(0)}function K(){M&&T(R=>R+w)}function B(){T(R=>Math.max(0,R-w))}return{tables:t,selectedTable:s,setSelectedTable:a,sample:l,tablesError:h,rowsError:f,loadingTables:_,loadingRows:x,limit:w,offset:N,canPrev:A,canNext:M,changePageSize:L,nextPage:K,prevPage:B}}function iL(){const{connections:e,loading:t,error:i,refresh:s}=J7(),{error:a,success:l}=Ii(),[c,h]=E.useState(null),[m,f]=E.useState(null);E.useEffect(()=>{if(e.length===0){h(null);return}h(v=>v&&e.some(x=>x.name===v)?v:e[0].name)},[e]);async function g(v){try{await gM(v),l(`Removed connection "${v}".`),await s()}catch(x){a(x instanceof Error?x.message:String(x))}}function _(v){f({mode:"edit",target:v})}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Kr,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Databases"}),t&&e.length===0?u.jsx(Gi,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),u.jsx(K7,{connections:e,selected:c,onSelect:h,onAdd:()=>f({mode:"add"}),onEdit:_,onRemove:v=>{g(v)}})]}),u.jsx("div",{className:"min-h-0 flex-1",children:i?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:i})}):c?u.jsx(nL,{connection:c}):u.jsx(sL,{onAdd:()=>f({mode:"add"})})}),m?u.jsx($7,{initial:m.mode==="edit"?m.target:void 0,onClose:()=>f(null),onSaved:s}):null]})}function nL({connection:e}){const{tables:t,selectedTable:i,setSelectedTable:s,sample:a,tablesError:l,rowsError:c,loadingTables:h,loadingRows:m,limit:f,offset:g,canPrev:_,canNext:v,changePageSize:x,nextPage:y,prevPage:w}=tL(e);return u.jsxs("div",{className:"flex h-full min-h-0",children:[u.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(K4,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),u.jsx(Ke,{variant:"outline",size:"small",children:t.length}),h?u.jsx(Gi,{className:"size-3.5 animate-spin"}):null]}),l?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:l})}):u.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(C=>u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>s(C.qualifiedName),className:de("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",C.qualifiedName===i&&"bg-muted/70 font-semibold"),children:C.qualifiedName})},C.qualifiedName)),!h&&t.length===0?u.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i??"Select a table"}),a?u.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[u.jsx("span",{className:"tabular-nums",children:a.rowCount===0?"no rows":`rows ${g+1}–${g+a.rowCount}`}),u.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:C=>x(Number(C.target.value)),children:eL.map(C=>u.jsxs("option",{value:C,children:[C," / page"]},C))}),u.jsx(he,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:w,disabled:!_,type:"button",children:"Prev"}),u.jsx(he,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:y,disabled:!v,type:"button",children:"Next"})]}):null]}),c?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:c})}):m?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(Gi,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):a?u.jsx(Q7,{connection:e,sample:a}):u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function sL({onAdd:e}){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(Kr,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),u.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' ",u.jsx("code",{children:".env"})," files."]}),u.jsxs(he,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[u.jsx(In,{}),"Add connection"]})]})})}function rL({incident:e}){const{error:t,success:i}=Ii(),[s,a]=E.useState(!1),[l,c]=E.useState(!1),[h,m]=E.useState(!1);async function f(){a(!0);try{const{prompt:_}=await xM(e.id);await navigator.clipboard.writeText(_),c(!0),i("Copied debugging prompt to clipboard."),window.setTimeout(()=>c(!1),2e3)}catch(_){t(_ instanceof Error?_.message:String(_))}finally{a(!1)}}async function g(){m(!0);try{const{markdown:_}=await yM(e.id);await navigator.clipboard.writeText(_),i("Copied repro bundle to clipboard.")}catch(_){t(_ instanceof Error?_.message:String(_))}finally{m(!1)}}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ke,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?u.jsxs(Ke,{variant:"outline",size:"small",children:["×",e.count]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(he,{onClick:()=>{g()},disabled:h,size:"sm",variant:"outline",children:[u.jsx(l4,{}),h?"Bundling…":"Copy repro bundle"]}),u.jsxs(he,{onClick:()=>{f()},disabled:s,size:"sm",children:[l?u.jsx(Jo,{}):u.jsx(iA,{}),l?"Copied":"Copy to agent"]})]})]}),u.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?u.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[u.jsx(X2,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,u.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()]})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),u.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(`
21
- `)}),u.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:'"Copy to agent" bundles this excerpt with the affected file\'s diff and the last 40 log lines. "Copy repro bundle" adds the service\'s runtime state and masked `.env` for sharing.'})]})]})}function bS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function aL(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),[a,l]=E.useState(null),c=E.useCallback(h=>{t(m=>bS([...m.filter(f=>f.id!==h.id),h]))},[]);return E.useEffect(()=>{let h=!0;vM().then(f=>{h&&t(bS(f))}).catch(f=>{h&&l(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 g=JSON.parse(f.data);c(g)}catch{}}),()=>{h=!1,m.close()}},[c]),{incidents:e,connected:i,error:a}}function oL(){const{incidents:e,connected:t,error:i}=aL(),[s,a]=E.useState(null);E.useEffect(()=>{if(e.length===0){a(null);return}a(c=>c!==null&&e.some(h=>h.id===c)?c:e[0].id)},[e]);const l=E.useMemo(()=>e.find(c=>c.id===s)??null,[e,s]);return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vg,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),u.jsx(Ke,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ke,{variant:"outline",size:"small",icon:u.jsx("span",{className:de("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(c=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>a(c.id),className:de("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",c.id===s&&"bg-muted/70"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:c.service}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.count>1?u.jsxs(Ke,{variant:"outline",size:"small",children:["×",c.count]}):null,u.jsx(Ke,{variant:c.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:c.level})]})]}),u.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:c.title}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(c.lastSeen).toLocaleTimeString()})]})},c.id))})]}),u.jsx("div",{className:"min-h-0 flex-1",children:i?u.jsx("div",{className:"p-4",children:u.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",i]})}):l?u.jsx(rL,{incident:l}):u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(vg,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),u.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 lL={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 Hr({label:e,children:t,side:i="bottom",className:s}){return u.jsxs("span",{className:de("group/tt relative inline-flex",s),children:[t,u.jsx("span",{role:"tooltip",className:de("pointer-events-none absolute z-[1100] whitespace-nowrap rounded-md bg-foreground px-2 py-1 text-xs font-medium text-background shadow-md","opacity-0 transition-opacity duration-150 group-hover/tt:opacity-100",lL[i]),children:e})]})}function cL({context:e}){const[t,i]=E.useState(!1);if(!e)return u.jsx("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"No agent context available yet."});async function s(){try{await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1500)}catch{i(!1)}}return u.jsxs("section",{"aria-label":"Agent context",className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"agent-context-panel",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-medium",children:[u.jsx(Zd,{className:"size-3.5"}),"Agent context"]}),u.jsxs(he,{onClick:s,size:"sm",type:"button",variant:"outline",children:[t?u.jsx(Jo,{className:"size-3.5"}):u.jsx(W2,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),u.jsx("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded bg-background p-3 font-mono text-[11px] leading-relaxed",children:e})]})}function On({className:e,...t}){return u.jsx("label",{className:de("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const Fn='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',$n='</title><path d="',Vn='"/></svg>',uL={title:".NET",slug:"dotnet",get svg(){return Fn+".NET"+$n+this.path+Vn},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"}},dL={title:"Bun",slug:"bun",get svg(){return Fn+"Bun"+$n+this.path+Vn},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"},hL={title:"Deno",slug:"deno",get svg(){return Fn+"Deno"+$n+this.path+Vn},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"}},fL={title:"Docker",slug:"docker",get svg(){return Fn+"Docker"+$n+this.path+Vn},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"},mL={title:"Go",slug:"go",get svg(){return Fn+"Go"+$n+this.path+Vn},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"},pL={title:"Node.js",slug:"nodedotjs",get svg(){return Fn+"Node.js"+$n+this.path+Vn},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"},gL={title:"npm",slug:"npm",get svg(){return Fn+"npm"+$n+this.path+Vn},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"},_L={title:"pnpm",slug:"pnpm",get svg(){return Fn+"pnpm"+$n+this.path+Vn},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"},bL={title:"Python",slug:"python",get svg(){return Fn+"Python"+$n+this.path+Vn},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/"},vS={title:"Rust",slug:"rust",get svg(){return Fn+"Rust"+$n+this.path+Vn},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"}},vL={title:"Vite",slug:"vite",get svg(){return Fn+"Vite"+$n+this.path+Vn},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"},xL={title:"Yarn",slug:"yarn",get svg(){return Fn+"Yarn"+$n+this.path+Vn},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 yL(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?rn.vite:/\bcargo\s+/.test(t)?rn.cargo:/\brustc\b/.test(t)?rn.rust:/\bdotnet\b/.test(t)?rn.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?rn.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?rn.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?rn.go:/\bbun\b/.test(t)?rn.bun:/\bdeno\b/.test(t)?rn.deno:/\bpnpm\b/.test(t)?rn.pnpm:/\byarn\b/.test(t)?rn.yarn:/\bnpm\b/.test(t)?rn.npm:/\bnode\b/.test(t)?rn.node:rn.generic}const rn={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 E_({command:e,compact:t}){const i=yL(e),s=SL[i.kind];return u.jsx("span",{"aria-label":`${i.label} process`,className:de("inline-flex shrink-0 items-center justify-center rounded-md border bg-card shadow-sm 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?u.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:s.path})}):u.jsx(sE,{className:t?"size-3.5":"size-4"})})}const SL={bun:dL,cargo:vS,deno:hL,dotnet:uL,docker:fL,generic:null,go:mL,node:pL,npm:gL,pnpm:_L,python:bL,rust:vS,vite:vL,yarn:xL},wL=[{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"}],xS=[{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 EL({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return u.jsxs(dt,{variant:e.ok?"default":"destructive",children:[u.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),u.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?u.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(`
22
- `)}):null]})}function C_({active:e,baseUrl:t,compact:i=!1,onRefresh:s,onStarted:a,restartAction:l,solidStart:c=!1,targetLabel:h}){return e?u.jsxs(u.Fragment,{children:[u.jsx(gp,{compact:i,intent:"restart",icon:u.jsx(iE,{}),label:"Restart",action:l,targetLabel:h,url:`${t}/restart`,onRefresh:s,onSuccess:a}),u.jsx(gp,{compact:i,intent:"stop",icon:u.jsx(Nh,{}),label:"Stop",targetLabel:h,url:`${t}/stop`,onRefresh:s})]}):u.jsx(gp,{compact:i,intent:c?"startSolid":"start",icon:u.jsx(V0,{}),label:"Start",targetLabel:h,url:`${t}/start`,onRefresh:s,onSuccess:a})}function zc(e,t,i){const s=i instanceof Error?i.message:String(i);return`${e} failed for ${t}: ${s}`}function gp({action:e,compact:t=!1,intent:i="neutral",icon:s,label:a,targetLabel:l,url:c,onRefresh:h,onSuccess:m}){const[f,g]=E.useState(!1),[_,v]=E.useState(null),{error:x,success:y}=Ii();async function w(N={}){g(!0);try{e?await e():await Ki(c,N),y(`${a} requested for ${l}.`),await h(),v(null),m?.()}catch(T){T instanceof rE?v(T.conflict):x(zc(a,l,T))}finally{g(!1)}}const C=u.jsxs(he,{"aria-label":a,className:`${kL[i]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>w(),size:t?"icon":"sm",variant:"outline",children:[s,t?null:a]});return u.jsxs(u.Fragment,{children:[t?u.jsx(Hr,{label:a,children:C}):C,_?u.jsx(CL,{busy:f,conflict:_,onCancel:()=>v(null),onKillAndStart:()=>w({strategy:"killHolder"}),targetLabel:l}):null]})}function CL({busy:e,conflict:t,onCancel:i,onKillAndStart:s,targetLabel:a}){const l=t.holder,c=`http://localhost:${t.port}/`;return u.jsx(Xs,{icon:u.jsx(nM,{}),onClose:e?()=>{}:i,title:`Port ${t.port} is already in use`,children:u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:a})," wants port"," ",u.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:l?`pid ${l.pid}${l.pgid?` (pgid ${l.pgid})`:""}
23
- ${l.command}`:"unknown process"}),u.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[u.jsx(he,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),u.jsxs(he,{onClick:()=>window.open(c,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[u.jsx(F0,{}),"Open in browser"]}),u.jsx(he,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!l,onClick:s,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const kL={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 NL({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{error:a,success:l}=Ii(),c=!!s,[h,m]=E.useState(s?.kind??"local"),[f,g]=E.useState(s?.name??""),[_,v]=E.useState(s?.command??""),[x,y]=E.useState(s?.cwd??e),[w,C]=E.useState(s?.port?String(s.port):""),[N,T]=E.useState(s?.description??""),[A,M]=E.useState(s?.composeFile??""),[L,K]=E.useState(s?.composeService??""),[B,R]=E.useState(s?.host??""),[H,P]=E.useState(null),[q,J]=E.useState(!1);E.useEffect(()=>{P(null)},[_,x,w,h]);function F(){g(""),v(""),y(e),C(""),T(""),M(""),K(""),R(""),P(null)}async function ie(O){O.preventDefault();try{const Y={name:f,kind:h,cwd:x,port:w,description:N};(h==="local"||h==="ssh")&&(Y.command=_),h==="docker-compose"&&(Y.composeFile=A,Y.composeService=L),h==="ssh"&&(Y.host=B),await Ki("/api/services",Y),c||F(),l(c?`${f} updated.`:`${f} added.`),await t(),i?.()}catch(Y){a(zc(c?"Update service":"Add service",f||"service",Y))}}async function V(){if(!_.trim()){a("Test command failed for service: command is required.");return}J(!0);try{P(await FM({command:_,cwd:x,port:w}))}catch(O){a(zc("Test command",f||"service",O))}finally{J(!1)}}return{editing:c,kind:h,setKind:m,name:f,setName:g,command:_,setCommand:v,formCwd:x,setFormCwd:y,port:w,setPort:C,description:N,setDescription:T,composeFile:A,setComposeFile:M,composeService:L,setComposeService:K,host:B,setHost:R,testResult:H,testing:q,submit:ie,testCommand:V}}function yS({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{editing:a,kind:l,setKind:c,name:h,setName:m,command:f,setCommand:g,formCwd:_,setFormCwd:v,port:x,setPort:y,description:w,setDescription:C,composeFile:N,setComposeFile:T,composeService:A,setComposeService:M,host:L,setHost:K,testResult:B,testing:R,submit:H,testCommand:P}=NL({cwd:e,onRefresh:t,onSaved:i,initialService:s}),q=xS.find(V=>V.value===l),J=l==="local"&&f.trim().length>0&&_.trim().length>0,F="grid gap-2 rounded-md border border-border bg-muted/30 p-3",ie="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return u.jsxs("form",{className:"grid gap-3",onSubmit:H,children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("fieldset",{className:`${F} sm:col-span-2`,children:[u.jsx("legend",{className:ie,children:"Step 1 · Service kind"}),u.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:xS.map(V=>u.jsx(he,{className:"justify-center",disabled:a,onClick:()=>c(V.value),size:"sm",type:"button",variant:l===V.value?"default":"outline",children:V.label},V.value))}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:q.hint})]}),u.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[u.jsxs("fieldset",{className:F,children:[u.jsx("legend",{className:ie,children:"Step 2 · Identity"}),u.jsxs(On,{children:["Name",u.jsx(ot,{className:"h-8 text-sm",name:"name",onChange:V=>m(V.target.value),placeholder:"backend",readOnly:a,required:!0,value:h}),a?u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),u.jsxs(On,{children:["Description",u.jsx(ot,{className:"h-8 text-sm",name:"description",onChange:V=>C(V.target.value),placeholder:"API server",value:w})]})]}),u.jsxs("fieldset",{className:F,children:[u.jsx("legend",{className:ie,children:"Step 4 · Networking (optional)"}),u.jsxs(On,{children:["Port",u.jsx(ot,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:V=>y(V.target.value),placeholder:"3001",value:x})]})]})]}),l==="local"?u.jsxs("fieldset",{className:`${F} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ie,children:"Step 3 · Local command"}),u.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:wL.map(V=>u.jsxs(he,{className:"justify-start gap-1.5",onClick:()=>{g(V.command),C(V.description)},size:"sm",type:"button",variant:"outline",children:[u.jsx(E_,{command:V.badgeCommand??V.command,compact:!0}),u.jsx("span",{className:"truncate",children:V.label})]},V.label))}),u.jsxs(On,{children:["Command",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"command",onChange:V=>g(V.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(On,{children:["Working Directory",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:V=>v(V.target.value),required:!0,value:_})]})]}):null,l==="docker-compose"?u.jsxs("fieldset",{className:`${F} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ie,children:"Step 3 · Docker Compose target"}),u.jsxs(On,{children:["Compose Service",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"composeService",onChange:V=>M(V.target.value),placeholder:"api",required:!0,value:A})]}),u.jsxs(On,{children:["Compose File (optional)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:V=>T(V.target.value),placeholder:"docker-compose.yml",value:N})]}),u.jsxs(On,{children:["Working Directory (where compose file lives)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:V=>v(V.target.value),required:!0,value:_})]})]}):null,l==="ssh"?u.jsxs("fieldset",{className:`${F} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ie,children:"Step 3 · SSH connection"}),u.jsxs(On,{children:["SSH Host (alias from ~/.ssh/config)",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"host",onChange:V=>K(V.target.value),placeholder:"devbox",required:!0,value:L})]}),u.jsxs(On,{children:["Remote Command",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"command",onChange:V=>g(V.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(On,{children:["Remote Working Directory",u.jsx(ot,{className:"h-8 font-mono text-sm",name:"cwd",onChange:V=>v(V.target.value),placeholder:"/srv/app",required:!0,value:_})]}),u.jsxs(dt,{variant:"muted",children:[u.jsx("div",{className:"font-medium",children:"SSH key handling"}),u.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",u.jsxs("code",{children:["Host ",L||"&lt;alias&gt;"]})," entry to",u.jsx("code",{children:" ~/.ssh/config"})," with ",u.jsx("code",{children:"HostName"}),", ",u.jsx("code",{children:"User"}),", and"," ",u.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",u.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",u.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",u.jsxs("code",{children:["ssh ",L||"&lt;alias&gt;"]})," using that config."]})]})]}):null]}),B?u.jsx(EL,{result:B}):null,u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[l==="local"?u.jsxs(he,{disabled:R||!J,onClick:P,type:"button",variant:"outline",children:[u.jsx(sE,{}),R?"Testing...":"Test Command"]}):null,u.jsx(he,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function bk({initialName:e="",initialServices:t=[],onSaved:i,onRefresh:s,originalName:a,services:l,submitLabel:c="Save Group"}){const{error:h,success:m}=Ii();async function f(g){g.preventDefault();const _=g.currentTarget,v=new FormData(_),x=String(v.get("name")??""),y=v.getAll("services").map(w=>String(w)).filter(Boolean);try{await Ki("/api/bundles",{name:x,originalName:a,services:y.join(",")}),_.reset(),m(`${x} group saved.`),await s(),i?.()}catch(w){h(zc("Save group",x||"group",w))}}return u.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[u.jsxs(On,{children:["Group name",u.jsx(ot,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),u.jsxs("fieldset",{className:"grid gap-1.5",children:[u.jsx("legend",{className:"text-xs font-medium",children:"Services"}),l.length?l.map(g=>u.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[u.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(g.name),name:"services",type:"checkbox",value:g.name}),u.jsx(E_,{command:g.command??"",compact:!0}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate text-sm font-medium",children:g.name}),u.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:g.command??g.kind??""})]})]},g.name)):u.jsx(dt,{variant:"muted",children:"All services are already grouped, or none registered."})]}),u.jsx(he,{className:"h-8",disabled:!l.length,type:"submit",children:c})]})}function ch({label:e}){return u.jsx(dt,{variant:"muted",className:"m-4 text-center",children:e})}const TL=900*1e3,_c=12,_p=200;function AL({events:e}){const[t,i]=E.useState(null),[s,a]=E.useState(null),{rows:l,windowStart:c,windowEnd:h}=E.useMemo(()=>ML(e),[e]),m=t?l.find(f=>f.service===t)??null:null;return u.jsxs(u.Fragment,{children:[u.jsxs(Qs,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs(er,{className:"flex items-center gap-2",children:[u.jsx(ja,{className:"size-3.5"}),"Runtime Monitor"]}),u.jsx(Jr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),u.jsx(tr,{className:"p-0",children:l.length===0?u.jsx(ch,{label:"No runtime timeline events yet."}):u.jsxs("div",{className:"divide-y divide-border",children:[l.map(f=>u.jsx(DL,{onClick:()=>i(f.service),row:f,windowEnd:h,windowStart:c},f.service)),u.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[u.jsx("span",{children:uh(c)}),u.jsx("span",{children:"now"})]})]})})]}),m?u.jsx(Xs,{icon:u.jsx(ja,{}),onClose:()=>i(null),title:m.service,children:u.jsx(jL,{onSelect:a,row:m})}):null,s?u.jsx(Xs,{icon:u.jsx(ja,{}),onClose:()=>a(null),title:s.title,children:u.jsx(LL,{event:s})}):null]})}function ML(e){const t=Date.now(),i=t,s=t-TL;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(-_p):a.length>_p&&(a=a.slice(-_p));const l=new Map;for(const m of a){const f=m.service||"·system",g=l.get(f)??[];g.push(m),l.set(f,g)}const c=Math.max(i-s,1);return{rows:Array.from(l.entries()).map(([m,f])=>{const g=[...f].sort((T,A)=>T.timestamp.localeCompare(A.timestamp)),_=new Array(_c).fill(0),v=new Array(_c).fill(null);for(const T of g){const A=new Date(T.timestamp).getTime(),M=Math.max(s,Math.min(i,A)),L=Math.min(_c-1,Math.floor((M-s)/c*_c));_[L]+=1;const K=v[L];v[L]=RL(K,T.severity)}const x=g.filter(T=>T.severity==="error").length,y=g.filter(T=>T.severity==="warning").length,w=g.length-x-y,C=[...g].reverse().find(T=>T.severity!=="info")??null,N=x>0?"error":y>0?"warning":"info";return{service:m,events:g,errors:x,warnings:y,infos:w,buckets:_,bucketSeverity:v,lastNotable:C,worstSeverity:N}}).sort((m,f)=>{const g=v=>v.errors*1e3+v.warnings,_=g(f)-g(m);return _!==0?_:m.service.localeCompare(f.service)}),windowStart:s,windowEnd:i}}function RL(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function DL({onClick:e,row:t,windowEnd:i,windowStart:s}){const a=Math.max(1,...t.buckets);return u.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:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:de("size-2 shrink-0 rounded-full",vk(t.worstSeverity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:u.jsx("bdi",{children:t.service})}),t.errors>0?u.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?u.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,u.jsx(Xr,{className:"size-3 text-muted-foreground"})]}),u.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${_c}, minmax(0, 1fr))`},children:t.buckets.map((l,c)=>u.jsx(OL,{count:l,max:a,severity:t.bucketSeverity[c]},c))}),t.lastNotable?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):u.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),u.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[u.jsx("span",{children:uh(s)}),u.jsx("span",{children:uh(i)})]})]})}function OL({count:e,max:t,severity:i}){if(e===0)return u.jsx("span",{className:"rounded-sm bg-border/60"});const s=Math.min(1,.35+e/t*.65);return u.jsx("span",{className:de("rounded-sm",BL(i)),style:{opacity:s},title:`${e} event${e===1?"":"s"}`})}function jL({onSelect:e,row:t}){const i=[...t.events].sort((s,a)=>a.timestamp.localeCompare(s.timestamp));return u.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[t.events.length," events"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),u.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:i.map(s=>u.jsx("li",{children:u.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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:de("size-2 shrink-0 rounded-full",vk(s.severity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:s.title}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:uh(s.timestamp)})]}),s.detail?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s.detail}):null]})},s.id))})]})}function LL({event:e}){const t=new Date(e.timestamp);return u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:de("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",zL(e.severity)),children:e.severity}),u.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?u.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]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),u.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),u.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 vk(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function BL(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function zL(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function uh(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 IL({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:FL(e.summary);return u.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:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsxs("span",{className:de("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",PL(e.status)),children:[u.jsx("span",{className:"inline-flex shrink-0",children:u.jsx(ja,{className:"size-3"})}),u.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),i?u.jsx("span",{className:"min-w-0 truncate",children:i}):null]}),t?u.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(uA,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),u.jsxs("span",{children:[HL(t.cpuPercent)," CPU"]}),u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(t4,{className:"size-3"}),UL(t.rssMb)," RAM"]})]}):null]})}function PL(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 UL(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function HL(e){return`${e.toFixed(1)}%`}function FL(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function $L({ports:e}){const t=e.filter(s=>s.state==="occupied").length,i=e.filter(s=>s.state==="managed").length;return u.jsxs(Qs,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs(er,{className:"flex items-center gap-2",children:[u.jsx(a4,{className:"size-3.5"}),"Ports"]}),u.jsxs(Jr,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),u.jsx(tr,{className:"p-0",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(s=>u.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"font-mono text-xs",children:[":",s.port]}),u.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:s.services.join(", ")||"Unassigned"}),s.urls[0]?u.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:s.urls[0]}):null]}),u.jsx(VL,{port:s})]},s.port))}):u.jsx(ch,{label:"No configured ports yet."})})]})}function VL({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 u.jsx(Ke,{className:de(e&&"max-w-36 truncate"),variant:s,children:i})}function qL({onChange:e,value:t}){return u.jsxs("label",{className:"relative block",children:[u.jsx(D4,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),u.jsx(ot,{"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 KL({className:e,containerRef:t,emptyText:i,logs:s,query:a}){return u.jsx("div",{className:de("h-full max-w-full overflow-auto bg-background font-mono text-[11px] leading-5 dark:bg-zinc-950",e),ref:t,role:"log",children:s.length?s.map((l,c)=>u.jsxs("div",{className:de("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5 dark:border-zinc-800/80",l.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:[u.jsx("span",{className:"text-muted-foreground dark:text-zinc-500",children:l.timestamp}),u.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[l.stream==="stderr"?u.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,WL(l.text,a)]})]},`${l.timestamp}-${l.stream}-${c}`)):u.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function GL(e){return`${e.timestamp} ${e.stream} ${e.text}`}function WL(e,t){const i=t.trim();if(!i)return e;const s=e.toLowerCase(),a=i.toLowerCase(),l=[];let c=0,h=s.indexOf(a);for(;h!==-1;){h>c&&l.push(e.slice(c,h));const m=h+i.length;l.push(u.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}`)),c=m,h=s.indexOf(a,c)}return c<e.length&&l.push(e.slice(c)),l}function SS(e){return`${e.kind}:${e.name}`}function YL(e,t=!1,i={}){const[s,a]=E.useState(),[l,c]=E.useState(),[h,m]=E.useState(e.kind==="source"),f=JSON.stringify(i);return E.useEffect(()=>{a(void 0),c(void 0);let g=!1;const _=async()=>{try{if(e.kind==="service"){const x=await lE(e.name,i);g||(a(x.logs),m(x.queryable),c(void 0))}else{const x=await aE(e.name,i);g||(a(x),m(!0),c(void 0))}}catch(x){g||c(x instanceof Error?x.message:String(x))}};_();const v=window.setInterval(_,t?1e3:2e3);return()=>{g=!0,window.clearInterval(v)}},[e.kind,e.name,t,f]),{logs:s,error:l,queryable:h}}const XL=[{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 xk({target:e,query:t,setQuery:i,streaming:s,setStreaming:a,hideStdout:l,setHideStdout:c,fill:h=!1,leading:m,trailing:f}){const g=e.kind==="source",[_,v]=E.useState(""),[x,y]=E.useState(""),[w,C]=E.useState(t);E.useEffect(()=>{const j=window.setTimeout(()=>C(t),300);return()=>window.clearTimeout(j)},[t]);const N=E.useMemo(()=>{const j={};_&&(j.since=_),x&&(j.level=x);const W=w.trim();return W&&(j.grep=W),j},[_,x,w]),{logs:T,error:A,queryable:M}=YL(e,s,N),L=g||M,K=E.useRef(null),B=E.useRef(!0),[R,H]=E.useState([]),[P,q]=E.useState(!1),J=JSON.stringify(N);E.useEffect(()=>{H([])},[J,e.kind,e.name]);const F=E.useMemo(()=>{const j=T??[];if(R.length===0)return j;const W=new Set(R.map(D=>D.cursor).filter(Boolean));return[...R,...j.filter(D=>!D.cursor||!W.has(D.cursor))]},[T,R]),ie=(R[0]??(T??[])[0])?.cursor;async function V(){if(!(!L||!ie||P)){q(!0),B.current=!1;try{const j={...N,before:ie,lines:200},W=e.kind==="source"?await aE(e.name,j):(await lE(e.name,j)).logs;W.length&&H(D=>{const te=new Set(D.map($=>$.cursor).filter(Boolean));return[...W.filter($=>!$.cursor||!te.has($.cursor)),...D]})}finally{q(!1)}}}const O=t.trim().toLowerCase(),Y=E.useMemo(()=>{let j=F;return l&&(j=j.filter(W=>W.stream==="stderr")),O&&(j=j.filter(W=>GL(W).toLowerCase().includes(O))),j},[F,l,O]);E.useEffect(()=>{const j=K.current;if(!j)return;const W=()=>{const D=j.scrollHeight-j.scrollTop-j.clientHeight;B.current=D<40};return W(),j.addEventListener("scroll",W,{passive:!0}),()=>j.removeEventListener("scroll",W)},[]),E.useEffect(()=>{if(!s||!B.current||Y.length===0)return;const j=K.current;j&&(j.scrollTop=j.scrollHeight)},[s,Y]);const X=T?O?`No log lines match "${t.trim()}".`:l?"No stderr output captured.":"No log entries.":"Loading…";return u.jsxs("div",{className:h?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,u.jsx(qL,{onChange:i,value:t}),L?u.jsxs(u.Fragment,{children:[u.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:j=>v(j.target.value),value:_,children:XL.map(j=>u.jsx("option",{value:j.value,children:j.label},j.label))}),u.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:j=>y(j.target.value),value:x,children:[u.jsx("option",{value:"",children:"All levels"}),u.jsx("option",{value:"warn",children:"Warnings+"}),u.jsx("option",{value:"error",children:"Errors"})]})]}):u.jsxs(wS,{active:l,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:()=>c(!l),children:[u.jsx(IA,{}),"Errors only"]}),u.jsxs(wS,{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:[u.jsx(k4,{}),s?"Streaming":"Stream"]}),L&&ie?u.jsxs(he,{disabled:P,onClick:()=>{V()},size:"sm",type:"button",variant:"outline",children:[u.jsx(H0,{}),P?"Loading…":"Load older"]}):null,f?u.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),A?u.jsx("div",{className:"text-red-600",children:A}):null,u.jsx(KL,{className:de("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:K,emptyText:X,logs:Y,query:t})]})}function wS({active:e,activeClassName:t,children:i,onClick:s}){return u.jsx(he,{"aria-pressed":e,className:e?t:void 0,onClick:s,size:"sm",type:"button",variant:"outline",children:i})}function ZL(e,t){return e.kind===t.kind&&e.name===t.name}function QL({options:e,target:t,onChange:i,className:s}){const a=e.findIndex(c=>ZL(c.target,t)),l=[...new Set(e.map(c=>c.group))];return u.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:c=>i(e[Number(c.target.value)].target),value:String(a),children:l.map(c=>u.jsx("optgroup",{label:c,children:e.map((h,m)=>h.group===c?u.jsx("option",{value:String(m),children:h.label},`${h.group}:${h.label}`):null)},c))})}function JL({serviceName:e}){const[t,i]=E.useState(""),[s,a]=E.useState(!1),[l,c]=E.useState(!1),[h,m]=E.useState(!1),f=u.jsx(xk,{fill:!0,hideStdout:l,query:t,setHideStdout:c,setQuery:i,setStreaming:a,streaming:s,target:{kind:"service",name:e},trailing:u.jsxs(he,{onClick:()=>m(g=>!g),size:"sm",type:"button",variant:"outline",children:[h?u.jsx(eE,{}):u.jsx(J2,{}),h?"Exit":"Expand"]})});return h?u.jsx(k_,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):u.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function k_({title:e,onClose:t,children:i,maxWidthClass:s="max-w-6xl"}){return E.useEffect(()=>{function a(l){l.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),Dh.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:u.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:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),u.jsx(he,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Hn,{})})]}),u.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const e9={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 t9({onClose:e,onAdded:t}){const[i,s]=E.useState(""),[a,l]=E.useState("journald"),[c,h]=E.useState(""),[m,f]=E.useState(""),[g,_]=E.useState(""),[v,x]=E.useState(""),[y,w]=E.useState(""),[C,N]=E.useState(""),[T,A]=E.useState(),[M,L]=E.useState(!1);async function K(){L(!0),A(void 0);try{const B={name:i.trim(),kind:"command"};a==="file"?(B.kind="file",B.path=m.trim()):a==="ssh"?(B.kind="ssh",B.host=c.trim(),B.path=m.trim()):a==="command"?(B.kind="command",B.command=g.trim(),v.trim()&&(B.cwd=v.trim())):a==="journald"?(B.driver="journald",B.unit=y.trim(),c.trim()&&(B.host=c.trim())):a==="docker"&&(B.driver="docker",B.container=C.trim(),c.trim()&&(B.host=c.trim()));const R=await DM(B);t(R,B.name),e()}catch(B){A(B instanceof Error?B.message:String(B))}finally{L(!1)}}return u.jsx(Xs,{icon:u.jsx(nE,{}),onClose:e,size:"md",title:"Add log source",children:u.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:B=>{B.preventDefault(),K()},children:[u.jsx(Ks,{label:"Name",children:u.jsx(ot,{autoFocus:!0,onChange:B=>s(B.target.value),placeholder:"PROD",value:i})}),u.jsxs(Ks,{label:"Type",children:[u.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:B=>l(B.target.value),value:a,children:[u.jsx("option",{value:"journald",children:"systemd journal (journald)"}),u.jsx("option",{value:"docker",children:"Docker container"}),u.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),u.jsx("option",{value:"file",children:"Local file"}),u.jsx("option",{value:"command",children:"Command"})]}),u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:e9[a]})]}),a==="journald"||a==="docker"?u.jsx(Ks,{label:"Host (optional — leave blank to run locally)",children:u.jsx(ot,{onChange:B=>h(B.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:c})}):null,a==="journald"?u.jsx(Ks,{label:"Unit",children:u.jsx(ot,{onChange:B=>w(B.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?u.jsx(Ks,{label:"Container",children:u.jsx(ot,{onChange:B=>N(B.target.value),placeholder:"brainctl-api",value:C})}):null,a==="ssh"?u.jsx(Ks,{label:"Host",children:u.jsx(ot,{onChange:B=>h(B.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:c})}):null,a==="file"||a==="ssh"?u.jsx(Ks,{label:a==="ssh"?"Remote path":"File path",children:u.jsx(ot,{onChange:B=>f(B.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?u.jsxs(u.Fragment,{children:[u.jsx(Ks,{label:"Command",children:u.jsx(ot,{onChange:B=>_(B.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:g})}),u.jsx(Ks,{label:"Working directory (optional)",children:u.jsx(ot,{onChange:B=>x(B.target.value),placeholder:"/srv/app",value:v})})]}):null,T?u.jsx("div",{className:"text-red-600",children:T}):null,u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx(he,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),u.jsx(he,{disabled:M||!i.trim(),size:"sm",type:"submit",children:M?"Saving…":"Add source"})]})]})})}function Ks({label:e,children:t}){return u.jsxs("label",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const ES=4;function i9({services:e,initialService:t,onClose:i}){const[s,a]=E.useState([]),[l,c]=E.useState(!1),[h,m]=E.useState(()=>[0]),[f,g]=E.useState(()=>{const A=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return A?{0:A}:{}}),_=E.useRef(1);E.useEffect(()=>{let A=!1;return RM().then(M=>{A||a(M)}),()=>{A=!0}},[]);const v=[...e.map(A=>({target:{kind:"service",name:A},label:A,group:"Services"})),...s.map(A=>({target:{kind:"source",name:A.name},label:A.name,group:"Log sources"}))],x=v.map(A=>A.target);function y(){if(h.length>=ES||x.length===0)return;const A=_.current++,M=new Set(Object.values(f).map(SS)),L=x.find(K=>!M.has(SS(K)))??x[0];m(K=>[...K,A]),g(K=>({...K,[A]:L}))}function w(A){m(M=>M.filter(L=>L!==A)),g(M=>{const L={...M};return delete L[A],L})}function C(A,M){g(L=>({...L,[A]:M}))}function N(A,M){a(A);const L=h[0];L!==void 0&&C(L,{kind:"source",name:M})}const T=u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:"Logs"}),u.jsxs(he,{onClick:()=>c(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(In,{}),"Add source"]}),u.jsxs(he,{disabled:h.length>=ES||x.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[u.jsx(In,{}),"Add pane"]})]});return u.jsxs(u.Fragment,{children:[u.jsx(k_,{maxWidthClass:"max-w-[1500px]",onClose:i,title:T,children:x.length===0?u.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:u.jsxs("div",{children:[u.jsx("p",{children:"No services or log sources yet."}),u.jsxs(he,{className:"mt-2",onClick:()=>c(!0),size:"sm",type:"button",children:[u.jsx(In,{}),"Add a log source"]})]})}):u.jsx("div",{className:de("grid h-full min-h-0 gap-3",h.length>1?"lg:grid-cols-2":"grid-cols-1",h.length>2?"lg:grid-rows-2":"grid-rows-1"),children:h.map(A=>u.jsx(n9,{onChangeTarget:M=>C(A,M),onRemove:h.length>1?()=>w(A):void 0,options:v,target:f[A]??x[0]},A))})}),l?u.jsx(t9,{onAdded:N,onClose:()=>c(!1)}):null]})}function n9({options:e,target:t,onChangeTarget:i,onRemove:s}){const[a,l]=E.useState(""),[c,h]=E.useState(!0),[m,f]=E.useState(!1);return u.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:u.jsx(xk,{fill:!0,hideStdout:m,leading:u.jsx(QL,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:l,setStreaming:h,streaming:c,target:t,trailing:s?u.jsx(he,{"aria-label":"Remove pane",onClick:s,size:"icon",type:"button",variant:"ghost",children:u.jsx(Hn,{})}):void 0})})}function s9({rows:e,revealAll:t,onAdd:i,onRemove:s,onUpdate:a}){return e.length===0?u.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",u.jsx("button",{className:"underline",onClick:i,type:"button",children:"Add one"}),"."]}):u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Key"}),u.jsx("th",{className:"py-1 pr-3",children:"Value"}),u.jsx("th",{className:"py-1 w-8"})]})}),u.jsx("tbody",{children:e.map((l,c)=>{const h=!l.reveal&&!t;return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(c,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:l.key})}),u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(c,{value:m.target.value}),spellCheck:!1,type:h?"password":"text",value:l.value}),u.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>a(c,{reveal:!l.reveal}),title:l.reveal||t?"Hide":"Reveal",type:"button",children:l.reveal||t?u.jsx(Y2,{size:14}):u.jsx($0,{size:14})})]})}),u.jsx("td",{className:"py-1 align-top",children:u.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>s(c),type:"button",children:u.jsx(Kc,{size:14})})})]},c)})})]})})}function r9({serviceName:e,onClose:t,onPick:i}){const[s,a]=E.useState(),[l,c]=E.useState(),[h,m]=E.useState(!0),[f,g]=E.useState();E.useEffect(()=>{let x=!1;return m(!0),c(void 0),(async()=>{try{const y=await zM(e,f);x||a(y)}catch(y){x||c(y instanceof Error?y.message:String(y))}finally{x||m(!1)}})(),()=>{x=!0}},[e,f]);function _(x){if(x.kind==="directory"){g(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("/")):"";g(y||void 0)}return u.jsx(Xs,{icon:u.jsx(Ch,{}),onClose:t,size:"lg",title:"Pick a config file",children:u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsxs(he,{disabled:!s||s.isRoot,onClick:v,size:"sm",type:"button",variant:"outline",children:[u.jsx(H0,{})," Up"]}),u.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:s?.relativePath||"./"})]}),l?u.jsx("div",{className:"text-red-600",children:l}):h?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!s||s.entries.length===0?u.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):u.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:u.jsx("ul",{className:"divide-y divide-border/40",children:s.entries.map(x=>{const y=x.kind==="directory",w=y||x.supported;return u.jsx("li",{children:u.jsxs("button",{className:de("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",w?"hover:bg-muted":"cursor-not-allowed text-muted-foreground"),disabled:!w,onClick:()=>_(x),type:"button",children:[y?u.jsx(Fa,{size:14}):u.jsx(Z2,{size:14}),u.jsx("span",{className:"flex-1 truncate font-mono",children:x.name}),!y&&x.format?u.jsx(Ke,{size:"small",variant:"secondary",children:x.format}):null]})},x.relativePath)})})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",u.jsx("code",{children:".env*"}),", ",u.jsx("code",{children:"appsettings*.json"}),", and"," ",u.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function yk(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function a9(e){const{error:t,success:i}=Ii(),[s,a]=E.useState([]),[l,c]=E.useState(),[h,m]=E.useState(),[f,g]=E.useState(!0),[_,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),[N,T]=E.useState();E.useEffect(()=>{let P=!1;return g(!0),T(void 0),(async()=>{try{const q=await IM(e);if(P)return;a(q.files),q.files.length>0?c(J=>J??q.files[0].path):(c(void 0),m(void 0))}catch(q){P||T(q instanceof Error?q.message:String(q))}finally{P||g(!1)}})(),()=>{P=!0}},[e]);const A=E.useCallback(async P=>{v(!0),T(void 0);try{const q=await Px(e,P),J={path:q.path,relativePath:q.relativePath,format:q.format};q.format==="env"?m({info:J,exists:q.exists,rows:q.entries.map(F=>({...F,reveal:!1}))}):m({info:J,exists:q.exists,text:q.format==="json"?yk(q.content):q.content}),C(!1)}catch(q){T(q instanceof Error?q.message:String(q))}finally{v(!1)}},[e]);E.useEffect(()=>{l&&A(l)},[l,A]);function M(P,q){m(J=>{if(!J?.rows)return J;const F=J.rows.map((ie,V)=>V===P?{...ie,...q}:ie);return{...J,rows:F}}),C(!0)}function L(){m(P=>P?.rows?{...P,rows:[...P.rows,{key:"",value:"",secret:!1,reveal:!0}]}:P),C(!0)}function K(P){m(q=>q?.rows?{...q,rows:q.rows.filter((J,F)=>F!==P)}:q),C(!0)}function B(P){m(q=>q&&{...q,text:P}),C(!0)}async function R(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const P=await PM(e,h.info.path,h.rows.map(q=>({key:q.key.trim(),value:q.value})));m({info:{path:P.path,relativePath:P.relativePath,format:P.format},exists:P.exists,rows:P.entries.map(q=>({...q,reveal:!1}))}),i(`Saved ${P.entries.length} entries to ${P.relativePath}.`)}else if(h.text!==void 0){const P=await UM(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}.`)}C(!1)}catch(P){t(P instanceof Error?P.message:String(P))}finally{y(!1)}}}async function H(P){try{const q=await Px(e,P),J={path:q.path,relativePath:q.relativePath,format:q.format};return a(F=>F.some(ie=>ie.path===J.path)?F:[...F,J]),c(J.path),i(`Loaded ${J.relativePath}.`),!0}catch(q){return t(q instanceof Error?q.message:String(q)),!1}}return{files:s,selectedPath:l,setSelectedPath:c,loaded:h,loadingList:f,loadingFile:_,saving:x,dirty:w,error:N,addRow:L,removeRow:K,updateRow:M,updateText:B,save:R,pickFile:H}}function o9({serviceName:e}){const{files:t,selectedPath:i,setSelectedPath:s,loaded:a,loadingList:l,loadingFile:c,saving:h,dirty:m,error:f,addRow:g,removeRow:_,updateRow:v,updateText:x,save:y,pickFile:w}=a9(e),[C,N]=E.useState(!1),[T,A]=E.useState(!1);return l?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?u.jsx("div",{className:"text-red-600",children:f}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?u.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:M=>s(M.target.value),value:i??"",children:t.map(M=>u.jsxs("option",{value:M.path,children:[M.relativePath," [",M.format,"]"]},M.path))}):u.jsx("span",{className:"text-muted-foreground",children:"none detected"}),u.jsxs(he,{onClick:()=>A(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(Ch,{})," Browse files"]}),a?u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),u.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?u.jsxs(u.Fragment,{children:[u.jsxs(he,{onClick:()=>N(M=>!M),size:"sm",type:"button",variant:"outline",children:[C?u.jsx(Y2,{}):u.jsx($0,{}),C?"Hide secrets":"Reveal secrets"]}),u.jsxs(he,{onClick:g,size:"sm",type:"button",variant:"outline",children:[u.jsx(In,{})," Add"]})]}):null,u.jsxs(he,{disabled:!m||h||!a,onClick:y,size:"sm",type:"button",children:[u.jsx(q0,{})," ",h?"Saving…":"Save"]})]})]}),f&&!a?u.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?u.jsx("div",{className:de(c&&"opacity-60 transition-opacity"),children:u.jsx(s9,{revealAll:C,rows:a.rows,onAdd:g,onRemove:_,onUpdate:v})}):a?.text!==void 0?u.jsxs("div",{className:de("space-y-1",c&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?u.jsx("div",{className:"flex justify-end",children:u.jsx(he,{onClick:()=>x(yk(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,u.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:M=>x(M.target.value),spellCheck:!1,value:a.text})]}):c?u.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?u.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?u.jsx(r9,{onClose:()=>A(!1),onPick:M=>{w(M).then(L=>{L&&A(!1)})},serviceName:e}):null]})}function l9({serviceName:e,status:t,timeline:i,onRefresh:s}){const{error:a,success:l}=Ii(),[c,h]=E.useState(!1),m=t?.inspector,f=t?.state==="running",g=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 _(x){h(!0);try{await Ki(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:x?"true":"false"}),await s(),l(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 u.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return u.jsxs("div",{className:"space-y-2",children:[u.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."}),u.jsxs(he,{disabled:c,onClick:()=>_(!0),size:"sm",type:"button",children:[u.jsx(V0,{})," Start HTTP inspector"]})]});const v=m.port?`http://127.0.0.1:${m.port}`:void 0;return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),v?u.jsxs(u.Fragment,{children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:v}),u.jsxs(he,{onClick:()=>{navigator.clipboard.writeText(v),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[u.jsx(W2,{})," Copy"]}),u.jsx(he,{onClick:()=>window.open(v,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):u.jsx("span",{className:"text-muted-foreground",children:"starting…"}),u.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),u.jsxs(he,{disabled:c,onClick:()=>_(!1),size:"sm",type:"button",variant:"outline",children:[u.jsx(Nh,{})," Stop"]})]}),g.length===0?u.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):u.jsx("div",{className:"max-h-80 overflow-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Time"}),u.jsx("th",{className:"py-1 pr-3",children:"Method"}),u.jsx("th",{className:"py-1 pr-3",children:"Path"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),u.jsx("tbody",{children:g.map(x=>u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(x.startedAt).toLocaleTimeString()}),u.jsx("td",{className:"py-1 pr-3",children:x.method}),u.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:x.path}),u.jsx("td",{className:de("py-1 pr-3 text-right",c9(x.status)),children:x.status}),u.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:u9(x.resBytes)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:x.durationMs.toFixed(1)})]},x.id))})]})})]})}function c9(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 u9(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function d9({serviceName:e}){const[t,i]=E.useState(null),[s,a]=E.useState(null),[l,c]=E.useState(()=>Date.now());return E.useEffect(()=>{let h=!1;async function m(){try{const g=await HM(e);h||(i(g),c(Date.now()),a(null))}catch(g){h||a(g instanceof Error?g.message:String(g))}}m();const f=setInterval(()=>{m()},3e3);return()=>{h=!0,clearInterval(f)}},[e]),s?u.jsxs("p",{className:"text-destructive",children:["Failed to load metrics: ",s]}):t?t.samples.length===0?u.jsx("p",{className:"text-muted-foreground",children:"No samples yet. Metrics start collecting once the service is running."}):u.jsx(h9,{series:t,now:l}):u.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"})}function h9({series:e,now:t}){const{samples:i}=e,s=E.useMemo(()=>CS(i,m=>m.cpu),[i]),a=E.useMemo(()=>CS(i,m=>m.rss),[i]),l=e.startedAt?new Date(e.startedAt):null,c=l?t-l.getTime():null,h=i.length>1?i[i.length-1].t-i[0].t:0;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[u.jsx(Td,{accent:"#22c55e",label:"CPU",value:`${s.last.toFixed(1)}%`,sub:`peak ${s.max.toFixed(1)}% · avg ${s.avg.toFixed(1)}%`}),u.jsx(Td,{accent:"#3b82f6",label:"Memory",value:bp(a.last),sub:`peak ${bp(a.max)} · avg ${bp(a.avg)}`}),u.jsx(Td,{accent:"#a855f7",label:"Uptime",value:c!=null?TS(c):"—",sub:l?`since ${l.toLocaleTimeString()}`:"not running"}),u.jsx(Td,{accent:"#f59e0b",label:"Samples",value:String(i.length),sub:h?`over ${TS(h)}`:"collecting…"})]}),u.jsx(NS,{label:"CPU",samples:i,pick:m=>m.cpu,summary:s,color:"#22c55e",suffix:"%",unit:"percent"}),u.jsx(NS,{label:"Memory (RSS)",samples:i,pick:m=>m.rss,summary:a,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function CS(e,t){const i=e.map(t),s=i.reduce((a,l)=>a+l,0);return{last:i[i.length-1],max:Math.max(...i),min:Math.min(...i),avg:s/i.length}}function Td({accent:e,label:t,value:i,sub:s}){return u.jsxs("div",{className:"rounded-lg border border-border bg-card px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:e}}),u.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:t})]}),u.jsx("div",{className:"mt-1 font-mono text-lg leading-none tabular-nums",children:i}),u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s})]})}const jo=160,kS=44,f9=20;function NS({label:e,samples:t,pick:i,summary:s,color:a,suffix:l,unit:c}){const h=E.useMemo(()=>`metric-grad-${c}-${Math.random().toString(36).slice(2,8)}`,[c]),m=t.map(i),f=Math.max(...m,c==="percent"?10:1),g=m9(f),_=0,v=g-_||1,x=t[0].t,y=t[t.length-1].t,w=Math.max(1,y-x),C=P=>(P-x)/w*1e3,N=P=>(1-(P-_)/v)*1e3,T=t.map(P=>`${C(P.t).toFixed(1)},${N(i(P)).toFixed(1)}`),A=`M0,1000 L${T.join(" L")} L1000,1000 Z`,M=`M${T.join(" L")}`,L=C(y),K=N(s.last),B=N(s.avg),R=[1,.75,.5,.25,0],H=5;return u.jsxs("figure",{className:"space-y-1",children:[u.jsxs("figcaption",{className:"flex items-baseline justify-between",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["now ",u.jsxs("span",{className:"text-foreground",children:[s.last.toFixed(1),l]}),u.jsx("span",{className:"mx-1.5",children:"·"}),"peak ",s.max.toFixed(1),l,u.jsx("span",{className:"mx-1.5",children:"·"}),"avg ",s.avg.toFixed(1),l]})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-card p-2",children:[u.jsxs("div",{className:"flex",children:[u.jsx("div",{className:"relative flex shrink-0 flex-col justify-between text-right font-mono text-[10px] text-muted-foreground",style:{width:kS,height:jo},children:R.map(P=>u.jsx("span",{className:"pr-1 leading-none",children:p9(_+P*v,c)},P))}),u.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:jo},children:[R.map((P,q)=>u.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-border/40",style:{top:`${P===1?0:P===0?jo-1:(1-P)*jo}px`,borderStyle:q===R.length-1?"solid":"dashed"}},P)),u.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-dashed",style:{top:`${B/1e3*jo}px`,borderColor:a,opacity:.4}}),u.jsxs("svg",{"aria-label":e,className:"absolute inset-0 h-full w-full",preserveAspectRatio:"none",role:"img",viewBox:"0 0 1000 1000",children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:h,x1:"0",x2:"0",y1:"0",y2:"1",children:[u.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.35}),u.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:.02})]})}),u.jsx("path",{d:A,fill:`url(#${h})`}),u.jsx("path",{d:M,fill:"none",stroke:a,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"})]}),u.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:`${L/1e3*100}%`,top:`${K/1e3*jo}px`,backgroundColor:a,boxShadow:`0 0 0 4px ${a}33`}})]})]}),u.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:f9,paddingLeft:kS},children:u.jsx("div",{className:"relative flex-1",children:Array.from({length:H+1},(P,q)=>{const J=q/H,F=x+J*w;return u.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${J*100}%`,transform:q===0?"translateX(0)":q===H?"translateX(-100%)":"translateX(-50%)"},children:g9(F-y)},q)})})})]})]})}function m9(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 p9(e,t){return t==="percent"?`${e.toFixed(0)}%`:e>=1024?`${(e/1024).toFixed(1)}G`:`${e.toFixed(0)}M`}function bp(e){return e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(0)} MB`}function TS(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 g9(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 _9({rows:e}){if(e.length===0)return u.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 u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"PID"}),u.jsx("th",{className:"py-1 pr-3",children:"PPID"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),u.jsx("th",{className:"py-1",children:"Command"})]})}),u.jsx("tbody",{children:t.map(s=>{const a=i.has(s.ppid);return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3",children:s.pid}),u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:s.ppid}),u.jsx("td",{className:"py-1 pr-3 text-right",children:s.cpuPercent.toFixed(1)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:s.rssMb.toFixed(1)}),u.jsx("td",{className:de("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:s.command})]},s.pid)})})]})})}var b9=2,v9=1,x9=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"))),l=window.getComputedStyle(this._terminal.element),c={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},h=c.top+c.bottom,m=c.right+c.left,f=s-h,g=a-m-t;return{cols:Math.max(b9,Math.floor(g/e.css.cell.width)),rows:Math.max(v9,Math.floor(f/e.css.cell.height))}}};var Sk=Object.defineProperty,y9=Object.getOwnPropertyDescriptor,S9=(e,t)=>{for(var i in t)Sk(e,i,{get:t[i],enumerable:!0})},Ht=(e,t,i,s)=>{for(var a=s>1?void 0:s?y9(t,i):t,l=e.length-1,c;l>=0;l--)(c=e[l])&&(a=(s?c(t,i,a):c(a))||a);return s&&a&&Sk(t,i,a),a},xe=(e,t)=>(i,s)=>t(i,s,e),AS="Terminal input",Gg={get:()=>AS,set:e=>AS=e},MS="Too much output to announce, navigate to rows manually to read",Wg={get:()=>MS,set:e=>MS=e};function w9(e){return e.replace(/\r?\n/g,"\r")}function E9(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function C9(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function k9(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");wk(a,t,i,s)}}function wk(e,t,i,s){e=w9(e),e=E9(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Ek(e,t,i){let s=i.getBoundingClientRect(),a=e.clientX-s.left-10,l=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function RS(e,t,i,s,a){Ek(e,t,i),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Ur(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Oh(e,t=0,i=e.length){let s="";for(let a=t;a<i;++a){let l=e[a];l>65535?(l-=65536,s+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):s+=String.fromCharCode(l)}return s}var N9=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 l=e.charCodeAt(a++);56320<=l&&l<=57343?t[s++]=(this._interim-55296)*1024+l-56320+65536:(t[s++]=this._interim,t[s++]=l),this._interim=0}for(let l=a;l<i;++l){let c=e.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=i)return this._interim=c,s;let h=e.charCodeAt(l);56320<=h&&h<=57343?t[s++]=(c-55296)*1024+h-56320+65536:(t[s++]=c,t[s++]=h);continue}c!==65279&&(t[s++]=c)}return s}},T9=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,l,c,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,w;for(;(w=this.interim[++y]&63)&&y<4;)x<<=6,x|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,N=C-y;for(;f<N;){if(f>=i)return 0;if(w=e[f++],(w&192)!==128){f--,v=!0;break}else this.interim[y++]=w,x<<=6,x|=w&63}v||(C===2?x<128?f--:t[s++]=x:C===3?x<2048||x>=55296&&x<=57343||x===65279||(t[s++]=x):x<65536||x>1114111||(t[s++]=x)),this.interim.fill(0)}let g=i-4,_=f;for(;_<i;){for(;_<g&&!((a=e[_])&128)&&!((l=e[_+1])&128)&&!((c=e[_+2])&128)&&!((h=e[_+3])&128);)t[s++]=a,t[s++]=l,t[s++]=c,t[s++]=h,_+=4;if(a=e[_++],a<128)t[s++]=a;else if((a&224)===192){if(_>=i)return this.interim[0]=a,s;if(l=e[_++],(l&192)!==128){_--;continue}if(m=(a&31)<<6|l&63,m<128){_--;continue}t[s++]=m}else if((a&240)===224){if(_>=i)return this.interim[0]=a,s;if(l=e[_++],(l&192)!==128){_--;continue}if(_>=i)return this.interim[0]=a,this.interim[1]=l,s;if(c=e[_++],(c&192)!==128){_--;continue}if(m=(a&15)<<12|(l&63)<<6|c&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[s++]=m}else if((a&248)===240){if(_>=i)return this.interim[0]=a,s;if(l=e[_++],(l&192)!==128){_--;continue}if(_>=i)return this.interim[0]=a,this.interim[1]=l,s;if(c=e[_++],(c&192)!==128){_--;continue}if(_>=i)return this.interim[0]=a,this.interim[1]=l,this.interim[2]=c,s;if(h=e[_++],(h&192)!==128){_--;continue}if(m=(a&7)<<18|(l&63)<<12|(c&63)<<6|h&63,m<65536||m>1114111)continue;t[s++]=m}}return s}},Ck="",$r=" ",eu=class kk{constructor(){this.fg=0,this.bg=0,this.extended=new dh}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 kk;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}},dh=class Nk{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 Nk(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Un=class Tk extends eu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new dh,this.combinedData=""}static fromCharData(t){let i=new Tk;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?Ur(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()]}},DS="di$target",Yg="di$dependencies",vp=new Map;function A9(e){return e[Yg]||[]}function vi(e){if(vp.has(e))return vp.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");M9(t,i,a)};return t._id=e,vp.set(e,t),t}function M9(e,t,i){t[DS]===t?t[Yg].push({id:e,index:i}):(t[Yg]=[{id:e,index:i}],t[DS]=t)}var Wi=vi("BufferService"),Ak=vi("CoreMouseService"),Va=vi("CoreService"),R9=vi("CharsetService"),N_=vi("InstantiationService"),Mk=vi("LogService"),Yi=vi("OptionsService"),Rk=vi("OscLinkService"),D9=vi("UnicodeService"),tu=vi("DecorationService"),Xg=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,l=new Un,c=i.getTrimmedLength(),h=-1,m=-1,f=!1;for(let g=0;g<c;g++)if(!(m===-1&&!i.hasContent(g))){if(i.loadCell(g,l),l.hasExtendedAttrs()&&l.extended.urlId)if(m===-1){m=g,h=l.extended.urlId;continue}else f=l.extended.urlId!==h;else m!==-1&&(f=!0);if(f||m!==-1&&g===c-1){let _=this._oscLinkService.getLinkData(h)?.uri;if(_){let v={start:{x:m+1,y:e},end:{x:g+(!f&&g===c-1?1:0),y:e}},x=!1;if(!a?.allowNonHttpProtocols)try{let y=new URL(_);["http:","https:"].includes(y.protocol)||(x=!0)}catch{x=!0}x||s.push({text:_,range:v,activate:(y,w)=>a?a.activate(y,w,v):O9(y,w),hover:(y,w)=>a?.hover?.(y,w,v),leave:(y,w)=>a?.leave?.(y,w,v)})}f=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=g,h=l.extended.urlId):(m=-1,h=-1)}}t(s)}};Xg=Ht([xe(0,Wi),xe(1,Yi),xe(2,Rk)],Xg);function O9(e,t){if(confirm(`Do you want to navigate to ${t}?
24
-
25
- 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 jh=vi("CharSizeService"),ir=vi("CoreBrowserService"),T_=vi("MouseService"),nr=vi("RenderService"),j9=vi("SelectionService"),Dk=vi("CharacterJoinerService"),sl=vi("ThemeService"),Ok=vi("LinkProviderService"),L9=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?OS.isErrorNoTelemetry(e)?new OS(e.message+`
26
-
27
- `+e.stack):new Error(e.message+`
28
-
29
- `+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)}},B9=new L9;function qd(e){z9(e)||B9.onUnexpectedError(e)}var Zg="Canceled";function z9(e){return e instanceof I9?!0:e instanceof Error&&e.name===Zg&&e.message===Zg}var I9=class extends Error{constructor(){super(Zg),this.name=this.message}};function P9(e){return new Error(`Illegal argument: ${e}`)}var OS=class Qg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Qg)return t;let i=new Qg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Jg=class jk extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,jk.prototype)}};function bn(e,t=0){return e[e.length-(1+t)]}var U9;(e=>{function t(l){return l<0}e.isLessThan=t;function i(l){return l<=0}e.isLessThanOrEqual=i;function s(l){return l>0}e.isGreaterThan=s;function a(l){return l===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(U9||={});function H9(e,t){let i=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(i,arguments))),a}}var Lk;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*a(M){yield M}e.single=a;function l(M){return t(M)?M:a(M)}e.wrap=l;function c(M){return M||i}e.from=c;function*h(M){for(let L=M.length-1;L>=0;L--)yield M[L]}e.reverse=h;function m(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(M){return M[Symbol.iterator]().next().value}e.first=f;function g(M,L){let K=0;for(let B of M)if(L(B,K++))return!0;return!1}e.some=g;function _(M,L){for(let K of M)if(L(K))return K}e.find=_;function*v(M,L){for(let K of M)L(K)&&(yield K)}e.filter=v;function*x(M,L){let K=0;for(let B of M)yield L(B,K++)}e.map=x;function*y(M,L){let K=0;for(let B of M)yield*L(B,K++)}e.flatMap=y;function*w(...M){for(let L of M)yield*L}e.concat=w;function C(M,L,K){let B=K;for(let R of M)B=L(B,R);return B}e.reduce=C;function*N(M,L,K=M.length){for(L<0&&(L+=M.length),K<0?K+=M.length:K>M.length&&(K=M.length);L<K;L++)yield M[L]}e.slice=N;function T(M,L=Number.POSITIVE_INFINITY){let K=[];if(L===0)return[K,M];let B=M[Symbol.iterator]();for(let R=0;R<L;R++){let H=B.next();if(H.done)return[K,e.empty()];K.push(H.value)}return[K,{[Symbol.iterator](){return B}}]}e.consume=T;async function A(M){let L=[];for await(let K of M)L.push(K);return Promise.resolve(L)}e.asyncToArray=A})(Lk||={});function Pa(e){if(Lk.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 F9(...e){return Dt(()=>Pa(e))}function Dt(e){return{dispose:H9(()=>{e()})}}var Bk=class zk{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{Pa(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?zk.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)}};Bk.DISABLE_DISPOSED_WARNING=!1;var Vr=Bk,Ge=class{constructor(){this._store=new Vr,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Ge.None=Object.freeze({dispose(){}});var Zo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Ys=typeof window=="object"?window:globalThis,e0=class t0{constructor(t){this.element=t,this.next=t0.Undefined,this.prev=t0.Undefined}};e0.Undefined=new e0(void 0);var Lt=e0,jS=class{constructor(){this._first=Lt.Undefined,this._last=Lt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Lt.Undefined}clear(){let e=this._first;for(;e!==Lt.Undefined;){let t=e.next;e.prev=Lt.Undefined,e.next=Lt.Undefined,e=t}this._first=Lt.Undefined,this._last=Lt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Lt(e);if(this._first===Lt.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!==Lt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Lt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Lt.Undefined&&e.next!==Lt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Lt.Undefined&&e.next===Lt.Undefined?(this._first=Lt.Undefined,this._last=Lt.Undefined):e.next===Lt.Undefined?(this._last=this._last.prev,this._last.next=Lt.Undefined):e.prev===Lt.Undefined&&(this._first=this._first.next,this._first.prev=Lt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Lt.Undefined;)yield e.element,e=e.next}},$9=globalThis.performance&&typeof globalThis.performance.now=="function",V9=class Ik{static create(t){return new Ik(t)}constructor(t){this._now=$9&&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}},Ti;(e=>{e.None=()=>Ge.None;function t(J,F){return _(J,()=>{},0,void 0,!0,void 0,F)}e.defer=t;function i(J){return(F,ie=null,V)=>{let O=!1,Y;return Y=J(X=>{if(!O)return Y?Y.dispose():O=!0,F.call(ie,X)},null,V),O&&Y.dispose(),Y}}e.once=i;function s(J,F,ie){return f((V,O=null,Y)=>J(X=>V.call(O,F(X)),null,Y),ie)}e.map=s;function a(J,F,ie){return f((V,O=null,Y)=>J(X=>{F(X),V.call(O,X)},null,Y),ie)}e.forEach=a;function l(J,F,ie){return f((V,O=null,Y)=>J(X=>F(X)&&V.call(O,X),null,Y),ie)}e.filter=l;function c(J){return J}e.signal=c;function h(...J){return(F,ie=null,V)=>{let O=F9(...J.map(Y=>Y(X=>F.call(ie,X))));return g(O,V)}}e.any=h;function m(J,F,ie,V){let O=ie;return s(J,Y=>(O=F(O,Y),O),V)}e.reduce=m;function f(J,F){let ie,V={onWillAddFirstListener(){ie=J(O.fire,O)},onDidRemoveLastListener(){ie?.dispose()}},O=new pe(V);return F?.add(O),O.event}function g(J,F){return F instanceof Array?F.push(J):F&&F.add(J),J}function _(J,F,ie=100,V=!1,O=!1,Y,X){let j,W,D,te=0,ue,$={leakWarningThreshold:Y,onWillAddFirstListener(){j=J(fe=>{te++,W=F(W,fe),V&&!D&&(se.fire(W),W=void 0),ue=()=>{let ve=W;W=void 0,D=void 0,(!V||te>1)&&se.fire(ve),te=0},typeof ie=="number"?(clearTimeout(D),D=setTimeout(ue,ie)):D===void 0&&(D=0,queueMicrotask(ue))})},onWillRemoveListener(){O&&te>0&&ue?.()},onDidRemoveLastListener(){ue=void 0,j.dispose()}},se=new pe($);return X?.add(se),se.event}e.debounce=_;function v(J,F=0,ie){return e.debounce(J,(V,O)=>V?(V.push(O),V):[O],F,void 0,!0,void 0,ie)}e.accumulate=v;function x(J,F=(V,O)=>V===O,ie){let V=!0,O;return l(J,Y=>{let X=V||!F(Y,O);return V=!1,O=Y,X},ie)}e.latch=x;function y(J,F,ie){return[e.filter(J,F,ie),e.filter(J,V=>!F(V),ie)]}e.split=y;function w(J,F=!1,ie=[],V){let O=ie.slice(),Y=J(W=>{O?O.push(W):j.fire(W)});V&&V.add(Y);let X=()=>{O?.forEach(W=>j.fire(W)),O=null},j=new pe({onWillAddFirstListener(){Y||(Y=J(W=>j.fire(W)),V&&V.add(Y))},onDidAddFirstListener(){O&&(F?setTimeout(X):X())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return V&&V.add(j),j.event}e.buffer=w;function C(J,F){return(ie,V,O)=>{let Y=F(new T);return J(function(X){let j=Y.evaluate(X);j!==N&&ie.call(V,j)},void 0,O)}}e.chain=C;let N=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(ie=>(F(ie),ie)),this}filter(F){return this.steps.push(ie=>F(ie)?ie:N),this}reduce(F,ie){let V=ie;return this.steps.push(O=>(V=F(V,O),V)),this}latch(F=(ie,V)=>ie===V){let ie=!0,V;return this.steps.push(O=>{let Y=ie||!F(O,V);return ie=!1,V=O,Y?O:N}),this}evaluate(F){for(let ie of this.steps)if(F=ie(F),F===N)break;return F}}function A(J,F,ie=V=>V){let V=(...j)=>X.fire(ie(...j)),O=()=>J.on(F,V),Y=()=>J.removeListener(F,V),X=new pe({onWillAddFirstListener:O,onDidRemoveLastListener:Y});return X.event}e.fromNodeEventEmitter=A;function M(J,F,ie=V=>V){let V=(...j)=>X.fire(ie(...j)),O=()=>J.addEventListener(F,V),Y=()=>J.removeEventListener(F,V),X=new pe({onWillAddFirstListener:O,onDidRemoveLastListener:Y});return X.event}e.fromDOMEventEmitter=M;function L(J){return new Promise(F=>i(J)(F))}e.toPromise=L;function K(J){let F=new pe;return J.then(ie=>{F.fire(ie)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}e.fromPromise=K;function B(J,F){return J(ie=>F.fire(ie))}e.forward=B;function R(J,F,ie){return F(ie),J(V=>F(V))}e.runAndSubscribe=R;class H{constructor(F,ie){this._observable=F,this._counter=0,this._hasChanged=!1;let V={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new pe(V),ie&&ie.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,ie){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(J,F){return new H(J,F).emitter.event}e.fromObservable=P;function q(J){return(F,ie,V)=>{let O=0,Y=!1,X={beginUpdate(){O++},endUpdate(){O--,O===0&&(J.reportChanges(),Y&&(Y=!1,F.call(ie)))},handlePossibleChange(){},handleChange(){Y=!0}};J.addObserver(X),J.reportChanges();let j={dispose(){J.removeObserver(X)}};return V instanceof Vr?V.add(j):Array.isArray(V)&&V.push(j),j}}e.fromObservableLight=q})(Ti||={});var i0=class n0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${n0._idPool++}`,n0.all.add(this)}start(t){this._stopWatch=new V9,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}}};i0.all=new Set,i0._idPool=0;var q9=i0,K9=-1,Pk=class Uk{constructor(t,i,s=(Uk._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[l,c]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${c}):`;console.warn(h),console.warn(l);let m=new Y9(h,l);this._errorHandler(m)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-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}};Pk._idPool=1;var G9=Pk,W9=class Hk{constructor(t){this.value=t}static create(){let t=new Error;return new Hk(t.stack??"")}print(){console.warn(this.value.split(`
30
- `).slice(2).join(`
31
- `))}},Y9=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},X9=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Z9=0,xp=class{constructor(e){this.value=e,this.id=Z9++}},Q9=2,J9,pe=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new G9(t?.onListenerError??qd,this._options?.leakWarningThreshold??K9):void 0,this._perfMon=this._options?._profName?new q9(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??=(t,i,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new X9(`${h}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(this._options?.onListenerError||qd)(f),Ge.None}if(this._disposed)return Ge.None;i&&(t=t.bind(i));let a=new xp(t),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=W9.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof xp?(this._deliveryQueue??=new eB,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let c=Dt(()=>{l?.(),this._removeListener(a)});return s instanceof Vr?s.add(c):Array.isArray(s)&&s.push(c),c},this._event}_removeListener(t){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 i=this._listeners,s=i.indexOf(t);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let a=this._deliveryQueue.current===this;if(this._size*Q9<=i.length){let l=0;for(let c=0;c<i.length;c++)i[c]?i[l++]=i[c]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(t,i){if(!t)return;let s=this._options?.onListenerError||qd;if(!s){t.value(i);return}try{t.value(i)}catch(a){s(a)}}_deliverQueue(t){let i=t.current._listeners;for(;t.i<t.end;)this._deliver(i[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof xp)this._deliver(this._listeners,t);else{let i=this._deliveryQueue;i.enqueue(this,t,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},eB=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}},s0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new pe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new pe,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}};s0.INSTANCE=new s0;var A_=s0;function tB(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}A_.INSTANCE.onDidChangeZoomLevel;function iB(e){return A_.INSTANCE.getZoomFactor(e)}A_.INSTANCE.onDidChangeFullscreen;var rl=typeof navigator=="object"?navigator.userAgent:"",r0=rl.indexOf("Firefox")>=0,nB=rl.indexOf("AppleWebKit")>=0,M_=rl.indexOf("Chrome")>=0,sB=!M_&&rl.indexOf("Safari")>=0;rl.indexOf("Electron/")>=0;rl.indexOf("Android")>=0;var yp=!1;if(typeof Ys.matchMedia=="function"){let e=Ys.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ys.matchMedia("(display-mode: fullscreen)");yp=e.matches,tB(Ys,e,({matches:i})=>{yp&&t.matches||(yp=i)})}var qo="en",a0=!1,o0=!1,Kd=!1,Fk=!1,Ad,Gd=qo,LS=qo,rB,Ws,za=globalThis,xn;typeof za.vscode<"u"&&typeof za.vscode.process<"u"?xn=za.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(xn=process);var aB=typeof xn?.versions?.electron=="string",oB=aB&&xn?.type==="renderer";if(typeof xn=="object"){a0=xn.platform==="win32",o0=xn.platform==="darwin",Kd=xn.platform==="linux",Kd&&xn.env.SNAP&&xn.env.SNAP_REVISION,xn.env.CI||xn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ad=qo,Gd=qo;let e=xn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ad=t.userLocale,LS=t.osLocale,Gd=t.resolvedLanguage||qo,rB=t.languagePack?.translationsConfigFile}catch{}Fk=!0}else typeof navigator=="object"&&!oB?(Ws=navigator.userAgent,a0=Ws.indexOf("Windows")>=0,o0=Ws.indexOf("Macintosh")>=0,(Ws.indexOf("Macintosh")>=0||Ws.indexOf("iPad")>=0||Ws.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Kd=Ws.indexOf("Linux")>=0,Ws?.indexOf("Mobi")>=0,Gd=globalThis._VSCODE_NLS_LANGUAGE||qo,Ad=navigator.language.toLowerCase(),LS=Ad):console.error("Unable to resolve platform.");var $k=a0,ps=o0,lB=Kd,BS=Fk,bs=Ws,Lr=Gd,cB;(e=>{function t(){return Lr}e.value=t;function i(){return Lr.length===2?Lr==="en":Lr.length>=3?Lr[0]==="e"&&Lr[1]==="n"&&Lr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Lr==="en"}e.isDefault=s})(cB||={});var uB=typeof za.postMessage=="function"&&!za.importScripts;(()=>{if(uB){let e=[];za.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,a=e.length;s<a;s++){let l=e[s];if(l.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),l.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),za.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var dB=!!(bs&&bs.indexOf("Chrome")>=0);bs&&bs.indexOf("Firefox")>=0;!dB&&bs&&bs.indexOf("Safari")>=0;bs&&bs.indexOf("Edg/")>=0;bs&&bs.indexOf("Android")>=0;var Lo=typeof navigator=="object"?navigator:{};BS||document.queryCommandSupported&&document.queryCommandSupported("copy")||Lo&&Lo.clipboard&&Lo.clipboard.writeText,BS||Lo&&Lo.clipboard&&Lo.clipboard.readText;var R_=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}},Sp=new R_,zS=new R_,IS=new R_,hB=new Array(230),Vk;(e=>{function t(h){return Sp.keyCodeToStr(h)}e.toString=t;function i(h){return Sp.strToKeyCode(h)}e.fromString=i;function s(h){return zS.keyCodeToStr(h)}e.toUserSettingsUS=s;function a(h){return IS.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function l(h){return zS.strToKeyCode(h)||IS.strToKeyCode(h)}e.fromUserSettings=l;function c(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 Sp.keyCodeToStr(h)}e.toElectronAccelerator=c})(Vk||={});var fB=class qk{constructor(t,i,s,a,l){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=a,this.keyCode=l}equals(t){return t instanceof qk&&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 mB([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},mB=class{constructor(e){if(e.length===0)throw P9("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 pB(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Vk.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(r0)switch(t){case 59:return 85;case 60:if(lB)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ps)return 57;break}else if(nB&&(ps&&t===93||!ps&&t===92))return 57;return hB[t]||0}var gB=ps?256:2048,_B=512,bB=1024,vB=ps?2048:256,PS=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=pB(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|=gB),this.altKey&&(t|=_B),this.shiftKey&&(t|=bB),this.metaKey&&(t|=vB),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new fB(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},US=new WeakMap;function xB(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 yB=class{static getSameOriginWindowChain(e){let t=US.get(e);if(!t){t=[],US.set(e,t);let i=e,s;do s=xB(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 l of a){let c=l.window.deref();if(i+=c?.scrollY??0,s+=c?.scrollX??0,c===t||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();i+=h.top,s+=h.left}return{top:i,left:s}}},Md=class{constructor(t,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=yB.getPositionOfChildWindowRelativeToAncestorWindow(t,i.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},HS=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(M_){let a=navigator.userAgent.match(/Chrome\/(\d+)/);s=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,c=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")s?this.deltaY=a.wheelDeltaY/(120*c):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?r0&&!ps?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")sB&&$k?this.deltaX=-(a.wheelDeltaX/120):s?this.deltaX=a.wheelDeltaX/(120*c):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?r0&&!ps?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*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},Kk=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),SB;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof wB?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ti.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Kk})})(SB||={});var wB=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?Kk:(this._emitter||(this._emitter=new pe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},D_=class{constructor(t,i){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof i=="number"&&this.setIfNotSet(t,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,i){if(this._isDisposed)throw new Jg("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},i)}setIfNotSet(t,i){if(this._isDisposed)throw new Jg("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},i))}},EB=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 Jg("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=Dt(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},CB;(e=>{async function t(s){let a,l=await Promise.all(s.map(c=>c.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}e.settled=t;function i(s){return new Promise(async(a,l)=>{try{await s(a,l)}catch(c){l(c)}})}e.withAsyncBody=i})(CB||={});var FS=class jn{static fromArray(t){return new jn(i=>{i.emitMany(t)})}static fromPromise(t){return new jn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new jn(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new jn(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 pe,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 Ti.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new jn(async s=>{for await(let a of t)s.emitOne(i(a))})}map(t){return jn.map(this,t)}static filter(t,i){return new jn(async s=>{for await(let a of t)i(a)&&s.emitOne(a)})}filter(t){return jn.filter(this,t)}static coalesce(t){return jn.filter(t,i=>!!i)}coalesce(){return jn.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return jn.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())}};FS.EMPTY=FS.fromArray([]);var{getWindow:fs,getWindowId:kB,onDidRegisterWindow:NB}=(function(){let e=new Map,t={window:Ys,disposables:new Vr};e.set(Ys.vscodeWindowId,t);let i=new pe,s=new pe,a=new pe;function l(c,h){return(typeof c=="number"?e.get(c):void 0)??(h?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(c){if(e.has(c.vscodeWindowId))return Ge.None;let h=new Vr,m={window:c,disposables:h.add(new Vr)};return e.set(c.vscodeWindowId,m),h.add(Dt(()=>{e.delete(c.vscodeWindowId),s.fire(c)})),h.add(Pe(c,pi.BEFORE_UNLOAD,()=>{a.fire(c)})),i.fire(m),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:l,getWindow(c){let h=c;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let m=c;return m?.view?m.view.window:Ys},getDocument(c){return fs(c).document}}})(),TB=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 Pe(e,t,i,s){return new TB(e,t,i,s)}var $S=function(e,t,i,s){return Pe(e,t,i,s)},O_,AB=class extends EB{constructor(e){super(),this.defaultTarget=e&&fs(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},VS=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){qd(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=l=>{i.set(l,!1);let c=e.get(l)??[];for(t.set(l,c),e.set(l,[]),s.set(l,!0);c.length>0;)c.sort(VS.sort),c.shift().execute();s.set(l,!1)};O_=(l,c,h=0)=>{let m=kB(l),f=new VS(c,h),g=e.get(m);return g||(g=[],e.set(m,g)),g.push(f),i.get(m)||(i.set(m,!0),l.requestAnimationFrame(()=>a(m))),f}})();function MB(e){let t=e.getBoundingClientRect(),i=fs(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var pi={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"},RB=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=an(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=an(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=an(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=an(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=an(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=an(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=an(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=an(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=an(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=an(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=an(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=an(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=an(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=an(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 an(e){return typeof e=="number"?`${e}px`:e}function Ac(e){return new RB(e)}var Gk=class{constructor(){this._hooks=new Vr,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 l=e;try{e.setPointerCapture(t),this._hooks.add(Dt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=fs(e)}this._hooks.add(Pe(l,pi.POINTER_MOVE,c=>{if(c.buttons!==i){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(Pe(l,pi.POINTER_UP,c=>this.stopMonitoring(!0)))}};function DB(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 l=`$memoize$${t}`;i[s]=function(...c){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,c)}),this[l]}}var cs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(cs||={});var bc=class Li extends Ge{constructor(){super(),this.dispatched=!1,this.targets=new jS,this.ignoreTargets=new jS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ti.runAndSubscribe(NB,({window:t,disposables:i})=>{i.add(Pe(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Pe(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(Pe(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Ys,disposables:this._store}))}static addTarget(t){if(!Li.isTouchDevice())return Ge.None;Li.INSTANCE||(Li.INSTANCE=new Li);let i=Li.INSTANCE.targets.push(t);return Dt(i)}static ignoreTarget(t){if(!Li.isTouchDevice())return Ge.None;Li.INSTANCE||(Li.INSTANCE=new Li);let i=Li.INSTANCE.ignoreTargets.push(t);return Dt(i)}static isTouchDevice(){return"ontouchstart"in Ys||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 l=t.targetTouches.item(s);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:i,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[i],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let c=this.newGestureEvent(cs.Start,l.target);c.pageX=l.pageX,c.pageY=l.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),a=Object.keys(this.activeTouches).length;for(let l=0,c=i.changedTouches.length;l<c;l++){let h=i.changedTouches.item(l);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<Li.HOLD_DELAY&&Math.abs(m.initialPageX-bn(m.rollingPageX))<30&&Math.abs(m.initialPageY-bn(m.rollingPageY))<30){let g=this.newGestureEvent(cs.Tap,m.initialTarget);g.pageX=bn(m.rollingPageX),g.pageY=bn(m.rollingPageY),this.dispatchEvent(g)}else if(f>=Li.HOLD_DELAY&&Math.abs(m.initialPageX-bn(m.rollingPageX))<30&&Math.abs(m.initialPageY-bn(m.rollingPageY))<30){let g=this.newGestureEvent(cs.Contextmenu,m.initialTarget);g.pageX=bn(m.rollingPageX),g.pageY=bn(m.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=bn(m.rollingPageX),_=bn(m.rollingPageY),v=bn(m.rollingTimestamps)-m.rollingTimestamps[0],x=g-m.rollingPageX[0],y=_-m.rollingPageY[0],w=[...this.targets].filter(C=>m.initialTarget instanceof Node&&C.contains(m.initialTarget));this.inertia(t,w,s,Math.abs(x)/v,x>0?1:-1,g,Math.abs(y)/v,y>0?1:-1,_)}this.dispatchEvent(this.newGestureEvent(cs.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===cs.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Li.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===cs.Change||t.type===cs.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,l=t.initialTarget;for(;l&&l!==s;)a++,l=l.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,l,c,h,m,f){this.handle=O_(t,()=>{let g=Date.now(),_=g-s,v=0,x=0,y=!0;a+=Li.SCROLL_FRICTION*_,h+=Li.SCROLL_FRICTION*_,a>0&&(y=!1,v=l*a*_),h>0&&(y=!1,x=m*h*_);let w=this.newGestureEvent(cs.Change);w.translationX=v,w.translationY=x,i.forEach(C=>C.dispatchEvent(w)),y||this.inertia(t,i,g,a,l,c+v,h,m,f+x)})}onTouchMove(t){let i=Date.now();for(let s=0,a=t.changedTouches.length;s<a;s++){let l=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],h=this.newGestureEvent(cs.Change,c.initialTarget);h.translationX=l.pageX-bn(c.rollingPageX),h.translationY=l.pageY-bn(c.rollingPageY),h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(l.pageX),c.rollingPageY.push(l.pageY),c.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};bc.SCROLL_FRICTION=-.005,bc.HOLD_DELAY=700,bc.CLEAR_TAP_COUNT_TIME=400,Ht([DB],bc,"isTouchDevice",1);var OB=bc,j_=class extends Ge{onclick(e,t){this._register(Pe(e,pi.CLICK,i=>t(new Md(fs(e),i))))}onmousedown(e,t){this._register(Pe(e,pi.MOUSE_DOWN,i=>t(new Md(fs(e),i))))}onmouseover(e,t){this._register(Pe(e,pi.MOUSE_OVER,i=>t(new Md(fs(e),i))))}onmouseleave(e,t){this._register(Pe(e,pi.MOUSE_LEAVE,i=>t(new Md(fs(e),i))))}onkeydown(e,t){this._register(Pe(e,pi.KEY_DOWN,i=>t(new PS(i))))}onkeyup(e,t){this._register(Pe(e,pi.KEY_UP,i=>t(new PS(i))))}oninput(e,t){this._register(Pe(e,pi.INPUT,t))}onblur(e,t){this._register(Pe(e,pi.BLUR,t))}onfocus(e,t){this._register(Pe(e,pi.FOCUS,t))}onchange(e,t){this._register(Pe(e,pi.CHANGE,t))}ignoreGesture(e){return OB.ignoreTarget(e)}},qS=11,jB=class extends j_{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=qS+"px",this.domNode.style.height=qS+"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 Gk),this._register($S(this.bgDomNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register($S(this.domNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new AB),this._pointerdownScheduleRepeatTimer=this._register(new D_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,fs(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()}},LB=class l0{constructor(t,i,s,a,l,c,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,a=a|0,l=l|0,c=c|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>s&&(a=s-i),a<0&&(a=0),l<0&&(l=0),h+l>c&&(h=c-l),h<0&&(h=0),this.width=i,this.scrollWidth=s,this.scrollLeft=a,this.height=l,this.scrollHeight=c,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 l0(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 l0(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,l=this.scrollLeft!==t.scrollLeft,c=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:l,heightChanged:c,scrollHeightChanged:h,scrollTopChanged:m}}},BB=class extends Ge{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new LB(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 GS(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=GS.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)))}},KS=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function wp(e,t){let i=t-e;return function(s){return e+i*PB(s)}}function zB(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var GS=class c0{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,l;return t<i?(a=t+.75*s,l=i-.75*s):(a=t-.75*s,l=i+.75*s),zB(wp(t,a),wp(l,i),.33)}return wp(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 KS(s,a,!1)}return new KS(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return c0.start(t,i,s)}static start(t,i,s){s=s+10;let a=Date.now()-10;return new c0(t,i,a,s)}};function IB(e){return Math.pow(e,3)}function PB(e){return 1-IB(1-e)}var UB=class extends Ge{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 D_)}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":"")))}},HB=140,Wk=class extends j_{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 UB(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Gk),this._shouldRender=!0,this.domNode=Ac(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(Pe(this.domNode.domNode,pi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new jB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Ac(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(Pe(this.slider.domNode,pi.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=MB(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 l=this._sliderOrthogonalPointerPosition(a),c=Math.abs(l-i);if($k&&c>HB){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()}},Yk=class u0{constructor(t,i,s,a,l,c){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=l,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new u0(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,l){let c=Math.max(0,s-t),h=Math.max(0,c-2*i),m=a>0&&a>s;if(!m)return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(s*h/a))),g=(h-f)/(a-s),_=l*g;return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:g,computedSliderPosition:Math.round(_)}}_refreshComputedValues(){let t=u0._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)}},FB=class extends Wk{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Yk(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}},$B=class extends Wk{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Yk(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}},VB=500,WS=50,qB=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},d0=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 l=a===this._front?t:Math.pow(2,-s);if(t-=l,i+=this._memory[a].score*l,a===this._front)break;a=(this._capacity+a-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(M_){let i=fs(t.browserEvent),s=iB(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,l=new qB(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=l,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]=l),l.score=this._computeScore(l,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),l=Math.abs(t.deltaY),c=Math.abs(i.deltaX),h=Math.abs(i.deltaY),m=Math.max(Math.min(a,c),1),f=Math.max(Math.min(l,h),1),g=Math.max(a,c),_=Math.max(l,h);g%m===0&&_%f===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};d0.INSTANCE=new d0;var KB=d0,GB=class extends j_{constructor(e,t,i){super(),this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new pe),this.onWillScroll=this._onWillScroll.event,this._options=YB(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 $B(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new FB(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=Ac(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ac(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ac(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 D_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Pa(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,ps&&(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 HS(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Pa(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new HS(i))};this._mouseWheelToDispose.push(Pe(this._listenOnDomNode,pi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=KB.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let c=!ps&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),m={};if(a){let f=WS*a,g=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,g)}if(l){let f=WS*l,g=h.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(m,g)}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":"",l=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${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(),VB)}},WB=class extends GB{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 YB(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,ps&&(t.className+=" mac"),t}var h0=class extends Ge{constructor(e,t,i,s,a,l,c,h){super(),this._bufferService=i,this._optionsService=c,this._renderService=h,this._onRequestScrollLines=this._register(new pe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new BB({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>O_(s.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new WB(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(Ti.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Dt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Dt(()=>this._styleElement.remove())),this._register(Ti.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
32
- `)})),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}};h0=Ht([xe(2,Wi),xe(3,ir),xe(4,Ak),xe(5,sl),xe(6,Yi),xe(7,nr)],h0);var f0=class extends Ge{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(l=>this._removeDecoration(l))),this._register(Dt(()=>{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()}};f0=Ht([xe(1,Wi),xe(2,ir),xe(3,tu),xe(4,nr)],f0);var XB=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)}},os={full:0,left:0,center:0,right:0},Br={full:0,left:0,center:0,right:0},oc={full:0,left:0,center:0,right:0},hh=class extends Ge{constructor(e,t,i,s,a,l,c,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=a,this._optionsService=l,this._themeService=c,this._coreBrowserService=h,this._colorZoneStore=new XB,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(Dt(()=>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);Br.full=this._canvas.width,Br.left=e,Br.center=t,Br.right=e,this._refreshDrawHeightConstants(),oc.full=1,oc.left=1,oc.center=1+Br.left,oc.right=1+Br.left+Br.center}_refreshDrawHeightConstants(){os.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);os.left=t,os.center=t,os.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*os.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*os.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*os.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*os.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(oc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-os[e.position||"full"]/2),Br[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+os[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}))}};hh=Ht([xe(2,Wi),xe(3,tu),xe(4,nr),xe(5,Yi),xe(6,sl),xe(7,ir)],hh);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=`
33
- `,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 Wd;(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="Ÿ"))(Wd||={});var Xk;(e=>e.ST=`${ce.ESC}\\`)(Xk||={});var m0=class{constructor(e,t,i,s,a,l){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=a,this._renderService=l,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 l=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};m0=Ht([xe(2,Wi),xe(3,Yi),xe(4,Va),xe(5,nr)],m0);var gi=0,_i=0,bi=0,Ut=0,YS={css:"#00000000",rgba:0},si;(e=>{function t(a,l,c,h){return h!==void 0?`#${Ca(a)}${Ca(l)}${Ca(c)}${Ca(h)}`:`#${Ca(a)}${Ca(l)}${Ca(c)}`}e.toCss=t;function i(a,l,c,h=255){return(a<<24|l<<16|c<<8|h)>>>0}e.toRgba=i;function s(a,l,c,h){return{css:e.toCss(a,l,c,h),rgba:e.toRgba(a,l,c,h)}}e.toColor=s})(si||={});var Tt;(e=>{function t(m,f){if(Ut=(f.rgba&255)/255,Ut===1)return{css:f.css,rgba:f.rgba};let g=f.rgba>>24&255,_=f.rgba>>16&255,v=f.rgba>>8&255,x=m.rgba>>24&255,y=m.rgba>>16&255,w=m.rgba>>8&255;gi=x+Math.round((g-x)*Ut),_i=y+Math.round((_-y)*Ut),bi=w+Math.round((v-w)*Ut);let C=si.toCss(gi,_i,bi),N=si.toRgba(gi,_i,bi);return{css:C,rgba:N}}e.blend=t;function i(m){return(m.rgba&255)===255}e.isOpaque=i;function s(m,f,g){let _=Yd.ensureContrastRatio(m.rgba,f.rgba,g);if(_)return si.toColor(_>>24&255,_>>16&255,_>>8&255)}e.ensureContrastRatio=s;function a(m){let f=(m.rgba|255)>>>0;return[gi,_i,bi]=Yd.toChannels(f),{css:si.toCss(gi,_i,bi),rgba:f}}e.opaque=a;function l(m,f){return Ut=Math.round(f*255),[gi,_i,bi]=Yd.toChannels(m.rgba),{css:si.toCss(gi,_i,bi,Ut),rgba:si.toRgba(gi,_i,bi,Ut)}}e.opacity=l;function c(m,f){return Ut=m.rgba&255,l(m,Ut*f/255)}e.multiplyOpacity=c;function h(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=h})(Tt||={});var Bt;(e=>{let t,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(t=l,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 gi=parseInt(a.slice(1,2).repeat(2),16),_i=parseInt(a.slice(2,3).repeat(2),16),bi=parseInt(a.slice(3,4).repeat(2),16),si.toColor(gi,_i,bi);case 5:return gi=parseInt(a.slice(1,2).repeat(2),16),_i=parseInt(a.slice(2,3).repeat(2),16),bi=parseInt(a.slice(3,4).repeat(2),16),Ut=parseInt(a.slice(4,5).repeat(2),16),si.toColor(gi,_i,bi,Ut);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 l=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(l)return gi=parseInt(l[1]),_i=parseInt(l[2]),bi=parseInt(l[3]),Ut=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),si.toColor(gi,_i,bi,Ut);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),[gi,_i,bi,Ut]=t.getImageData(0,0,1,1).data,Ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:si.toRgba(gi,_i,bi,Ut),css:a}}e.toColor=s})(Bt||={});var Fi;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,a,l){let c=s/255,h=a/255,m=l/255,f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),_=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return f*.2126+g*.7152+_*.0722}e.relativeLuminance2=i})(Fi||={});var Yd;(e=>{function t(c,h){if(Ut=(h&255)/255,Ut===1)return h;let m=h>>24&255,f=h>>16&255,g=h>>8&255,_=c>>24&255,v=c>>16&255,x=c>>8&255;return gi=_+Math.round((m-_)*Ut),_i=v+Math.round((f-v)*Ut),bi=x+Math.round((g-x)*Ut),si.toRgba(gi,_i,bi)}e.blend=t;function i(c,h,m){let f=Fi.relativeLuminance(c>>8),g=Fi.relativeLuminance(h>>8);if(Gs(f,g)<m){if(g<f){let x=s(c,h,m),y=Gs(f,Fi.relativeLuminance(x>>8));if(y<m){let w=a(c,h,m),C=Gs(f,Fi.relativeLuminance(w>>8));return y>C?x:w}return x}let _=a(c,h,m),v=Gs(f,Fi.relativeLuminance(_>>8));if(v<m){let x=s(c,h,m),y=Gs(f,Fi.relativeLuminance(x>>8));return v>y?_:x}return _}}e.ensureContrastRatio=i;function s(c,h,m){let f=c>>24&255,g=c>>16&255,_=c>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,w=Gs(Fi.relativeLuminance2(v,x,y),Fi.relativeLuminance2(f,g,_));for(;w<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)),w=Gs(Fi.relativeLuminance2(v,x,y),Fi.relativeLuminance2(f,g,_));return(v<<24|x<<16|y<<8|255)>>>0}e.reduceLuminance=s;function a(c,h,m){let f=c>>24&255,g=c>>16&255,_=c>>8&255,v=h>>24&255,x=h>>16&255,y=h>>8&255,w=Gs(Fi.relativeLuminance2(v,x,y),Fi.relativeLuminance2(f,g,_));for(;w<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)),w=Gs(Fi.relativeLuminance2(v,x,y),Fi.relativeLuminance2(f,g,_));return(v<<24|x<<16|y<<8|255)>>>0}e.increaseLuminance=a;function l(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=l})(Yd||={});function Ca(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Gs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var ZB=class extends eu{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()]}},fh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Un}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,l=0,c=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 g=this._getJoinedRanges(s,c,l,t,a);for(let _=0;_<g.length;_++)i.push(g[_])}a=f,c=l,h=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||$r.length}if(this._bufferService.cols-a>1){let f=this._getJoinedRanges(s,c,l,t,a);for(let g=0;g<f.length;g++)i.push(f[g])}return i}_getJoinedRanges(e,t,i,s,a){let l=e.substring(t,i),c=[];try{c=this._characterJoiners[0].handler(l)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let m=this._characterJoiners[h].handler(l);for(let f=0;f<m.length;f++)fh._mergeRanges(c,m[f])}catch(m){console.error(m)}return this._stringRangesToCellRanges(c,s,a),c}_stringRangesToCellRanges(e,t,i){let s=0,a=!1,l=0,c=e[s];if(c){for(let h=i;h<this._bufferService.cols;h++){let m=t.getWidth(h),f=t.getString(h).length||$r.length;if(m!==0){if(!a&&c[0]<=l&&(c[0]=h,a=!0),c[1]<=l){if(c[1]=h,c=e[++s],!c)break;c[0]<=l?(c[0]=h,a=!0):a=!1}l+=f}}c&&(c[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}};fh=Ht([xe(0,Wi)],fh);function QB(e){return 57508<=e&&e<=57558}function JB(e){return 9472<=e&&e<=9631}function ez(e){return QB(e)||JB(e)}function tz(){return{css:{canvas:Rd(),cell:Rd()},device:{canvas:Rd(),cell:Rd(),char:{width:0,height:0,left:0,top:0}}}}function Rd(){return{width:0,height:0}}var p0=class{constructor(e,t,i,s,a,l,c){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=a,this._decorationService=l,this._themeService=c,this._workCell=new Un,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,l,c,h,m,f,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),x=this._themeService.colors,y=e.getNoBgTrimmedLength();i&&y<l+1&&(y=l+1);let w,C=0,N="",T=0,A=0,M=0,L=0,K=!1,B=0,R=!1,H=0,P=0,q=[],J=f!==-1&&g!==-1;for(let F=0;F<y;F++){e.loadCell(F,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let V=!1,O=F>=P,Y=F,X=this._workCell;if(v.length>0&&F===v[0][0]&&O){let ze=v.shift(),Ft=this._isCellInSelection(ze[0],t);for(T=ze[0]+1;T<ze[1];T++)O&&=Ft===this._isCellInSelection(T,t);O&&=!i||l<ze[0]||l>=ze[1],O?(V=!0,X=new ZB(this._workCell,e.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),Y=ze[1]-1,ie=X.getWidth()):P=ze[1]}let j=this._isCellInSelection(F,t),W=i&&F===l,D=J&&F>=f&&F<=g,te=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,ze=>{te=!0});let ue=X.getChars()||$r;if(ue===" "&&(X.isUnderline()||X.isOverline())&&(ue=" "),H=ie*h-m.get(ue,X.isBold(),X.isItalic()),!w)w=this._document.createElement("span");else if(C&&(j&&R||!j&&!R&&X.bg===A)&&(j&&R&&x.selectionForeground||X.fg===M)&&X.extended.ext===L&&D===K&&H===B&&!W&&!V&&!te&&O){X.isInvisible()?N+=$r:N+=ue,C++;continue}else C&&(w.textContent=N),w=this._document.createElement("span"),C=0,N="";if(A=X.bg,M=X.fg,L=X.extended.ext,K=D,B=H,R=j,V&&l>=F&&l<=Y&&(l=F),!this._coreService.isCursorHidden&&W&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&q.push("xterm-cursor-blink"),q.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break}}if(X.isBold()&&q.push("xterm-bold"),X.isItalic()&&q.push("xterm-italic"),X.isDim()&&q.push("xterm-dim"),X.isInvisible()?N=$r:N=X.getChars()||$r,X.isUnderline()&&(q.push(`xterm-underline-${X.extended.underlineStyle}`),N===" "&&(N=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${eu.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let ze=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&ze<8&&(ze+=8),w.style.textDecorationColor=x.ansi[ze].css}X.isOverline()&&(q.push("xterm-overline"),N===" "&&(N=" ")),X.isStrikethrough()&&q.push("xterm-strikethrough"),D&&(w.style.textDecoration="underline");let $=X.getFgColor(),se=X.getFgColorMode(),fe=X.getBgColor(),ve=X.getBgColorMode(),Oe=!!X.isInverse();if(Oe){let ze=$;$=fe,fe=ze;let Ft=se;se=ve,ve=Ft}let ye,st,lt=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,ze=>{ze.options.layer!=="top"&&lt||(ze.backgroundColorRGB&&(ve=50331648,fe=ze.backgroundColorRGB.rgba>>8&16777215,ye=ze.backgroundColorRGB),ze.foregroundColorRGB&&(se=50331648,$=ze.foregroundColorRGB.rgba>>8&16777215,st=ze.foregroundColorRGB),lt=ze.options.layer==="top")}),!lt&&j&&(ye=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,fe=ye.rgba>>8&16777215,ve=50331648,lt=!0,x.selectionForeground&&(se=50331648,$=x.selectionForeground.rgba>>8&16777215,st=x.selectionForeground)),lt&&q.push("xterm-decoration-top");let ct;switch(ve){case 16777216:case 33554432:ct=x.ansi[fe],q.push(`xterm-bg-${fe}`);break;case 50331648:ct=si.toColor(fe>>16,fe>>8&255,fe&255),this._addStyle(w,`background-color:#${XS((fe>>>0).toString(16),"0",6)}`);break;default:Oe?(ct=x.foreground,q.push("xterm-bg-257")):ct=x.background}switch(ye||X.isDim()&&(ye=Tt.multiplyOpacity(ct,.5)),se){case 16777216:case 33554432:X.isBold()&&$<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($+=8),this._applyMinimumContrast(w,ct,x.ansi[$],X,ye,void 0)||q.push(`xterm-fg-${$}`);break;case 50331648:let ze=si.toColor($>>16&255,$>>8&255,$&255);this._applyMinimumContrast(w,ct,ze,X,ye,st)||this._addStyle(w,`color:#${XS($.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,ct,x.foreground,X,ye,st)||Oe&&q.push("xterm-fg-257")}q.length&&(w.className=q.join(" "),q.length=0),!W&&!V&&!te&&O?C++:w.textContent=N,H!==this.defaultSpacing&&(w.style.letterSpacing=`${H}px`),_.push(w),F=Y}return w&&C&&(w.textContent=N),_}_applyMinimumContrast(e,t,i,s,a,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||ez(s.getCode()))return!1;let c=this._getContrastCache(s),h;if(!a&&!l&&(h=c.getColor(t.rgba,i.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);h=Tt.ensureContrastRatio(a||t,l||i,m),c.setColor((a||t).rgba,(l||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]}};p0=Ht([xe(1,Dk),xe(2,Yi),xe(3,ir),xe(4,Va),xe(5,tu),xe(6,sl)],p0);function XS(e,t,i){for(;e.length<i;)e=t+e;return e}var iz=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 l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[i,s,a,l],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(a),this._container.appendChild(l),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 c=this._measure(e,0);return c>0&&(this._flat[s]=c),c}let a=e;t&&(a+="B"),i&&(a+="I");let l=this._holey.get(a);if(l===void 0){let c=0;t&&(c|=1),i&&(c|=2),l=this._measure(e,c),l>0&&this._holey.set(a,l)}return l}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},nz=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,l=t[1]-a,c=i[1]-a,h=Math.max(l,0),m=Math.min(c,e.rows-1);if(h>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=l,this.viewportEndRow=c,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 sz(){return new nz}var Ep="xterm-dom-renderer-owner-",Dn="xterm-rows",Dd="xterm-fg-",ZS="xterm-bg-",lc="xterm-focus",Od="xterm-selection",rz=1,g0=class extends Ge{constructor(e,t,i,s,a,l,c,h,m,f,g,_,v,x){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=a,this._helperContainer=l,this._linkifier2=c,this._charSizeService=m,this._optionsService=f,this._bufferService=g,this._coreService=_,this._coreBrowserService=v,this._themeService=x,this._terminalClass=rz++,this._rowElements=[],this._selectionRenderModel=sz(),this.onRequestRedraw=this._register(new pe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Dn),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(Od),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=tz(),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(p0,document),this._element.classList.add(Ep+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(Dt(()=>{this._element.classList.remove(Ep+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new iz(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} .${Dn} 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} .${Dn} { 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} .${Dn} .xterm-dim { color: ${Tt.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} .${Dn}.${lc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Dn}.${lc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Dn}.${lc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Dn} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Dn} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Dn} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Dn} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Dn} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Od} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Od} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Od} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,c]of e.ansi.entries())t+=`${this._terminalSelector} .${Dd}${l} { color: ${c.css}; }${this._terminalSelector} .${Dd}${l}.xterm-dim { color: ${Tt.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${ZS}${l} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${Dd}257 { color: ${Tt.opaque(e.background).css}; }${this._terminalSelector} .${Dd}257.xterm-dim { color: ${Tt.multiplyOpacity(Tt.opaque(e.background),.5).css}; }${this._terminalSelector} .${ZS}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(lc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(lc),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,l=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(i){let m=e[0]>t[0];h.appendChild(this._createSelectionElement(l,m?t[0]:e[0],m?e[0]:t[0],c-l+1))}else{let m=s===l?e[0]:0,f=l===a?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(l,m,f));let g=c-l-1;if(h.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,g)),l!==c){let _=a===c?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(c,0,_))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,i,s=1){let a=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(i-t);return l+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-l),a.style.height=`${s*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${l}px`,a.style.width=`${c}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),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=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,g=this._rowElements[m],_=i.lines.get(f);if(!g||!_)break;g.replaceChildren(...this._rowFactory.createRow(_,f,f===s,c,h,a,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ep}${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,l){i<0&&(e=0),s<0&&(t=0);let c=this._bufferService.rows-1;i=Math.max(Math.min(i,c),0),s=Math.max(Math.min(s,c),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),g=this._optionsService.rawOptions.cursorBlink,_=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=i;x<=s;++x){let y=x+h.ydisp,w=this._rowElements[x],C=h.lines.get(y);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,y,y===m,_,v,f,g,this.dimensions.css.cell.width,this._widthCache,l?x===i?e:0:-1,l?(x===s?t:a)-1:-1))}}};g0=Ht([xe(7,N_),xe(8,jh),xe(9,Yi),xe(10,Wi),xe(11,Va),xe(12,ir),xe(13,sl)],g0);var _0=class extends Ge{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new pe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new oz(this._optionsService))}catch{this._measureStrategy=this._register(new az(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())}};_0=Ht([xe(2,Yi)],_0);var Zk=class extends Ge{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)}},az=class extends Zk{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}},oz=class extends Zk{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}},lz=class extends Ge{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 cz(this._window)),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new pe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ti.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Pe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Pe(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}},cz=class extends Ge{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Zo),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Dt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Pe(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)}},uz=class extends Ge{constructor(){super(),this.linkProviders=[],this._register(Dt(()=>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 L_(e,t,i){let s=i.getBoundingClientRect(),a=e.getComputedStyle(i),l=parseInt(a.getPropertyValue("padding-left")),c=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-l,t.clientY-s.top-c]}function dz(e,t,i,s,a,l,c,h,m){if(!l)return;let f=L_(e,t,i);if(f)return f[0]=Math.ceil((f[0]+(m?c/2:0))/c),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 b0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,a){return dz(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=L_(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])}}};b0=Ht([xe(0,nr),xe(1,jh)],b0);var hz=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=[]}},Qk={};S9(Qk,{getSafariVersion:()=>mz,isChromeOS:()=>i3,isFirefox:()=>Jk,isIpad:()=>pz,isIphone:()=>gz,isLegacyEdge:()=>fz,isLinux:()=>B_,isMac:()=>mh,isNode:()=>Lh,isSafari:()=>e3,isWindows:()=>t3});var Lh=typeof process<"u"&&"title"in process,iu=Lh?"node":navigator.userAgent,nu=Lh?"node":navigator.platform,Jk=iu.includes("Firefox"),fz=iu.includes("Edge"),e3=/^((?!chrome|android).)*safari/i.test(iu);function mz(){if(!e3)return 0;let e=iu.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var mh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(nu),pz=nu==="iPad",gz=nu==="iPhone",t3=["Windows","Win16","Win32","WinCE"].includes(nu),B_=nu.indexOf("Linux")>=0,i3=/\bCrOS\b/.test(iu),n3=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()}},_z=class extends n3{_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())}}},bz=class extends n3{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ph=!Lh&&"requestIdleCallback"in window?bz:_z,vz=class{constructor(){this._queue=new ph}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},v0=class extends Ge{constructor(e,t,i,s,a,l,c,h,m){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new Zo),this._pausedResizeTask=new vz,this._observerDisposable=this._register(new Zo),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 pe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new pe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new pe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new hz((f,g)=>this._renderRows(f,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xz(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Dt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.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=Dt(()=>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()}};v0=Ht([xe(2,Yi),xe(3,jh),xe(4,Va),xe(5,tu),xe(6,Wi),xe(7,ir),xe(8,sl)],v0);var xz=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 yz(e,t,i,s){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return Ez(a,l,e,t,i,s)+Bh(l,t,i,s)+Cz(a,l,e,t,i,s);let c;if(l===t)return c=a>e?"D":"C",Pc(Math.abs(a-e),Ic(c,s));c=l>t?"D":"C";let h=Math.abs(l-t),m=wz(l>t?e:a,i)+(h-1)*i.cols+1+Sz(l>t?a:e);return Pc(m,Ic(c,s))}function Sz(e,t){return e-1}function wz(e,t){return t.cols-e}function Ez(e,t,i,s,a,l){return Bh(t,s,a,l).length===0?"":Pc(r3(e,t,e,t-Ua(t,a),!1,a).length,Ic("D",l))}function Bh(e,t,i,s){let a=e-Ua(e,i),l=t-Ua(t,i),c=Math.abs(a-l)-kz(e,t,i);return Pc(c,Ic(s3(e,t),s))}function Cz(e,t,i,s,a,l){let c;Bh(t,s,a,l).length>0?c=s-Ua(s,a):c=t;let h=s,m=Nz(e,t,i,s,a,l);return Pc(r3(e,c,i,h,m==="C",a).length,Ic(m,l))}function kz(e,t,i){let s=0,a=e-Ua(e,i),l=t-Ua(t,i);for(let c=0;c<Math.abs(a-l);c++){let h=s3(e,t)==="A"?-1:1;i.buffer.lines.get(a+h*c)?.isWrapped&&s++}return s}function Ua(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 Nz(e,t,i,s,a,l){let c;return Bh(i,s,a,l).length>0?c=s-Ua(s,a):c=t,e<i&&c<=s||e>=i&&c<s?"C":"D"}function s3(e,t){return e>t?"A":"B"}function r3(e,t,i,s,a,l){let c=e,h=t,m="";for(;(c!==i||h!==s)&&h>=0&&h<l.buffer.lines.length;)c+=a?1:-1,a&&c>l.cols-1?(m+=l.buffer.translateBufferLineToString(h,!1,e,c),c=0,e=0,h++):!a&&c<0&&(m+=l.buffer.translateBufferLineToString(h,!1,0,e+1),c=l.cols-1,e=c,h--);return m+l.buffer.translateBufferLineToString(h,!1,e,c)}function Ic(e,t){let i=t?"O":"[";return ce.ESC+i+e}function Pc(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var Tz=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 QS(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 Cp=50,Az=15,Mz=50,Rz=500,Dz=" ",Oz=new RegExp(Dz,"g"),x0=class extends Ge{constructor(e,t,i,s,a,l,c,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=a,this._mouseService=l,this._optionsService=c,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Un,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new pe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new pe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new pe),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 Tz(this._bufferService),this._activeSelectionMode=0,this._register(Dt(()=>{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],l=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let h=i.translateBufferLineToString(c,!0,a,l);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 l=e[1]+1;l<=t[1]-1;l++){let c=i.lines.get(l),h=i.translateBufferLineToString(l,!0);c?.isWrapped?s[s.length-1]+=h:s.push(h)}if(e[1]!==t[1]){let l=i.lines.get(t[1]),c=i.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?s[s.length-1]+=c:s.push(c)}}return s.map(a=>a.replace(Oz," ")).join(t3?`\r
34
- `:`
35
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),B_&&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=QS(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=L_(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,-Cp),Cp),t/=Cp,t/Math.abs(t)+Math.round(t*(Az-1)))}shouldForceSelection(e){return mh?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(),Mz)}_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&&!(mh&&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<Rz&&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=yz(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,l=a.lines.get(e[1]);if(!l)return;let c=a.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(l,e[0]),m=h,f=e[0]-h,g=0,_=0,v=0,x=0;if(c.charAt(h)===" "){for(;h>0&&c.charAt(h-1)===" ";)h--;for(;m<c.length&&c.charAt(m+1)===" ";)m++}else{let C=e[0],N=e[0];l.getWidth(C)===0&&(g++,C--),l.getWidth(N)===2&&(_++,N++);let T=l.getString(N).length;for(T>1&&(x+=T-1,m+=T-1);C>0&&h>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.loadCell(C-1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):A>1&&(v+=A-1,h-=A-1),h--,C--}for(;N<l.length&&m+1<c.length&&!this._isCharWordSeparator(l.loadCell(N+1,this._workCell));){l.loadCell(N+1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===2?(_++,N++):A>1&&(x+=A-1,m+=A-1),m++,N++}}m++;let y=h+f-g+v,w=Math.min(this._bufferService.cols,m-h+g+_-v-x);if(!(!t&&c.slice(h,m).trim()==="")){if(i&&y===0&&l.getCodePoint(0)!==32){let C=a.lines.get(e[1]-1);if(C&&l.isWrapped&&C.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,w+=T}}}if(s&&y+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let C=a.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let N=this._getWordAt([0,e[1]+1],!1,!1,!0);N&&(w+=N.length)}}return{start:y,length:w}}}_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=QS(i,this._bufferService.cols)}};x0=Ht([xe(3,Wi),xe(4,Va),xe(5,T_),xe(6,Yi),xe(7,nr),xe(8,ir)],x0);var JS=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={}}},ew=class{constructor(){this._color=new JS,this._css=new JS}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()}},li=Object.freeze((()=>{let e=[Bt.toColor("#2e3436"),Bt.toColor("#cc0000"),Bt.toColor("#4e9a06"),Bt.toColor("#c4a000"),Bt.toColor("#3465a4"),Bt.toColor("#75507b"),Bt.toColor("#06989a"),Bt.toColor("#d3d7cf"),Bt.toColor("#555753"),Bt.toColor("#ef2929"),Bt.toColor("#8ae234"),Bt.toColor("#fce94f"),Bt.toColor("#729fcf"),Bt.toColor("#ad7fa8"),Bt.toColor("#34e2e2"),Bt.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],l=t[i%6];e.push({css:si.toCss(s,a,l),rgba:si.toRgba(s,a,l)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:si.toCss(s,s,s),rgba:si.toRgba(s,s,s)})}return e})()),Ta=Bt.toColor("#ffffff"),vc=Bt.toColor("#000000"),tw=Bt.toColor("#ffffff"),iw=vc,cc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},jz=Ta,y0=class extends Ge{constructor(e){super(),this._optionsService=e,this._contrastCache=new ew,this._halfContrastCache=new ew,this._onChangeColors=this._register(new pe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ta,background:vc,cursor:tw,cursorAccent:iw,selectionForeground:void 0,selectionBackgroundTransparent:cc,selectionBackgroundOpaque:Tt.blend(vc,cc),selectionInactiveBackgroundTransparent:cc,selectionInactiveBackgroundOpaque:Tt.blend(vc,cc),scrollbarSliderBackground:Tt.opacity(Ta,.2),scrollbarSliderHoverBackground:Tt.opacity(Ta,.4),scrollbarSliderActiveBackground:Tt.opacity(Ta,.5),overviewRulerBorder:Ta,ansi:li.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=xt(e.foreground,Ta),t.background=xt(e.background,vc),t.cursor=Tt.blend(t.background,xt(e.cursor,tw)),t.cursorAccent=Tt.blend(t.background,xt(e.cursorAccent,iw)),t.selectionBackgroundTransparent=xt(e.selectionBackground,cc),t.selectionBackgroundOpaque=Tt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=xt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Tt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?xt(e.selectionForeground,YS):void 0,t.selectionForeground===YS&&(t.selectionForeground=void 0),Tt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Tt.opacity(t.selectionBackgroundTransparent,.3)),Tt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Tt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=xt(e.scrollbarSliderBackground,Tt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=xt(e.scrollbarSliderHoverBackground,Tt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=xt(e.scrollbarSliderActiveBackground,Tt.opacity(t.foreground,.5)),t.overviewRulerBorder=xt(e.overviewRulerBorder,jz),t.ansi=li.slice(),t.ansi[0]=xt(e.black,li[0]),t.ansi[1]=xt(e.red,li[1]),t.ansi[2]=xt(e.green,li[2]),t.ansi[3]=xt(e.yellow,li[3]),t.ansi[4]=xt(e.blue,li[4]),t.ansi[5]=xt(e.magenta,li[5]),t.ansi[6]=xt(e.cyan,li[6]),t.ansi[7]=xt(e.white,li[7]),t.ansi[8]=xt(e.brightBlack,li[8]),t.ansi[9]=xt(e.brightRed,li[9]),t.ansi[10]=xt(e.brightGreen,li[10]),t.ansi[11]=xt(e.brightYellow,li[11]),t.ansi[12]=xt(e.brightBlue,li[12]),t.ansi[13]=xt(e.brightMagenta,li[13]),t.ansi[14]=xt(e.brightCyan,li[14]),t.ansi[15]=xt(e.brightWhite,li[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]=xt(e.extendedAnsi[s],li[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()}}};y0=Ht([xe(0,Yi)],y0);function xt(e,t){if(e!==void 0)try{return Bt.toColor(e)}catch{}return t}var Lz=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)}},Bz=class{constructor(){this._services=new Lz,this._services.set(N_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=A9(e).sort((l,c)=>l.index-c.index),s=[];for(let l of i){let c=this._services.get(l.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);s.push(c)}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)}},zz={trace:0,debug:1,info:2,warn:3,error:4,off:5},Iz="xterm.js: ",S0=class extends Ge{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=zz[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?"":Iz)+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)}};S0=Ht([xe(0,Yi)],S0);var nw=class extends Ge{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new pe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new pe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new pe),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}},Ve=3,ti=Object.freeze(new eu),jd=0,kp=2,xc=class a3{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ve);let a=i||Un.fromCharData([0,Ck,1,0]);for(let l=0;l<t;++l)this.setCell(l,a);this.length=t}get(t){let i=this._data[t*Ve+0],s=i&2097151;return[this._data[t*Ve+1],i&2097152?this._combined[t]:s?Ur(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Ve+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ve+0]=t|2097152|i[2]<<22):this._data[t*Ve+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ve+0]>>22}hasWidth(t){return this._data[t*Ve+0]&12582912}getFg(t){return this._data[t*Ve+1]}getBg(t){return this._data[t*Ve+2]}hasContent(t){return this._data[t*Ve+0]&4194303}getCodePoint(t){let i=this._data[t*Ve+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ve+0]&2097152}getString(t){let i=this._data[t*Ve+0];return i&2097152?this._combined[t]:i&2097151?Ur(i&2097151):""}isProtected(t){return this._data[t*Ve+2]&536870912}loadCell(t,i){return jd=t*Ve,i.content=this._data[jd+0],i.fg=this._data[jd+1],i.bg=this._data[jd+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*Ve+0]=i.content,this._data[t*Ve+1]=i.fg,this._data[t*Ve+2]=i.bg}setCellFromCodepoint(t,i,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ve+0]=i|s<<22,this._data[t*Ve+1]=a.fg,this._data[t*Ve+2]=a.bg}addCodepointToCell(t,i,s){let a=this._data[t*Ve+0];a&2097152?this._combined[t]+=Ur(i):a&2097151?(this._combined[t]=Ur(a&2097151)+Ur(i),a&=-2097152,a|=2097152):a=i|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Ve+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 Un;for(let l=this.length-t-i-1;l>=0;--l)this.setCell(t+i+l,this.loadCell(t+l,a));for(let l=0;l<i;++l)this.setCell(t+l,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 Un;for(let l=0;l<this.length-t-i;++l)this.setCell(t+l,this.loadCell(t+i+l,a));for(let l=this.length-i;l<this.length;++l)this.setCell(l,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*kp<this._data.buffer.byteLength;let s=t*Ve;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 c=0;c<a.length;c++){let h=parseInt(a[c],10);h>=t&&delete this._combined[h]}let l=Object.keys(this._extendedAttrs);for(let c=0;c<l.length;c++){let h=parseInt(l[c],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,s*4*kp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*kp<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 a3(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*Ve+0]&4194303)return t+(this._data[t*Ve+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ve+0]&4194303||this._data[t*Ve+2]&50331648)return t+(this._data[t*Ve+0]>>22);return 0}copyCellsFrom(t,i,s,a,l){let c=t._data;if(l)for(let m=a-1;m>=0;m--){for(let f=0;f<Ve;f++)this._data[(s+m)*Ve+f]=c[(i+m)*Ve+f];c[(i+m)*Ve+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ve;f++)this._data[(s+m)*Ve+f]=c[(i+m)*Ve+f];c[(i+m)*Ve+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 l="";for(;i<s;){let c=this._data[i*Ve+0],h=c&2097151,m=c&2097152?this._combined[i]:h?Ur(h):$r;if(l+=m,a)for(let f=0;f<m.length;++f)a.push(i);i+=c>>22||1}return a&&a.push(i),l}};function Pz(e,t,i,s,a,l){let c=[];for(let h=0;h<e.length-1;h++){let m=h,f=e.get(++m);if(!f.isWrapped)continue;let g=[e.get(h)];for(;m<e.length&&f.isWrapped;)g.push(f),f=e.get(++m);if(!l&&s>=h&&s<m){h+=g.length-1;continue}let _=0,v=Uc(g,_,t),x=1,y=0;for(;x<g.length;){let C=Uc(g,x,t),N=C-y,T=i-v,A=Math.min(N,T);g[_].copyCellsFrom(g[x],y,v,A,!1),v+=A,v===i&&(_++,v=0),y+=A,y===C&&(x++,y=0),v===0&&_!==0&&g[_-1].getWidth(i-1)===2&&(g[_].copyCellsFrom(g[_-1],i-1,v++,1,!1),g[_-1].setCell(i-1,a))}g[_].replaceCells(v,i,a);let w=0;for(let C=g.length-1;C>0&&(C>_||g[C].getTrimmedLength()===0);C--)w++;w>0&&(c.push(h+g.length-w),c.push(w)),h+=g.length-1}return c}function Uz(e,t){let i=[],s=0,a=t[s],l=0;for(let c=0;c<e.length;c++)if(a===c){let h=t[++s];e.onDeleteEmitter.fire({index:c-l,amount:h}),c+=h-1,l+=h,a=t[++s]}else i.push(c);return{layout:i,countRemoved:l}}function Hz(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 Fz(e,t,i){let s=[],a=e.map((m,f)=>Uc(e,f,t)).reduce((m,f)=>m+f),l=0,c=0,h=0;for(;h<a;){if(a-h<i){s.push(a-h);break}l+=i;let m=Uc(e,c,t);l>m&&(l-=m,c++);let f=e[c].getWidth(l-1)===2;f&&l--;let g=f?i-1:i;s.push(g),h+=g}return s}function Uc(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 o3=class l3{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=l3._nextId++,this._onDispose=this.register(new pe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Pa(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};o3._nextId=1;var $z=o3,hi={},Aa=hi.B;hi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};hi.A={"#":"£"};hi.B=void 0;hi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};hi.C=hi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};hi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};hi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};hi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};hi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};hi.E=hi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};hi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};hi.H=hi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};hi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var sw=4294967295,rw=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=ti.clone(),this.savedCharset=Aa,this.markers=[],this._nullCell=Un.fromCharData([0,Ck,1,0]),this._whitespaceCell=Un.fromCharData([0,$r,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ph,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new nw(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 dh),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 dh),this._whitespaceCell}getBlankLine(e,t){return new xc(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>sw?sw:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ti);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 nw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(ti),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 c=0;c<this.lines.length;c++)s+=+this.lines.get(c).resize(e,i);let l=0;if(this._rows<t)for(let c=this._rows;c<t;c++)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 xc(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new xc(e,i)));else for(let c=this._rows;c>t;c--)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 c=this.lines.length-a;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),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 l=0;l<this.lines.length;l++)s+=+this.lines.get(l).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=Pz(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ti),i);if(s.length>0){let a=Uz(this.lines,s);Hz(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(ti),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new xc(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(ti),a=[],l=0;for(let c=this.lines.length-1;c>=0;c--){let h=this.lines.get(c);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let m=[h];for(;h.isWrapped&&c>0;)h=this.lines.get(--c),m.unshift(h);if(!i){let A=this.ybase+this.y;if(A>=c&&A<c+m.length)continue}let f=m[m.length-1].getTrimmedLength(),g=Fz(m,this._cols,e),_=g.length-m.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+_):v=Math.max(0,this.lines.length-this.lines.maxLength+_);let x=[];for(let A=0;A<_;A++){let M=this.getBlankLine(ti,!0);x.push(M)}x.length>0&&(a.push({start:c+m.length+l,newLines:x}),l+=x.length),m.push(...x);let y=g.length-1,w=g[y];w===0&&(y--,w=g[y]);let C=m.length-_-1,N=f;for(;C>=0;){let A=Math.min(N,w);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[C],N-A,w-A,A,!0),w-=A,w===0&&(y--,w=g[y]),N-=A,N===0){C--;let M=Math.max(C,0);N=Uc(m,M,this._cols)}}for(let A=0;A<m.length;A++)g[A]<e&&m[A].setCell(g[A],s);let T=_-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+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+_,this.ybase+t-1)}if(a.length>0){let c=[],h=[];for(let w=0;w<this.lines.length;w++)h.push(this.lines.get(w));let m=this.lines.length,f=m-1,g=0,_=a[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let v=0;for(let w=Math.min(this.lines.maxLength-1,m+l-1);w>=0;w--)if(_&&_.start>f+v){for(let C=_.newLines.length-1;C>=0;C--)this.lines.set(w--,_.newLines[C]);w++,c.push({index:f+1,amount:_.newLines.length}),v+=_.newLines.length,_=a[++g]}else this.lines.set(w,h[f--]);let x=0;for(let w=c.length-1;w>=0;w--)c[w].index+=x,this.lines.onInsertEmitter.fire(c[w]),x+=c[w].amount;let y=Math.max(0,m+l-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 $z(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)}},Vz=class extends Ge{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new pe),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 rw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new rw(!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)}},c3=2,u3=1,w0=class extends Ge{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,c3),this.rows=Math.max(e.rawOptions.rows||0,u3),this.buffers=this._register(new Vz(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,l=i.ybase+i.scrollBottom;if(i.scrollTop===0){let c=i.lines.isFull;l===i.lines.length-1?c?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(l+1,0,s.clone()),c?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let c=l-a+1;i.lines.shiftElements(a+1,c-1,-1),i.lines.set(l,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))}};w0=Ht([xe(0,Yi)],w0);var Bo={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:mh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},qz=["normal","bold","100","200","300","400","500","600","700","800","900"],Kz=class extends Ge{constructor(e){super(),this._onOptionChange=this._register(new pe),this.onOptionChange=this._onOptionChange.event;let t={...Bo};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(Dt(()=>{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 Bo))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Bo))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=Bo[e]),!Gz(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Bo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=qz.includes(t)?t:Bo[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 Gz(e){return e==="block"||e==="underline"||e==="bar"}function yc(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]&&yc(e[s],t-1);return i}var aw=Object.freeze({insertMode:!1}),ow=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),E0=class extends Ge{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 pe),this.onData=this._onData.event,this._onUserInput=this._register(new pe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new pe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=yc(aw),this.decPrivateModes=yc(ow)}reset(){this.modes=yc(aw),this.decPrivateModes=yc(ow)}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))}};E0=Ht([xe(0,Wi),xe(1,Mk),xe(2,Yi)],E0);var lw={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 Np(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 Tp=String.fromCharCode,cw={DEFAULT:e=>{let t=[Np(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Tp(t[0])}${Tp(t[1])}${Tp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Np(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Np(e,!0)};${e.x};${e.y}${t}`}},C0=class extends Ge{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 pe),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(lw))this.addProtocol(s,lw[s]);for(let s of Object.keys(cw))this.addEncoding(s,cw[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)}};C0=Ht([xe(0,Wi),xe(1,Va),xe(2,Yi)],C0);var Ap=[[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]],Wz=[[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]],ci;function Yz(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 Xz=class{constructor(){if(this.version="6",!ci){ci=new Uint8Array(65536),ci.fill(1),ci[0]=0,ci.fill(0,1,32),ci.fill(0,127,160),ci.fill(2,4352,4448),ci[9001]=2,ci[9002]=2,ci.fill(2,11904,42192),ci[12351]=1,ci.fill(2,44032,55204),ci.fill(2,63744,64256),ci.fill(2,65040,65050),ci.fill(2,65072,65136),ci.fill(2,65280,65377),ci.fill(2,65504,65511);for(let e=0;e<Ap.length;++e)ci.fill(0,Ap[e][0],Ap[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ci[e]:Yz(e,Wz)?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=Oa.extractWidth(t);a===0?s=!1:a>i&&(i=a)}return Oa.createPropertyValue(0,i,s)}},Oa=class Xd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new pe,this.onChange=this._onChange.event;let t=new Xz;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 l=0;l<a;++l){let c=t.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=a)return i+this.wcwidth(c);let f=t.charCodeAt(l);56320<=f&&f<=57343?c=(c-55296)*1024+f-56320+65536:i+=this.wcwidth(f)}let h=this.charProperties(c,s),m=Xd.extractWidth(h);Xd.extractShouldJoin(h)&&(m-=Xd.extractWidth(s)),i+=m,s=h}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},Zz=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 uw(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 uc=2147483647,Qz=256,d3=class k0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>Qz)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 k0;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 l=0;l<a.length;++l)i.addSubParam(a[l]);else i.addParam(a)}return i}clone(){let t=new k0(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let 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>uc?uc: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>uc?uc: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,uc):t}},dc=[],Jz=class{constructor(){this._state=0,this._active=dc,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=dc}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=dc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||dc,!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",Oh(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=dc,this._id=-1,this._state=0}}},vn=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,i,s){this._hitLimit||(this._data+=Oh(t,i,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let i=!1;if(this._hitLimit)i=!1;else if(t&&(i=this._handler(this._data),i instanceof Promise))return i.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,i}},hc=[],eI=class{constructor(){this._handlers=Object.create(null),this._active=hc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=hc}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=hc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||hc,!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",Oh(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=hc,this._ident=0}},Sc=new d3;Sc.addParam(0);var dw=class{constructor(e){this._handler=e,this._data="",this._params=Sc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Sc,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Oh(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=Sc,this._data="",this._hitLimit=!1,i));return this._params=Sc,this._data="",this._hitLimit=!1,t}},tI=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}},Bn=160,iI=(function(){let e=new tI(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 l=i(0,14),c;e.setDefault(1,0),e.addMany(s,0,2,0);for(c in l)e.addMany([24,26,153,154],c,3,0),e.addMany(i(128,144),c,3,0),e.addMany(i(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,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(Bn,0,2,0),e.add(Bn,8,5,8),e.add(Bn,6,0,6),e.add(Bn,11,0,11),e.add(Bn,13,13,13),e})(),nI=class extends Ge{constructor(e=iI){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 d3,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(Dt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Jz),this._dcsParser=this._register(new eI),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 l=e.intermediates.charCodeAt(a);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=l}}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,l=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=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&&(c=h[m](this._params),c!==!0);m--)if(c instanceof Promise)return this._parseStack.handlerPos=m,c}this._parseStack.handlers=[];break;case 4:if(i===!1&&m>-1){for(;m>=0&&(c=h[m](),c!==!0);m--)if(c instanceof Promise)return this._parseStack.handlerPos=m,c}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(s!==24&&s!==26,i),c)return c;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],c=this._oscParser.end(s!==24&&s!==26,i),c)return c;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=l;h<t;++h){switch(s=e[h],a=this._transitions.table[this.currentState<<8|(s<160?s:Bn)],a>>4){case 2:for(let v=h+1;;++v){if(v>=t||(s=e[v])<32||s>126&&s<Bn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Bn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Bn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<Bn){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&&(c=m[f](this._params),c!==!0);f--)if(c instanceof Promise)return this._preserveStack(3,m,f,a,h),c;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 g=this._escHandlers[this._collect<<8|s],_=g?g.length-1:-1;for(;_>=0&&(c=g[_](),c!==!0);_--)if(c instanceof Promise)return this._preserveStack(4,g,_,a,h),c;_<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<Bn){this._dcsParser.put(e,h,v),h=v-1;break}break;case 14:if(c=this._dcsParser.unhook(s!==24&&s!==26),c)return this._preserveStack(6,[],0,a,h),c;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<Bn){this._oscParser.put(e,h,v),h=v-1;break}break;case 6:if(c=this._oscParser.end(s!==24&&s!==26),c)return this._preserveStack(5,[],0,a,h),c;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},sI=/^([\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})$/,rI=/^[\da-f]+$/;function hw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=sI.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),rI.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 l=parseInt(t.slice(i*a,i*a+i),16);s[a]=i===1?l<<4:i===2?l:i===3?l>>4:l>>8}return s}}function Mp(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 aI(e,t=16){let[i,s,a]=e;return`rgb:${Mp(i,t)}/${Mp(s,t)}/${Mp(a,t)}`}var oI={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zr=131072,fw=10;function mw(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 pw=5e3,gw=0,lI=class extends Ge{constructor(e,t,i,s,a,l,c,h,m=new nI){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=c,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new N9,this._utf8Decoder=new T9,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ti.clone(),this._eraseAttrDataInternal=ti.clone(),this._onRequestBell=this._register(new pe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new pe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new pe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new pe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new pe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new pe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new pe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new pe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new pe),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 N0(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:g.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,g,_)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:g,data:_})}),this._parser.setDcsHandlerFallback((f,g,_)=>{g==="HOOK"&&(_=_.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:g,payload:_})}),this._parser.setPrintHandler((f,g,_)=>this.print(f,g,_)),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(Wd.IND,()=>this.index()),this._parser.setExecuteHandler(Wd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Wd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new vn(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new vn(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new vn(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new vn(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new vn(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new vn(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new vn(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new vn(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new vn(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new vn(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new vn(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new vn(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 hi)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 dw((f,g)=>this.requestStatusString(f,g)))}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"),pw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${pw} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,a=this._activeBuffer.y,l=0,c=this._parseStack.paused;if(c){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>zr&&(l=this._parseStack.position+zr)}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<zr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zr))),c||this._dirtyRowTracker.clearRange(),e.length>zr)for(let f=l;f<e.length;f+=zr){let g=f+zr<e.length?f+zr:e.length,_=typeof e=="string"?this._stringDecoder.decode(e.substring(f,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,g),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,_))return this._preserveStack(s,a,_,f),this._logSlowResolvingAsync(i),i}else if(!c){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,l=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,g=this._curAttrData,_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&_.getWidth(this._activeBuffer.x-1)===2&&_.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let x=t;x<i;++x){if(s=e[x],s<127&&l){let N=l[String.fromCharCode(s)];N&&(s=N.charCodeAt(0))}let y=this._unicodeService.charProperties(s,v);a=Oa.extractWidth(y);let w=Oa.extractShouldJoin(y),C=w?Oa.extractWidth(v):0;if(v=y,c&&this._onA11yChar.fire(Ur(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-C>h){if(m){let N=_,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&_ instanceof xc&&_.copyCellsFrom(N,T,0,C,!1);T<h;)N.setCellFromCodepoint(T++,0,1,g)}else if(this._activeBuffer.x=h-1,a===2)continue}if(w&&this._activeBuffer.x){let N=_.getWidth(this._activeBuffer.x-1)?1:2;_.addCodepointToCell(this._activeBuffer.x-N,s,a);for(let T=a-C;--T>=0;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(f&&(_.insertCells(this._activeBuffer.x,a-C,this._activeBuffer.getNullCell(g)),_.getWidth(h-1)===2&&_.setCellFromCodepoint(h-1,0,1,g)),_.setCellFromCodepoint(this._activeBuffer.x++,s,a,g),a>0)for(;--a;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<h&&i-t>0&&_.getWidth(this._activeBuffer.x)===0&&!_.hasContent(this._activeBuffer.x)&&_.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>mw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new dw(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new vn(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 l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),s&&(l.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(ti));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=Oa.extractWidth(t),a=this._activeBuffer.x-s,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),c=new Uint32Array(l.length*i),h=0;for(let f=0;f<l.length;){let g=l.codePointAt(f)||0;c[h++]=g,f+=g>65535?2:1}let m=h;for(let f=1;f<i;++f)c.copyWithin(m,0,h),m+=h;return this.print(c,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,Aa),this._charsetService.setgCharset(1,Aa),this._charsetService.setgCharset(2,Aa),this._charsetService.setgCharset(3,Aa);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;(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:l}=this._coreMouseService,c=this._coreService,{buffers:h,cols:m}=this._bufferService,{active:f,alt:g}=h,_=this._optionsService.rawOptions,v=(w,C)=>(c.triggerDataEvent(`${ce.ESC}[${t?"":"?"}${w};${C}$y`),!0),x=w=>w?1:2,y=e.params[0];return t?y===2?v(y,4):y===4?v(y,x(c.modes.insertMode)):y===12?v(y,3):y===20?v(y,x(_.convertEol)):v(y,0):y===1?v(y,x(s.applicationCursorKeys)):y===3?v(y,_.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(_.cursorBlink)):y===25?v(y,x(!c.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(l==="SGR")):y===1015?v(y,4):y===1016?v(y,x(l==="SGR_PIXELS")):y===1048?v(y,1):y===47||y===1047||y===1049?v(y,x(f===g)):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|=eu.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,l=0;do{if(s[l+a]=e.params[t+l],e.hasSubParams(t+l)){let c=e.getSubParams(t+l),h=0;do s[1]===5&&(a=1),s[l+h+1+a]=c[h];while(++h<c.length&&h+l+1+a<s.length);break}if(s[1]===5&&l+a>=2||s[1]===2&&l+a>=5)break;s[1]&&(a=1)}while(++l+t<e.length&&l+a<s.length);for(let c=2;c<s.length;++c)s[c]===-1&&(s[c]=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 l}_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=ti.fg,e.bg=ti.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|=ti.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=ti.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|=ti.fg&16777215,s.bg&=-67108864,s.bg|=ti.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=ti.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(!mw(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>fw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>fw&&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 l=parseInt(s);if(_w(l))if(a==="?")t.push({type:0,index:l});else{let c=hw(a);c&&t.push({type:1,index:l,color:c})}}}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(l=>l.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=hw(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]);_w(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,Aa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(oI[e[0]],hi[e[1]]||Aa),!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=ti.clone(),this._eraseAttrDataInternal=ti.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 Un;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=c=>(this._coreService.triggerDataEvent(`${ce.ESC}${c}${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)}},N0=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&&(gw=e,e=t,t=gw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};N0=Ht([xe(0,Wi)],N0);function _w(e){return 0<=e&&e<256}var cI=5e7,bw=12,uI=50,dI=class extends Ge{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 pe),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>cI)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 c=h=>performance.now()-i>=bw?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(i,h);a.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(c);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=bw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>uI&&(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()}},T0=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 l=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.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)))}};T0=Ht([xe(0,Wi)],T0);var vw=!1,hI=class extends Ge{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Zo),this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onData=this._register(new pe),this.onData=this._onData.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new pe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new pe),this._instantiationService=new Bz,this.optionsService=this._register(new Kz(e)),this._instantiationService.setService(Yi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(w0)),this._instantiationService.setService(Wi,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(S0)),this._instantiationService.setService(Mk,this._logService),this.coreService=this._register(this._instantiationService.createInstance(E0)),this._instantiationService.setService(Va,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(C0)),this._instantiationService.setService(Ak,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Oa)),this._instantiationService.setService(D9,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Zz),this._instantiationService.setService(R9,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T0),this._instantiationService.setService(Rk,this._oscLinkService),this._inputHandler=this._register(new lI(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ti.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ti.forward(this._bufferService.onResize,this._onResize)),this._register(Ti.forward(this.coreService.onData,this._onData)),this._register(Ti.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 dI((t,i)=>this._inputHandler.parse(t,i))),this._register(Ti.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new pe),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&&!vw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),vw=!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,c3),t=Math.max(t,u3),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(uw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(uw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Dt(()=>{for(let t of e)t.dispose()})}}},fI={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 mI(e,t,i,s){let a={type:0,cancel:!1,key:void 0},l=(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;l?a.key=ce.ESC+"[1;"+(l+1)+"D":t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D";break;case 39:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"C":t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C";break;case 38:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"A":t?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A";break;case 40:if(e.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+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:l?a.key=ce.ESC+"[3;"+(l+1)+"~":a.key=ce.ESC+"[3~";break;case 36:l?a.key=ce.ESC+"[1;"+(l+1)+"H":t?a.key=ce.ESC+"OH":a.key=ce.ESC+"[H";break;case 35:l?a.key=ce.ESC+"[1;"+(l+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;"+(l+1)+"~":a.key=ce.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ce.ESC+"[6;"+(l+1)+"~":a.key=ce.ESC+"[6~";break;case 112:l?a.key=ce.ESC+"[1;"+(l+1)+"P":a.key=ce.ESC+"OP";break;case 113:l?a.key=ce.ESC+"[1;"+(l+1)+"Q":a.key=ce.ESC+"OQ";break;case 114:l?a.key=ce.ESC+"[1;"+(l+1)+"R":a.key=ce.ESC+"OR";break;case 115:l?a.key=ce.ESC+"[1;"+(l+1)+"S":a.key=ce.ESC+"OS";break;case 116:l?a.key=ce.ESC+"[15;"+(l+1)+"~":a.key=ce.ESC+"[15~";break;case 117:l?a.key=ce.ESC+"[17;"+(l+1)+"~":a.key=ce.ESC+"[17~";break;case 118:l?a.key=ce.ESC+"[18;"+(l+1)+"~":a.key=ce.ESC+"[18~";break;case 119:l?a.key=ce.ESC+"[19;"+(l+1)+"~":a.key=ce.ESC+"[19~";break;case 120:l?a.key=ce.ESC+"[20;"+(l+1)+"~":a.key=ce.ESC+"[20~";break;case 121:l?a.key=ce.ESC+"[21;"+(l+1)+"~":a.key=ce.ESC+"[21~";break;case 122:l?a.key=ce.ESC+"[23;"+(l+1)+"~":a.key=ce.ESC+"[23~";break;case 123:l?a.key=ce.ESC+"[24;"+(l+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 c=fI[e.keyCode]?.[e.shiftKey?1:0];if(c)a.key=ce.ESC+c;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 Wt=0,pI=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ph,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ph,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,l)=>this._getKey(a)-this._getKey(l)),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||(Wt=this._search(t),Wt===-1)||this._getKey(this._array[Wt])!==t)return!1;do if(this._array[Wt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Wt),!0;while(++Wt<this._array.length&&this._getKey(this._array[Wt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,l)=>a-l),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&&(Wt=this._search(e),!(Wt<0||Wt>=this._array.length)&&this._getKey(this._array[Wt])===e))do yield this._array[Wt];while(++Wt<this._array.length&&this._getKey(this._array[Wt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Wt=this._search(e),!(Wt<0||Wt>=this._array.length)&&this._getKey(this._array[Wt])===e))do t(this._array[Wt]);while(++Wt<this._array.length&&this._getKey(this._array[Wt])===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}},Rp=0,xw=0,gI=class extends Ge{constructor(){super(),this._decorations=new pI(e=>e?.marker.line),this._onDecorationRegistered=this._register(new pe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new pe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Dt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new _I(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 l of this._decorations.getKeyIterator(t))s=l.options.x??0,a=s+(l.options.width??1),e>=s&&e<a&&(!i||(l.options.layer??"bottom")===i)&&(yield l)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,a=>{Rp=a.options.x??0,xw=Rp+(a.options.width??1),e>=Rp&&e<xw&&(!i||(a.options.layer??"bottom")===i)&&s(a)})}},_I=class extends Vr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new pe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new pe),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=Bt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Bt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},bI=1e3,vI=class{constructor(e,t=bI){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,l=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_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)}},yw=20,gh=class extends Ge{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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._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 vI(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
36
- `))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Pe(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Dt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<yw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
37
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===yw+1&&(this._liveRegion.textContent+=Wg.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 l=i.lines.get(i.ydisp+a),c=[],h=l?.translateToString(!0,void 0,void 0,c)||"",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,c)),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"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===l||e.relatedTarget!==s)return;let c,h;if(t===0?(c=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(c=this._rowElements.shift(),h=i,this._rowContainer.removeChild(c)),c.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,g=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(f);if(!_)return console.warn("columns is null. Race condition?"),null;let v=m<_.length?_[m]:_.slice(-1)[0]+1;return v>=this._terminal.cols&&(++g,v=0),{row:g,column:v}},l=a(t),c=a(i);if(!(!l||!c)){if(l.row>c.row||l.row===c.row&&l.column>=c.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(c.row-l.row)*this._terminal.cols-l.column+c.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})`}};gh=Ht([xe(1,N_),xe(2,ir),xe(3,nr)],gh);var A0=class extends Ge{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 pe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new pe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Dt(()=>{Pa(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(Pe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Pe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Pe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Pe(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,l=>{if(this._isMouseOut)return;let c=l?.map(h=>({link:h}));this._activeProviderReplies?.set(s,c),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 l=0;l<a.length;l++){let c=a[l],h=c.link.range.start.y<e?0:c.link.range.start.x,m=c.link.range.end.y>e?this._bufferService.cols:c.link.range.end.x;for(let f=h;f<=m;f++){if(i.has(f)){a.splice(l--,1);break}i.add(f)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),a=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(a=!0);if(!a&&s){let l=s.find(c=>this._linkAtPosition(c.link,t));l&&(i=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let l=0;l<this._activeProviderReplies.size;l++){let c=this._activeProviderReplies.get(l)?.find(h=>this._linkAtPosition(h.link,t));if(c){i=!0,this._handleNewLink(c);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&&xI(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,Pa(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 l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!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}}};A0=Ht([xe(1,T_),xe(2,nr),xe(3,Wi),xe(4,Ok)],A0);function xI(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 yI=class extends hI{constructor(e={}){super(e),this._linkifier=this._register(new Zo),this.browser=Qk,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Zo),this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new pe),this.onKey=this._onKey.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new pe),this.onBell=this._onBell.event,this._onFocus=this._register(new pe),this._onBlur=this._register(new pe),this._onA11yCharEmitter=this._register(new pe),this._onA11yTabEmitter=this._register(new pe),this._onWillOpen=this._register(new pe),this._setup(),this._decorationService=this._instantiationService.createInstance(gI),this._instantiationService.setService(tu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(uz),this._instantiationService.setService(Ok,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Xg)),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(Ti.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ti.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ti.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ti.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Dt(()=>{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=Tt.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${ce.ESC}]${s};${aI(a)}${Xk.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=si.toColor(...t.color));else{let l=i;this._themeService.modifyColors(c=>c[l]=si.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(gh,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),l=this._renderService.dimensions.css.cell.width*a,c=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=c+"px",this.textarea.style.width=l+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Pe(this.element,"copy",t=>{this.hasSelection()&&C9(t,this._selectionService)}));let e=t=>k9(t,this.textarea,this.coreService,this.optionsService);this._register(Pe(this.textarea,"paste",e)),this._register(Pe(this.element,"paste",e)),Jk?this._register(Pe(this.element,"mousedown",t=>{t.button===2&&RS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Pe(this.element,"contextmenu",t=>{RS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),B_&&this._register(Pe(this.element,"auxclick",t=>{t.button===1&&Ek(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Pe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Pe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Pe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Pe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Pe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Pe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Pe(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(Pe(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",Gg.get()),i3||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(lz,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ir,this._coreBrowserService),this._register(Pe(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Pe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_0,this._document,this._helperContainer),this._instantiationService.setService(jh,this._charSizeService),this._themeService=this._instantiationService.createInstance(y0),this._instantiationService.setService(sl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(fh),this._instantiationService.setService(Dk,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(v0,this.rows,this.screenElement)),this._instantiationService.setService(nr,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(m0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b0),this._instantiationService.setService(T_,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(A0,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(h0,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(x0,this.element,this.screenElement,s)),this._instantiationService.setService(j9,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(Ti.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(f0,this.screenElement)),this._register(Pe(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(gh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(l){let c=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!c)return!1;let h,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(h=3,l.button!==void 0&&(h=l.button<3?l.button:3)):h=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,h=l.button<3?l.button:3;break;case"mousedown":m=1,h=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let f=l.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(l,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:c.col,row:c.row,x:c.x,y:c.y,button:h,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:l=>(i(l),l.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(l)),wheel:l=>(i(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&i(l)},mousemove:l=>{l.buttons||i(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?s.mousemove||(t.addEventListener("mousemove",a.mousemove),s.mousemove=a.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),l&16?s.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),s.wheel=a.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),l&2?s.mouseup||(s.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),l&4?s.mousedrag||(s.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Pe(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return i(l),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(l)})),this._register(Pe(t,"wheel",l=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let c=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(c,!0),this.cancel(l,!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){wk(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=mI(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)&&(SI(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(ti));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 SI(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var wI=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)}},EI=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 Un)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Sw=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 EI(t)}getNullCell(){return new Un}},CI=class extends Ge{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new pe),this.onBufferChange=this._onBufferChange.event,this._normal=new Sw(this._core.buffers.normal,"normal"),this._alternate=new Sw(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)}},kI=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)}},NI=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}},TI=["cols","rows"],ls=0,AI=class extends Ge{constructor(e){super(),this._core=this._register(new yI(e)),this._addonManager=this._register(new wI),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(TI.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 kI(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new NI(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 CI(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
38
- `,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 Gg.get()},set promptLabel(e){Gg.set(e)},get tooMuchOutput(){return Wg.get()},set tooMuchOutput(e){Wg.set(e)}}}_verifyIntegers(...e){for(ls of e)if(ls===1/0||isNaN(ls)||ls%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ls of e)if(ls&&(ls===1/0||isNaN(ls)||ls%1!==0||ls<0))throw new Error("This API only accepts positive integers")}};function h3({sessionId:e,active:t,toolbarExtra:i}){const s=E.useRef(null),a=E.useRef(null),l=E.useRef(null),c=E.useRef(null),[h,m]=E.useState("Local workspace"),[f,g]=E.useState("connecting"),[_,v]=E.useState("Opening shell"),x=E.useCallback(()=>{const w=c.current,C=l.current;if(!w||w.readyState!==WebSocket.OPEN||!C)return;C.fit();const N=C.proposeDimensions();N&&w.send(JSON.stringify({cols:N.cols,rows:N.rows,type:"resize"}))},[]);E.useEffect(()=>{if(!s.current)return;const w=new AI({allowProposedApi:!0,cursorBlink:!0,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:12,lineHeight:1.25,scrollback:4e3,theme:{background:"#090909",black:"#090909",blue:"#69a7ff",brightBlack:"#5f6368",brightBlue:"#8ab4f8",brightCyan:"#7ddfd7",brightGreen:"#8fdc8a",brightMagenta:"#d7a2ff",brightRed:"#ff8a80",brightWhite:"#ffffff",brightYellow:"#ffd166",cyan:"#62d0c8",foreground:"#f2f2f2",green:"#7ac77f",magenta:"#c792ea",red:"#ff6b6b",selectionBackground:"#ffffff33",white:"#e8eaed",yellow:"#f7c948"}}),C=new x9;w.loadAddon(C),w.open(s.current),a.current=w,l.current=C;const N=new WebSocket(MI(e));c.current=N;const T=w.onData(M=>{N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({data:M,type:"input"}))});N.addEventListener("open",()=>{g("running"),v("Shell connected"),x()}),N.addEventListener("message",M=>{const L=RI(M.data);if(L){if(L.type==="output"){w.write(L.data);return}if(L.type==="error"){g("error"),v(L.error);return}g(L.state==="idle"?"connecting":L.state),L.cwd&&m(L.cwd),v(L.error??L.shell??"Shell connected")}}),N.addEventListener("close",()=>{g(M=>M==="exited"?M:"exited"),v("Socket closed")}),N.addEventListener("error",()=>{g("error"),v("Terminal socket error")}),window.addEventListener("resize",x),window.setTimeout(x,0);const A=new ResizeObserver(()=>x());return A.observe(s.current),()=>{window.removeEventListener("resize",x),A.disconnect(),T.dispose(),N.close(),w.dispose(),c.current=null,a.current=null,l.current=null}},[e,x]),E.useEffect(()=>{if(!t)return;const w=window.setTimeout(()=>{x(),a.current?.focus()},0);return()=>window.clearTimeout(w)},[t,x]);const y=E.useCallback(w=>{const C=c.current;if(!C||C.readyState!==WebSocket.OPEN)return;const N=l.current?.proposeDimensions();C.send(JSON.stringify({cols:N?.cols,rows:N?.rows,...w}))},[]);return u.jsxs("section",{className:de("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[u.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:[u.jsx("div",{className:"min-w-0",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ke,{className:de("border-white/15 bg-white/10 text-white shadow-none",f==="running"&&"border-emerald-400/35 text-emerald-200",f==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:f}),u.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",_]})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(he,{"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:[u.jsx(iE,{}),"Restart"]}),u.jsxs(he,{"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:[u.jsx(Nh,{}),"Stop"]}),i]})]}),u.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden px-3 py-0.5",children:u.jsx("div",{className:"h-full w-full",ref:s})})]})}function MI(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function RI(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function DI({serviceName:e,active:t}){const[i,s]=E.useState(null),[a,l]=E.useState(null),[c,h]=E.useState(!1),m=E.useRef(!1);E.useEffect(()=>{if(!t||m.current)return;m.current=!0;let _=!1;return(async()=>{try{const v=await Bd({serviceName:e});_||s(v.id)}catch(v){_||l(v instanceof Error?v.message:String(v))}})(),()=>{_=!0}},[t,e]);const f=u.jsxs(he,{"aria-label":c?"Exit fullscreen terminal":"Expand terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",onClick:()=>h(_=>!_),size:"sm",type:"button",variant:"outline",children:[c?u.jsx(eE,{}):u.jsx(J2,{}),c?"Exit":"Expand"]}),g=a?u.jsxs("div",{className:"p-3 font-mono text-[11px] text-destructive",children:["Could not open terminal: ",a]}):i?u.jsx(h3,{active:t,sessionId:i,toolbarExtra:f}):u.jsx("div",{className:"p-3 font-mono text-[11px] text-muted-foreground",children:"Opening terminal…"});return c&&t?u.jsx(k_,{onClose:()=>h(!1),title:`Terminal — ${e}`,children:g}):u.jsx("div",{className:de("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:g})}const OI=500;function jI(e){const[t,i]=E.useState(),[s,a]=E.useState([]),[l,c]=E.useState(),[h,m]=E.useState(!1),f=E.useRef(void 0);E.useEffect(()=>{f.current=void 0,i(void 0),a([]);const _=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(w=>[...w,y.line].slice(-OI))}catch{}};return _.addEventListener("status",v),_.addEventListener("output",v),()=>_.close()},[e]);const g=E.useCallback(async _=>{m(!0),c(void 0);try{await $M(e,_)}catch(v){c(v instanceof Error?v.message:String(v))}finally{m(!1)}},[e]);return{run:t,lines:s,error:l,starting:h,start:g}}const LI={running:"secondary",passed:"success",failed:"error",error:"error"},BI={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function zI({serviceName:e}){const{run:t,lines:i,error:s,starting:a,start:l}=jI(e),[c,h]=E.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("form",{className:"flex items-center gap-2",onSubmit:g=>{g.preventDefault(),m||l(c.trim()||void 0)},children:[u.jsx(ot,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:g=>h(g.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:c}),u.jsx(he,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),s?u.jsx("div",{className:"text-red-600",children:s}):null,t?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[u.jsx(Ke,{size:"small",variant:LI[t.status],children:BI[t.status]}),u.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?u.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?u.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):u.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),i.length>0?u.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((g,_)=>u.jsx("div",{className:de(g.stream==="stderr"&&"text-red-500"),children:g.text},_))}):null,f?u.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",u.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 II({serviceName:e,status:t,health:i,timeline:s,onRefresh:a}){const[l,c]=E.useState("metrics"),h=i?.processTree?.processes??[];return u.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"mb-2 flex gap-1",children:[u.jsx(ka,{active:l==="logs",onClick:()=>c("logs"),children:"Logs"}),u.jsxs(ka,{active:l==="processes",onClick:()=>c("processes"),children:["Processes ",h.length?u.jsx(Ke,{variant:"secondary",size:"small",children:h.length}):null]}),u.jsx(ka,{active:l==="metrics",onClick:()=>c("metrics"),children:"Metrics"}),u.jsxs(ka,{active:l==="http",onClick:()=>c("http"),children:["HTTP",t?.inspector?.enabled?u.jsx(Ke,{variant:"success",size:"small",children:"on"}):null]}),u.jsx(ka,{active:l==="env",onClick:()=>c("env"),children:"Env"}),u.jsx(ka,{active:l==="tests",onClick:()=>c("tests"),children:"Tests"}),u.jsx(ka,{active:l==="terminal",onClick:()=>c("terminal"),children:"Terminal"})]}),l==="processes"?u.jsx(_9,{rows:h}):null,l==="metrics"?u.jsx(d9,{serviceName:e}):null,l==="http"?u.jsx(l9,{serviceName:e,status:t,timeline:s,onRefresh:a}):null,l==="env"?u.jsx(o9,{serviceName:e}):null,l==="tests"?u.jsx(zI,{serviceName:e}):null,l==="logs"?u.jsx(JL,{serviceName:e}):null,u.jsx(DI,{active:l==="terminal",serviceName:e},e)]})}function ka({active:e,onClick:t,children:i}){return u.jsx("button",{className:de("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:i})}function PI({allServices:e,group:t,onRefresh:i,ports:s,services:a,health:l,statuses:c,timeline:h,selectedService:m,onSelectService:f,onDropService:g}){const[_,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),N=a.some(M=>Ko(c[M.name]?.state));function T(M){!g||!M.dataTransfer.types.includes(Hc)||(M.preventDefault(),M.dataTransfer.dropEffect="copy",C(!0))}function A(M){if(!g)return;M.preventDefault(),C(!1);const L=M.dataTransfer.getData(Hc);L&&g(L)}return u.jsxs("section",{className:de("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>C(!1),onDrop:A,children:[u.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[u.jsxs("button",{"aria-expanded":!x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>y(M=>!M),type:"button",children:[u.jsx(es,{className:de("size-3.5 shrink-0 text-muted-foreground transition-transform",x&&"-rotate-90")}),u.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.services.length?u.jsx(Ke,{size:"small",variant:"secondary",children:t.services.length}):null]}),u.jsx(Hr,{label:"Edit group",children:u.jsx(he,{"aria-expanded":_,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(M=>!M),size:"icon",type:"button",variant:"ghost",children:u.jsx(Rc,{})})}),u.jsx(C_,{active:N,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await Ki(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await Ki(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const M=a[0];M&&f(M.name)}})]}),_?u.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:u.jsx(bk,{initialName:t.name,initialServices:t.services,onRefresh:i,onSaved:()=>v(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,x?null:u.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(M=>u.jsx(f3,{service:M,status:c[M.name],health:l[M.name],ports:s,onRefresh:i,timeline:h,selected:m===M.name,onSelect:()=>f(M.name)},M.name)):u.jsx(dt,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function f3({service:e,status:t,onRefresh:i,selected:s=!1,onSelect:a}){const l=t?.state??"stopped",c=Ko(l),[h,m]=E.useState(!1);return u.jsxs("div",{"aria-selected":s,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(Hc,e.name),e.cwd&&mk(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:de("group flex cursor-pointer 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:[u.jsx(E_,{command:e.command??""}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx(m3,{kind:e.kind}),e.port?u.jsxs("span",{children:[":",e.port]}):null]})]}),u.jsx(p3,{state:l}),u.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:u.jsx(C_,{active:c,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:i,onStarted:a})})]})}const Hc="application/x-nomoreide-service",ww={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 m3({kind:e}){const t=ww[e??"local"]??ww.local;return u.jsx("span",{className:de("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Ko(e){return e==="running"||e==="starting"}function UI({service:e,onRefresh:t}){const[i,s]=E.useState(e.port?String(e.port):""),[a,l]=E.useState(!1),{error:c,success:h}=Ii(),m=i.trim()!==(e.port?String(e.port):"");E.useEffect(()=>{s(e.port?String(e.port):"")},[e.port]);async function f(g){g.preventDefault(),l(!0);try{await Ki("/api/services",{name:e.name,command:e.command??"",cwd:e.cwd??"",port:i,description:e.description}),h(`Port saved for ${e.name}.`),await t()}catch(_){c(zc("Save port",e.name,_))}finally{l(!1)}}return u.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:f,children:[u.jsx(ot,{"aria-label":`Port for ${e.name}`,className:"h-8 w-20 font-mono text-xs",inputMode:"numeric",min:1,max:65535,onChange:g=>s(g.target.value),placeholder:"port",type:"number",value:i}),u.jsx(he,{"aria-label":`Save port for ${e.name}`,disabled:a||!m,className:"size-8",size:"icon",title:"Save port",type:"submit",variant:"outline",children:u.jsx(q0,{})})]})}function HI(e){return`http://127.0.0.1:${e}`}function p3({state:e}){return u.jsx(Ke,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:de(e==="running"&&"font-mono"),children:e})}function FI({data:e,onRefresh:t,focusService:i,onServiceFocused:s}){const a=e.config.services[0]?.name??"",[l,c]=E.useState(a),[h,m]=E.useState(null),{sendToAgent:f}=Jc(),[g,_]=E.useState(!1),[v,x]=E.useState(!1),[y,w]=E.useState(!1),[C,N]=E.useState(!1),[T,A]=E.useState(!1),M=E.useRef({}),{error:L,message:K,success:B}=Ii(),R=E.useMemo(()=>new Set(e.config.bundles.flatMap(j=>j.services)),[e.config.bundles]),H=E.useMemo(()=>{const j=new Map;for(const W of e.config.bundles)for(const D of W.services)j.has(D)||j.set(D,W.name);return j},[e.config.bundles]),P=E.useMemo(()=>e.config.services.filter(j=>!R.has(j.name)),[e.config.services,R]),q=e.health??{},J=e.config.bundles.length>0||P.length>0;E.useEffect(()=>{!e.config.services.some(W=>W.name===l)&&a&&c(a)},[e.config.services,a,l]),E.useEffect(()=>{i&&e.config.services.some(j=>j.name===i)&&(c(i),s?.())},[i,e.config.services,s]);const F=E.useMemo(()=>e.config.services.find(j=>j.name===l),[e.config.services,l]),ie=l?e.runtime.services[l]:void 0,V=l?q[l]:void 0;async function O(j,W){if(!j.services.includes(W))try{await LM(j.name,j.services,W),B(`Added ${W} to ${j.name}.`),await t()}catch(D){L(D instanceof Error?D.message:String(D))}}async function Y(){if(F){if(Ko(ie?.state)){L(`Stop ${F.name} before deleting it.`);return}if(window.confirm(`Delete service "${F.name}"? This removes it from your config.`))try{await jM(F.name),B(`Deleted ${F.name}.`),await t()}catch(j){L(j instanceof Error?j.message:String(j))}}}async function X(j){const W=e.config.bundles.filter(D=>D.services.includes(j));if(W.length!==0)try{for(const D of W)await BM(D.name,D.services,j);K({text:`Removed ${j} from ${W.map(D=>D.name).join(", ")}.`}),await t()}catch(D){L(D instanceof Error?D.message:String(D))}}return E.useEffect(()=>{const j=Object.fromEntries(e.config.services.map(D=>[D.name,e.runtime.services[D.name]?.state??"stopped"])),W=M.current;if(Object.keys(W).length){const D=new Map,te=new Map;for(const ue of e.config.services){const $=j[ue.name],se=W[ue.name];if(!se||se===$)continue;const fe=e.runtime.services[ue.name],ve=H.get(ue.name);if(ve){const Oe=D.get(ve)??new Map;if(Oe.set($,(Oe.get($)??0)+1),D.set(ve,Oe),$==="exited"){const ye=te.get(ve)??[];ye.push(fe?.exitCode),te.set(ve,ye)}continue}if($==="running")B(`${ue.name} is running.`);else if($==="stopped")K({text:`${ue.name} stopped.`});else if($==="starting")K({text:`${ue.name} is starting.`});else if($==="exited"){const Oe=fe?.exitCode===void 0||fe.exitCode===null?"":` with code ${fe.exitCode}`;L(`${ue.name} exited${Oe}.`)}}for(const[ue,$]of D)VI({exitCodes:te.get(ue)??[],groupName:ue,showErrorToast:L,showMessageToast:K,showSuccessToast:B,transitions:$})}M.current=j},[e.config.services,e.runtime.services,H,L,K,B]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:de("grid h-full min-h-0 overflow-hidden bg-card/85",v?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsx(Js,{className:"border-b border-border px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(er,{className:"text-sm",children:"Services"}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(he,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>_(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(nE,{className:"size-3.5"}),"Logs"]}),u.jsx($I,{onCreateGroup:()=>m("group"),onCreateService:()=>m("service"),onCreateWithAi:()=>f({prompt:Y7,source:{type:"service-setup",label:"Add a service"}})})]})]})}),u.jsx(tr,{className:"p-0",children:J?u.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(j=>u.jsx(PI,{group:j,onRefresh:t,ports:e.ports,allServices:e.config.services,health:q,services:e.config.services.filter(W=>j.services.includes(W.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:l,onSelectService:c,onDropService:W=>{O(j,W)}},j.name)),P.length?u.jsxs("div",{className:de("transition-colors",T&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:j=>{j.dataTransfer.types.includes(Hc)&&(j.preventDefault(),j.dataTransfer.dropEffect="move",A(!0))},onDragLeave:()=>A(!1),onDrop:j=>{j.preventDefault(),A(!1);const W=j.dataTransfer.getData(Hc);W&&X(W)},children:[u.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:[u.jsx("span",{children:"Ungrouped"}),u.jsx("span",{className:"text-muted-foreground/80",children:P.length})]}),u.jsx("div",{className:"divide-y divide-border",children:P.map(j=>u.jsx(f3,{service:j,status:e.runtime.services[j.name],health:q[j.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:l===j.name,onSelect:()=>c(j.name)},j.name))})]}):null]}):u.jsx(ch,{label:"No services registered yet."})})]})}),u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:F?u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:F.name}),u.jsx(p3,{state:ie?.state??"stopped"}),u.jsx(m3,{kind:F.kind}),u.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[u.jsx(UI,{service:F,onRefresh:t}),(()=>{const j=ie?.url??(F.port?HI(F.port):void 0);return j?u.jsx(Hr,{label:`Open ${j}`,children:u.jsx(he,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(j,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:u.jsx(F0,{})})}):null})(),V?.agentContext?u.jsx(Hr,{label:"Copy debug context for an AI agent",children:u.jsx(he,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>w(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Zd,{})})}):null,u.jsx(C_,{active:Ko(ie?.state),baseUrl:`/api/services/${encodeURIComponent(F.name)}`,compact:!0,targetLabel:F.name,onRefresh:t}),u.jsx(Hr,{label:"Edit service",children:u.jsx(he,{"aria-label":`Edit ${F.name}`,className:"size-7",onClick:()=>N(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Rc,{})})}),u.jsx(Hr,{label:Ko(ie?.state)?"Stop before deleting":"Delete service",children:u.jsx(he,{"aria-label":`Delete ${F.name}`,className:"size-7",disabled:Ko(ie?.state),onClick:()=>{Y()},size:"icon",type:"button",variant:"outline",children:u.jsx(Kc,{className:"text-destructive"})})}),u.jsx(Hr,{label:v?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:u.jsx(he,{"aria-label":v?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>x(j=>!j),size:"icon",type:"button",variant:"ghost",children:v?u.jsx(QT,{}):u.jsx(Xr,{})})})]})]}),F.command?u.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:F.command,children:["$ ",F.command]}):null,F.cwd?u.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:F.cwd,children:F.cwd}):null,u.jsx(IL,{health:V})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsx(II,{serviceName:F.name,status:ie,health:V,timeline:e.timeline??[],onRefresh:t},F.name)})]}):u.jsx(ch,{label:"Select a service to see details."})}),v?null:u.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[u.jsx($L,{ports:e.ports}),u.jsx(AL,{events:e.timeline??[]})]})]}),y&&F&&V?.agentContext?u.jsx(Xs,{icon:u.jsx(Zd,{}),onClose:()=>w(!1),title:`Agent context — ${F.name}`,children:u.jsx("div",{className:"p-4",children:u.jsx(cL,{context:V.agentContext})})}):null,C&&F?u.jsx(Xs,{icon:u.jsx(Rc,{}),onClose:()=>N(!1),size:"lg",title:`Edit Service — ${F.name}`,children:u.jsx(yS,{cwd:e.cwd,initialService:F,onRefresh:t,onSaved:()=>N(!1)})}):null,h?u.jsx(Xs,{icon:h==="service"?u.jsx(In,{}):u.jsx(q2,{}),onClose:()=>m(null),size:h==="service"?"lg":"md",title:h==="service"?"Add Service":"Create Group",children:h==="service"?u.jsx(yS,{cwd:e.cwd,onRefresh:t,onSaved:()=>m(null)}):u.jsx(bk,{services:P,onRefresh:t,onSaved:()=>m(null)})}):null,g?u.jsx(i9,{initialService:l||void 0,onClose:()=>_(!1),services:e.config.services.map(j=>j.name)}):null]})}function $I({onCreateService:e,onCreateGroup:t,onCreateWithAi:i}){const[s,a]=E.useState(!1);function l(c){a(!1),c()}return u.jsxs("div",{className:"relative",children:[u.jsx(Hr,{label:"Add",side:"bottom",children:u.jsx(he,{"aria-expanded":s,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>a(c=>!c),size:"icon",type:"button",variant:"ghost",children:u.jsx(In,{})})}),s?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>a(!1),tabIndex:-1,type:"button"}),u.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:[u.jsxs("div",{className:"group flex items-stretch",children:[u.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:()=>l(e),role:"menuitem",type:"button",children:[u.jsx(In,{}),"Create Service"]}),u.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:()=>l(i),role:"menuitem",title:"Set up with AI — the agent walks you through it",type:"button",children:[u.jsx(G7,{className:"size-3.5 shrink-0"}),"AI"]})]}),u.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>l(t),role:"menuitem",type:"button",children:[u.jsx(q2,{}),"Create Group"]})]})]}):null]})}function VI({exitCodes:e,groupName:t,showErrorToast:i,showMessageToast:s,showSuccessToast:a,transitions:l}){if(l.size===1){const[m]=l.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(_=>_!=null),g=f.length?` with code ${f.join(", ")}`:"";i(`${t} group exited${g}.`)}return}const c=[...l.entries()].map(([m,f])=>`${f} ${m}`).join(", "),h=`${t} group updated: ${c}.`;l.has("exited")?i(h):s({text:h})}function qI({data:e,onOpenService:t}){const i=E.useMemo(()=>KI(e),[e]);return i.length?u.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:[u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[u.jsx(ja,{className:"size-3"}),"Running"]}),u.jsx("div",{className:"flex min-w-0 items-center gap-2",children:i.map(s=>u.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:[u.jsx("span",{className:de("size-2 shrink-0 rounded-full",WI(s.tone))}),u.jsx("span",{className:"max-w-40 truncate font-medium text-foreground",children:s.name}),s.port?u.jsxs("span",{className:"text-muted-foreground",children:[":",s.port]}):null,s.uptime?u.jsxs("span",{className:"text-muted-foreground/70",children:["↑",s.uptime]}):null]},s.name))})]}):null}function KI(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:GI(i,e.health[i.name]),port:t.get(i.name)??YI(i.url),uptime:i.state==="running"?XI(i.startedAt):"starting…",url:i.url})).sort((i,s)=>i.name.localeCompare(s.name))}function GI(e,t){return e.state==="starting"?"starting":t?.status==="healthy"?"healthy":t?.status==="warning"?"warning":t?.status==="unhealthy"?"unhealthy":"healthy"}function WI(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 YI(e){if(e)try{const t=new URL(e).port;return t?Number(t):void 0}catch{return}}function XI(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),l=s%60;return a<24?`${a}h${l?`${l}m`:""}`:`${Math.floor(a/24)}d${a%24?`${a%24}h`:""}`}function ZI(){const[e,t]=E.useState([]),[i,s]=E.useState(null),[a,l]=E.useState(!1);E.useEffect(()=>{let m=!1;return(async()=>{let f=await VM().catch(()=>[]);if(f.length===0){const g=await Bd().catch(()=>null);f=g?[g]:[]}m||(t(f),s(f[0]?.id??null))})(),()=>{m=!0}},[]);const c=E.useCallback(async()=>{l(!0);try{const m=await Bd();t(f=>[...f,m]),s(m.id)}finally{l(!1)}},[]),h=E.useCallback(async m=>{l(!0);try{await qM(m);const f=e.findIndex(_=>_.id===m),g=e.filter(_=>_.id!==m);if(g.length===0){const _=await Bd();t([_]),s(_.id);return}if(t(g),i===m){const _=g[Math.min(f,g.length-1)];s(_.id)}}finally{l(!1)}},[e,i]);return u.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[u.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 g=m.label??`Terminal ${f+1}`;return u.jsxs("div",{className:de("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:[u.jsx("button",{"aria-selected":m.id===i,className:"max-w-[160px] truncate font-medium",onClick:()=>s(m.id),role:"tab",type:"button",children:g}),u.jsx("button",{"aria-label":`Close ${g}`,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:u.jsx(Hn,{className:"size-3"})})]},m.id)}),u.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:()=>{c()},type:"button",children:u.jsx(In,{className:"size-4"})})]}),u.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>u.jsx("div",{className:"absolute inset-0",children:u.jsx(h3,{active:m.id===i,sessionId:m.id})},m.id))})]})}const QI=800;function g3({activeHunkIndex:e=0,diff:t}){const i=eP(t),s=E.useRef(null),a=E.useRef([]),[l,c]=E.useState(!1),h=E.useMemo(()=>i.reduce((f,g)=>Math.max(f,g.content.length),0),[i]),m=h>QI;if(E.useEffect(()=>{c(!1)},[t]),E.useEffect(()=>{if(m&&!l)return;const f=a.current[e],g=s.current;!f||!g||g.scrollTo({top:Math.max(f.offsetTop-8,0),behavior:"smooth"})},[e,t,m,l]),m&&!l){const f=i.filter(_=>_.kind==="add").length,g=i.filter(_=>_.kind==="delete").length;return u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card p-6",children:u.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),u.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."]}),u.jsxs("p",{className:"font-mono text-[11px]",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",f]})," ",u.jsxs("span",{className:"text-red-700",children:["-",g]})," lines changed"]}),u.jsx(he,{onClick:()=>c(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return u.jsx("div",{className:"absolute inset-0 overflow-auto bg-card text-xs leading-6 text-foreground",ref:s,children:u.jsx("div",{className:"min-w-full font-mono",children:i.map((f,g)=>u.jsxs("div",{className:de("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",f.kind==="add"&&"bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",f.kind==="delete"&&"bg-red-50 text-red-800 dark:bg-red-500/15 dark:text-red-300",Ew(i,g)&&f.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:f.hunkIndex!==null&&Ew(i,g)?_=>{a.current[f.hunkIndex??0]=_}:void 0,children:[u.jsx(Cw,{value:f.oldLine}),u.jsx(Cw,{value:f.newLine}),u.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:f.content||" "})]},`${g}-${f.content}`))})})}function JI(e){return e.split(`
39
- `).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 eP(e){const t=tP(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function tP(e){let t=null,i=null,s=null;return e.split(`
40
- `).map(a=>{if(iP(a))return t=null,i=null,s=null,{content:a,hunkIndex:s,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("@@")){const c=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(a);return c&&(t=Number(c[1]),i=Number(c[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 c={content:a,hunkIndex:s,kind:"add",oldLine:null,newLine:i};return i+=1,c}if(a.startsWith("-")&&!a.startsWith("---")){const c={content:a,hunkIndex:s,kind:"delete",oldLine:t,newLine:null};return t+=1,c}const l={content:a,hunkIndex:s,kind:"context",oldLine:t,newLine:i};return t+=1,i+=1,l})}function Ew(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 iP(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 Cw({value:e}){return u.jsx("span",{className:de("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function nP({branch:e,error:t,files:i,selectedFile:s,onSelectFile:a,root:l}){const c=E.useMemo(()=>oP(i).filter(f=>f.files.length),[i]),[h,m]=E.useState({staged:!1,unstaged:!1,untracked:!1});return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.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:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(Mc,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Changes"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?u.jsx(Ke,{variant:"outline",children:e}):null,u.jsx(Ke,{variant:"secondary",children:i.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:c.length?c.map(f=>u.jsx(sP,{collapsed:h[f.id],group:f,onSelectFile:a,onToggle:()=>m(g=>({...g,[f.id]:!g[f.id]})),root:l,selectedFile:s},f.id)):u.jsx(dt,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function sP({collapsed:e,group:t,onSelectFile:i,onToggle:s,root:a,selectedFile:l}){const c=e?Xr:es;return u.jsxs("section",{className:"border-b border-border last:border-b-0",children:[u.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:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(c,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:t.label})]}),u.jsx(Ke,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:u.jsx("div",{children:t.files.map(h=>u.jsx(rP,{active:l===h.path,file:h,group:t.id,onClick:()=>i(h.path),root:a},h.path))})]})}function rP({active:e,file:t,group:i,onClick:s,root:a}){const l=t.path.split("/").pop()||t.path,c=t.path.split("/").slice(0,-1).join("/"),h=a?pk(fk(a,t.path)):{};return u.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",e&&"bg-muted font-medium"),onClick:s,type:"button",...h,children:[u.jsx(w_,{path:t.path}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 truncate",children:[u.jsx("span",{"data-testid":"changed-file-name",className:"shrink-0 truncate",children:l}),c?u.jsx("span",{"data-testid":"changed-file-dir",className:"min-w-0 truncate text-muted-foreground",children:c}):null]}),u.jsx("span",{className:de("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:aP(t,i)})]})}function aP(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function oP(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 lP(e){const t={name:"",path:"",children:[],isFile:!1},i=new Map;i.set("",t);const s=[...e].sort();for(const l of s){const c=l.split("/");let h="";for(let m=0;m<c.length;m+=1){const f=c[m],g=m===c.length-1,_=h?`${h}/${f}`:f;let v=i.get(_);v||(v={name:f,path:_,children:[],isFile:g},i.set(_,v),i.get(h)?.children.push(v)),h=_}}const a=l=>{l.children.sort((c,h)=>c.isFile!==h.isFile?c.isFile?1:-1:c.name.localeCompare(h.name)),l.children.forEach(a)};return a(t),t}function cP(e,t){const i={"":!0},s=a=>{for(const l of a.children)l.isFile||(i[l.path]=!0,t&&s(l))};return s(e),i}function kw({defaultExpandAll:e=!1,paths:t,status:i,selectedFile:s,onSelectFile:a,branch:l,emptyMessage:c="No tracked files.",root:h,title:m="Files"}){const f=E.useMemo(()=>lP(t),[t]),g=E.useMemo(()=>cP(f,e),[e,f]),_=E.useMemo(()=>{const N=new Map;for(const T of i)N.set(T.path,T);return N},[i]),[v,x]=E.useState(g),[y,w]=E.useState(!1);E.useEffect(()=>{y||f.children.length===0||(x(g),w(!0))},[g,y,f.children.length]);function C(N){x(T=>({...T,[N]:!T[N]}))}return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.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:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(Fa,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:m})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[l?u.jsx(Ke,{variant:"outline",children:l}):null,u.jsx(Ke,{variant:"secondary",children:t.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:f.children.length===0?u.jsx(dt,{variant:"muted",className:"m-3 text-center",children:c}):f.children.map(N=>u.jsx(_3,{depth:0,expanded:v,node:N,onSelectFile:a,onToggle:C,root:h,selectedFile:s,statusByPath:_},N.path))})]})}function _3({depth:e,expanded:t,node:i,onSelectFile:s,onToggle:a,root:l,selectedFile:c,statusByPath:h}){const m=t[i.path]??!1,f=6+e*12,g=l?pk(fk(l,i.path)):{};if(i.isFile){const x=h.get(i.path),y=c===i.path;return u.jsxs("button",{className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",y&&"bg-muted font-medium"),onClick:()=>s(i.path),style:{paddingLeft:f},type:"button",...g,children:[u.jsx(w_,{path:i.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),x?u.jsx(uP,{file:x}):null]})}const _=m?es:Xr,v=m?Ch:Fa;return u.jsxs("div",{children:[u.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",...g,children:[u.jsx(_,{className:"size-3.5 shrink-0 text-muted-foreground"}),u.jsx(v,{className:"size-3.5 shrink-0 text-amber-600"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]}),m?i.children.map(x=>u.jsx(_3,{depth:e+1,expanded:t,node:x,onSelectFile:s,onToggle:a,root:l,selectedFile:c,statusByPath:h},x.path)):null]})}function uP({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 u.jsx("span",{className:de("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}const dP="modulepreload",hP=function(e){return"/"+e},Nw={},fP=function(t,i,s){let a=Promise.resolve();if(i&&i.length>0){let m=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");a=m(i.map(f=>{if(f=hP(f),f in Nw)return;Nw[f]=!0;const g=f.endsWith(".css"),_=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${_}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":dP,g||(v.as="script"),v.crossOrigin="",v.href=f,h&&v.setAttribute("nonce",h),document.head.appendChild(v),g)return new Promise((x,y)=>{v.addEventListener("load",x),v.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function l(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return a.then(c=>{for(const h of c||[])h.status==="rejected"&&l(h.reason);return t().catch(l)})};var Dp,Tw;function mP(){if(Tw)return Dp;Tw=1;function e(I){return I instanceof Map?I.clear=I.delete=I.set=function(){throw new Error("map is read-only")}:I instanceof Set&&(I.add=I.clear=I.delete=function(){throw new Error("set is read-only")}),Object.freeze(I),Object.getOwnPropertyNames(I).forEach(ae=>{const be=I[ae],Ie=typeof be;(Ie==="object"||Ie==="function")&&!Object.isFrozen(be)&&e(be)}),I}class t{constructor(ae){ae.data===void 0&&(ae.data={}),this.data=ae.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(I,...ae){const be=Object.create(null);for(const Ie in I)be[Ie]=I[Ie];return ae.forEach(function(Ie){for(const Ct in Ie)be[Ct]=Ie[Ct]}),be}const a="</span>",l=I=>!!I.scope,c=(I,{prefix:ae})=>{if(I.startsWith("language:"))return I.replace("language:","language-");if(I.includes(".")){const be=I.split(".");return[`${ae}${be.shift()}`,...be.map((Ie,Ct)=>`${Ie}${"_".repeat(Ct+1)}`)].join(" ")}return`${ae}${I}`};class h{constructor(ae,be){this.buffer="",this.classPrefix=be.classPrefix,ae.walk(this)}addText(ae){this.buffer+=i(ae)}openNode(ae){if(!l(ae))return;const be=c(ae.scope,{prefix:this.classPrefix});this.span(be)}closeNode(ae){l(ae)&&(this.buffer+=a)}value(){return this.buffer}span(ae){this.buffer+=`<span class="${ae}">`}}const m=(I={})=>{const ae={children:[]};return Object.assign(ae,I),ae};class f{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ae){this.top.children.push(ae)}openNode(ae){const be=m({scope:ae});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ae){return this.constructor._walk(ae,this.rootNode)}static _walk(ae,be){return typeof be=="string"?ae.addText(be):be.children&&(ae.openNode(be),be.children.forEach(Ie=>this._walk(ae,Ie)),ae.closeNode(be)),ae}static _collapse(ae){typeof ae!="string"&&ae.children&&(ae.children.every(be=>typeof be=="string")?ae.children=[ae.children.join("")]:ae.children.forEach(be=>{f._collapse(be)}))}}class g extends f{constructor(ae){super(),this.options=ae}addText(ae){ae!==""&&this.add(ae)}startScope(ae){this.openNode(ae)}endScope(){this.closeNode()}__addSublanguage(ae,be){const Ie=ae.root;be&&(Ie.scope=`language:${be}`),this.add(Ie)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function _(I){return I?typeof I=="string"?I:I.source:null}function v(I){return w("(?=",I,")")}function x(I){return w("(?:",I,")*")}function y(I){return w("(?:",I,")?")}function w(...I){return I.map(be=>_(be)).join("")}function C(I){const ae=I[I.length-1];return typeof ae=="object"&&ae.constructor===Object?(I.splice(I.length-1,1),ae):{}}function N(...I){return"("+(C(I).capture?"":"?:")+I.map(Ie=>_(Ie)).join("|")+")"}function T(I){return new RegExp(I.toString()+"|").exec("").length-1}function A(I,ae){const be=I&&I.exec(ae);return be&&be.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(I,{joinWith:ae}){let be=0;return I.map(Ie=>{be+=1;const Ct=be;let yt=_(Ie),Ne="";for(;yt.length>0;){const Se=M.exec(yt);if(!Se){Ne+=yt;break}Ne+=yt.substring(0,Se.index),yt=yt.substring(Se.index+Se[0].length),Se[0][0]==="\\"&&Se[1]?Ne+="\\"+String(Number(Se[1])+Ct):(Ne+=Se[0],Se[0]==="("&&be++)}return Ne}).map(Ie=>`(${Ie})`).join(ae)}const K=/\b\B/,B="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",J="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",F=(I={})=>{const ae=/^#![ ]*\//;return I.binary&&(I.begin=w(ae,/.*\b/,I.binary,/\b.*/)),s({scope:"meta",begin:ae,end:/$/,relevance:0,"on:begin":(be,Ie)=>{be.index!==0&&Ie.ignoreMatch()}},I)},ie={begin:"\\\\[\\s\\S]",relevance:0},V={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ie]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ie]},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(I,ae,be={}){const Ie=s({scope:"comment",begin:I,end:ae,contains:[]},be);Ie.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 Ct=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 Ie.contains.push({begin:w(/[ ]+/,"(",Ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},j=X("//","$"),W=X("/\\*","\\*/"),D=X("#","$"),te={scope:"number",begin:H,relevance:0},ue={scope:"number",begin:P,relevance:0},$={scope:"number",begin:q,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ie,{begin:/\[/,end:/\]/,relevance:0,contains:[ie]}]},fe={scope:"title",begin:B,relevance:0},ve={scope:"title",begin:R,relevance:0},Oe={begin:"\\.\\s*"+R,relevance:0};var st=Object.freeze({__proto__:null,APOS_STRING_MODE:V,BACKSLASH_ESCAPE:ie,BINARY_NUMBER_MODE:$,BINARY_NUMBER_RE:q,COMMENT:X,C_BLOCK_COMMENT_MODE:W,C_LINE_COMMENT_MODE:j,C_NUMBER_MODE:ue,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(I){return Object.assign(I,{"on:begin":(ae,be)=>{be.data._beginMatch=ae[1]},"on:end":(ae,be)=>{be.data._beginMatch!==ae[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:B,MATCH_NOTHING_RE:K,METHOD_GUARD:Oe,NUMBER_MODE:te,NUMBER_RE:H,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:O,REGEXP_MODE:se,RE_STARTERS_RE:J,SHEBANG:F,TITLE_MODE:fe,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:ve});function lt(I,ae){I.input[I.index-1]==="."&&ae.ignoreMatch()}function ct(I,ae){I.className!==void 0&&(I.scope=I.className,delete I.className)}function ze(I,ae){ae&&I.beginKeywords&&(I.begin="\\b("+I.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",I.__beforeBegin=lt,I.keywords=I.keywords||I.beginKeywords,delete I.beginKeywords,I.relevance===void 0&&(I.relevance=0))}function Ft(I,ae){Array.isArray(I.illegal)&&(I.illegal=N(...I.illegal))}function ea(I,ae){if(I.match){if(I.begin||I.end)throw new Error("begin & end are not supported with match");I.begin=I.match,delete I.match}}function vs(I,ae){I.relevance===void 0&&(I.relevance=1)}const Ka=(I,ae)=>{if(!I.beforeMatch)return;if(I.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},I);Object.keys(I).forEach(Ie=>{delete I[Ie]}),I.keywords=be.keywords,I.begin=w(be.beforeMatch,v(be.begin)),I.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},I.relevance=0,delete be.beforeMatch},ta=["of","and","for","in","not","or","if","then","parent","list","value"],ia="keyword";function sr(I,ae,be=ia){const Ie=Object.create(null);return typeof I=="string"?Ct(be,I.split(" ")):Array.isArray(I)?Ct(be,I):Object.keys(I).forEach(function(yt){Object.assign(Ie,sr(I[yt],ae,yt))}),Ie;function Ct(yt,Ne){ae&&(Ne=Ne.map(Se=>Se.toLowerCase())),Ne.forEach(function(Se){const Be=Se.split("|");Ie[Be[0]]=[yt,xs(Be[0],Be[1])]})}}function xs(I,ae){return ae?Number(ae):ol(I)?0:1}function ol(I){return ta.includes(I.toLowerCase())}const Ga={},Ot=I=>{console.error(I)},ys=(I,...ae)=>{console.log(`WARN: ${I}`,...ae)},xi=(I,ae)=>{Ga[`${I}/${ae}`]||(console.log(`Deprecated as of ${I}. ${ae}`),Ga[`${I}/${ae}`]=!0)},Ss=new Error;function ws(I,ae,{key:be}){let Ie=0;const Ct=I[be],yt={},Ne={};for(let Se=1;Se<=ae.length;Se++)Ne[Se+Ie]=Ct[Se],yt[Se+Ie]=!0,Ie+=T(ae[Se-1]);I[be]=Ne,I[be]._emit=yt,I[be]._multi=!0}function Wa(I){if(Array.isArray(I.begin)){if(I.skip||I.excludeBegin||I.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ss;if(typeof I.beginScope!="object"||I.beginScope===null)throw Ot("beginScope must be object"),Ss;ws(I,I.begin,{key:"beginScope"}),I.begin=L(I.begin,{joinWith:""})}}function rr(I){if(Array.isArray(I.end)){if(I.skip||I.excludeEnd||I.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ss;if(typeof I.endScope!="object"||I.endScope===null)throw Ot("endScope must be object"),Ss;ws(I,I.end,{key:"endScope"}),I.end=L(I.end,{joinWith:""})}}function ll(I){I.scope&&typeof I.scope=="object"&&I.scope!==null&&(I.beginScope=I.scope,delete I.scope)}function Ya(I){ll(I),typeof I.beginScope=="string"&&(I.beginScope={_wrap:I.beginScope}),typeof I.endScope=="string"&&(I.endScope={_wrap:I.endScope}),Wa(I),rr(I)}function Es(I){function ae(Ne,Se){return new RegExp(_(Ne),"m"+(I.case_insensitive?"i":"")+(I.unicodeRegex?"u":"")+(Se?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Se,Be){Be.position=this.position++,this.matchIndexes[this.matchAt]=Be,this.regexes.push([Be,Se]),this.matchAt+=T(Se)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Se=this.regexes.map(Be=>Be[1]);this.matcherRe=ae(L(Se,{joinWith:"|"}),!0),this.lastIndex=0}exec(Se){this.matcherRe.lastIndex=this.lastIndex;const Be=this.matcherRe.exec(Se);if(!Be)return null;const $t=Be.findIndex((Cs,Za)=>Za>0&&Cs!==void 0),Mt=this.matchIndexes[$t];return Be.splice(0,$t),Object.assign(Be,Mt)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Se){if(this.multiRegexes[Se])return this.multiRegexes[Se];const Be=new be;return this.rules.slice(Se).forEach(([$t,Mt])=>Be.addRule($t,Mt)),Be.compile(),this.multiRegexes[Se]=Be,Be}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Se,Be){this.rules.push([Se,Be]),Be.type==="begin"&&this.count++}exec(Se){const Be=this.getMatcher(this.regexIndex);Be.lastIndex=this.lastIndex;let $t=Be.exec(Se);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const Mt=this.getMatcher(0);Mt.lastIndex=this.lastIndex+1,$t=Mt.exec(Se)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Ct(Ne){const Se=new Ie;return Ne.contains.forEach(Be=>Se.addRule(Be.begin,{rule:Be,type:"begin"})),Ne.terminatorEnd&&Se.addRule(Ne.terminatorEnd,{type:"end"}),Ne.illegal&&Se.addRule(Ne.illegal,{type:"illegal"}),Se}function yt(Ne,Se){const Be=Ne;if(Ne.isCompiled)return Be;[ct,ea,Ya,Ka].forEach(Mt=>Mt(Ne,Se)),I.compilerExtensions.forEach(Mt=>Mt(Ne,Se)),Ne.__beforeBegin=null,[ze,Ft,vs].forEach(Mt=>Mt(Ne,Se)),Ne.isCompiled=!0;let $t=null;return typeof Ne.keywords=="object"&&Ne.keywords.$pattern&&(Ne.keywords=Object.assign({},Ne.keywords),$t=Ne.keywords.$pattern,delete Ne.keywords.$pattern),$t=$t||/\w+/,Ne.keywords&&(Ne.keywords=sr(Ne.keywords,I.case_insensitive)),Be.keywordPatternRe=ae($t,!0),Se&&(Ne.begin||(Ne.begin=/\B|\b/),Be.beginRe=ae(Be.begin),!Ne.end&&!Ne.endsWithParent&&(Ne.end=/\B|\b/),Ne.end&&(Be.endRe=ae(Be.end)),Be.terminatorEnd=_(Be.end)||"",Ne.endsWithParent&&Se.terminatorEnd&&(Be.terminatorEnd+=(Ne.end?"|":"")+Se.terminatorEnd)),Ne.illegal&&(Be.illegalRe=ae(Ne.illegal)),Ne.contains||(Ne.contains=[]),Ne.contains=[].concat(...Ne.contains.map(function(Mt){return Sn(Mt==="self"?Ne:Mt)})),Ne.contains.forEach(function(Mt){yt(Mt,Be)}),Ne.starts&&yt(Ne.starts,Se),Be.matcher=Ct(Be),Be}if(I.compilerExtensions||(I.compilerExtensions=[]),I.contains&&I.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return I.classNameAliases=s(I.classNameAliases||{}),yt(I)}function fi(I){return I?I.endsWithParent||fi(I.starts):!1}function Sn(I){return I.variants&&!I.cachedVariants&&(I.cachedVariants=I.variants.map(function(ae){return s(I,{variants:null},ae)})),I.cachedVariants?I.cachedVariants:fi(I)?s(I,{starts:I.starts?s(I.starts):null}):Object.isFrozen(I)?s(I):I}var yi="11.11.1";class cl extends Error{constructor(ae,be){super(ae),this.name="HTMLInjectionError",this.html=be}}const na=i,Xa=s,it=Symbol("nomatch"),qn=7,ln=function(I){const ae=Object.create(null),be=Object.create(null),Ie=[];let Ct=!0;const yt="Could not find the language '{}', did you forget to load/include a language module?",Ne={disableAutodetect:!0,name:"Plain text",contains:[]};let Se={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Be(me){return Se.noHighlightRe.test(me)}function $t(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Ye=Se.languageDetectRe.exec(Me);if(Ye){const ht=Ui(Ye[1]);return ht||(ys(yt.replace("{}",Ye[1])),ys("Falling back to no-highlight mode for this block.",me)),ht?Ye[1]:"no-highlight"}return Me.split(/\s+/).find(ht=>Be(ht)||Ui(ht))}function Mt(me,Me,Ye){let ht="",qt="";typeof Me=="object"?(ht=me,Ye=Me.ignoreIllegals,qt=Me.language):(xi("10.7.0","highlight(lang, code, ...args) has been deprecated."),xi("10.7.0",`Please use highlight(code, options) instead.
41
- https://github.com/highlightjs/highlight.js/issues/2277`),qt=me,ht=Me),Ye===void 0&&(Ye=!0);const Oi={code:ht,language:qt};ra("before:highlight",Oi);const cn=Oi.result?Oi.result:Cs(Oi.language,Oi.code,Ye);return cn.code=Oi.code,ra("after:highlight",cn),cn}function Cs(me,Me,Ye,ht){const qt=Object.create(null);function Oi(ge,Te){return ge.keywords[Te]}function cn(){if(!Le.keywords){Xt.addText(ft);return}let ge=0;Le.keywordPatternRe.lastIndex=0;let Te=Le.keywordPatternRe.exec(ft),He="";for(;Te;){He+=ft.substring(ge,Te.index);const Qe=Si.case_insensitive?Te[0].toLowerCase():Te[0],jt=Oi(Le,Qe);if(jt){const[wn,pl]=jt;if(Xt.addText(He),He="",qt[Qe]=(qt[Qe]||0)+1,qt[Qe]<=qn&&(cr+=pl),wn.startsWith("_"))He+=Te[0];else{const du=Si.classNameAliases[wn]||wn;un(Te[0],du)}}else He+=Te[0];ge=Le.keywordPatternRe.lastIndex,Te=Le.keywordPatternRe.exec(ft)}He+=ft.substring(ge),Xt.addText(He)}function Xi(){if(ft==="")return;let ge=null;if(typeof Le.subLanguage=="string"){if(!ae[Le.subLanguage]){Xt.addText(ft);return}ge=Cs(Le.subLanguage,ft,!0,uu[Le.subLanguage]),uu[Le.subLanguage]=ge._top}else ge=Qa(ft,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(cr+=ge.relevance),Xt.__addSublanguage(ge._emitter,ge.language)}function Et(){Le.subLanguage!=null?Xi():cn(),ft=""}function un(ge,Te){ge!==""&&(Xt.startScope(Te),Xt.addText(ge),Xt.endScope())}function lu(ge,Te){let He=1;const Qe=Te.length-1;for(;He<=Qe;){if(!ge._emit[He]){He++;continue}const jt=Si.classNameAliases[ge[He]]||ge[He],wn=Te[He];jt?un(wn,jt):(ft=wn,cn(),ft=""),He++}}function eo(ge,Te){return ge.scope&&typeof ge.scope=="string"&&Xt.openNode(Si.classNameAliases[ge.scope]||ge.scope),ge.beginScope&&(ge.beginScope._wrap?(un(ft,Si.classNameAliases[ge.beginScope._wrap]||ge.beginScope._wrap),ft=""):ge.beginScope._multi&&(lu(ge.beginScope,Te),ft="")),Le=Object.create(ge,{parent:{value:Le}}),Le}function hl(ge,Te,He){let Qe=A(ge.endRe,He);if(Qe){if(ge["on:end"]){const jt=new t(ge);ge["on:end"](Te,jt),jt.isMatchIgnored&&(Qe=!1)}if(Qe){for(;ge.endsParent&&ge.parent;)ge=ge.parent;return ge}}if(ge.endsWithParent)return hl(ge.parent,Te,He)}function to(ge){return Le.matcher.regexIndex===0?(ft+=ge[0],1):(ur=!0,0)}function Uh(ge){const Te=ge[0],He=ge.rule,Qe=new t(He),jt=[He.__beforeBegin,He["on:begin"]];for(const wn of jt)if(wn&&(wn(ge,Qe),Qe.isMatchIgnored))return to(Te);return He.skip?ft+=Te:(He.excludeBegin&&(ft+=Te),Et(),!He.returnBegin&&!He.excludeBegin&&(ft=Te)),eo(He,ge),He.returnBegin?0:Te.length}function Zi(ge){const Te=ge[0],He=Me.substring(ge.index),Qe=hl(Le,ge,He);if(!Qe)return it;const jt=Le;Le.endScope&&Le.endScope._wrap?(Et(),un(Te,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(Et(),lu(Le.endScope,ge)):jt.skip?ft+=Te:(jt.returnEnd||jt.excludeEnd||(ft+=Te),Et(),jt.excludeEnd&&(ft=Te));do Le.scope&&Xt.closeNode(),!Le.skip&&!Le.subLanguage&&(cr+=Le.relevance),Le=Le.parent;while(Le!==Qe.parent);return Qe.starts&&eo(Qe.starts,ge),jt.returnEnd?0:Te.length}function fl(){const ge=[];for(let Te=Le;Te!==Si;Te=Te.parent)Te.scope&&ge.unshift(Te.scope);ge.forEach(Te=>Xt.openNode(Te))}let aa={};function io(ge,Te){const He=Te&&Te[0];if(ft+=ge,He==null)return Et(),0;if(aa.type==="begin"&&Te.type==="end"&&aa.index===Te.index&&He===""){if(ft+=Me.slice(Te.index,Te.index+1),!Ct){const Qe=new Error(`0 width match regex (${me})`);throw Qe.languageName=me,Qe.badRule=aa.rule,Qe}return 1}if(aa=Te,Te.type==="begin")return Uh(Te);if(Te.type==="illegal"&&!Ye){const Qe=new Error('Illegal lexeme "'+He+'" for mode "'+(Le.scope||"<unnamed>")+'"');throw Qe.mode=Le,Qe}else if(Te.type==="end"){const Qe=Zi(Te);if(Qe!==it)return Qe}if(Te.type==="illegal"&&He==="")return ft+=`
42
- `,1;if(ml>1e5&&ml>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=He,He.length}const Si=Ui(me);if(!Si)throw Ot(yt.replace("{}",me)),new Error('Unknown language: "'+me+'"');const cu=Es(Si);let no="",Le=ht||cu;const uu={},Xt=new Se.__emitter(Se);fl();let ft="",cr=0,Ts=0,ml=0,ur=!1;try{if(Si.__emitTokens)Si.__emitTokens(Me,Xt);else{for(Le.matcher.considerAll();;){ml++,ur?ur=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=Ts;const ge=Le.matcher.exec(Me);if(!ge)break;const Te=Me.substring(Ts,ge.index),He=io(Te,ge);Ts=ge.index+He}io(Me.substring(Ts))}return Xt.finalize(),no=Xt.toHTML(),{language:me,value:no,relevance:cr,illegal:!1,_emitter:Xt,_top:Le}}catch(ge){if(ge.message&&ge.message.includes("Illegal"))return{language:me,value:na(Me),illegal:!0,relevance:0,_illegalBy:{message:ge.message,index:Ts,context:Me.slice(Ts-100,Ts+100),mode:ge.mode,resultSoFar:no},_emitter:Xt};if(Ct)return{language:me,value:na(Me),illegal:!1,relevance:0,errorRaised:ge,_emitter:Xt,_top:Le};throw ge}}function Za(me){const Me={value:na(me),illegal:!1,relevance:0,_top:Ne,_emitter:new Se.__emitter(Se)};return Me._emitter.addText(me),Me}function Qa(me,Me){Me=Me||Se.languages||Object.keys(ae);const Ye=Za(me),ht=Me.filter(Ui).filter(or).map(Et=>Cs(Et,me,!1));ht.unshift(Ye);const qt=ht.sort((Et,un)=>{if(Et.relevance!==un.relevance)return un.relevance-Et.relevance;if(Et.language&&un.language){if(Ui(Et.language).supersetOf===un.language)return 1;if(Ui(un.language).supersetOf===Et.language)return-1}return 0}),[Oi,cn]=qt,Xi=Oi;return Xi.secondBest=cn,Xi}function ts(me,Me,Ye){const ht=Me&&be[Me]||Ye;me.classList.add("hljs"),me.classList.add(`language-${ht}`)}function Vt(me){let Me=null;const Ye=$t(me);if(Be(Ye))return;if(ra("before:highlightElement",{el:me,language:Ye}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.children.length>0&&(Se.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(me)),Se.throwUnescapedHTML))throw new cl("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const ht=Me.textContent,qt=Ye?Mt(ht,{language:Ye,ignoreIllegals:!0}):Qa(ht);me.innerHTML=qt.value,me.dataset.highlighted="yes",ts(me,Ye,qt.language),me.result={language:qt.language,re:qt.relevance,relevance:qt.relevance},qt.secondBest&&(me.secondBest={language:qt.secondBest.language,relevance:qt.secondBest.relevance}),ra("after:highlightElement",{el:me,result:qt,text:ht})}function Di(me){Se=Xa(Se,me)}const ar=()=>{Ja(),xi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ul(){Ja(),xi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ru=!1;function Ja(){function me(){Ja()}if(document.readyState==="loading"){ru||window.addEventListener("DOMContentLoaded",me,!1),ru=!0;return}document.querySelectorAll(Se.cssSelector).forEach(Vt)}function au(me,Me){let Ye=null;try{Ye=Me(I)}catch(ht){if(Ot("Language definition for '{}' could not be registered.".replace("{}",me)),Ct)Ot(ht);else throw ht;Ye=Ne}Ye.name||(Ye.name=me),ae[me]=Ye,Ye.rawDefinition=Me.bind(null,I),Ye.aliases&&ks(Ye.aliases,{languageName:me})}function sa(me){delete ae[me];for(const Me of Object.keys(be))be[Me]===me&&delete be[Me]}function dl(){return Object.keys(ae)}function Ui(me){return me=(me||"").toLowerCase(),ae[me]||ae[be[me]]}function ks(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Ye=>{be[Ye.toLowerCase()]=Me})}function or(me){const Me=Ui(me);return Me&&!Me.disableAutodetect}function lr(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Me=>{me["before:highlightBlock"](Object.assign({block:Me.el},Me))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Me=>{me["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Yt(me){lr(me),Ie.push(me)}function ou(me){const Me=Ie.indexOf(me);Me!==-1&&Ie.splice(Me,1)}function ra(me,Me){const Ye=me;Ie.forEach(function(ht){ht[Ye]&&ht[Ye](Me)})}function Ns(me){return xi("10.7.0","highlightBlock will be removed entirely in v12.0"),xi("10.7.0","Please use highlightElement now."),Vt(me)}Object.assign(I,{highlight:Mt,highlightAuto:Qa,highlightAll:Ja,highlightElement:Vt,highlightBlock:Ns,configure:Di,initHighlighting:ar,initHighlightingOnLoad:ul,registerLanguage:au,unregisterLanguage:sa,listLanguages:dl,getLanguage:Ui,registerAliases:ks,autoDetection:or,inherit:Xa,addPlugin:Yt,removePlugin:ou}),I.debugMode=function(){Ct=!1},I.safeMode=function(){Ct=!0},I.versionString=yi,I.regex={concat:w,lookahead:v,either:N,optional:y,anyNumberOfTimes:x};for(const me in st)typeof st[me]=="object"&&e(st[me]);return Object.assign(I,st),I},Ri=ln({});return Ri.newInstance=()=>ln({}),Dp=Ri,Ri.HighlightJS=Ri,Ri.default=Ri,Dp}var Op,Aw;function pP(){if(Aw)return Op;Aw=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,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},h=t.inherit(c,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={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:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[c,f,m,h,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,h,f,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{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:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],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:g}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(s,/>/))),contains:[{className:"name",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Op=e,Op}var jp,Mw;function gP(){if(Mw)return jp;Mw=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 l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=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,l]};l.contains.push(m);const f={match:/\\"/},g={className:"string",begin:/'/,end:/'/},_={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}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],L=["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"],K=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:N,built_in:[...A,...M,"set","shopt",...L,...K]},contains:[y,t.SHEBANG(),w,v,c,h,T,m,f,g,_,s]}}return jp=e,jp}var Lp,Rw;function _P(){if(Rw)return Lp;Rw=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",h="("+a+"|"+i.optional(l)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},g={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})"/})]},_={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(g,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},y=i.optional(l)+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,_,g],A={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},M={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,g,_,m,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,g,_,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(A,M,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:g,keywords:N}}}return Lp=e,Lp}var Bp,Dw;function bP(){if(Dw)return Bp;Dw=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",h="(?!struct)("+a+"|"+i.optional(l)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},g={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})"/})]},_={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(g,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},y=i.optional(l)+t.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],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"],L={type:C,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},K={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},B=[K,v,m,s,t.C_BLOCK_COMMENT_MODE,_,g],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:B.concat([{begin:/\(/,end:/\)/,keywords:L,contains:B.concat(["self"]),relevance:0}]),relevance:0},H={className:"function",begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:L,relevance:0},{begin:y,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,_]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,g,_,m,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,g,_,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,H,K,B,[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:L,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Bp=e,Bp}var zp,Ow;function vP(){if(Ow)return zp;Ow=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"],l=["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"],c=["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:l.concat(c),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},g={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},_={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},v=t.inherit(_,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:h},y=t.inherit(x,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,y]},C={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},N=t.inherit(C,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});x.contains=[C,w,_,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],y.contains=[N,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[g,C,w,_,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},M=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",L={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,A,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,A,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:h,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,A],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]},L]}}return zp=e,zp}var Ip,jw;function xP(){if(jw)return Ip;jw=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(),l=["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(),c=["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 g=f.regex,_=e(f),v={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},x="and or not only",y=/@-?\w[\w]*(-\w+)*/,w="[a-zA-Z-][a-zA-Z0-9_-]*",C=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[_.BLOCK_COMMENT,v,_.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+w,relevance:0},_.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},_.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[_.BLOCK_COMMENT,_.HEXCOLOR,_.IMPORTANT,_.CSS_NUMBER_MODE,...C,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...C,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},_.FUNCTION_DISPATCH]},{begin:g.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"},...C,_.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b"}]}}return Ip=m,Ip}var Pp,Lw;function yP(){if(Lw)return Pp;Lw=1;function e(t){const i=t.regex,s={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={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}]},c={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}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},_={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},v=t.inherit(g,{contains:[]}),x=t.inherit(_,{contains:[]});g.contains.push(x),_.contains.push(v);let y=[s,f];return[g,_,v,x].forEach(T=>{T.contains=T.contains.concat(y)}),y=y.concat(g,_),{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,c,g,_,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},l,a,f,h,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Pp=e,Pp}var Up,Bw;function SP(){if(Bw)return Up;Bw=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 Up=e,Up}var Hp,zw;function wP(){if(zw)return Hp;zw=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]+/),l=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:">"},g=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],_={className:"subst",begin:/#\{/,end:/\}/,keywords:h},v={className:"string",contains:[t.BACKSLASH_ESCAPE,_],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,_]})]}]},x="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",w={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"}]},C={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:h}]},B=[v,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:h},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:h},{relevance:0,match:[l,/\.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:[C]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[v,{begin:s}],relevance:0},w,{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,_],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,g),relevance:0}].concat(f,g);_.contains=B,C.contains=B;const q=[{begin:/^\s*=>/,starts:{end:"$",contains:B}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:h,contains:B}}];return g.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:h,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(q).concat(g).concat(B)}}return Hp=e,Hp}var Fp,Iw;function EP(){if(Iw)return Fp;Iw=1;function e(t){const c={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:c,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:c,illegal:/["']/}]}]}}return Fp=e,Fp}var $p,Pw;function CP(){if(Pw)return $p;Pw=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 $p=e,$p}var Vp,Uw;function kP(){if(Uw)return Vp;Uw=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 l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={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,c,l,h,s,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,g=/"(\\"|[^"])*"/,_=/'[^']*'/,v=i.either(f,g,_),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,c,l,h,s]}}]}}return Vp=e,Vp}var qp,Hw;function NP(){if(Hw)return qp;Hw=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(c,h,m){return m===-1?"":c.replace(h,f=>a(c,h,m-1))}function l(c){const h=c.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"]},w={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},C={className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:y,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[h.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[C,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+f+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[w,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,s,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},s,w]}}return qp=l,qp}var Kp,Fw;function TP(){if(Fw)return Kp;Fw=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"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(l,s,a);function m(f){const g=f.regex,_=(ve,{after:Oe})=>{const ye="</"+ve[0].slice(1);return ve.input.indexOf(ye,Oe)!==-1},v=e,x={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ve,Oe)=>{const ye=ve[0].length+ve.index,st=ve.input[ye];if(st==="<"||st===","){Oe.ignoreMatch();return}st===">"&&(_(ve,{after:ye})||Oe.ignoreMatch());let lt;const ct=ve.input.substring(ye);if(lt=ct.match(/^\s*=/)){Oe.ignoreMatch();return}if((lt=ct.match(/^\s+extends\s+/))&&lt.index===0){Oe.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":c},N="[0-9](_?[0-9])*",T=`\\.(${N})`,A="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",M={className:"number",variants:[{begin:`(\\b(${A})((${T})|\\.)?|(${T}))[eE][+-]?(${N})\\b`},{begin:`\\b(${A})\\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},L={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},K={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"xml"}},B={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"css"}},R={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,L]},q={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]},J=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,K,B,R,H,{match:/\$\d+/},M];L.contains=J.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(J)});const F=[].concat(q,L.contains),ie=F.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(F)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:ie},O={variants:[{match:[/class/,/\s+/,v,/\s+/,/extends/,/\s+/,g.concat(v,"(",g.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:g.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)['"]/},j={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(ve){return g.concat("(?!",ve.join("|"),")")}const te={match:g.concat(/\b/,D([...l,"super","import"].map(ve=>`${ve}\\s*\\(`)),v,g.lookahead(/\s*\(/)),className:"title.function",relevance:0},ue={begin:g.concat(/\./,g.lookahead(g.concat(v,/(?![0-9A-Za-z$_(])/))),end:v,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:ie,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,K,B,R,H,q,{match:/\$\d+/},M,Y,{scope:"attr",match:v+g.lookahead(":"),relevance:0},fe,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[q,f.REGEXP_MODE,{className:"function",begin:se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:f.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:ie}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:y},{begin:w.begin,"on:begin":w.isTrulyOpeningTag,end:w.end}],subLanguage:"xml",contains:[{begin:w.begin,end:w.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+f.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,f.inherit(f.TITLE_MODE,{begin:v,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},te,W,O,$,{match:/\$[(.]/}]}}return Kp=m,Kp}var Gp,$w;function AP(){if($w)return Gp;$w=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"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,s,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Gp=e,Gp}var Wp,Vw;function MP(){if(Vw)return Wp;Vw=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(l){const c={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:l.UNDERSCORE_IDENT_RE+"@"},f={className:"subst",begin:/\$\{/,end:/\}/,contains:[l.C_NUMBER_MODE]},g={className:"variable",begin:"\\$"+l.UNDERSCORE_IDENT_RE},_={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[g,f]},{begin:"'",end:"'",illegal:/\n/,contains:[l.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[l.BACKSLASH_ESCAPE,g,f]}]};f.contains.push(_);const v={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},x={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(_,{className:"string"}),"self"]}]},y=s,w=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),C={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},N=C;return N.variants[1].contains=[C],C.variants[1].contains=[N],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[l.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),l.C_LINE_COMMENT_MODE,w,h,m,v,x,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:l.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[l.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[C,l.C_LINE_COMMENT_MODE,w],relevance:0},l.C_LINE_COMMENT_MODE,w,v,x,_,l.C_NUMBER_MODE]},w]},{begin:[/class|interface|trait/,/\s+/,l.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},l.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]},_,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
43
- `},y]}}return Wp=a,Wp}var Yp,qw;function RP(){if(qw)return Yp;qw=1;const e=g=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:g.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:[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:g.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(),l=["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(),c=["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=l.concat(c).sort().reverse();function f(g){const _=e(g),v=m,x="and or not only",y="[\\w-]+",w="("+y+"|@\\{"+y+"\\})",C=[],N=[],T=function(F){return{className:"string",begin:"~?"+F+".*?"+F}},A=function(F,ie,V){return{className:F,begin:ie,relevance:V}},M={$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},L={begin:"\\(",end:"\\)",contains:N,keywords:M,relevance:0};N.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,T("'"),T('"'),_.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},_.HEXCOLOR,L,A("variable","@@?"+y,10),A("variable","@\\{"+y+"\\}"),A("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},_.IMPORTANT,{beginKeywords:"and not"},_.FUNCTION_DISPATCH);const K=N.concat({begin:/\{/,end:/\}/,contains:C}),B={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(N)},R={begin:w+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},_.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:N}}]},H={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:M,returnEnd:!0,contains:N,relevance:0}},P={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:K}},q={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:w,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,B,A("keyword","all\\b"),A("variable","@\\{"+y+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},_.CSS_NUMBER_MODE,A("selector-tag",w,0),A("selector-id","#"+w),A("selector-class","\\."+w,0),A("selector-tag","&",0),_.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:K},{begin:"!important"},_.FUNCTION_DISPATCH]},J={begin:y+`:(:)?(${v.join("|")})`,returnBegin:!0,contains:[q]};return C.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,H,P,J,R,q,B,_.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:C}}return Yp=f,Yp}var Xp,Kw;function DP(){if(Kw)return Xp;Kw=1;function e(t){const i="\\[=*\\[",s="\\]=*\\]",a={begin:i,end:s,contains:["self"]},l=[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:l.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:l}].concat(l)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:i,end:s,contains:[a],relevance:5}])}}return Xp=e,Xp}var Zp,Gw;function OP(){if(Gw)return Zp;Gw=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]},l={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={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,l,c,h]}}return Zp=e,Zp}var Qp,Ww;function jP(){if(Ww)return Qp;Ww=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}/,l={$pattern:/[\w.]+/,keyword:s.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},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]},g={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},_=[t.BACKSLASH_ESCAPE,c,f],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(C,N,T="\\1")=>{const A=T==="\\1"?T:i.concat(T,N);return i.concat(i.concat("(?:",C,")"),N,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,T,a)},y=(C,N,T)=>i.concat(i.concat("(?:",C,")"),N,/(?:\\.|[^\\\/])*?/,T,a),w=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),h,{className:"string",contains:_,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}]},g,{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,g]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=w,h.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:w}}return Qp=e,Qp}var Jp,Yw;function LP(){if(Yw)return Jp;Yw=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 Jp=e,Jp}var eg,Xw;function BP(){if(Xw)return eg;Xw=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),l=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,s),c=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:/\}/}]},g=t.inherit(t.APOS_STRING_MODE,{illegal:null}),_=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":(V,O)=>{O.data._beginMatch=V[1]||V[2]},"on:end":(V,O)=>{O.data._beginMatch!==V[1]&&O.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
44
- ]`,w={scope:"string",variants:[_,g,v,x]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},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"],A=["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"],L={keyword:T,literal:(V=>{const O=[];return V.forEach(Y=>{O.push(Y),Y.toLowerCase()===Y?O.push(Y.toUpperCase()):O.push(Y.toLowerCase())}),O})(N),built_in:A},K=V=>V.map(O=>O.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",K(A).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},R=i.concat(a,"\\b(?!\\()"),H={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[l,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[P,h,H,t.C_BLOCK_COMMENT_MODE,w,C,B]},J={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",K(T).join("\\b|"),"|",K(A).join("\\b|"),"\\b)"),a,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(J);const F=[P,H,t.C_BLOCK_COMMENT_MODE,w,C,B],ie={begin:i.concat(/#\[\s*\\?/,i.either(l,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:L,contains:[ie,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,J,H,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},B,{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:L,contains:["self",ie,h,H,t.C_BLOCK_COMMENT_MODE,w,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},w,C]}}return eg=e,eg}var tg,Zw;function zP(){if(Zw)return tg;Zw=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 tg=e,tg}var ig,Qw;function IP(){if(Qw)return ig;Qw=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return ig=e,ig}var ng,Jw;function PP(){if(Jw)return ng;Jw=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:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},_={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,_,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,_,g]},{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,_,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,_,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",y=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,w=`\\b|${a.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${y}))[eE][+-]?(${x})[jJ]?(?=${w})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${x})[jJ](?=${w})`}]},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,C,v,t.HASH_COMMENT_MODE]}]};return g.contains=[v,C,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},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:[C,T,v]}]}}return ng=e,ng}var sg,e2;function UP(){if(e2)return sg;e2=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return sg=e,sg}var rg,t2;function HP(){if(t2)return rg;t2=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]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=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:[l,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[c,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[s,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return rg=e,rg}var ag,i2;function FP(){if(i2)return ag;i2=1;function e(t){const i=t.regex,s=/(r#)?/,a=i.concat(s,t.UNDERSCORE_IDENT_RE),l=i.concat(s,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,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"],g=["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!"],_=["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:_,keyword:m,literal:f,built_in:g},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:g,type:_}},{className:"punctuation",begin:"->"},c]}}return ag=e,ag}var og,n2;function $P(){if(n2)return og;n2=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(),l=["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(),c=["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 g=e(f),_=c,v=l,x="@[a-z-]+",y="and or not only",C={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[f.C_LINE_COMMENT_MODE,f.C_BLOCK_COMMENT_MODE,g.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+v.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+_.join("|")+")"},C,{begin:/\(/,end:/\)/,contains:[g.CSS_NUMBER_MODE]},g.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:[g.BLOCK_COMMENT,C,g.HEXCOLOR,g.CSS_NUMBER_MODE,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,g.IMPORTANT,g.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"},C,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,g.HEXCOLOR,g.CSS_NUMBER_MODE]},g.FUNCTION_DISPATCH]}}return og=m,og}var lg,s2;function VP(){if(s2)return lg;s2=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 lg=e,lg}var cg,r2;function qP(){if(r2)return cg;r2=1;function e(t){const i=t.regex,s=t.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["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"],g=["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"],_=["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=_,w=[...g,...f].filter(K=>!_.includes(K)),C={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 A(K){return i.concat(/\b/,i.either(...K.map(B=>B.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:A(x),relevance:0};function L(K,{exceptions:B,when:R}={}){const H=R;return B=B||[],K.map(P=>P.match(/\|\d+$/)||B.includes(P)?P:H(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(w,{when:K=>K.length<3}),literal:c,type:m,built_in:v},contains:[{scope:"type",match:A(h)},M,T,C,a,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,s,N]}}return cg=e,cg}var ug,a2;function KP(){if(a2)return ug;a2=1;function e(R){return R?typeof R=="string"?R:R.source:null}function t(R){return i("(?=",R,")")}function i(...R){return R.map(P=>e(P)).join("")}function s(R){const H=R[R.length-1];return typeof H=="object"&&H.constructor===Object?(R.splice(R.length-1,1),H):{}}function a(...R){return"("+(s(R).capture?"":"?:")+R.map(q=>e(q)).join("|")+")"}const l=R=>i(/\b/,R,/\w$/.test(R)?/\b/:/\B/),c=["Protocol","Type"].map(l),h=["init","self"].map(l),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"],g=["false","nil","true"],_=["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]/),w=a(y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),C=i(y,w,"*"),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]/),A=i(N,T,"*"),M=i(/[A-Z]/,T,"*"),L=["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\(/,A,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],K=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function B(R){const H={match:/\s+/,relevance:0},P=R.COMMENT("/\\*","\\*/",{contains:["self"]}),q=[R.C_LINE_COMMENT_MODE,P],J={match:[/\./,a(...c,...h)],className:{2:"keyword"}},F={match:i(/\./,a(...f)),relevance:0},ie=f.filter(it=>typeof it=="string").concat(["_|0"]),V=f.filter(it=>typeof it!="string").concat(m).map(l),O={variants:[{className:"keyword",match:a(...V,...h)}]},Y={$pattern:a(/\b\w+/,/#\w+/),keyword:ie.concat(v),literal:g},X=[J,F,O],j={match:i(/\./,a(...x)),relevance:0},W={className:"built_in",match:i(/\b/,a(...x),/(?=\()/)},D=[j,W],te={match:/->/,relevance:0},ue={className:"operator",relevance:0,variants:[{match:C},{match:`\\.(\\.|${w})+`}]},$=[te,ue],se="([0-9]_*)+",fe="([0-9a-fA-F]_*)+",ve={className:"number",relevance:0,variants:[{match:`\\b(${se})(\\.(${se}))?([eE][+-]?(${se}))?\\b`},{match:`\\b0x(${fe})(\\.(${fe}))?([pP][+-]?(${se}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Oe=(it="")=>({className:"subst",variants:[{match:i(/\\/,it,/[0\\tnr"']/)},{match:i(/\\/,it,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ye=(it="")=>({className:"subst",match:i(/\\/,it,/[\t ]*(?:[\r\n]|\r\n)/)}),st=(it="")=>({className:"subst",label:"interpol",begin:i(/\\/,it,/\(/),end:/\)/}),lt=(it="")=>({begin:i(it,/"""/),end:i(/"""/,it),contains:[Oe(it),ye(it),st(it)]}),ct=(it="")=>({begin:i(it,/"/),end:i(/"/,it),contains:[Oe(it),st(it)]}),ze={className:"string",variants:[lt(),lt("#"),lt("##"),lt("###"),ct(),ct("#"),ct("##"),ct("###")]},Ft=[R.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[R.BACKSLASH_ESCAPE]}],ea={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ft},vs=it=>{const qn=i(it,/\//),ln=i(/\//,it);return{begin:qn,end:ln,contains:[...Ft,{scope:"comment",begin:`#(?!.*${ln})`,end:/$/}]}},Ka={scope:"regexp",variants:[vs("###"),vs("##"),vs("#"),ea]},ta={match:i(/`/,A,/`/)},ia={className:"variable",match:/\$\d+/},sr={className:"variable",match:`\\$${T}+`},xs=[ta,ia,sr],ol={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:K,contains:[...$,ve,ze]}]}},Ga={scope:"keyword",match:i(/@/,a(...L),t(a(/\(/,/\s+/)))},Ot={scope:"meta",match:i(/@/,A)},ys=[ol,Ga,Ot],xi={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:M,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(M)),relevance:0}]},Ss={begin:/</,end:/>/,keywords:Y,contains:[...q,...X,...ys,te,xi]};xi.contains.push(Ss);const ws={match:i(A,/\s*:/),keywords:"_|0",relevance:0},Wa={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",ws,...q,Ka,...X,...D,...$,ve,ze,...xs,...ys,xi]},rr={begin:/</,end:/>/,keywords:"repeat each",contains:[...q,xi]},ll={begin:a(t(i(A,/\s*:/)),t(i(A,/\s+/,A,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:A}]},Ya={begin:/\(/,end:/\)/,keywords:Y,contains:[ll,...q,...X,...$,ve,ze,...ys,xi,Wa],endsParent:!0,illegal:/["']/},Es={match:[/(func|macro)/,/\s+/,a(ta.match,A,C)],className:{1:"keyword",3:"title.function"},contains:[rr,Ya,H],illegal:[/\[/,/%/]},fi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[rr,Ya,H],illegal:/\[|%/},Sn={match:[/operator/,/\s+/,C],className:{1:"keyword",3:"title"}},yi={begin:[/precedencegroup/,/\s+/,M],className:{1:"keyword",3:"title"},contains:[xi],keywords:[..._,...g],end:/}/},cl={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},na={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Xa={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,A,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[rr,...X,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:M},...X],relevance:0}]};for(const it of ze.variants){const qn=it.contains.find(Ri=>Ri.label==="interpol");qn.keywords=Y;const ln=[...X,...D,...$,ve,ze,...xs];qn.contains=[...ln,{begin:/\(/,end:/\)/,contains:["self",...ln]}]}return{name:"Swift",keywords:Y,contains:[...q,Es,fi,cl,na,Xa,Sn,yi,{beginKeywords:"import",end:/$/,contains:[...q],relevance:0},Ka,...X,...D,...$,ve,ze,...xs,...ys,xi,Wa]}}return ug=B,ug}var dg,o2;function GP(){if(o2)return dg;o2=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]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={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,l]},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},w={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},C={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},w,C,c,h],T=[...N];return T.pop(),T.push(m),y.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}return dg=e,dg}var hg,l2;function WP(){if(l2)return hg;l2=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"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(l,s,a);function m(g){const _=g.regex,v=(Oe,{after:ye})=>{const st="</"+Oe[0].slice(1);return Oe.input.indexOf(st,ye)!==-1},x=e,y={begin:"<>",end:"</>"},w=/<[A-Za-z0-9\\._:-]+\s*\/>/,C={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Oe,ye)=>{const st=Oe[0].length+Oe.index,lt=Oe.input[st];if(lt==="<"||lt===","){ye.ignoreMatch();return}lt===">"&&(v(Oe,{after:st})||ye.ignoreMatch());let ct;const ze=Oe.input.substring(st);if(ct=ze.match(/^\s*=/)){ye.ignoreMatch();return}if((ct=ze.match(/^\s+extends\s+/))&&ct.index===0){ye.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":c},T="[0-9](_?[0-9])*",A=`\\.(${T})`,M="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",L={className:"number",variants:[{begin:`(\\b(${M})((${A})|\\.)?|(${A}))[eE][+-]?(${T})\\b`},{begin:`\\b(${M})\\b((${A})\\b|\\.)?|(${A})\\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},K={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},B={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,K],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,K],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[g.BACKSLASH_ESCAPE,K]},J={className:"comment",variants:[g.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}]}]}),g.C_BLOCK_COMMENT_MODE,g.C_LINE_COMMENT_MODE]},F=[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,B,R,H,P,{match:/\$\d+/},L];K.contains=F.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(F)});const ie=[].concat(J,K.contains),V=ie.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(ie)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:V},Y={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,_.concat(x,"(",_.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:_.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]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(Oe){return _.concat("(?!",Oe.join("|"),")")}const ue={match:_.concat(/\b/,te([...l,"super","import"].map(Oe=>`${Oe}\\s*\\(`)),x,_.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:_.concat(/\./,_.lookahead(_.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},fe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+g.UNDERSCORE_IDENT_RE+")\\s*=>",ve={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,_.lookahead(fe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:X},illegal:/#(?![$_A-z])/,contains:[g.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,B,R,H,P,J,{match:/\$\d+/},L,X,{scope:"attr",match:x+_.lookahead(":"),relevance:0},ve,{begin:"("+g.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[J,g.REGEXP_MODE,{className:"function",begin:fe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:g.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:w},{begin:C.begin,"on:begin":C.isTrulyOpeningTag,end:C.end}],subLanguage:"xml",contains:[{begin:C.begin,end:C.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+g.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,g.inherit(g.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ue,D,Y,se,{match:/\$[(.]/}]}}function f(g){const _=g.regex,v=m(g),x=e,y=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],w={begin:[/namespace/,/\s+/,g.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},C={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"],A={$pattern:e,keyword:t.concat(T),literal:i,built_in:h.concat(y),"variable.language":c},M={className:"meta",begin:"@"+x},L=(H,P,q)=>{const J=H.contains.findIndex(F=>F.label===P);if(J===-1)throw new Error("can not find mode to replace");H.contains.splice(J,1,q)};Object.assign(v.keywords,A),v.exports.PARAMS_CONTAINS.push(M);const K=v.contains.find(H=>H.scope==="attr"),B=Object.assign({},K,{match:_.concat(x,_.lookahead(/\s*\?:/))});v.exports.PARAMS_CONTAINS.push([v.exports.CLASS_REFERENCE,K,B]),v.contains=v.contains.concat([M,w,C,B]),L(v,"shebang",g.SHEBANG()),L(v,"use_strict",N);const R=v.contains.find(H=>H.label==="func.def");return R.relevance=0,Object.assign(v,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),v}return hg=f,hg}var fg,c2;function YP(){if(c2)return fg;c2=1;function e(t){const i=t.regex,s={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\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(c,l),/ *#/)},{begin:i.concat(/# */,m,/ *#/)},{begin:i.concat(/# */,h,/ *#/)},{begin:i.concat(/# */,i.either(c,l),/ +/,i.either(h,m),/ *#/)}]},g={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])|[%&])?/}]},_={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,g,_,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 fg=e,fg}var mg,u2;function XP(){if(u2)return mg;u2=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"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={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"},g={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"}},c,h,l,t.QUOTE_STRING_MODE,f,g,m]}}return mg=e,mg}var pg,d2;function ZP(){if(d2)return pg;d2=1;var e=mP();return e.registerLanguage("xml",pP()),e.registerLanguage("bash",gP()),e.registerLanguage("c",_P()),e.registerLanguage("cpp",bP()),e.registerLanguage("csharp",vP()),e.registerLanguage("css",xP()),e.registerLanguage("markdown",yP()),e.registerLanguage("diff",SP()),e.registerLanguage("ruby",wP()),e.registerLanguage("go",EP()),e.registerLanguage("graphql",CP()),e.registerLanguage("ini",kP()),e.registerLanguage("java",NP()),e.registerLanguage("javascript",TP()),e.registerLanguage("json",AP()),e.registerLanguage("kotlin",MP()),e.registerLanguage("less",RP()),e.registerLanguage("lua",DP()),e.registerLanguage("makefile",OP()),e.registerLanguage("perl",jP()),e.registerLanguage("objectivec",LP()),e.registerLanguage("php",BP()),e.registerLanguage("php-template",zP()),e.registerLanguage("plaintext",IP()),e.registerLanguage("python",PP()),e.registerLanguage("python-repl",UP()),e.registerLanguage("r",HP()),e.registerLanguage("rust",FP()),e.registerLanguage("scss",$P()),e.registerLanguage("shell",VP()),e.registerLanguage("sql",qP()),e.registerLanguage("swift",KP()),e.registerLanguage("yaml",GP()),e.registerLanguage("typescript",WP()),e.registerLanguage("vbnet",YP()),e.registerLanguage("wasm",XP()),e.HighlightJS=e,e.default=e,pg=e,pg}var QP=ZP();const M0=ET(QP);function z_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qa=z_();function b3(e){qa=e}var Ma={exec:()=>null};function zo(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 nt(e,t=""){let i=typeof e=="string"?e:e.source,s={replace:(a,l)=>{let c=typeof l=="string"?l:l.source;return c=c.replace(zi.caret,"$1"),i=i.replace(a,c),s},getRegex:()=>new RegExp(i,t)};return s}var JP=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),zi={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:zo(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:zo(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:zo(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:zo(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:zo(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:zo(e=>new RegExp(`^ {0,${e}}>`))},eU=/^(?:[ \t]*(?:\n|$))+/,tU=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,iU=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,su=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nU=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,I_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,v3=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,x3=nt(v3).replace(/bull/g,I_).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(),sU=nt(v3).replace(/bull/g,I_).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(),P_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rU=/^[^\n]+/,U_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,aU=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",U_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oU=nt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,I_).getRegex(),zh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",H_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lU=nt("^ {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",H_).replace("tag",zh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y3=nt(P_).replace("hr",su).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zh).getRegex(),cU=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",y3).getRegex(),F_={blockquote:cU,code:tU,def:aU,fences:iU,heading:nU,hr:su,html:lU,lheading:x3,list:oU,newline:eU,paragraph:y3,table:Ma,text:rU},h2=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",su).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zh).getRegex(),uU={...F_,lheading:sU,table:h2,paragraph:nt(P_).replace("hr",su).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",h2).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zh).getRegex()},dU={...F_,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",H_).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:Ma,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(P_).replace("hr",su).replace("heading",` *#{1,6} *[^
45
- ]`).replace("lheading",x3).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hU=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fU=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,S3=/^( {2,}|\\)\n(?!\s*$)/,mU=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,al=/[\p{P}\p{S}]/u,Ih=/[\s\p{P}\p{S}]/u,$_=/[^\s\p{P}\p{S}]/u,pU=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ih).getRegex(),w3=/(?!~)[\p{P}\p{S}]/u,gU=/(?!~)[\s\p{P}\p{S}]/u,_U=/(?:[^\s\p{P}\p{S}]|~)/u,bU=nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JP?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),E3=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,vU=nt(E3,"u").replace(/punct/g,al).getRegex(),xU=nt(E3,"u").replace(/punct/g,w3).getRegex(),C3="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yU=nt(C3,"gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,al).getRegex(),SU=nt(C3,"gu").replace(/notPunctSpace/g,_U).replace(/punctSpace/g,gU).replace(/punct/g,w3).getRegex(),wU=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,al).getRegex(),EU=nt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,al).getRegex(),CU="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",kU=nt(CU,"gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,al).getRegex(),NU=nt(/\\(punct)/,"gu").replace(/punct/g,al).getRegex(),TU=nt(/^<(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(),AU=nt(H_).replace("(?:-->|$)","-->").getRegex(),MU=nt("^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",AU).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_h=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,RU=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",_h).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),k3=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",_h).replace("ref",U_).getRegex(),N3=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",U_).getRegex(),DU=nt("reflink|nolink(?!\\()","g").replace("reflink",k3).replace("nolink",N3).getRegex(),f2=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,V_={_backpedal:Ma,anyPunctuation:NU,autolink:TU,blockSkip:bU,br:S3,code:fU,del:Ma,delLDelim:Ma,delRDelim:Ma,emStrongLDelim:vU,emStrongRDelimAst:yU,emStrongRDelimUnd:wU,escape:hU,link:RU,nolink:N3,punctuation:pU,reflink:k3,reflinkSearch:DU,tag:MU,text:mU,url:Ma},OU={...V_,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",_h).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_h).getRegex()},R0={...V_,emStrongRDelimAst:SU,emStrongLDelim:xU,delLDelim:EU,delRDelim:kU,url:nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",f2).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:nt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",f2).getRegex()},jU={...R0,br:nt(S3).replace("{2,}","*").getRegex(),text:nt(R0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ld={normal:F_,gfm:uU,pedantic:dU},fc={normal:V_,gfm:R0,breaks:jU,pedantic:OU},LU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},m2=e=>LU[e];function us(e,t){if(t){if(zi.escapeTest.test(e))return e.replace(zi.escapeReplace,m2)}else if(zi.escapeTestNoEncode.test(e))return e.replace(zi.escapeReplaceNoEncode,m2);return e}function p2(e){try{e=encodeURI(e).replace(zi.percentDecode,"%")}catch{return null}return e}function g2(e,t){let i=e.replace(zi.findPipe,(l,c,h)=>{let m=!1,f=c;for(;--f>=0&&h[f]==="\\";)m=!m;return m?"|":" |"}),s=i.split(zi.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(zi.slashPipe,"|");return s}function Ir(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 _2(e){let t=e.split(`
46
- `),i=t.length-1;for(;i>=0&&zi.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
47
- `)}function BU(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 zU(e,t=0){let i=t,s="";for(let a of e)if(a===" "){let l=4-i%4;s+=" ".repeat(l),i+=l}else s+=a,i++;return s}function b2(e,t,i,s,a){let l=t.href,c=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:l,title:c,text:h,tokens:s.inlineTokens(h)};return s.state.inLink=!1,m}function IU(e,t,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
48
- `).map(l=>{let c=l.match(i.other.beginningSpace);if(c===null)return l;let[h]=c;return h.length>=a.length?l.slice(a.length):l}).join(`
49
- `)}var bh=class{options;rules;lexer;constructor(e){this.options=e||qa}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]:_2(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=IU(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=Ir(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:Ir(t[0],`
50
- `),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:Ir(t[0],`
51
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=Ir(t[0],`
52
- `).split(`
53
- `),s="",a="",l=[];for(;i.length>0;){let c=!1,h=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))h.push(i[m]),c=!0;else if(!c)h.push(i[m]);else break;i=i.slice(m);let f=h.join(`
54
- `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
55
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
56
- ${f}`:f,a=a?`${a}
57
- ${g}`:g;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,l,!0),this.lexer.state.top=_,i.length===0)break;let v=l.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,y=x.raw+`
58
- `+i.join(`
59
- `),w=this.blockquote(y);l[l.length-1]=w,s=s.substring(0,s.length-x.raw.length)+w.raw,a=a.substring(0,a.length-x.text.length)+w.text;break}else if(v?.type==="list"){let x=v,y=x.raw+`
60
- `+i.join(`
61
- `),w=this.list(y);l[l.length-1]=w,s=s.substring(0,s.length-v.raw.length)+w.raw,a=a.substring(0,a.length-x.raw.length)+w.raw,i=y.substring(l.at(-1).raw.length).split(`
62
- `);continue}}return{type:"blockquote",raw:s,tokens:l,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 l=this.rules.other.listItemRegex(i),c=!1;for(;e;){let m=!1,f="",g="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let _=zU(t[2].split(`
63
- `,1)[0],t[1].length),v=e.split(`
64
- `,1)[0],x=!_.trim(),y=0;if(this.options.pedantic?(y=2,g=_.trimStart()):x?y=t[1].length+1:(y=_.search(this.rules.other.nonSpaceChar),y=y>4?1:y,g=_.slice(y),y+=t[1].length),x&&this.rules.other.blankLine.test(v)&&(f+=v+`
65
- `,e=e.substring(v.length+1),m=!0),!m){let w=this.rules.other.nextBulletRegex(y),C=this.rules.other.hrRegex(y),N=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),A=this.rules.other.htmlBeginRegex(y),M=this.rules.other.blockquoteBeginRegex(y);for(;e;){let L=e.split(`
66
- `,1)[0],K;if(v=L,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),K=v):K=v.replace(this.rules.other.tabCharGlobal," "),N.test(v)||T.test(v)||A.test(v)||M.test(v)||w.test(v)||C.test(v))break;if(K.search(this.rules.other.nonSpaceChar)>=y||!v.trim())g+=`
67
- `+K.slice(y);else{if(x||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(_)||T.test(_)||C.test(_))break;g+=`
68
- `+v}x=!v.trim(),f+=L+`
69
- `,e=e.substring(L.length+1),_=K.slice(y)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,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 _=this.lexer.inlineQueue.length-1;_>=0;_--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[_].src)){this.lexer.inlineQueue[_].src=this.lexer.inlineQueue[_].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(m.raw);if(g){let _={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};m.checked=_.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=_.raw+m.tokens[0].raw,m.tokens[0].text=_.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(_)):m.tokens.unshift({type:"paragraph",raw:_.raw,text:_.raw,tokens:[_]}):m.tokens.unshift(_)}}else m.task&&(m.task=!1);if(!a.loose){let g=m.tokens.filter(v=>v.type==="space"),_=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=_}}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=_2(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:Ir(t[0],`
70
- `),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=g2(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
71
- `):[],l={type:"table",raw:Ir(t[0],`
72
- `),header:[],align:[],rows:[]};if(i.length===s.length){for(let c of s)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<i.length;c++)l.header.push({text:i[c],tokens:this.lexer.inline(i[c]),header:!0,align:l.align[c]});for(let c of a)l.rows.push(g2(c,l.header.length).map((h,m)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:l.align[m]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i=t[1].trim();return{type:"heading",raw:Ir(t[0],`
73
- `),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)===`
74
- `?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 l=Ir(i.slice(0,-1),"\\");if((i.length-l.length)%2===0)return}else{let l=BU(t[2],"()");if(l===-2)return;if(l>-1){let c=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],a=l[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)),b2(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 l=i[0].charAt(0);return{type:"text",raw:l,text:l}}return b2(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,l,c,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(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(c=[...l].length,s[3]||s[4]){h+=c;continue}else if((s[5]||s[6])&&a%3&&!((a+c)%3)){m+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+m);let g=[...s[0]][0].length,_=e.slice(0,a+s.index+g+c);if(Math.min(a,c)%2){let x=_.slice(1,-1);return{type:"em",raw:_,text:x,tokens:this.lexer.inlineTokens(x)}}let v=_.slice(2,-2);return{type:"strong",raw:_,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,l,c,h=a,m=this.rules.inline.delRDelim;for(m.lastIndex=0,t=t.slice(-1*e.length+a);(s=m.exec(t))!==null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l||(c=[...l].length,c!==a))continue;if(s[3]||s[4]){h+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h);let f=[...s[0]][0].length,g=e.slice(0,a+s.index+f+c),_=g.slice(a,-a);return{type:"del",raw:g,text:_,tokens:this.lexer.inlineTokens(_)}}}}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}}}},Zn=class D0{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||qa,this.options.tokenizer=this.options.tokenizer||new bh,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:zi,block:Ld.normal,inline:fc.normal};this.options.pedantic?(i.block=Ld.pedantic,i.inline=fc.pedantic):this.options.gfm&&(i.block=Ld.gfm,this.options.breaks?i.inline=fc.breaks:i.inline=fc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Ld,inline:fc}}static lex(t,i){return new D0(i).lex(t)}static lexInline(t,i){return new D0(i).inlineTokens(t)}lex(t){t=t.replace(zi.carriageReturn,`
75
- `),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(zi.tabCharGlobal," ").replace(zi.spaceLine,""));let a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let l;if(this.options.extensions?.block?.some(h=>(l=h.call({lexer:this},t,i))?(t=t.substring(l.raw.length),i.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let h=i.at(-1);l.raw.length===1&&h!==void 0?h.raw+=`
76
- `:i.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
77
- `)?"":`
78
- `)+l.raw,h.text+=`
79
- `+l.text,this.inlineQueue.at(-1).src=h.text):i.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
80
- `)?"":`
81
- `)+l.raw,h.text+=`
82
- `+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},i.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),i.push(l);continue}let c=t;if(this.options.extensions?.startBlock){let h=1/0,m=t.slice(1),f;this.options.extensions.startBlock.forEach(g=>{f=g.call({lexer:this},m),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let h=i.at(-1);s&&h?.type==="paragraph"?(h.raw+=(h.raw.endsWith(`
83
- `)?"":`
84
- `)+l.raw,h.text+=`
85
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(l),s=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let h=i.at(-1);h?.type==="text"?(h.raw+=(h.raw.endsWith(`
86
- `)?"":`
87
- `)+l.raw,h.text+=`
88
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(l);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 l;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)l=a[2]?a[2].length:0,s=s.slice(0,a.index+l)+"["+"a".repeat(a[0].length-l-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let c=!1,h="",m=1/0;for(;t;){if(t.length<m)m=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}c||(h=""),c=!1;let f;if(this.options.extensions?.inline?.some(_=>(f=_.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 _=i.at(-1);f.type==="text"&&_?.type==="text"?(_.raw+=f.raw,_.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 g=t;if(this.options.extensions?.startInline){let _=1/0,v=t.slice(1),x;this.options.extensions.startInline.forEach(y=>{x=y.call({lexer:this},v),typeof x=="number"&&x>=0&&(_=Math.min(_,x))}),_<1/0&&_>=0&&(g=t.substring(0,_+1))}if(f=this.tokenizer.inlineText(g)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(h=f.raw.slice(-1)),c=!0;let _=i.at(-1);_?.type==="text"?(_.raw+=f.raw,_.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)}},vh=class{options;parser;constructor(e){this.options=e||qa}space(e){return""}code({text:e,lang:t,escaped:i}){let s=(t||"").match(zi.notSpaceStart)?.[0],a=e.replace(zi.endingNewline,"")+`
89
- `;return s?'<pre><code class="language-'+us(s)+'">'+(i?a:us(a,!0))+`</code></pre>
90
- `:"<pre><code>"+(i?a:us(a,!0))+`</code></pre>
91
- `}blockquote({tokens:e}){return`<blockquote>
92
- ${this.parser.parse(e)}</blockquote>
93
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
94
- `}hr(e){return`<hr>
95
- `}list(e){let t=e.ordered,i=e.start,s="";for(let c=0;c<e.items.length;c++){let h=e.items[c];s+=this.listitem(h)}let a=t?"ol":"ul",l=t&&i!==1?' start="'+i+'"':"";return"<"+a+l+`>
96
- `+s+"</"+a+`>
97
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
98
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
99
- `}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 l=e.rows[a];i="";for(let c=0;c<l.length;c++)i+=this.tablecell(l[c]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
100
- <thead>
101
- `+t+`</thead>
102
- `+s+`</table>
103
- `}tablerow({text:e}){return`<tr>
104
- ${e}</tr>
105
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
106
- `}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>${us(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=p2(e);if(a===null)return s;e=a;let l='<a href="'+e+'"';return t&&(l+=' title="'+us(t)+'"'),l+=">"+s+"</a>",l}image({href:e,title:t,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let a=p2(e);if(a===null)return us(i);e=a;let l=`<img src="${e}" alt="${us(i)}"`;return t&&(l+=` title="${us(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:us(e.text)}},q_=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Qn=class O0{options;renderer;textRenderer;constructor(t){this.options=t||qa,this.options.renderer=this.options.renderer||new vh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new q_}static parse(t,i){return new O0(i).parse(t)}static parseInline(t,i){return new O0(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 c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){i+=h||"";continue}}let l=a;switch(l.type){case"space":{i+=this.renderer.space(l);break}case"hr":{i+=this.renderer.hr(l);break}case"heading":{i+=this.renderer.heading(l);break}case"code":{i+=this.renderer.code(l);break}case"table":{i+=this.renderer.table(l);break}case"blockquote":{i+=this.renderer.blockquote(l);break}case"list":{i+=this.renderer.list(l);break}case"checkbox":{i+=this.renderer.checkbox(l);break}case"html":{i+=this.renderer.html(l);break}case"def":{i+=this.renderer.def(l);break}case"paragraph":{i+=this.renderer.paragraph(l);break}case"text":{i+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}parseInline(t,i=this.renderer){this.renderer.parser=this;let s="";for(let a=0;a<t.length;a++){let l=t[a];if(this.options.extensions?.renderers?.[l.type]){let h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=h||"";continue}}let c=l;switch(c.type){case"escape":{s+=i.text(c);break}case"html":{s+=i.html(c);break}case"link":{s+=i.link(c);break}case"image":{s+=i.image(c);break}case"checkbox":{s+=i.checkbox(c);break}case"strong":{s+=i.strong(c);break}case"em":{s+=i.em(c);break}case"codespan":{s+=i.codespan(c);break}case"br":{s+=i.br(c);break}case"del":{s+=i.del(c);break}case"text":{s+=i.text(c);break}default:{let h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return s}},wc=class{options;block;constructor(e){this.options=e||qa}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?Zn.lex:Zn.lexInline}provideParser(e=this.block){return e?Qn.parse:Qn.parseInline}},PU=class{defaults=z_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Qn;Renderer=vh;TextRenderer=q_;Lexer=Zn;Tokenizer=bh;Hooks=wc;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(let s of e)switch(i=i.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)i=i.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)i=i.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=s;i=i.concat(this.walkTokens(a.items,t));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);i=i.concat(this.walkTokens(c,t))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,t)))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=t.renderers[a.name];l?t.renderers[a.name]=function(...c){let h=a.renderer.apply(this,c);return h===!1&&(h=l.apply(this,c)),h}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=t[a.level];l?l.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),s.extensions=t),i.renderer){let a=this.defaults.renderer||new vh(this.defaults);for(let l in i.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,h=i.renderer[c],m=a[c];a[c]=(...f)=>{let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g||""}}s.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new bh(this.defaults);for(let l in i.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,h=i.tokenizer[c],m=a[c];a[c]=(...f)=>{let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g}}s.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new wc;for(let l in i.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,h=i.hooks[c],m=a[c];wc.passThroughHooks.has(l)?a[c]=f=>{if(this.defaults.async&&wc.passThroughHooksRespectAsync.has(l))return(async()=>{let _=await h.call(a,f);return m.call(a,_)})();let g=h.call(a,f);return m.call(a,g)}:a[c]=(...f)=>{if(this.defaults.async)return(async()=>{let _=await h.apply(a,f);return _===!1&&(_=await m.apply(a,f)),_})();let g=h.apply(a,f);return g===!1&&(g=m.apply(a,f)),g}}s.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,l=i.walkTokens;s.walkTokens=function(c){let h=[];return h.push(l.call(this,c)),a&&(h=h.concat(a.call(this,c))),h}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Zn.lex(e,t??this.defaults)}parser(e,t){return Qn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,i)=>{let s={...i},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(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 t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let c=a.hooks?await a.hooks.preprocess(t):t,h=await(a.hooks?await a.hooks.provideLexer(e):e?Zn.lex:Zn.lexInline)(c,a),m=a.hooks?await a.hooks.processAllTokens(h):h;a.walkTokens&&await Promise.all(this.walkTokens(m,a.walkTokens));let f=await(a.hooks?await a.hooks.provideParser(e):e?Qn.parse:Qn.parseInline)(m,a);return a.hooks?await a.hooks.postprocess(f):f})().catch(l);try{a.hooks&&(t=a.hooks.preprocess(t));let c=(a.hooks?a.hooks.provideLexer(e):e?Zn.lex:Zn.lexInline)(t,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let h=(a.hooks?a.hooks.provideParser(e):e?Qn.parse:Qn.parseInline)(c,a);return a.hooks&&(h=a.hooks.postprocess(h)),h}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=`
107
- Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+us(i.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(i);throw i}}},Ha=new PU;function gt(e,t){return Ha.parse(e,t)}gt.options=gt.setOptions=function(e){return Ha.setOptions(e),gt.defaults=Ha.defaults,b3(gt.defaults),gt};gt.getDefaults=z_;gt.defaults=qa;gt.use=function(...e){return Ha.use(...e),gt.defaults=Ha.defaults,b3(gt.defaults),gt};gt.walkTokens=function(e,t){return Ha.walkTokens(e,t)};gt.parseInline=Ha.parseInline;gt.Parser=Qn;gt.parser=Qn.parse;gt.Renderer=vh;gt.TextRenderer=q_;gt.Lexer=Zn;gt.lexer=Zn.lex;gt.Tokenizer=bh;gt.Hooks=wc;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Qn.parse;Zn.lex;function UU(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 HU({content:e}){const t=E.useMemo(()=>{const s=gt.parse(e,{async:!1,gfm:!0,breaks:!1});return UU(s)},[e]),i=E.useRef(null);return E.useEffect(()=>{const s=i.current;s&&s.querySelectorAll("pre code").forEach(a=>{M0.highlightElement(a)})},[t]),u.jsx("div",{ref:i,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function T3(e){return typeof e>"u"||e===null}function FU(e){return typeof e=="object"&&e!==null}function $U(e){return Array.isArray(e)?e:T3(e)?[]:[e]}function VU(e,t){var i,s,a,l;if(t)for(l=Object.keys(t),i=0,s=l.length;i<s;i+=1)a=l[i],e[a]=t[a];return e}function qU(e,t){var i="",s;for(s=0;s<t;s+=1)i+=e;return i}function KU(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var GU=T3,WU=FU,YU=$U,XU=qU,ZU=KU,QU=VU,di={isNothing:GU,isObject:WU,toArray:YU,repeat:XU,isNegativeZero:ZU,extend:QU};function A3(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+=`
108
-
109
- `+e.mark.snippet),s+" "+i):s}function Fc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=A3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Fc.prototype=Object.create(Error.prototype);Fc.prototype.constructor=Fc;Fc.prototype.toString=function(t){return this.name+": "+A3(this,t)};var $i=Fc;function gg(e,t,i,s,a){var l="",c="",h=Math.floor(a/2)-1;return s-t>h&&(l=" ... ",t=s-h+l.length),i-s>h&&(c=" ...",i=s+h-c.length),{str:l+e.slice(t,i).replace(/\t/g,"→")+c,pos:s-t+l.length}}function _g(e,t){return di.repeat(" ",t-e.length)+e}function JU(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=[],l,c=-1;l=i.exec(e.buffer);)a.push(l.index),s.push(l.index+l[0].length),e.position<=l.index&&c<0&&(c=s.length-2);c<0&&(c=s.length-1);var h="",m,f,g=Math.min(e.line+t.linesAfter,a.length).toString().length,_=t.maxLength-(t.indent+g+3);for(m=1;m<=t.linesBefore&&!(c-m<0);m++)f=gg(e.buffer,s[c-m],a[c-m],e.position-(s[c]-s[c-m]),_),h=di.repeat(" ",t.indent)+_g((e.line-m+1).toString(),g)+" | "+f.str+`
110
- `+h;for(f=gg(e.buffer,s[c],a[c],e.position,_),h+=di.repeat(" ",t.indent)+_g((e.line+1).toString(),g)+" | "+f.str+`
111
- `,h+=di.repeat("-",t.indent+g+3+f.pos)+`^
112
- `,m=1;m<=t.linesAfter&&!(c+m>=a.length);m++)f=gg(e.buffer,s[c+m],a[c+m],e.position-(s[c]-s[c+m]),_),h+=di.repeat(" ",t.indent)+_g((e.line+m+1).toString(),g)+" | "+f.str+`
113
- `;return h.replace(/\n$/,"")}var eH=JU,tH=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],iH=["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 sH(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(tH.indexOf(i)===-1)throw new $i('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),iH.indexOf(this.kind)===-1)throw new $i('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Mi=sH;function v2(e,t){var i=[];return e[t].forEach(function(s){var a=i.length;i.forEach(function(l,c){l.tag===s.tag&&l.kind===s.kind&&l.multi===s.multi&&(a=c)}),i[a]=s}),i}function rH(){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 j0(e){return this.extend(e)}j0.prototype.extend=function(t){var i=[],s=[];if(t instanceof Mi)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 $i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(l){if(!(l instanceof Mi))throw new $i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new $i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new $i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),s.forEach(function(l){if(!(l instanceof Mi))throw new $i("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(j0.prototype);return a.implicit=(this.implicit||[]).concat(i),a.explicit=(this.explicit||[]).concat(s),a.compiledImplicit=v2(a,"implicit"),a.compiledExplicit=v2(a,"explicit"),a.compiledTypeMap=rH(a.compiledImplicit,a.compiledExplicit),a};var M3=j0,R3=new Mi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),D3=new Mi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),O3=new Mi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),j3=new M3({explicit:[R3,D3,O3]});function aH(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function oH(){return null}function lH(e){return e===null}var L3=new Mi("tag:yaml.org,2002:null",{kind:"scalar",resolve:aH,construct:oH,predicate:lH,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function cH(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 uH(e){return e==="true"||e==="True"||e==="TRUE"}function dH(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var B3=new Mi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:cH,construct:uH,predicate:dH,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 hH(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function fH(e){return 48<=e&&e<=55}function mH(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(!hH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!fH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!mH(e.charCodeAt(i)))return!1;s=!0}return!(!s||a==="_")}function gH(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 _H(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!di.isNegativeZero(e)}var z3=new Mi("tag:yaml.org,2002:int",{kind:"scalar",resolve:pH,construct:gH,predicate:_H,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"]}}),bH=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function vH(e){return!(e===null||!bH.test(e)||e[e.length-1]==="_")}function xH(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 yH=/^[-+]?[0-9]+e/;function SH(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(di.isNegativeZero(e))return"-0.0";return i=e.toString(10),yH.test(i)?i.replace("e",".e"):i}function wH(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||di.isNegativeZero(e))}var I3=new Mi("tag:yaml.org,2002:float",{kind:"scalar",resolve:vH,construct:xH,predicate:wH,represent:SH,defaultStyle:"lowercase"}),P3=j3.extend({implicit:[L3,B3,z3,I3]}),U3=P3,H3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),F3=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 EH(e){return e===null?!1:H3.exec(e)!==null||F3.exec(e)!==null}function CH(e){var t,i,s,a,l,c,h,m=0,f=null,g,_,v;if(t=H3.exec(e),t===null&&(t=F3.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(l=+t[4],c=+t[5],h=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(g=+t[10],_=+(t[11]||0),f=(g*60+_)*6e4,t[9]==="-"&&(f=-f)),v=new Date(Date.UTC(i,s,a,l,c,h,m)),f&&v.setTime(v.getTime()-f),v}function kH(e){return e.toISOString()}var $3=new Mi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:EH,construct:CH,instanceOf:Date,represent:kH});function NH(e){return e==="<<"||e===null}var V3=new Mi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:NH}),K_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
114
- \r`;function TH(e){if(e===null)return!1;var t,i,s=0,a=e.length,l=K_;for(i=0;i<a;i++)if(t=l.indexOf(e.charAt(i)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function AH(e){var t,i,s=e.replace(/[\r\n=]/g,""),a=s.length,l=K_,c=0,h=[];for(t=0;t<a;t++)t%4===0&&t&&(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)),c=c<<6|l.indexOf(s.charAt(t));return i=a%4*6,i===0?(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)):i===18?(h.push(c>>10&255),h.push(c>>2&255)):i===12&&h.push(c>>4&255),new Uint8Array(h)}function MH(e){var t="",i=0,s,a,l=e.length,c=K_;for(s=0;s<l;s++)s%3===0&&s&&(t+=c[i>>18&63],t+=c[i>>12&63],t+=c[i>>6&63],t+=c[i&63]),i=(i<<8)+e[s];return a=l%3,a===0?(t+=c[i>>18&63],t+=c[i>>12&63],t+=c[i>>6&63],t+=c[i&63]):a===2?(t+=c[i>>10&63],t+=c[i>>4&63],t+=c[i<<2&63],t+=c[64]):a===1&&(t+=c[i>>2&63],t+=c[i<<4&63],t+=c[64],t+=c[64]),t}function RH(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var q3=new Mi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:TH,construct:AH,predicate:RH,represent:MH}),DH=Object.prototype.hasOwnProperty,OH=Object.prototype.toString;function jH(e){if(e===null)return!0;var t=[],i,s,a,l,c,h=e;for(i=0,s=h.length;i<s;i+=1){if(a=h[i],c=!1,OH.call(a)!=="[object Object]")return!1;for(l in a)if(DH.call(a,l))if(!c)c=!0;else return!1;if(!c)return!1;if(t.indexOf(l)===-1)t.push(l);else return!1}return!0}function LH(e){return e!==null?e:[]}var K3=new Mi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:jH,construct:LH}),BH=Object.prototype.toString;function zH(e){if(e===null)return!0;var t,i,s,a,l,c=e;for(l=new Array(c.length),t=0,i=c.length;t<i;t+=1){if(s=c[t],BH.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;l[t]=[a[0],s[a[0]]]}return!0}function IH(e){if(e===null)return[];var t,i,s,a,l,c=e;for(l=new Array(c.length),t=0,i=c.length;t<i;t+=1)s=c[t],a=Object.keys(s),l[t]=[a[0],s[a[0]]];return l}var G3=new Mi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:zH,construct:IH}),PH=Object.prototype.hasOwnProperty;function UH(e){if(e===null)return!0;var t,i=e;for(t in i)if(PH.call(i,t)&&i[t]!==null)return!1;return!0}function HH(e){return e!==null?e:{}}var W3=new Mi("tag:yaml.org,2002:set",{kind:"mapping",resolve:UH,construct:HH}),G_=U3.extend({implicit:[$3,V3],explicit:[q3,K3,G3,W3]}),Yr=Object.prototype.hasOwnProperty,xh=1,Y3=2,X3=3,yh=4,bg=1,FH=2,x2=3,$H=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,VH=/[\x85\u2028\u2029]/,qH=/[,\[\]\{\}]/,Z3=/^(?:!|!!|![a-z\-]+!)$/i,Q3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function y2(e){return Object.prototype.toString.call(e)}function gs(e){return e===10||e===13}function Ia(e){return e===9||e===32}function on(e){return e===9||e===32||e===10||e===13}function Go(e){return e===44||e===91||e===93||e===123||e===125}function KH(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function GH(e){return e===120?2:e===117?4:e===85?8:0}function WH(e){return 48<=e&&e<=57?e-48:-1}function S2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
115
- `: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 YH(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function J3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var eN=new Array(256),tN=new Array(256);for(var Io=0;Io<256;Io++)eN[Io]=S2(Io)?1:0,tN[Io]=S2(Io);function XH(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||G_,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 iN(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 $i(t,i)}function Re(e,t){throw iN(e,t)}function Sh(e,t){e.onWarning&&e.onWarning.call(null,iN(e,t))}var w2={YAML:function(t,i,s){var a,l,c;t.version!==null&&Re(t,"duplication of %YAML directive"),s.length!==1&&Re(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&Re(t,"ill-formed argument of the YAML directive"),l=parseInt(a[1],10),c=parseInt(a[2],10),l!==1&&Re(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&Sh(t,"unsupported YAML version of the document")},TAG:function(t,i,s){var a,l;s.length!==2&&Re(t,"TAG directive accepts exactly two arguments"),a=s[0],l=s[1],Z3.test(a)||Re(t,"ill-formed tag handle (first argument) of the TAG directive"),Yr.call(t.tagMap,a)&&Re(t,'there is a previously declared suffix for "'+a+'" tag handle'),Q3.test(l)||Re(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Re(t,"tag prefix is malformed: "+l)}t.tagMap[a]=l}};function qr(e,t,i,s){var a,l,c,h;if(t<i){if(h=e.input.slice(t,i),s)for(a=0,l=h.length;a<l;a+=1)c=h.charCodeAt(a),c===9||32<=c&&c<=1114111||Re(e,"expected valid JSON character");else $H.test(h)&&Re(e,"the stream contains non-printable characters");e.result+=h}}function E2(e,t,i,s){var a,l,c,h;for(di.isObject(i)||Re(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(i),c=0,h=a.length;c<h;c+=1)l=a[c],Yr.call(t,l)||(J3(t,l,i[l]),s[l]=!0)}function Wo(e,t,i,s,a,l,c,h,m){var f,g;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),f=0,g=a.length;f<g;f+=1)Array.isArray(a[f])&&Re(e,"nested arrays are not supported inside keys"),typeof a=="object"&&y2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&y2(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(f=0,g=l.length;f<g;f+=1)E2(e,t,l[f],i);else E2(e,t,l,i);else!e.json&&!Yr.call(i,a)&&Yr.call(t,a)&&(e.line=c||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,Re(e,"duplicated mapping key")),J3(t,a,l),delete i[a];return t}function W_(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++):Re(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ri(e,t,i){for(var s=0,a=e.input.charCodeAt(e.position);a!==0;){for(;Ia(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(gs(a))for(W_(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&&Sh(e,"deficient indentation"),s}function Ph(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||on(i)))}function Y_(e,t){t===1?e.result+=" ":t>1&&(e.result+=di.repeat(`
116
- `,t-1))}function ZH(e,t,i){var s,a,l,c,h,m,f,g,_=e.kind,v=e.result,x;if(x=e.input.charCodeAt(e.position),on(x)||Go(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),on(a)||i&&Go(a)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,h=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),on(a)||i&&Go(a))break}else if(x===35){if(s=e.input.charCodeAt(e.position-1),on(s))break}else{if(e.position===e.lineStart&&Ph(e)||i&&Go(x))break;if(gs(x))if(m=e.line,f=e.lineStart,g=e.lineIndent,ri(e,!1,-1),e.lineIndent>=t){h=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=m,e.lineStart=f,e.lineIndent=g;break}}h&&(qr(e,l,c,!1),Y_(e,e.line-m),l=c=e.position,h=!1),Ia(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return qr(e,l,c,!1),e.result?!0:(e.kind=_,e.result=v,!1)}function QH(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 gs(i)?(qr(e,s,a,!0),Y_(e,ri(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Ph(e)?Re(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Re(e,"unexpected end of the stream within a single quoted scalar")}function JH(e,t){var i,s,a,l,c,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),gs(h))ri(e,!1,t);else if(h<256&&eN[h])e.result+=tN[h],e.position++;else if((c=GH(h))>0){for(a=c,l=0;a>0;a--)h=e.input.charCodeAt(++e.position),(c=KH(h))>=0?l=(l<<4)+c:Re(e,"expected hexadecimal character");e.result+=YH(l),e.position++}else Re(e,"unknown escape sequence");i=s=e.position}else gs(h)?(qr(e,i,s,!0),Y_(e,ri(e,!1,t)),i=s=e.position):e.position===e.lineStart&&Ph(e)?Re(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}Re(e,"unexpected end of the stream within a double quoted scalar")}function eF(e,t){var i=!0,s,a,l,c=e.tag,h,m=e.anchor,f,g,_,v,x,y=Object.create(null),w,C,N,T;if(T=e.input.charCodeAt(e.position),T===91)g=93,x=!1,h=[];else if(T===123)g=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(ri(e,!0,t),T=e.input.charCodeAt(e.position),T===g)return e.position++,e.tag=c,e.anchor=m,e.kind=x?"mapping":"sequence",e.result=h,!0;i?T===44&&Re(e,"expected the node content, but found ','"):Re(e,"missed comma between flow collection entries"),C=w=N=null,_=v=!1,T===63&&(f=e.input.charCodeAt(e.position+1),on(f)&&(_=v=!0,e.position++,ri(e,!0,t))),s=e.line,a=e.lineStart,l=e.position,Qo(e,t,xh,!1,!0),C=e.tag,w=e.result,ri(e,!0,t),T=e.input.charCodeAt(e.position),(v||e.line===s)&&T===58&&(_=!0,T=e.input.charCodeAt(++e.position),ri(e,!0,t),Qo(e,t,xh,!1,!0),N=e.result),x?Wo(e,h,y,C,w,N,s,a,l):_?h.push(Wo(e,null,y,C,w,N,s,a,l)):h.push(w),ri(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(i=!0,T=e.input.charCodeAt(++e.position)):i=!1}Re(e,"unexpected end of the stream within a flow collection")}function tF(e,t){var i,s,a=bg,l=!1,c=!1,h=t,m=0,f=!1,g,_;if(_=e.input.charCodeAt(e.position),_===124)s=!1;else if(_===62)s=!0;else return!1;for(e.kind="scalar",e.result="";_!==0;)if(_=e.input.charCodeAt(++e.position),_===43||_===45)bg===a?a=_===43?x2:FH:Re(e,"repeat of a chomping mode identifier");else if((g=WH(_))>=0)g===0?Re(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Re(e,"repeat of an indentation width identifier"):(h=t+g-1,c=!0);else break;if(Ia(_)){do _=e.input.charCodeAt(++e.position);while(Ia(_));if(_===35)do _=e.input.charCodeAt(++e.position);while(!gs(_)&&_!==0)}for(;_!==0;){for(W_(e),e.lineIndent=0,_=e.input.charCodeAt(e.position);(!c||e.lineIndent<h)&&_===32;)e.lineIndent++,_=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>h&&(h=e.lineIndent),gs(_)){m++;continue}if(e.lineIndent<h){a===x2?e.result+=di.repeat(`
117
- `,l?1+m:m):a===bg&&l&&(e.result+=`
118
- `);break}for(s?Ia(_)?(f=!0,e.result+=di.repeat(`
119
- `,l?1+m:m)):f?(f=!1,e.result+=di.repeat(`
120
- `,m+1)):m===0?l&&(e.result+=" "):e.result+=di.repeat(`
121
- `,m):e.result+=di.repeat(`
122
- `,l?1+m:m),l=!0,c=!0,m=0,i=e.position;!gs(_)&&_!==0;)_=e.input.charCodeAt(++e.position);qr(e,i,e.position,!1)}return!0}function C2(e,t){var i,s=e.tag,a=e.anchor,l=[],c,h=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),m=e.input.charCodeAt(e.position);m!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),!(m!==45||(c=e.input.charCodeAt(e.position+1),!on(c))));){if(h=!0,e.position++,ri(e,!0,-1)&&e.lineIndent<=t){l.push(null),m=e.input.charCodeAt(e.position);continue}if(i=e.line,Qo(e,t,X3,!1,!0),l.push(e.result),ri(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)Re(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=l,!0):!1}function iF(e,t,i){var s,a,l,c,h,m,f=e.tag,g=e.anchor,_={},v=Object.create(null),x=null,y=null,w=null,C=!1,N=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=_),T=e.input.charCodeAt(e.position);T!==0;){if(!C&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),s=e.input.charCodeAt(e.position+1),l=e.line,(T===63||T===58)&&on(s))T===63?(C&&(Wo(e,_,v,x,y,null,c,h,m),x=y=w=null),N=!0,C=!0,a=!0):C?(C=!1,a=!0):Re(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(c=e.line,h=e.lineStart,m=e.position,!Qo(e,i,Y3,!1,!0))break;if(e.line===l){for(T=e.input.charCodeAt(e.position);Ia(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),on(T)||Re(e,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(Wo(e,_,v,x,y,null,c,h,m),x=y=w=null),N=!0,C=!1,a=!1,x=e.tag,y=e.result;else if(N)Re(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=g,!0}else if(N)Re(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=g,!0}if((e.line===l||e.lineIndent>t)&&(C&&(c=e.line,h=e.lineStart,m=e.position),Qo(e,t,yh,!0,a)&&(C?y=e.result:w=e.result),C||(Wo(e,_,v,x,y,w,c,h,m),x=y=w=null),ri(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&T!==0)Re(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return C&&Wo(e,_,v,x,y,null,c,h,m),N&&(e.tag=f,e.anchor=g,e.kind="mapping",e.result=_),N}function nF(e){var t,i=!1,s=!1,a,l,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&Re(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(i=!0,c=e.input.charCodeAt(++e.position)):c===33?(s=!0,a="!!",c=e.input.charCodeAt(++e.position)):a="!",t=e.position,i){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(l=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):Re(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!on(c);)c===33&&(s?Re(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),Z3.test(a)||Re(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),qH.test(l)&&Re(e,"tag suffix cannot contain flow indicator characters")}l&&!Q3.test(l)&&Re(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Re(e,"tag name is malformed: "+l)}return i?e.tag=l:Yr.call(e.tagMap,a)?e.tag=e.tagMap[a]+l:a==="!"?e.tag="!"+l:a==="!!"?e.tag="tag:yaml.org,2002:"+l:Re(e,'undeclared tag handle "'+a+'"'),!0}function sF(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&Re(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!on(i)&&!Go(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function rF(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&&!on(s)&&!Go(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Yr.call(e.anchorMap,i)||Re(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],ri(e,!0,-1),!0}function Qo(e,t,i,s,a){var l,c,h,m=1,f=!1,g=!1,_,v,x,y,w,C;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=c=h=yh===i||X3===i,s&&ri(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)||sF(e);)ri(e,!0,-1)?(f=!0,h=l,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):h=!1;if(h&&(h=f||a),(m===1||yh===i)&&(xh===i||Y3===i?w=t:w=t+1,C=e.position-e.lineStart,m===1?h&&(C2(e,C)||iF(e,C,w))||eF(e,w)?g=!0:(c&&tF(e,w)||QH(e,w)||JH(e,w)?g=!0:rF(e)?(g=!0,(e.tag!==null||e.anchor!==null)&&Re(e,"alias node should not have any properties")):ZH(e,w,xh===i)&&(g=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(g=h&&C2(e,C))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Re(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),_=0,v=e.implicitTypes.length;_<v;_+=1)if(y=e.implicitTypes[_],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(Yr.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"],_=0,v=x.length;_<v;_+=1)if(e.tag.slice(0,x[_].tag.length)===x[_].tag){y=x[_];break}y||Re(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&Re(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)):Re(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||g}function aF(e){var t=e.position,i,s,a,l=!1,c;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(c=e.input.charCodeAt(e.position))!==0&&(ri(e,!0,-1),c=e.input.charCodeAt(e.position),!(e.lineIndent>0||c!==37));){for(l=!0,c=e.input.charCodeAt(++e.position),i=e.position;c!==0&&!on(c);)c=e.input.charCodeAt(++e.position);for(s=e.input.slice(i,e.position),a=[],s.length<1&&Re(e,"directive name must not be less than one character in length");c!==0;){for(;Ia(c);)c=e.input.charCodeAt(++e.position);if(c===35){do c=e.input.charCodeAt(++e.position);while(c!==0&&!gs(c));break}if(gs(c))break;for(i=e.position;c!==0&&!on(c);)c=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}c!==0&&W_(e),Yr.call(w2,s)?w2[s](e,s,a):Sh(e,'unknown document directive "'+s+'"')}if(ri(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,ri(e,!0,-1)):l&&Re(e,"directives end mark is expected"),Qo(e,e.lineIndent-1,yh,!1,!0),ri(e,!0,-1),e.checkLineBreaks&&VH.test(e.input.slice(t,e.position))&&Sh(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ph(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ri(e,!0,-1));return}if(e.position<e.length-1)Re(e,"end of the stream or a document separator is expected");else return}function nN(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
123
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new XH(e,t),s=e.indexOf("\0");for(s!==-1&&(i.position=s,Re(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;)aF(i);return i.documents}function oF(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var s=nN(e,i);if(typeof t!="function")return s;for(var a=0,l=s.length;a<l;a+=1)t(s[a])}function lF(e,t){var i=nN(e,t);if(i.length!==0){if(i.length===1)return i[0];throw new $i("expected a single document in the stream, but found more")}}var cF=oF,uF=lF,sN={loadAll:cF,load:uF},rN=Object.prototype.toString,aN=Object.prototype.hasOwnProperty,X_=65279,dF=9,$c=10,hF=13,fF=32,mF=33,pF=34,L0=35,gF=37,_F=38,bF=39,vF=42,oN=44,xF=45,wh=58,yF=61,SF=62,wF=63,EF=64,lN=91,cN=93,CF=96,uN=123,kF=124,dN=125,Pi={};Pi[0]="\\0";Pi[7]="\\a";Pi[8]="\\b";Pi[9]="\\t";Pi[10]="\\n";Pi[11]="\\v";Pi[12]="\\f";Pi[13]="\\r";Pi[27]="\\e";Pi[34]='\\"';Pi[92]="\\\\";Pi[133]="\\N";Pi[160]="\\_";Pi[8232]="\\L";Pi[8233]="\\P";var NF=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],TF=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function AF(e,t){var i,s,a,l,c,h,m;if(t===null)return{};for(i={},s=Object.keys(t),a=0,l=s.length;a<l;a+=1)c=s[a],h=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),m=e.compiledTypeMap.fallback[c],m&&aN.call(m.styleAliases,h)&&(h=m.styleAliases[h]),i[c]=h;return i}function MF(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 $i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+di.repeat("0",s-t.length)+t}var RF=1,Vc=2;function DF(e){this.schema=e.schema||G_,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=di.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=AF(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==='"'?Vc:RF,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 k2(e,t){for(var i=di.repeat(" ",t),s=0,a=-1,l="",c,h=e.length;s<h;)a=e.indexOf(`
124
- `,s),a===-1?(c=e.slice(s),s=h):(c=e.slice(s,a+1),s=a+1),c.length&&c!==`
125
- `&&(l+=i),l+=c;return l}function B0(e,t){return`
126
- `+di.repeat(" ",e.indent*t)}function OF(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 Eh(e){return e===fF||e===dF}function qc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==X_||65536<=e&&e<=1114111}function N2(e){return qc(e)&&e!==X_&&e!==hF&&e!==$c}function T2(e,t,i){var s=N2(e),a=s&&!Eh(e);return(i?s:s&&e!==oN&&e!==lN&&e!==cN&&e!==uN&&e!==dN)&&e!==L0&&!(t===wh&&!a)||N2(t)&&!Eh(t)&&e===L0||t===wh&&a}function jF(e){return qc(e)&&e!==X_&&!Eh(e)&&e!==xF&&e!==wF&&e!==wh&&e!==oN&&e!==lN&&e!==cN&&e!==uN&&e!==dN&&e!==L0&&e!==_F&&e!==vF&&e!==mF&&e!==kF&&e!==yF&&e!==SF&&e!==bF&&e!==pF&&e!==gF&&e!==EF&&e!==CF}function LF(e){return!Eh(e)&&e!==wh}function Ec(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 hN(e){var t=/^\n* /;return t.test(e)}var fN=1,z0=2,mN=3,pN=4,Ho=5;function BF(e,t,i,s,a,l,c,h){var m,f=0,g=null,_=!1,v=!1,x=s!==-1,y=-1,w=jF(Ec(e,0))&&LF(Ec(e,e.length-1));if(t||c)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Ec(e,m),!qc(f))return Ho;w=w&&T2(f,g,h),g=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Ec(e,m),f===$c)_=!0,x&&(v=v||m-y-1>s&&e[y+1]!==" ",y=m);else if(!qc(f))return Ho;w=w&&T2(f,g,h),g=f}v=v||x&&m-y-1>s&&e[y+1]!==" "}return!_&&!v?w&&!c&&!a(e)?fN:l===Vc?Ho:z0:i>9&&hN(e)?Ho:c?l===Vc?Ho:z0:v?pN:mN}function zF(e,t,i,s,a){e.dump=(function(){if(t.length===0)return e.quotingType===Vc?'""':"''";if(!e.noCompatMode&&(NF.indexOf(t)!==-1||TF.test(t)))return e.quotingType===Vc?'"'+t+'"':"'"+t+"'";var l=e.indent*Math.max(1,i),c=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),h=s||e.flowLevel>-1&&i>=e.flowLevel;function m(f){return OF(e,f)}switch(BF(t,h,e.indent,c,m,e.quotingType,e.forceQuotes&&!s,a)){case fN:return t;case z0:return"'"+t.replace(/'/g,"''")+"'";case mN:return"|"+A2(t,e.indent)+M2(k2(t,l));case pN:return">"+A2(t,e.indent)+M2(k2(IF(t,c),l));case Ho:return'"'+PF(t)+'"';default:throw new $i("impossible error: invalid scalar style")}})()}function A2(e,t){var i=hN(e)?String(t):"",s=e[e.length-1]===`
127
- `,a=s&&(e[e.length-2]===`
128
- `||e===`
129
- `),l=a?"+":s?"":"-";return i+l+`
130
- `}function M2(e){return e[e.length-1]===`
131
- `?e.slice(0,-1):e}function IF(e,t){for(var i=/(\n+)([^\n]*)/g,s=(function(){var f=e.indexOf(`
132
- `);return f=f!==-1?f:e.length,i.lastIndex=f,R2(e.slice(0,f),t)})(),a=e[0]===`
133
- `||e[0]===" ",l,c;c=i.exec(e);){var h=c[1],m=c[2];l=m[0]===" ",s+=h+(!a&&!l&&m!==""?`
134
- `:"")+R2(m,t),a=l}return s}function R2(e,t){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,s,a=0,l,c=0,h=0,m="";s=i.exec(e);)h=s.index,h-a>t&&(l=c>a?c:h,m+=`
135
- `+e.slice(a,l),a=l+1),c=h;return m+=`
136
- `,e.length-a>t&&c>a?m+=e.slice(a,c)+`
137
- `+e.slice(c+1):m+=e.slice(a),m.slice(1)}function PF(e){for(var t="",i=0,s,a=0;a<e.length;i>=65536?a+=2:a++)i=Ec(e,a),s=Pi[i],!s&&qc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=s||MF(i);return t}function UF(e,t,i){var s="",a=e.tag,l,c,h;for(l=0,c=i.length;l<c;l+=1)h=i[l],e.replacer&&(h=e.replacer.call(i,String(l),h)),(Zs(e,t,h,!1,!1)||typeof h>"u"&&Zs(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function D2(e,t,i,s){var a="",l=e.tag,c,h,m;for(c=0,h=i.length;c<h;c+=1)m=i[c],e.replacer&&(m=e.replacer.call(i,String(c),m)),(Zs(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&Zs(e,t+1,null,!0,!0,!1,!0))&&((!s||a!=="")&&(a+=B0(e,t)),e.dump&&$c===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=l,e.dump=a||"[]"}function HF(e,t,i){var s="",a=e.tag,l=Object.keys(i),c,h,m,f,g;for(c=0,h=l.length;c<h;c+=1)g="",s!==""&&(g+=", "),e.condenseFlow&&(g+='"'),m=l[c],f=i[m],e.replacer&&(f=e.replacer.call(i,m,f)),Zs(e,t,m,!1,!1)&&(e.dump.length>1024&&(g+="? "),g+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Zs(e,t,f,!1,!1)&&(g+=e.dump,s+=g));e.tag=a,e.dump="{"+s+"}"}function FF(e,t,i,s){var a="",l=e.tag,c=Object.keys(i),h,m,f,g,_,v;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new $i("sortKeys must be a boolean or a function");for(h=0,m=c.length;h<m;h+=1)v="",(!s||a!=="")&&(v+=B0(e,t)),f=c[h],g=i[f],e.replacer&&(g=e.replacer.call(i,f,g)),Zs(e,t+1,f,!0,!0,!0)&&(_=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,_&&(e.dump&&$c===e.dump.charCodeAt(0)?v+="?":v+="? "),v+=e.dump,_&&(v+=B0(e,t)),Zs(e,t+1,g,!0,_)&&(e.dump&&$c===e.dump.charCodeAt(0)?v+=":":v+=": ",v+=e.dump,a+=v));e.tag=l,e.dump=a||"{}"}function O2(e,t,i){var s,a,l,c,h,m;for(a=i?e.explicitTypes:e.implicitTypes,l=0,c=a.length;l<c;l+=1)if(h=a[l],(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,rN.call(h.represent)==="[object Function]")s=h.represent(t,m);else if(aN.call(h.represent,m))s=h.represent[m](t,m);else throw new $i("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');e.dump=s}return!0}return!1}function Zs(e,t,i,s,a,l,c){e.tag=null,e.dump=i,O2(e,i,!1)||O2(e,i,!0);var h=rN.call(e.dump),m=s,f;s&&(s=e.flowLevel<0||e.flowLevel>t);var g=h==="[object Object]"||h==="[object Array]",_,v;if(g&&(_=e.duplicates.indexOf(i),v=_!==-1),(e.tag!==null&&e.tag!=="?"||v||e.indent!==2&&t>0)&&(a=!1),v&&e.usedDuplicates[_])e.dump="*ref_"+_;else{if(g&&v&&!e.usedDuplicates[_]&&(e.usedDuplicates[_]=!0),h==="[object Object]")s&&Object.keys(e.dump).length!==0?(FF(e,t,e.dump,a),v&&(e.dump="&ref_"+_+e.dump)):(HF(e,t,e.dump),v&&(e.dump="&ref_"+_+" "+e.dump));else if(h==="[object Array]")s&&e.dump.length!==0?(e.noArrayIndent&&!c&&t>0?D2(e,t-1,e.dump,a):D2(e,t,e.dump,a),v&&(e.dump="&ref_"+_+e.dump)):(UF(e,t,e.dump),v&&(e.dump="&ref_"+_+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&zF(e,e.dump,t,l,m);else{if(h==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $i("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,l;for(I0(e,i,s),a=0,l=s.length;a<l;a+=1)t.duplicates.push(i[s[a]]);t.usedDuplicates=new Array(l)}function I0(e,t,i){var s,a,l;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,l=e.length;a<l;a+=1)I0(e[a],t,i);else for(s=Object.keys(e),a=0,l=s.length;a<l;a+=1)I0(e[s[a]],t,i)}function VF(e,t){t=t||{};var i=new DF(t);i.noRefs||$F(e,i);var s=e;return i.replacer&&(s=i.replacer.call({"":s},"",s)),Zs(i,0,s,!0,!0)?i.dump+`
138
- `:""}var qF=VF,KF={dump:qF};function Z_(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 GF=Mi,WF=M3,YF=j3,XF=P3,ZF=U3,QF=G_,JF=sN.load,e$=sN.loadAll,t$=KF.dump,i$=$i,n$={binary:q3,float:I3,map:O3,null:L3,pairs:G3,set:W3,timestamp:$3,bool:B3,int:z3,merge:V3,omap:K3,seq:D3,str:R3},s$=Z_("safeLoad","load"),r$=Z_("safeLoadAll","loadAll"),a$=Z_("safeDump","dump"),o$={Type:GF,Schema:WF,FAILSAFE_SCHEMA:YF,JSON_SCHEMA:XF,CORE_SCHEMA:ZF,DEFAULT_SCHEMA:QF,load:JF,loadAll:e$,dump:t$,YAMLException:i$,types:n$,safeLoad:s$,safeLoadAll:r$,safeDump:a$};function gN(e){return e!==null&&typeof e=="object"}function _N(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 bN(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function vN({label:e,value:t,depth:i,defaultOpen:s}){const[a,l]=E.useState(s),c={paddingLeft:`${i*1.1}rem`};if(!gN(t))return u.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:c,children:[u.jsxs("span",{className:"text-zinc-500",children:[e,":"]}),u.jsx("span",{className:de("whitespace-pre-wrap break-words",_N(t)),children:bN(t)})]});const h=Array.isArray(t)?t.map((f,g)=>[String(g),f]):Object.entries(t),m=Array.isArray(t)?`[${h.length}]`:`{${h.length}}`;return u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>l(f=>!f),className:"flex w-full items-center gap-1 py-[1px] text-left hover:bg-zinc-100",style:c,children:[a?u.jsx(es,{className:"size-3.5 shrink-0 text-zinc-400"}):u.jsx(Xr,{className:"size-3.5 shrink-0 text-zinc-400"}),u.jsx("span",{className:"font-medium text-zinc-700",children:e}),u.jsx("span",{className:"text-zinc-400",children:m})]}),a?h.map(([f,g])=>u.jsx(vN,{label:f,value:g,depth:i+1,defaultOpen:i<1},f)):null]})}function l$({content:e}){const t=E.useMemo(()=>{try{const s=o$.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 u.jsx("div",{className:"p-4",children:u.jsxs(dt,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!gN(t.value))return u.jsx("div",{className:"p-4 font-mono text-[12px]",children:u.jsx("span",{className:_N(t.value),children:bN(t.value)})});const i=Array.isArray(t.value)?t.value.map((s,a)=>[String(a),s]):Object.entries(t.value);return u.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:i.map(([s,a])=>u.jsx(vN,{label:s,value:a,depth:0,defaultOpen:!0},s))})}const c$=E.lazy(()=>fP(()=>import("./code-editor-z1WxDN4v.js"),[]).then(e=>({default:e.CodeEditor})));function u$(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function d$(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 h$(e,t){const i=e.endsWith(`
139
- `)?e.slice(0,-1):e;return!t||!M0.getLanguage(t)?i.split(`
140
- `).map(j2):i.split(`
141
- `).map(s=>{if(!s)return"";try{return M0.highlight(s,{language:t,ignoreIllegals:!0}).value}catch{return j2(s)}})}function j2(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function f$({content:e,path:t}){const i=E.useMemo(()=>d$(t),[t]),s=E.useMemo(()=>h$(e,i),[e,i]),a=`${Math.max(2,String(s.length).length)}ch`;return u.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:s.map((l,c)=>u.jsxs("div",{className:"flex",children:[u.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400",style:{minWidth:`calc(${a} + 1rem)`},children:c+1}),u.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800",dangerouslySetInnerHTML:{__html:l||" "}})]},c))})}function m$({path:e,isModified:t,onViewDiff:i,onFileSaved:s}){const[a,l]=E.useState(null),[c,h]=E.useState(""),[m,f]=E.useState(!1),[g,_]=E.useState(null),[v,x]=E.useState(!1),[y,w]=E.useState(!1),{success:C,error:N}=Ii(),T=E.useMemo(()=>u$(e),[e]),[A,M]=E.useState("preview"),L=!!(a&&!a.binary&&!a.truncated),K=a?c!==a.content:!1;E.useEffect(()=>{M(T?"preview":"source"),f(!1)},[T]),E.useEffect(()=>{if(!e){l(null);return}let H=!0;return x(!0),_(null),f(!1),NM(e).then(P=>{H&&(l(P),h(P.content),x(!1))}).catch(P=>{H&&(_(P instanceof Error?P.message:String(P)),x(!1))}),()=>{H=!1}},[e]);async function B(){if(!(!e||!a||!K||y)){w(!0);try{await TM(e,c);const H={...a,content:c,size:new TextEncoder().encode(c).length};l(H),f(!1),C(`Saved ${e}.`),s?.(e)}catch(H){N(H instanceof Error?H.message:String(H))}finally{w(!1)}}}function R(){h(a?.content??""),f(!1)}return e?u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Read-only view of tracked file."}),a?.truncated?u.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,a?.binary?u.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[T&&!a?.binary?u.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[u.jsxs("button",{type:"button",onClick:()=>M("preview"),"aria-pressed":A==="preview",className:de("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:[u.jsx($0,{className:"size-3.5"}),"Preview"]}),u.jsxs("button",{type:"button",onClick:()=>M("source"),"aria-pressed":A==="source",className:de("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:[u.jsx(G2,{className:"size-3.5"}),"Source"]})]}):null,t?u.jsx(he,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,m?u.jsxs(u.Fragment,{children:[u.jsxs(he,{disabled:!K||y,onClick:()=>{B()},size:"sm",type:"button",children:[u.jsx(q0,{}),"Apply"]}),u.jsxs(he,{disabled:y,onClick:R,size:"sm",type:"button",variant:"outline",children:[u.jsx(Hn,{}),"Cancel"]})]}):L?u.jsxs(he,{onClick:()=>{M("source"),f(!0)},size:"sm",type:"button",variant:"outline",children:[u.jsx(Rc,{}),"Edit"]}):null]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50",children:g?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:g})}):v?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):a?.binary?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):a?m?u.jsx(E.Suspense,{fallback:u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading editor…"}),children:u.jsx(c$,{path:e,value:c,onChange:h})}):T&&A==="preview"?T==="markdown"?u.jsx(HU,{content:a.content}):u.jsx(l$,{content:a.content}):u.jsx(f$,{content:a.content,path:e}):null})]}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{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 l=t.indexOf(a),c=t[l+1];return c?s===c?{kind:"file",filePath:c}:{kind:"confirm-next-file",filePath:c}:{kind:"none"}}function L2(e){const t={name:"",fullPath:"",children:new Map};for(const i of e){const s=i.name.split("/");let a=t;s.forEach((l,c)=>{let h=a.children.get(l);h||(h={name:l,fullPath:s.slice(0,c+1).join("/"),children:new Map},a.children.set(l,h)),a=h}),a.branch=i}return t}function B2({label:e,tree:t,onSelect:i,defaultOpen:s,forceOpen:a}){const[l,c]=E.useState(s??!1),h=a||l,m=t.children.size===0;return u.jsxs("div",{className:"mb-1",children:[u.jsxs("button",{type:"button",onClick:()=>c(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?u.jsx(es,{size:12}):u.jsx(Xr,{size:12}),e,m?null:u.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),h&&!m?u.jsx("ul",{children:Array.from(t.children.values()).map(f=>u.jsx(xN,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function xN({node:e,depth:t,onSelect:i,forceOpen:s}){const[a,l]=E.useState(!0),c=s||a,h=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!h&&m?u.jsx("li",{children:u.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:[u.jsx(Mc,{size:11,className:"shrink-0 opacity-70"}),u.jsx("span",{className:"truncate",children:e.name}),m.current?u.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>{m?i(m):l(g=>!g)},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?c?u.jsx(es,{size:11}):u.jsx(Xr,{size:11}):u.jsx("span",{className:"inline-block w-[11px]"}),u.jsx("span",{className:"truncate",children:e.name})]}),c&&h?u.jsx("ul",{children:Array.from(e.children.values()).map(g=>u.jsx(xN,{node:g,depth:t+1,onSelect:i,forceOpen:s},g.fullPath))}):null]})}function g$({selectedCommit:e,selectedFile:t,diff:i,diffLoading:s,diffError:a}){return u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-card border-b border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),u.jsxs("span",{children:[e.author," <",e.email,">"]}),u.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:a})}):e?s?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?u.jsx(g3,{activeHunkIndex:0,diff:i}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{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."})}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function _$({files:e,filesError:t,selectedHash:i,selectedFile:s,onSelect:a}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?u.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"destructive",children:t})}):i?e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>u.jsx("li",{children:u.jsxs("button",{onClick:()=>a(l.path),type:"button",title:l.path,className:`flex w-full items-center gap-2 px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted/60 ${s===l.path?"bg-muted":""}`,children:[u.jsx("span",{className:b$(l.index),children:l.index.trim()||"·"}),u.jsx("span",{className:"truncate font-mono",children:l.path})]})},l.path))}):u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function b$(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 z2=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function mc(e){return z2[e%z2.length]}function v$({lane:e,laneCount:t,edges:i,throughLanes:s,isMerge:a,height:l=28,laneWidth:c=14}){const m=Math.max(e+1,t,1)*c,f=l/2,g=pc(e,c),_=a?4:3.5;return u.jsxs("svg",{width:m,height:l,viewBox:`0 0 ${m} ${l}`,style:{flex:"0 0 auto",display:"block"},children:[s.map(v=>u.jsx("line",{x1:pc(v,c),y1:0,x2:pc(v,c),y2:l,stroke:mc(v),strokeWidth:1.5},`t-${v}`)),u.jsx("line",{x1:g,y1:0,x2:g,y2:f,stroke:mc(e),strokeWidth:1.5}),i.map((v,x)=>{const y=pc(v.fromLane,c),w=pc(v.toLane,c);if(y===w)return u.jsx("line",{x1:y,y1:f,x2:w,y2:l,stroke:mc(v.toLane),strokeWidth:1.5},`e-${x}`);const C=f+(l-f)/2;return u.jsx("path",{d:`M ${y} ${f} C ${y} ${C}, ${w} ${C}, ${w} ${l}`,fill:"none",stroke:mc(v.toLane),strokeWidth:1.5},`e-${x}`)}),u.jsx("circle",{cx:g,cy:f,r:_,fill:mc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function pc(e,t){return e*t+t/2}const I2=28;function x$({commits:e,loading:t,error:i,selectedHash:s,maxLanes:a,rowRefs:l,onSelect:c,onLoadMore:h}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?u.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),u.jsx(he,{disabled:t,onClick:h,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i?u.jsx("div",{className:"p-3",children:u.jsx(dt,{variant:"destructive",children:i})}):t&&e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>u.jsx("li",{ref:f=>{f?l.current.set(m.hash,f):l.current.delete(m.hash)},children:u.jsxs("button",{onClick:()=>c(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:I2},title:`${m.hash}
142
- ${m.author} <${m.email}>
143
- ${m.subject}`,children:[u.jsx(v$,{lane:m.lane,laneCount:Math.max(m.laneCount,a),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:I2}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(f=>u.jsx("span",{className:S$(f.kind),children:f.name},`${f.kind}-${f.name}`)),u.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),u.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:y$(m.timestamp)})]})},m.hash))})})]})}function y$(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 l=Math.floor(a/30);return l<12?`${l}mo`:`${Math.floor(l/12)}y`}function S$(e){const t="rounded px-1.5 py-px text-[10px] font-medium";switch(e){case"head":return`${t} bg-emerald-100 text-emerald-800`;case"branch":return`${t} bg-blue-100 text-blue-800`;case"remote":return`${t} bg-slate-100 text-slate-700`;case"tag":return`${t} bg-amber-100 text-amber-800`}}const P2=200;function w$(){const[e,t]=E.useState([]),[i,s]=E.useState(P2),[a,l]=E.useState(!0),[c,h]=E.useState(null),[m,f]=E.useState(null),[g,_]=E.useState([]),[v,x]=E.useState(null),[y,w]=E.useState(null),[C,N]=E.useState(""),[T,A]=E.useState(!1),[M,L]=E.useState(null);E.useEffect(()=>{let R=!0;return l(!0),h(null),SM(i).then(H=>{R&&(t(H),H.length>0&&!H.some(P=>P.hash===m)&&f(H[0].hash))}).catch(H=>{R&&h(H instanceof Error?H.message:String(H))}).finally(()=>{R&&l(!1)}),()=>{R=!1}},[i]),E.useEffect(()=>{if(!m){_([]),w(null);return}let R=!0;return x(null),EM(m).then(H=>{R&&(_(H),w(H[0]?.path??null))}).catch(H=>{R&&x(H instanceof Error?H.message:String(H))}),()=>{R=!1}},[m]),E.useEffect(()=>{if(!m){N("");return}let R=!0;return L(null),A(!0),wM(m,y??void 0).then(H=>{R&&N(H)}).catch(H=>{R&&L(H instanceof Error?H.message:String(H))}).finally(()=>{R&&A(!1)}),()=>{R=!1}},[m,y]);const K=E.useMemo(()=>e.reduce((R,H)=>Math.max(R,H.laneCount),1),[e]),B=e.find(R=>R.hash===m)??null;return{commits:e,loading:a,error:c,selectedHash:m,setSelectedHash:f,files:g,filesError:v,selectedFile:y,setSelectedFile:w,diff:C,diffLoading:T,diffError:M,maxLanes:K,selectedCommit:B,loadMore:()=>s(R=>R+P2)}}function E$({branches:e=[]}){const{commits:t,loading:i,error:s,selectedHash:a,setSelectedHash:l,files:c,filesError:h,selectedFile:m,setSelectedFile:f,diff:g,diffLoading:_,diffError:v,maxLanes:x,selectedCommit:y,loadMore:w}=w$(),[C,N]=E.useState(""),T=E.useMemo(()=>{const R=C.trim().toLowerCase();return R?e.filter(H=>H.name.toLowerCase().includes(R)):e},[e,C]),A=E.useMemo(()=>L2(T.filter(R=>!R.remote)),[T]),M=E.useMemo(()=>L2(T.filter(R=>R.remote)),[T]),L=C.trim().length>0,K=E.useRef(new Map);function B(R){const H=R.remote?"remote":"branch",P=t.find(F=>F.refs.some(ie=>ie.kind===H&&ie.name===R.name));if(!P)return;l(P.hash);const q=K.current.get(P.hash),J=q?.parentElement?.parentElement;!q||!J||J.scrollTo({top:Math.max(q.offsetTop-J.clientHeight/2+q.clientHeight/2,0),behavior:"smooth"})}return u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[u.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),u.jsx("input",{type:"search",value:C,onChange:R=>N(R.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"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[u.jsx(B2,{label:"Local",tree:A,onSelect:B,defaultOpen:!0,forceOpen:L}),u.jsx(B2,{label:"Remote",tree:M,onSelect:B,forceOpen:L})]})]}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[u.jsx(g$,{selectedCommit:y,selectedFile:m,diff:g,diffLoading:_,diffError:v}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[u.jsx(x$,{commits:t,loading:i,error:s,selectedHash:a,maxLanes:x,rowRefs:K,onSelect:l,onLoadMore:w}),u.jsx(_$,{files:c,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const P0=300,C$=600,k$=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 N$(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:!k$.has(t.slice(i+1))}function T$(e){return e>=C$?"danger":e>=P0?"warn":"ok"}const A$={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},M$={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function R$({onOpenFile:e}){const[t,i]=E.useState([]),[s,a]=E.useState(!0),[l,c]=E.useState(null),[h,m]=E.useState(!0);function f(){a(!0),c(null),kM().then(i).catch(y=>c(y instanceof Error?y.message:String(y))).finally(()=>a(!1))}E.useEffect(()=>{f()},[]);const g=E.useMemo(()=>h?t.filter(y=>N$(y.path)):t,[t,h]),_=t.length-g.length,v=g[0]?.lines??1,x=g.filter(y=>y.lines>=P0).length;return u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx(X2,{className:"size-4"}),u.jsx("span",{className:"font-semibold text-foreground",children:"Largest files"}),!s&&!l?u.jsxs("span",{children:[g.length," files · ",x," over ",P0," lines",h&&_>0?` · ${_} data/docs hidden`:""]}):null]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(he,{size:"sm",variant:h?"default":"outline",className:"h-7",onClick:()=>m(y=>!y),title:"Hide docs, data, config and generated files",type:"button",children:[u.jsx(G2,{}),"Code only"]}),u.jsxs(he,{size:"sm",variant:"outline",className:"h-7",onClick:f,disabled:s,type:"button",children:[s?u.jsx(Gi,{className:"animate-spin"}):u.jsx(kh,{}),"Refresh"]})]})]}),l?u.jsx(dt,{variant:"destructive",className:"m-3",children:l}):s&&t.length===0?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(Gi,{className:"mr-2 size-4 animate-spin"}),"Scanning tracked files…"]}):g.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:t.length===0?"No tracked text files found.":"No code files — toggle off “Code only” to see data & docs."}):u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border/60 overflow-auto",children:g.map((y,w)=>{const C=T$(y.lines);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>e(y.path),className:"group flex w-full items-center gap-3 px-3 py-1.5 text-left transition-colors hover:bg-muted/50",children:[u.jsx("span",{className:"w-6 shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:w+1}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"truncate font-mono text-[11px]",children:y.path}),u.jsxs("span",{className:de("shrink-0 font-mono text-[11px] tabular-nums",M$[C]),children:[y.truncated?"≥":"",y.lines.toLocaleString()," lines"]})]}),u.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:de("h-full rounded-full",A$[C]),style:{width:`${Math.max(2,y.lines/v*100)}%`}})})]})]})},y.path)})})]})}function D$({data:e}){const[t,i]=E.useState("changes"),[s,a]=E.useState("changes"),[l,c]=E.useState(e.git.status?.files[0]?.path??""),[h,m]=E.useState(""),[f,g]=E.useState([]),[_,v]=E.useState(null),[x,y]=E.useState(""),[w,C]=E.useState(null),[N,T]=E.useState(0),[A,M]=E.useState(null),[L,K]=E.useState(()=>new Set),B=e.git.status?.files??[],R=E.useMemo(()=>{const $=new Set(B.map(fe=>fe.path)),se=[...L].filter(fe=>!$.has(fe)).sort().map(fe=>({path:fe,index:" ",workingTree:"M"}));return[...B,...se]},[B,L]),H=E.useMemo(()=>R.map($=>$.path),[R]),P=E.useMemo(()=>JI(x),[x]);E.useEffect(()=>{const $=R[0]?.path??"";c(se=>se&&R.some(fe=>fe.path===se)?se:$)},[R]),E.useEffect(()=>{if(t!=="all"||f.length>0)return;let $=!0;return v(null),CM().then(se=>{$&&g(se)}).catch(se=>{$&&v(se instanceof Error?se.message:String(se))}),()=>{$=!1}},[t,f.length]),E.useEffect(()=>{if(!l){y("");return}let $=!0;return C(null),AM(l).then(se=>{$&&(y(se),T(0),M(null))}).catch(se=>{$&&C(se instanceof Error?se.message:String(se))}),()=>{$=!1}},[l]);function q($){T(0),M(null),c($)}function J(){const $=p$({activeHunkIndex:N,filePaths:H,hunkCount:P.hunks,pendingNextFilePath:A,selectedFile:l});$.kind==="hunk"?(M(null),T($.activeHunkIndex)):$.kind==="confirm-next-file"?M($.filePath):$.kind==="file"?q($.filePath):M(null)}function F(){if(M(null),N>0){T(fe=>fe-1);return}const $=R.findIndex(fe=>fe.path===l),se=R[$-1];se&&q(se.path)}const ie=R.findIndex($=>$.path===l),V=!!(P.hunks&&N<P.hunks-1||R[ie+1]),O=!!(N>0||R[ie-1]),Y=A?`End of file. Click Next again to open ${A}.`:null,X=$=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${$?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,j=$=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${$?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,W=E.useMemo(()=>{const $=new Set(R.map(se=>se.path));for(const se of L)$.add(se);return $},[R,L]);if(!e.git.selectedRepository)return u.jsx(O$,{});function D(){h&&(i("changes"),a("changes"),q(h))}function te($){K(se=>new Set(se).add($)),m($),i("changes"),a("changes"),q($)}function ue($){m($),i("all")}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[u.jsx("button",{type:"button",className:X(t==="changes"),onClick:()=>i("changes"),children:"Changes"}),u.jsx("button",{type:"button","aria-label":"Open all tracked files",className:X(t==="all"),onClick:()=>i("all"),children:"All files"}),u.jsx("button",{type:"button",className:X(t==="graph"),onClick:()=>i("graph"),children:"Tree"}),u.jsx("button",{type:"button",className:X(t==="largest"),onClick:()=>i("largest"),children:"Largest files"})]}),u.jsx("div",{className:"min-h-0 flex-1",children:t==="graph"?u.jsx(E$,{branches:e.git.branches??[]}):t==="largest"?u.jsx(R$,{onOpenFile:ue}):t==="all"?u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsx("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:_?u.jsx(dt,{variant:"destructive",className:"m-3",children:_}):u.jsx(kw,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:f,root:e.git.cwd,selectedFile:h,status:R})}),u.jsx(m$,{isModified:W.has(h),onFileSaved:te,onViewDiff:D,path:h})]}):u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[u.jsx("button",{"aria-label":"Show changed files as a list",className:j(s==="changes"),onClick:()=>a("changes"),type:"button",children:"Changes"}),u.jsx("button",{"aria-label":"Show changed files as a tree",className:j(s==="tree"),onClick:()=>a("tree"),type:"button",children:"Tree"})]}),s==="changes"?u.jsx(nP,{branch:e.git.status?.branch||void 0,error:e.git.error,files:R,selectedFile:l,onSelectFile:q,root:e.git.cwd}):u.jsx(kw,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:q,paths:H,root:e.git.cwd,selectedFile:l,status:R,title:"Changes"})]}),u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:l||"Diff"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Long rows wrap inside the editor pane."}),P.additions||P.deletions?u.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",P.additions]}),u.jsxs("span",{className:"text-red-700",children:["-",P.deletions]})]}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Y?u.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:Y}):null,u.jsxs(he,{disabled:!l||!O,onClick:F,size:"sm",type:"button",variant:"outline",children:[u.jsx($T,{}),"Previous"]}),u.jsxs(he,{disabled:!l||!V,onClick:J,size:"sm",type:"button",variant:"outline",children:[u.jsx(HT,{}),"Next"]})]})]}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:w?u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"destructive",children:w})}):l?u.jsx(g3,{activeHunkIndex:N,diff:x||"No unstaged diff for this file."}):u.jsx("div",{className:"p-4",children:u.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function O$(){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(DA,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No Git project registered"}),u.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 j$({initialPath:e,onSelect:t,selectedPath:i}){const[s,a]=E.useState(e),[l,c]=E.useState(null),[h,m]=E.useState(null),[f,g]=E.useState(!1),_=L$(l);return E.useEffect(()=>{a(e)},[e]),E.useEffect(()=>{let v=!0;return g(!0),m(null),oE(s).then(x=>{v&&(c(x),t(x.path))}).catch(x=>{v&&m(x instanceof Error?x.message:String(x))}).finally(()=>{v&&g(!1)}),()=>{v=!1}},[s,t]),u.jsxs("div",{className:"rounded-md border border-border bg-background",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[_?u.jsx(he,{"aria-label":"Open parent folder",onClick:()=>l&&a(l.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(es,{className:"rotate-90"})}):null,u.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l?.path??s}),f?u.jsx(Gi,{className:"size-4 animate-spin text-muted-foreground"}):null]}),u.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[h?u.jsx(dt,{variant:"destructive",className:"m-1",children:h}):null,!h&&l?.entries.length===0?u.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,l?.entries.map(v=>u.jsxs(he,{className:de("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:[u.jsx(Fa,{className:"text-accent"}),u.jsx("span",{className:"truncate",children:v.name})]},v.path))]})]})}function L$(e){return!!(e&&e.parent!==e.path)}function U2(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function B$({data:e,onRefresh:t}){const[i,s]=E.useState(!1),[a,l]=E.useState(e.git.cwd),[c,h]=E.useState(null),[m,f]=E.useState(!1),[g,_]=E.useState(e.git.cwd),v=E.useRef(null),x=e.git.selectedRepository,y=x?.name??(e.git.cwd?U2(e.git.cwd):"Add Git project"),{error:w,success:C}=Ii(),N=I$({gitCwd:e.git.cwd});E.useEffect(()=>{l(e.git.cwd),_(e.git.cwd)},[e.git.cwd]),E.useEffect(()=>{if(!i)return;function B(R){v.current&&R.target instanceof Node&&!v.current.contains(R.target)&&s(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[i]);async function T(B){try{await Ki("/api/git/select",{name:B}),s(!1),await t(),C(`Switched to ${B}.`)}catch(R){w(R instanceof Error?R.message:String(R))}}async function A(B){const R=B.trim();if(!z$(R)){const H="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h(H),w(H),!1}try{const H=U2(R);return await Ki("/api/git/repositories",{name:H,path:R}),h(null),await t(),C(`Added Git project ${H}.`),!0}catch(H){const P=H instanceof Error?H.message:String(H);return h(P),w(P),!1}}async function M(B){try{await MM(B),await t(),C(`Removed Git project ${B}.`)}catch(R){w(R instanceof Error?R.message:String(R))}}async function L(B){B.preventDefault(),await A(a)&&s(!1)}function K(){h(null),_(N.selectedPath),f(!0)}return u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:v,children:[u.jsxs(he,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>s(B=>!B),size:"sm",type:"button",variant:"outline",children:[u.jsx(Fa,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:y}),u.jsx(es,{className:de("ml-auto transition-transform",i&&"rotate-180")})]}),u.jsx(he,{"aria-label":"Add Git project",onClick:K,size:"sm",type:"button",variant:"outline",children:u.jsx(In,{})}),i?u.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:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(pA,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),u.jsx(Ke,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?u.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(B=>{const R=B.name===x?.name;return u.jsxs("div",{className:de("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",R&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(B.name)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:B.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:B.path})]}),R?u.jsx(Jo,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(he,{"aria-label":`Remove ${B.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{M(B.name)},size:"icon",title:`Remove ${B.name}`,type:"button",variant:"ghost",children:u.jsx(Kc,{className:"size-3.5 text-destructive"})})]},B.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),u.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[u.jsxs("form",{className:"flex gap-1.5",onSubmit:L,children:[u.jsx(ot,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:B=>{l(B.target.value),h(null)},placeholder:"/absolute/path",value:a}),u.jsxs(he,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[u.jsx(In,{className:"size-3"}),"Add"]}),u.jsx(he,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:K,size:"sm",type:"button",variant:"outline",children:u.jsx(LA,{className:"size-3"})})]}),c?u.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:c}):null]})]}):null,m?u.jsx(P$,{confirmLabel:N.confirmLabel,errorMessage:c,initialPath:N.initialPath,selectedPath:g,title:"Add Git Project",onCancel:()=>f(!1),onSelect:_,onUse:async()=>{await A(g)&&(f(!1),s(!1))}}):null]})}function z$(e){return e.startsWith("/")}function I$({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function P$({confirmLabel:e="Use this folder",errorMessage:t,initialPath:i,onCancel:s,onSelect:a,onUse:l,selectedPath:c,title:h="Choose Git Project Folder"}){return Dh.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:u.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:u.jsx(Fa,{className:"size-4"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"text-sm font-semibold",children:h}),u.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:c})]}),u.jsx(he,{"aria-label":"Close folder picker",onClick:s,size:"icon",variant:"ghost",children:u.jsx(Hn,{})})]}),u.jsx(j$,{initialPath:i,onSelect:a,selectedPath:c}),t?u.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,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx(he,{onClick:s,type:"button",variant:"outline",children:"Cancel"}),u.jsx(he,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function U$({branches:e,currentBranch:t,disabled:i,onRefresh:s}){const[a,l]=E.useState(!1),[c,h]=E.useState(""),[m,f]=E.useState(null),[g,_]=E.useState(null),[v,x]=E.useState(null),y=e.filter(M=>!M.remote),w=e.filter(M=>M.remote);async function C(M,L){f(M),x(null),_(null);try{await L(),await s()}catch(K){x(K instanceof Error?K.message:String(K))}finally{f(null)}}async function N(M){await C(`switch:${M}`,async()=>{await Ki("/api/git/branches/switch",{name:M}),l(!1)})}async function T(){await C("fetch",async()=>{await Ki("/api/git/fetch",{}),_("Fetched latest branch refs.")})}async function A(M){M.preventDefault();const L=c.trim();if(!L){x("Branch name is required.");return}await C("create",async()=>{await Ki("/api/git/branches",{name:L}),h(""),l(!1)})}return u.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?u.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:[u.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Mc,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(he,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:u.jsx(kh,{className:de(m==="fetch"&&"animate-spin")})}),u.jsx(he,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:u.jsx(Hn,{})})]})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsxs(u.Fragment,{children:[u.jsx(H2,{branches:y,busy:m!==null,disabled:i,label:"Local",onSwitch:N}),u.jsx(H2,{branches:w,busy:m!==null,disabled:i,label:"Remote",onSwitch:N})]}):u.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),u.jsxs("div",{className:"border-t border-border p-3",children:[u.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:A,children:[u.jsx(ot,{"aria-label":"New branch name",disabled:i||m!==null,onChange:M=>{h(M.target.value),x(null),_(null)},placeholder:"feature/new-work",value:c}),u.jsxs(he,{disabled:i||m!==null,type:"submit",children:[u.jsx(FA,{}),"Create"]})]}),v||g?u.jsx(dt,{className:"mt-3 px-3 py-2 text-xs",variant:v?"destructive":"muted",children:v??g}):null]})]}):null,u.jsxs(he,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>l(M=>!M),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[u.jsx(Mc,{className:"size-4"}),u.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),u.jsx(es,{className:de("size-4 transition-transform",a&&"rotate-180")})]})]})}function H2({branches:e,busy:t,disabled:i,label:s,onSwitch:a}){return u.jsxs("section",{children:[u.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(l=>u.jsxs("button",{className:de("grid w-full grid-cols-[1fr_auto] items-center gap-2 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 hover:bg-muted",l.current&&"bg-muted/70"),disabled:i||t||l.current,onClick:()=>{a(l.name)},type:"button",children:[u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block truncate font-medium",children:l.name}),l.upstream?u.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",l.upstream]}):null]}),u.jsx(Ke,{variant:l.current?"success":l.remote?"outline":"secondary",children:l.current?"current":l.remote?"remote":"local"})]},`${l.remote?"remote":"local"}:${l.name}`)):u.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",s.toLowerCase()," branches."]})]})}const yN="nomoreide-theme-choice";function H$(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(yN);return e==="light"||e==="dark"?e:"dark"}function F$(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function $$(){const[e,t]=E.useState(()=>H$()),i=E.useRef(null);E.useEffect(()=>{F$(e),window.localStorage.setItem(yN,e)},[e]);const s=E.useCallback(()=>{const a=e==="dark"?"light":"dark",l=i.current,c=document;if(!l||!c.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(a);return}const h=l.getBoundingClientRect(),m=h.left+h.width/2,f=h.top+h.height/2,g=Math.hypot(Math.max(m,window.innerWidth-m),Math.max(f,window.innerHeight-f));c.startViewTransition(()=>{t(a)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${m}px ${f}px)`,`circle(${g}px at ${m}px ${f}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},[e]);return u.jsx("button",{ref:i,onClick:s,title:e==="dark"?"Switch to light mode":"Switch to dark mode","aria-label":"Toggle theme",className:de(CE({variant:"outline",size:"sm"}),"px-2"),children:e==="dark"?u.jsx(V4,{}):u.jsx(s4,{})})}function V$(e=!1){return de("group/sidebar hidden h-full shrink-0 overflow-x-hidden overflow-y-auto border-r border-border bg-card/85 py-5 backdrop-blur transition-[width,padding] duration-200 md:flex md:flex-col",e?"w-64 px-4":"w-16 px-2 hover:w-64 hover:px-4")}function q$(e,t=!1){return de("relative grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center justify-start gap-0 overflow-hidden rounded-md px-0 text-[15px] font-medium transition-[background-color,color,width] duration-150",t?"w-full":"w-12 group-hover/sidebar:w-full",e?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-muted")}function K$(e=!1,t=!1){return de("min-w-0 overflow-hidden text-left text-current transition duration-150 whitespace-pre",e?"translate-x-1 opacity-100":"opacity-0 group-hover/sidebar:translate-x-1 group-hover/sidebar:opacity-100",t?"pr-10":"pr-3")}function G$(e=!1){return de("flex size-12 items-center justify-center text-current transition-transform duration-150 [&_svg]:size-5",e?"translate-x-0":"-translate-x-px group-hover/sidebar:translate-x-0")}function W$({docked:e,onToggleDock:t}){return u.jsxs("div",{className:de("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[u.jsxs("span",{className:de("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[u.jsx("span",{children:"Made with"}),u.jsx(VA,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),u.jsx("span",{children:"by Robert Wang"}),u.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:u.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:u.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"})})})]}),u.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:de("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?u.jsx(h4,{}):u.jsx(m4,{})})]})}function Y$({className:e}){return u.jsxs("div",{className:de("min-w-0",e),children:[u.jsxs("div",{className:"flex items-baseline gap-1.5",children:[u.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),u.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.41"]})]}),u.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function X$({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),[l,c]=E.useState(null),[h,m]=E.useState(null),[f,g]=E.useState(!0),{error:_,success:v}=Ii(),[x,y]=E.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),w=E.useCallback(async(N={})=>{N.silent||g(!0),m(null);try{a(await OM()),N.notify&&v("Dashboard refreshed.")}catch(T){const A=T instanceof Error?T.message:String(T);m(A),_(A)}finally{g(!1)}},[_,v]);E.useEffect(()=>{w()},[w]),E.useEffect(()=>{function N(){document.visibilityState==="visible"&&w({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,w]),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 C=E.useMemo(()=>s?Object.values(s.runtime.services).filter(N=>N.state==="running").length:0,[s]);return u.jsx(u7,{children:u.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[u.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[u.jsxs("aside",{className:V$(x),children:[u.jsxs("div",{className:de("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:[u.jsx("div",{className:"flex size-12 items-center justify-center",children:u.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground",children:u.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:[u.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"}),u.jsx("path",{d:"M22 31L30 39L22 47",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4.5"}),u.jsx("path",{d:"M36 47H48",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeWidth:"4.5"})]})})}),u.jsx(Y$,{className:de("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",x?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),u.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[u.jsx(Po,{active:t==="services",badge:C,docked:x,icon:u.jsx(j4,{}),label:"Services",onClick:()=>i("services")}),u.jsx(Po,{active:t==="git",docked:x,icon:u.jsx(Mc,{}),label:"Git Review",onClick:()=>i("git")}),u.jsx(Po,{active:t==="errors",docked:x,icon:u.jsx(vg,{}),label:"Error Inbox",onClick:()=>i("errors")}),u.jsx(Po,{active:t==="database",docked:x,icon:u.jsx(Kr,{}),label:"Database",onClick:()=>i("database")}),u.jsx(Po,{active:t==="terminal",docked:x,icon:u.jsx(H4,{}),label:"Terminal",onClick:()=>i("terminal")}),u.jsx(Po,{active:t==="agent",docked:x,icon:u.jsx(Zd,{}),label:"Agent",onClick:()=>i("agent")})]}),u.jsx(W$,{docked:x,onToggleDock:()=>y(N=>!N)})]}),u.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[u.jsxs("header",{className:de("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(g4,{className:"size-4 text-muted-foreground md:hidden"}),u.jsxs("div",{children:[u.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"}),u.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s?.git.selectedRepository?.name??s?.git.cwd??"Local workspace"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[h?u.jsx(Ke,{variant:"danger",children:h}):null,s&&t==="git"?u.jsx(B$,{data:s,onRefresh:w}):null,u.jsxs(he,{onClick:()=>{w({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[u.jsx(kh,{className:de(f&&"animate-spin")}),"Refresh"]}),u.jsx($$,{})]})]}),s?u.jsx(qI,{data:s,onOpenService:N=>{c(N),i("services"),w({silent:!0})}}):null,f&&!s?u.jsx(dt,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,u.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[s&&t==="services"?u.jsx(FI,{data:s,onRefresh:w,focusService:l,onServiceFocused:()=>c(null)}):null,s&&t==="git"?u.jsx(D$,{data:s}):null,t==="agent"?u.jsx(l7,{}):null,t==="errors"?u.jsx(oL,{}):null,t==="database"?u.jsx(iL,{}):null,t==="terminal"?u.jsx(ZI,{}):null]})]})]}),s&&t==="git"?u.jsx(U$,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:w}):null,u.jsx(L7,{onOpenAgentPage:t==="agent"?void 0:()=>i("agent"),onOpenService:N=>{c(N),i("services"),w({silent:!0})}})]})})}function Po({active:e,badge:t,docked:i,icon:s,label:a,onClick:l}){const c=t!==void 0&&t>0;return u.jsxs(he,{"aria-label":a,title:a,className:q$(e,i),variant:"ghost",onClick:l,type:"button",children:[u.jsx("span",{className:G$(i),children:s}),u.jsx("span",{className:K$(i,c),children:a}),t!==void 0&&t>0?u.jsx(Ke,{appearance:t>0?"solid":"outline",className:de("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground":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]})}$2.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(X$,{})}));export{u as j,E as r};