nomoreide 0.1.40 → 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.
@@ -0,0 +1,145 @@
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 CT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},sc={};var Tx;function kT(){if(Tx)return sc;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 sc.Fragment=t,sc.jsx=i,sc.jsxs=i,sc}var Ax;function NT(){return Ax||(Ax=1,Fm.exports=kT()),Fm.exports}var u=NT(),$m={exports:{}},Fe={};var Mx;function TT(){if(Mx)return Fe;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,Y,ue){this.props=D,this.context=Y,this.refs=C,this.updater=ue||y}N.prototype.isReactComponent={},N.prototype.setState=function(D,Y){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,Y,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=N.prototype;function R(D,Y,ue){this.props=D,this.context=Y,this.refs=C,this.updater=ue||y}var A=R.prototype=new T;A.constructor=R,w(A,N.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function F(){}var j={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function H(D,Y,ue){var te=ue.ref;return{$$typeof:e,type:D,key:Y,ref:te!==void 0?te:null,props:ue}}function U(D,Y){return H(D.type,Y,D.props)}function V(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ee(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ue){return Y[ue]})}var K=/\/+/g;function Z(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?ee(""+D.key):Y.toString(36)}function q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(F,F):(D.status="pending",D.then(function(Y){D.status==="pending"&&(D.status="fulfilled",D.value=Y)},function(Y){D.status==="pending"&&(D.status="rejected",D.reason=Y)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function O(D,Y,ue,te,re){var me=typeof D;(me==="undefined"||me==="boolean")&&(D=null);var xe=!1;if(D===null)xe=!0;else switch(me){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(D.$$typeof){case e:case t:xe=!0;break;case g:return xe=D._init,O(xe(D._payload),Y,ue,te,re)}}if(xe)return re=re(D),xe=te===""?"."+Z(D,0):te,L(re)?(ue="",xe!=null&&(ue=xe.replace(K,"$&/")+"/"),O(re,Y,ue,"",function(pe){return pe})):re!=null&&(V(re)&&(re=U(re,ue+(re.key==null||D&&D.key===re.key?"":(""+re.key).replace(K,"$&/")+"/")+xe)),Y.push(re)),1;xe=0;var Oe=te===""?".":te+":";if(L(D))for(var ye=0;ye<D.length;ye++)te=D[ye],me=Oe+Z(te,ye),xe+=O(te,Y,ue,me,re);else if(ye=x(D),typeof ye=="function")for(D=ye.call(D),ye=0;!(te=D.next()).done;)te=te.value,me=Oe+Z(te,ye++),xe+=O(te,Y,ue,me,re);else if(me==="object"){if(typeof D.then=="function")return O(q(D),Y,ue,te,re);throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return xe}function W(D,Y,ue){if(D==null)return D;var te=[],re=0;return O(D,te,"","",function(me){return Y.call(ue,me,re++)}),te}function X(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.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=Y)}if(D._status===1)return D._result.default;throw D._result}var $=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},I={map:W,forEach:function(D,Y,ue){W(D,function(){Y.apply(this,arguments)},ue)},count:function(D){var Y=0;return W(D,function(){Y++}),Y},toArray:function(D){return W(D,function(Y){return Y})||[]},only:function(D){if(!V(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Fe.Activity=_,Fe.Children=I,Fe.Component=N,Fe.Fragment=i,Fe.Profiler=a,Fe.PureComponent=R,Fe.StrictMode=s,Fe.Suspense=m,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(D){return j.H.useMemoCache(D)}},Fe.cache=function(D){return function(){return D.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(D,Y,ue){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var te=w({},D.props),re=D.key;if(Y!=null)for(me in Y.key!==void 0&&(re=""+Y.key),Y)!M.call(Y,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&Y.ref===void 0||(te[me]=Y[me]);var me=arguments.length-2;if(me===1)te.children=ue;else if(1<me){for(var xe=Array(me),Oe=0;Oe<me;Oe++)xe[Oe]=arguments[Oe+2];te.children=xe}return H(D.type,re,te)},Fe.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},Fe.createElement=function(D,Y,ue){var te,re={},me=null;if(Y!=null)for(te in Y.key!==void 0&&(me=""+Y.key),Y)M.call(Y,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(re[te]=Y[te]);var xe=arguments.length-2;if(xe===1)re.children=ue;else if(1<xe){for(var Oe=Array(xe),ye=0;ye<xe;ye++)Oe[ye]=arguments[ye+2];re.children=Oe}if(D&&D.defaultProps)for(te in xe=D.defaultProps,xe)re[te]===void 0&&(re[te]=xe[te]);return H(D,me,re)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(D){return{$$typeof:h,render:D}},Fe.isValidElement=V,Fe.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:X}},Fe.memo=function(D,Y){return{$$typeof:f,type:D,compare:Y===void 0?null:Y}},Fe.startTransition=function(D){var Y=j.T,ue={};j.T=ue;try{var te=D(),re=j.S;re!==null&&re(ue,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(F,$)}catch(me){$(me)}finally{Y!==null&&ue.types!==null&&(Y.types=ue.types),j.T=Y}},Fe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Fe.use=function(D){return j.H.use(D)},Fe.useActionState=function(D,Y,ue){return j.H.useActionState(D,Y,ue)},Fe.useCallback=function(D,Y){return j.H.useCallback(D,Y)},Fe.useContext=function(D){return j.H.useContext(D)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(D,Y){return j.H.useDeferredValue(D,Y)},Fe.useEffect=function(D,Y){return j.H.useEffect(D,Y)},Fe.useEffectEvent=function(D){return j.H.useEffectEvent(D)},Fe.useId=function(){return j.H.useId()},Fe.useImperativeHandle=function(D,Y,ue){return j.H.useImperativeHandle(D,Y,ue)},Fe.useInsertionEffect=function(D,Y){return j.H.useInsertionEffect(D,Y)},Fe.useLayoutEffect=function(D,Y){return j.H.useLayoutEffect(D,Y)},Fe.useMemo=function(D,Y){return j.H.useMemo(D,Y)},Fe.useOptimistic=function(D,Y){return j.H.useOptimistic(D,Y)},Fe.useReducer=function(D,Y,ue){return j.H.useReducer(D,Y,ue)},Fe.useRef=function(D){return j.H.useRef(D)},Fe.useState=function(D){return j.H.useState(D)},Fe.useSyncExternalStore=function(D,Y,ue){return j.H.useSyncExternalStore(D,Y,ue)},Fe.useTransition=function(){return j.H.useTransition()},Fe.version="19.2.6",Fe}var Rx;function U0(){return Rx||(Rx=1,$m.exports=TT()),$m.exports}var E=U0(),Vm={exports:{}},rc={},qm={exports:{}},Gm={};var Dx;function AT(){return Dx||(Dx=1,(function(e){function t(O,W){var X=O.length;O.push(W);e:for(;0<X;){var $=X-1>>>1,I=O[$];if(0<a(I,W))O[$]=W,O[X]=I,X=$;else break e}}function i(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var W=O[0],X=O.pop();if(X!==W){O[0]=X;e:for(var $=0,I=O.length,D=I>>>1;$<D;){var Y=2*($+1)-1,ue=O[Y],te=Y+1,re=O[te];if(0>a(ue,X))te<I&&0>a(re,ue)?(O[$]=re,O[te]=X,$=te):(O[$]=ue,O[Y]=X,$=Y);else if(te<I&&0>a(re,X))O[$]=re,O[te]=X,$=te;else break e}}return W}function a(O,W){var X=O.sortIndex-W.sortIndex;return X!==0?X:O.id-W.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,R=typeof setImmediate<"u"?setImmediate:null;function A(O){for(var W=i(f);W!==null;){if(W.callback===null)s(f);else if(W.startTime<=O)s(f),W.sortIndex=W.expirationTime,t(m,W);else break;W=i(f)}}function L(O){if(w=!1,A(O),!y)if(i(m)!==null)y=!0,F||(F=!0,ee());else{var W=i(f);W!==null&&q(L,W.startTime-O)}}var F=!1,j=-1,M=5,H=-1;function U(){return C?!0:!(e.unstable_now()-H<M)}function V(){if(C=!1,F){var O=e.unstable_now();H=O;var W=!0;try{e:{y=!1,w&&(w=!1,T(j),j=-1),x=!0;var X=v;try{t:{for(A(O),_=i(m);_!==null&&!(_.expirationTime>O&&U());){var $=_.callback;if(typeof $=="function"){_.callback=null,v=_.priorityLevel;var I=$(_.expirationTime<=O);if(O=e.unstable_now(),typeof I=="function"){_.callback=I,A(O),W=!0;break t}_===i(m)&&s(m),A(O)}else s(m);_=i(m)}if(_!==null)W=!0;else{var D=i(f);D!==null&&q(L,D.startTime-O),W=!1}}break e}finally{_=null,v=X,x=!1}W=void 0}}finally{W?ee():F=!1}}}var ee;if(typeof R=="function")ee=function(){R(V)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Z=K.port2;K.port1.onmessage=V,ee=function(){Z.postMessage(null)}}else ee=function(){N(V,0)};function q(O,W){j=N(function(){O(e.unstable_now())},W)}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"):M=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 W=3;break;default:W=v}var X=v;v=W;try{return O()}finally{v=X}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,W){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var X=v;v=O;try{return W()}finally{v=X}},e.unstable_scheduleCallback=function(O,W,X){var $=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?$+X:$):X=$,O){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=X+I,O={id:g++,callback:W,priorityLevel:O,startTime:X,expirationTime:I,sortIndex:-1},X>$?(O.sortIndex=X,t(f,O),i(m)===null&&O===i(f)&&(w?(T(j),j=-1):w=!0,q(L,X-$))):(O.sortIndex=I,t(m,O),y||x||(y=!0,F||(F=!0,ee()))),O},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(O){var W=v;return function(){var X=v;v=W;try{return O.apply(this,arguments)}finally{v=X}}}})(Gm)),Gm}var Ox;function MT(){return Ox||(Ox=1,qm.exports=AT()),qm.exports}var Km={exports:{}},ji={};var jx;function RT(){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 $2(){if(Lx)return Km.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(),Km.exports=RT(),Km.exports}var Bx;function DT(){if(Bx)return rc;Bx=1;var e=MT(),t=U0(),i=$2();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"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function ee(n){return n===null||typeof n!="object"?null:(n=V&&n[V]||n["@@iterator"],typeof n=="function"?n:null)}var K=Symbol.for("react.client.reference");function Z(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===K?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case w:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case F:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case y:return"Portal";case R:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case A:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case j:return r=n.displayName||null,r!==null?r:Z(n.type)||"Memo";case M:r=n._payload,n=n._init;try{return Z(n(r))}catch{}}return null}var q=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},$=[],I=-1;function D(n){return{current:n}}function Y(n){0>I||(n.current=$[I],$[I]=null,I--)}function ue(n,r){I++,$[I]=n.current,n.current=r}var te=D(null),re=D(null),me=D(null),xe=D(null);function Oe(n,r){switch(ue(me,r),ue(re,n),ue(te,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}}Y(te),ue(te,n)}function ye(){Y(te),Y(re),Y(me)}function pe(n){n.memoizedState!==null&&ue(xe,n);var r=te.current,o=Q1(r,n.type);r!==o&&(ue(re,n),ue(te,o))}function Pe(n){re.current===n&&(Y(te),Y(re)),xe.current===n&&(Y(xe),ec._currentValue=X)}var st,Ie;function Ft(n){if(st===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);st=r&&r[1]||"",Ie=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+st+n+Ie}var ta=!1;function vs(n,r){if(!n||ta)return"";ta=!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 ie=ne}Reflect.construct(n,[],le)}else{try{le.call()}catch(ne){ie=ne}n.call(le.prototype)}}else{try{throw Error()}catch(ne){ie=ne}(le=n())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&ie&&typeof ne.stack=="string")return[ne.stack,ie.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 B=S.split(`
4
+ `),J=k.split(`
5
+ `);for(p=d=0;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;for(;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;if(d===B.length||p===J.length)for(d=B.length-1,p=J.length-1;1<=d&&0<=p&&B[d]!==J[p];)p--;for(;1<=d&&0<=p;d--,p--)if(B[d]!==J[p]){if(d!==1||p!==1)do if(d--,p--,0>p||B[d]!==J[p]){var se=`
6
+ `+B[d].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),se}while(1<=d&&0<=p);break}}}finally{ta=!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 ia(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 na=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,xs=e.unstable_cancelCallback,ll=e.unstable_shouldYield,Wa=e.unstable_requestPaint,Ot=e.unstable_now,ys=e.unstable_getCurrentPriorityLevel,xi=e.unstable_ImmediatePriority,Ss=e.unstable_UserBlockingPriority,ws=e.unstable_NormalPriority,Ya=e.unstable_LowPriority,ar=e.unstable_IdlePriority,cl=e.log,Xa=e.unstable_setDisableYieldValue,Es=null,fi=null;function wn(n){if(typeof cl=="function"&&Xa(n),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(Es,n)}catch{}}var yi=Math.clz32?Math.clz32:Za,ul=Math.log,sa=Math.LN2;function Za(n){return n>>>=0,n===0?32:31-(ul(n)/sa|0)|0}var rt=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 z(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 ve(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){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 Te(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,B=n.expirationTimes,J=n.hiddenUpdates;for(o=S&~o;0<o;){var se=31-yi(o),le=1<<se;k[se]=0,B[se]=-1;var ie=J[se];if(ie!==null)for(J[se]=null,se=0;se<ie.length;se++){var ne=ie[se];ne!==null&&(ne.lane&=-536870913)}o&=~le}d!==0&&we(n,d,0),b!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=b&~(S&~r))}function we(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 ze(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 Qa(){var n=W.p;return n!==0?n:(n=window.event,n===void 0?32:yx(n.type))}function Ja(n,r){var o=W.p;try{return W.p=n,r()}finally{W.p=o}}var ts=Math.random().toString(36).slice(2),Vt="__reactFiber$"+ts,Di="__reactProps$"+ts,or="__reactContainer$"+ts,dl="__reactEvents$"+ts,ru="__reactListeners$"+ts,eo="__reactHandles$"+ts,au="__reactResources$"+ts,ra="__reactMarker$"+ts;function hl(n){delete n[Vt],delete n[Di],delete n[dl],delete n[ru],delete n[eo]}function Ui(n){var r=n[Vt];if(r)return r;for(var o=n.parentNode;o;){if(r=o[or]||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[or]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function lr(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function cr(n){var r=n[au];return r||(r=n[au]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Yt(n){n[ra]=!0}var ou=new Set,aa={};function Ns(n,r){fe(n,r),fe(n+"Capture",r)}function fe(n,r){for(aa[n]=r,n=0;n<r.length;n++)ou.add(r[n])}var Re=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ze={},ht={};function qt(n){return na.call(ht,n)?!0:na.call(Ze,n)?!1:Re.test(n)?ht[n]=!0:(Ze[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 to(n){if(!n._valueTracker){var r=un(n)?"checked":"value";n._valueTracker=lu(n,r,""+n[r])}}function fl(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 io(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 ml(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?no(n,S,Et(r)):o!=null?no(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 oa(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)){to(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),to(n)}function no(n,r,o){r==="number"&&io(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 so(n,r,o,d){if(r==null){if(d!=null){if(o!=null)throw Error(s(92));if(q(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),to(n)}function Be(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 ur(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"]]),pl=/^[\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 dr(n){return pl.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function _e(){}var Ae=null;function $e(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var et=null,jt=null;function En(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(ml(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));ml(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&&fl(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 gl=!1;function du(n,r,o){if(gl)return n(r,o);gl=!0;try{var d=n(r);return d}finally{if(gl=!1,(et!==null||jt!==null)&&(Qu(),et&&(r=et,n=jt,jt=et=null,En(r),n)))for(r=0;r<n.length;r++)En(n[r])}}function _l(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 bl={};Object.defineProperty(bl,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Hh=!1}var hr=null,Fh=null,hu=null;function Q_(){if(hu)return hu;var n,r=Fh,o=r.length,d,p="value"in hr?hr.value:hr.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 la={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pu=Qi(la),vl=_({},la,{view:0,detail:0}),w3=Qi(vl),$h,Vh,xl,gu=_({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gh,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!==xl&&(xl&&n.type==="mousemove"?($h=n.screenX-xl.screenX,Vh=n.screenY-xl.screenY):Vh=$h=0,xl=n),$h)},movementY:function(n){return"movementY"in n?n.movementY:Vh}}),eb=Qi(gu),E3=_({},gu,{dataTransfer:0}),C3=Qi(E3),k3=_({},vl,{relatedTarget:0}),qh=Qi(k3),N3=_({},la,{animationName:0,elapsedTime:0,pseudoElement:0}),T3=Qi(N3),A3=_({},la,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),M3=Qi(A3),R3=_({},la,{data:0}),tb=Qi(R3),D3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O3={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"},j3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L3(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=j3[n])?!!r[n]:!1}function Gh(){return L3}var B3=_({},vl,{key:function(n){if(n.key){var r=D3[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"?O3[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gh,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}}),z3=Qi(B3),I3=_({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ib=Qi(I3),P3=_({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gh}),U3=Qi(P3),H3=_({},la,{propertyName:0,elapsedTime:0,pseudoElement:0}),F3=Qi(H3),$3=_({},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}),V3=Qi($3),q3=_({},la,{newState:0,oldState:0}),G3=Qi(q3),K3=[9,13,27,32],Kh=As&&"CompositionEvent"in window,yl=null;As&&"documentMode"in document&&(yl=document.documentMode);var W3=As&&"TextEvent"in window&&!yl,nb=As&&(!Kh||yl&&8<yl&&11>=yl),sb=" ",rb=!1;function ab(n,r){switch(n){case"keyup":return K3.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 ro=!1;function Y3(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 X3(n,r){if(ro)return n==="compositionend"||!Kh&&ab(n,r)?(n=Q_(),hu=Fh=hr=null,ro=!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 Z3={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"?!!Z3[n.type]:r==="textarea"}function cb(n,r,o,d){et?jt?jt.push(d):jt=[d]:et=d,r=rd(r,"onChange"),0<r.length&&(o=new pu("onChange","change",null,o,d),n.push({event:o,listeners:r}))}var Sl=null,wl=null;function Q3(n){q1(n,0)}function _u(n){var r=lr(n);if(fl(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(){Sl&&(Sl.detachEvent("onpropertychange",mb),wl=Sl=null)}function mb(n){if(n.propertyName==="value"&&_u(wl)){var r=[];cb(r,wl,n,$e(n)),du(Q3,r)}}function J3(n,r,o){n==="focusin"?(fb(),Sl=r,wl=o,Sl.attachEvent("onpropertychange",mb)):n==="focusout"&&fb()}function e5(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return _u(wl)}function t5(n,r){if(n==="click")return _u(r)}function i5(n,r){if(n==="input"||n==="change")return _u(r)}function n5(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var dn=typeof Object.is=="function"?Object.is:n5;function El(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(!na.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=io(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=io(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 s5=As&&"documentMode"in document&&11>=document.documentMode,ao=null,Zh=null,Cl=null,Qh=!1;function vb(n,r,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Qh||ao==null||ao!==io(d)||(d=ao,"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}),Cl&&El(Cl,d)||(Cl=d,d=rd(Zh,"onSelect"),0<d.length&&(r=new pu("onSelect","select",null,r,o),n.push({event:r,listeners:d}),r.target=ao)))}function ca(n,r){var o={};return o[n.toLowerCase()]=r.toLowerCase(),o["Webkit"+n]="webkit"+r,o["Moz"+n]="moz"+r,o}var oo={animationend:ca("Animation","AnimationEnd"),animationiteration:ca("Animation","AnimationIteration"),animationstart:ca("Animation","AnimationStart"),transitionrun:ca("Transition","TransitionRun"),transitionstart:ca("Transition","TransitionStart"),transitioncancel:ca("Transition","TransitionCancel"),transitionend:ca("Transition","TransitionEnd")},Jh={},xb={};As&&(xb=document.createElement("div").style,"AnimationEvent"in window||(delete oo.animationend.animation,delete oo.animationiteration.animation,delete oo.animationstart.animation),"TransitionEvent"in window||delete oo.transitionend.transition);function ua(n){if(Jh[n])return Jh[n];if(!oo[n])return n;var r=oo[n],o;for(o in r)if(r.hasOwnProperty(o)&&o in xb)return Jh[n]=r[o];return n}var yb=ua("animationend"),Sb=ua("animationiteration"),wb=ua("animationstart"),r5=ua("transitionrun"),a5=ua("transitionstart"),o5=ua("transitioncancel"),Eb=ua("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 Gn(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)},Cn=[],lo=0,tf=0;function vu(){for(var n=lo,r=tf=lo=0;r<n;){var o=Cn[r];Cn[r++]=null;var d=Cn[r];Cn[r++]=null;var p=Cn[r];Cn[r++]=null;var b=Cn[r];if(Cn[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){Cn[lo++]=n,Cn[lo++]=r,Cn[lo++]=o,Cn[lo++]=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 da(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 co={};function l5(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 l5(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=fT(n,o,te.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 ha(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 F:return n=hn(19,o,r,p),n.elementType=F,n.lanes=b,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:S=10;break e;case T:S=9;break e;case A:S=11;break e;case j:S=14;break e;case M: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 ha(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 kn(n,r){if(typeof n=="object"&&n!==null){var o=Ab.get(n);return o!==void 0?o:(r={value:n,source:r,stack:ia(r)},Ab.set(n,r),r)}return{value:n,source:r,stack:ia(r)}}var uo=[],ho=0,wu=null,kl=0,Nn=[],Tn=0,fr=null,is=1,ns="";function Rs(n,r){uo[ho++]=kl,uo[ho++]=wu,wu=n,kl=r}function Mb(n,r,o){Nn[Tn++]=is,Nn[Tn++]=ns,Nn[Tn++]=fr,fr=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=uo[--ho],uo[ho]=null,kl=uo[--ho],uo[ho]=null;for(;n===fr;)fr=Nn[--Tn],Nn[Tn]=null,ns=Nn[--Tn],Nn[Tn]=null,is=Nn[--Tn],Nn[Tn]=null}function Rb(n,r){Nn[Tn++]=is,Nn[Tn++]=ns,Nn[Tn++]=fr,is=r.id,ns=r.overflow,fr=n}var wi=null,kt=null,nt=!1,mr=null,An=!1,cf=Error(s(519));function pr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nl(kn(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":Je("cancel",r),Je("close",r);break;case"iframe":case"object":case"embed":Je("load",r);break;case"video":case"audio":for(o=0;o<Yl.length;o++)Je(Yl[o],r);break;case"source":Je("error",r);break;case"img":case"image":case"link":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"input":Je("invalid",r),oa(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",r);break;case"textarea":Je("invalid",r),so(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&&(Je("beforetoggle",r),Je("toggle",r)),d.onScroll!=null&&Je("scroll",r),d.onScrollEnd!=null&&Je("scrollend",r),d.onClick!=null&&(r.onclick=_e),r=!0):r=!1,r||pr(n,!0)}function Ob(n){for(wi=n.return;wi;)switch(wi.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:wi=wi.return}}function fo(n){if(n!==wi)return!1;if(!nt)return Ob(n),nt=!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&&pr(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,Ar(n.type)?(n=Dm,Dm=null,kt=n):kt=r):kt=wi?Rn(n.stateNode.nextSibling):null;return!0}function fa(){kt=wi=null,nt=!1}function uf(){var n=mr;return n!==null&&(nn===null?nn=n:nn.push.apply(nn,n),mr=null),n}function Nl(n){mr===null?mr=[n]:mr.push(n)}var df=D(null),ma=null,Ds=null;function gr(n,r,o){ue(df,r._currentValue),r._currentValue=o}function Os(n){n._currentValue=df.current,Y(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 B=0;B<r.length;B++)if(k.context===r[B]){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 mo(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===xe.current){if(S=p.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(ec):n=[ec])}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 pa(n){ma=n,Ds=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ei(n){return jb(ma,n)}function Cu(n,r){return ma===null&&pa(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 c5=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()})}},u5=e.unstable_scheduleCallback,d5=e.unstable_NormalPriority,Zt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new c5,data:new Map,refCount:0}}function Tl(n){n.refCount--,n.refCount===0&&u5(d5,function(){n.controller.abort()})}var Al=null,pf=0,po=0,go=null;function h5(n,r){if(Al===null){var o=Al=[];pf=0,po=bm(),go={status:"pending",value:void 0,then:function(d){o.push(d)}}}return pf++,r.then(Lb,Lb),r}function Lb(){if(--pf===0&&Al!==null){go!==null&&(go.status="fulfilled");var n=Al;Al=null,po=0,go=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function f5(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"&&h5(n,r),Bb!==null&&Bb(n,r)};var ga=D(null);function gf(){var n=ga.current;return n!==null?n:St.pooledCache}function ku(n,r){r===null?ue(ga,ga.current):ue(ga,r.pool)}function zb(){var n=gf();return n===null?null:{parent:Zt._currentValue,pool:n}}var _o=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(_e,_e),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(_e,_e);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 ba=r,_o}}function _a(n){try{var r=n._init;return r(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ba=o,_o):o}}var ba=null;function Ub(){if(ba===null)throw Error(s(459));var n=ba;return ba=null,n}function Hb(n){if(n===_o||n===Nu)throw Error(s(483))}var bo=null,Ml=0;function Au(n){var r=Ml;return Ml+=1,bo===null&&(bo=[]),Pb(bo,n,r)}function Rl(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,P){if(n){var Q=G.deletions;Q===null?(G.deletions=[P],G.flags|=16):Q.push(P)}}function o(G,P){if(!n)return null;for(;P!==null;)r(G,P),P=P.sibling;return null}function d(G){for(var P=new Map;G!==null;)G.key!==null?P.set(G.key,G):P.set(G.index,G),G=G.sibling;return P}function p(G,P){return G=Ms(G,P),G.index=0,G.sibling=null,G}function b(G,P,Q){return G.index=Q,n?(Q=G.alternate,Q!==null?(Q=Q.index,Q<P?(G.flags|=67108866,P):Q):(G.flags|=67108866,P)):(G.flags|=1048576,P)}function S(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function k(G,P,Q,oe){return P===null||P.tag!==6?(P=rf(Q,G.mode,oe),P.return=G,P):(P=p(P,Q),P.return=G,P)}function B(G,P,Q,oe){var je=Q.type;return je===w?se(G,P,Q.props.children,oe,Q.key):P!==null&&(P.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===M&&_a(je)===P.type)?(P=p(P,Q.props),Rl(P,Q),P.return=G,P):(P=Su(Q.type,Q.key,Q.props,null,G.mode,oe),Rl(P,Q),P.return=G,P)}function J(G,P,Q,oe){return P===null||P.tag!==4||P.stateNode.containerInfo!==Q.containerInfo||P.stateNode.implementation!==Q.implementation?(P=af(Q,G.mode,oe),P.return=G,P):(P=p(P,Q.children||[]),P.return=G,P)}function se(G,P,Q,oe,je){return P===null||P.tag!==7?(P=ha(Q,G.mode,oe,je),P.return=G,P):(P=p(P,Q),P.return=G,P)}function le(G,P,Q){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=rf(""+P,G.mode,Q),P.return=G,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case x:return Q=Su(P.type,P.key,P.props,null,G.mode,Q),Rl(Q,P),Q.return=G,Q;case y:return P=af(P,G.mode,Q),P.return=G,P;case M:return P=_a(P),le(G,P,Q)}if(q(P)||ee(P))return P=ha(P,G.mode,Q,null),P.return=G,P;if(typeof P.then=="function")return le(G,Au(P),Q);if(P.$$typeof===R)return le(G,Cu(G,P),Q);Mu(G,P)}return null}function ie(G,P,Q,oe){var je=P!==null?P.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return je!==null?null:k(G,P,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return Q.key===je?B(G,P,Q,oe):null;case y:return Q.key===je?J(G,P,Q,oe):null;case M:return Q=_a(Q),ie(G,P,Q,oe)}if(q(Q)||ee(Q))return je!==null?null:se(G,P,Q,oe,null);if(typeof Q.then=="function")return ie(G,P,Au(Q),oe);if(Q.$$typeof===R)return ie(G,P,Cu(G,Q),oe);Mu(G,Q)}return null}function ne(G,P,Q,oe,je){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return G=G.get(Q)||null,k(P,G,""+oe,je);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return G=G.get(oe.key===null?Q:oe.key)||null,B(P,G,oe,je);case y:return G=G.get(oe.key===null?Q:oe.key)||null,J(P,G,oe,je);case M:return oe=_a(oe),ne(G,P,Q,oe,je)}if(q(oe)||ee(oe))return G=G.get(Q)||null,se(P,G,oe,je,null);if(typeof oe.then=="function")return ne(G,P,Q,Au(oe),je);if(oe.$$typeof===R)return ne(G,P,Q,Cu(P,oe),je);Mu(P,oe)}return null}function ke(G,P,Q,oe){for(var je=null,ot=null,Me=P,qe=P=0,it=null;Me!==null&&qe<Q.length;qe++){Me.index>qe?(it=Me,Me=null):it=Me.sibling;var lt=ie(G,Me,Q[qe],oe);if(lt===null){Me===null&&(Me=it);break}n&&Me&&lt.alternate===null&&r(G,Me),P=b(lt,P,qe),ot===null?je=lt:ot.sibling=lt,ot=lt,Me=it}if(qe===Q.length)return o(G,Me),nt&&Rs(G,qe),je;if(Me===null){for(;qe<Q.length;qe++)Me=le(G,Q[qe],oe),Me!==null&&(P=b(Me,P,qe),ot===null?je=Me:ot.sibling=Me,ot=Me);return nt&&Rs(G,qe),je}for(Me=d(Me);qe<Q.length;qe++)it=ne(Me,G,qe,Q[qe],oe),it!==null&&(n&&it.alternate!==null&&Me.delete(it.key===null?qe:it.key),P=b(it,P,qe),ot===null?je=it:ot.sibling=it,ot=it);return n&&Me.forEach(function(jr){return r(G,jr)}),nt&&Rs(G,qe),je}function Le(G,P,Q,oe){if(Q==null)throw Error(s(151));for(var je=null,ot=null,Me=P,qe=P=0,it=null,lt=Q.next();Me!==null&&!lt.done;qe++,lt=Q.next()){Me.index>qe?(it=Me,Me=null):it=Me.sibling;var jr=ie(G,Me,lt.value,oe);if(jr===null){Me===null&&(Me=it);break}n&&Me&&jr.alternate===null&&r(G,Me),P=b(jr,P,qe),ot===null?je=jr:ot.sibling=jr,ot=jr,Me=it}if(lt.done)return o(G,Me),nt&&Rs(G,qe),je;if(Me===null){for(;!lt.done;qe++,lt=Q.next())lt=le(G,lt.value,oe),lt!==null&&(P=b(lt,P,qe),ot===null?je=lt:ot.sibling=lt,ot=lt);return nt&&Rs(G,qe),je}for(Me=d(Me);!lt.done;qe++,lt=Q.next())lt=ne(Me,G,qe,lt.value,oe),lt!==null&&(n&&lt.alternate!==null&&Me.delete(lt.key===null?qe:lt.key),P=b(lt,P,qe),ot===null?je=lt:ot.sibling=lt,ot=lt);return n&&Me.forEach(function(ET){return r(G,ET)}),nt&&Rs(G,qe),je}function vt(G,P,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===w&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:e:{for(var je=Q.key;P!==null;){if(P.key===je){if(je=Q.type,je===w){if(P.tag===7){o(G,P.sibling),oe=p(P,Q.props.children),oe.return=G,G=oe;break e}}else if(P.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===M&&_a(je)===P.type){o(G,P.sibling),oe=p(P,Q.props),Rl(oe,Q),oe.return=G,G=oe;break e}o(G,P);break}else r(G,P);P=P.sibling}Q.type===w?(oe=ha(Q.props.children,G.mode,oe,Q.key),oe.return=G,G=oe):(oe=Su(Q.type,Q.key,Q.props,null,G.mode,oe),Rl(oe,Q),oe.return=G,G=oe)}return S(G);case y:e:{for(je=Q.key;P!==null;){if(P.key===je)if(P.tag===4&&P.stateNode.containerInfo===Q.containerInfo&&P.stateNode.implementation===Q.implementation){o(G,P.sibling),oe=p(P,Q.children||[]),oe.return=G,G=oe;break e}else{o(G,P);break}else r(G,P);P=P.sibling}oe=af(Q,G.mode,oe),oe.return=G,G=oe}return S(G);case M:return Q=_a(Q),vt(G,P,Q,oe)}if(q(Q))return ke(G,P,Q,oe);if(ee(Q)){if(je=ee(Q),typeof je!="function")throw Error(s(150));return Q=je.call(Q),Le(G,P,Q,oe)}if(typeof Q.then=="function")return vt(G,P,Au(Q),oe);if(Q.$$typeof===R)return vt(G,P,Cu(G,Q),oe);Mu(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,P!==null&&P.tag===6?(o(G,P.sibling),oe=p(P,Q),oe.return=G,G=oe):(o(G,P),oe=rf(Q,G.mode,oe),oe.return=G,G=oe),S(G)):o(G,P)}return function(G,P,Q,oe){try{Ml=0;var je=vt(G,P,Q,oe);return bo=null,je}catch(Me){if(Me===_o||Me===Nu)throw Me;var ot=hn(29,Me,null,G.mode);return ot.lanes=oe,ot.return=G,ot}}}var va=Fb(!0),$b=Fb(!1),_r=!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 br(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function vr(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 Dl(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,ze(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 Ol(){if(yf){var n=go;if(n!==null)throw n}}function jl(n,r,o,d){yf=!1;var p=n.updateQueue;_r=!1;var b=p.firstBaseUpdate,S=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var B=k,J=B.next;B.next=null,S===null?b=J:S.next=J,S=B;var se=n.alternate;se!==null&&(se=se.updateQueue,k=se.lastBaseUpdate,k!==S&&(k===null?se.firstBaseUpdate=J:k.next=J,se.lastBaseUpdate=B))}if(b!==null){var le=p.baseState;S=0,se=J=B=null,k=b;do{var ie=k.lane&-536870913,ne=ie!==k.lane;if(ne?(tt&ie)===ie:(d&ie)===ie){ie!==0&&ie===po&&(yf=!0),se!==null&&(se=se.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ke=n,Le=k;ie=r;var vt=o;switch(Le.tag){case 1:if(ke=Le.payload,typeof ke=="function"){le=ke.call(vt,le,ie);break e}le=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Le.payload,ie=typeof ke=="function"?ke.call(vt,le,ie):ke,ie==null)break e;le=_({},le,ie);break e;case 2:_r=!0}}ie=k.callback,ie!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[ie]:ne.push(ie))}else ne={lane:ie,tag:k.tag,payload:k.payload,callback:k.callback,next:null},se===null?(J=se=ne,B=le):se=se.next=ne,S|=ie;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);se===null&&(B=le),p.baseState=B,p.firstBaseUpdate=J,p.lastBaseUpdate=se,b===null&&(p.shared.lanes=0),Er|=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 vo=D(null),Ru=D(0);function Gb(n,r){n=Fs,ue(Ru,n),ue(vo,r),Fs=n|r.baseLanes}function Sf(){ue(Ru,Fs),ue(vo,vo.current)}function wf(){Fs=Ru.current,Y(vo),Y(Ru)}var fn=D(null),Mn=null;function xr(n){var r=n.alternate;ue(Gt,Gt.current&1),ue(fn,n),Mn===null&&(r===null||vo.current!==null||r.memoizedState!==null)&&(Mn=n)}function Ef(n){ue(Gt,Gt.current),ue(fn,n),Mn===null&&(Mn=n)}function Kb(n){n.tag===22?(ue(Gt,Gt.current),ue(fn,n),Mn===null&&(Mn=n)):yr()}function yr(){ue(Gt,Gt.current),ue(fn,fn.current)}function mn(n){Y(fn),Mn===n&&(Mn=null),Y(Gt)}var Gt=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,Ve=null,_t=null,Qt=null,Ou=!1,xo=!1,xa=!1,ju=0,Ll=0,yo=null,m5=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,Ve=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?Mv:Hf,xa=!1,b=o(d,p),xa=!1,xo&&(b=Yb(r,o,d,p)),Wb(n),b}function Wb(n){O.H=Il;var r=_t!==null&&_t.next!==null;if(js=0,Qt=_t=Ve=null,Ou=!1,Ll=0,yo=null,r)throw Error(s(300));n===null||Jt||(n=n.dependencies,n!==null&&Eu(n)&&(Jt=!0))}function Yb(n,r,o,d){Ve=n;var p=0;do{if(xo&&(yo=null),Ll=0,xo=!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(xo);return b}function p5(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?Bl(r):r,n=n.useState()[0],(_t!==null?_t.memoizedState:null)!==n&&(Ve.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=Ve=null,xo=!1,Ll=ju=0,yo=null}function Hi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Ve.memoizedState=Qt=n:Qt=Qt.next=n,Qt}function Kt(){if(_t===null){var n=Ve.alternate;n=n!==null?n.memoizedState:null}else n=_t.next;var r=Qt===null?Ve.memoizedState:Qt.next;if(r!==null)Qt=r,_t=n;else{if(n===null)throw Ve.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?Ve.memoizedState=Qt=n:Qt=Qt.next=n}return Qt}function Lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bl(n){var r=Ll;return Ll+=1,yo===null&&(yo=[]),n=Pb(yo,n,r),r=Ve,(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 Bl(n);if(n.$$typeof===R)return Ei(n)}throw Error(s(438,String(n)))}function Mf(n){var r=null,o=Ve.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var d=Ve.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(),Ve.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]=U;return r.index++,o}function Ls(n,r){return typeof r=="function"?r(n):r}function zu(n){var r=Kt();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,B=null,J=r,se=!1;do{var le=J.lane&-536870913;if(le!==J.lane?(tt&le)===le:(js&le)===le){var ie=J.revertLane;if(ie===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),le===po&&(se=!0);else if((js&ie)===ie){J=J.next,ie===po&&(se=!0);continue}else le={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},B===null?(k=B=le,S=b):B=B.next=le,Ve.lanes|=ie,Er|=ie;le=J.action,xa&&o(b,le),b=J.hasEagerState?J.eagerState:o(b,le)}else ie={lane:le,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},B===null?(k=B=ie,S=b):B=B.next=ie,Ve.lanes|=le,Er|=le;J=J.next}while(J!==null&&J!==r);if(B===null?S=b:B.next=k,!dn(b,n.memoizedState)&&(Jt=!0,se&&(o=go,o!==null)))throw o;n.memoizedState=b,n.baseState=S,n.baseQueue=B,d.lastRenderedState=b}return p===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function Df(n){var r=Kt(),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=Ve,p=Kt(),b=nt;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,So(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=Ve.updateQueue,r===null?(r=Lu(),Ve.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=da(n,2);r!==null&&sn(r,n,2)}function Of(n){var r=Hi();if(typeof n=="function"){var o=n;if(n=o(),xa){wn(!0);try{o()}finally{wn(!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 g5(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),B=O.S;B!==null&&B(S,k),sv(n,r,k)}catch(J){jf(n,r,J)}finally{b!==null&&S.types!==null&&(b.types=S.types),O.T=b}}else try{b=o(p,d),sv(n,r,b)}catch(J){jf(n,r,J)}}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(nt){var o=St.formState;if(o!==null){e:{var d=Ve;if(nt){if(kt){t:{for(var p=kt,b=An;p.nodeType!==8;){if(!b){p=null;break t}if(p=Rn(p.nextSibling),p===null){p=null;break t}}b=p.data,p=b==="F!"||b==="F"?p:null}if(p){kt=Rn(p.nextSibling),d=p.data==="F!";break e}}pr(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,Ve,d),d.dispatch=o,d=Of(!1),b=Uf.bind(null,Ve,!1,d.queue),d=Hi(),p={state:r,dispatch:null,action:n,pending:null},d.queue=p,o=g5.bind(null,Ve,p,b,o),p.dispatch=o,d.memoizedState=n,[r,o,!1]}function cv(n){var r=Kt();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=Bl(r)}catch(S){throw S===_o?Nu:S}else d=r;r=Kt();var p=r.queue,b=p.dispatch;return o!==r.memoizedState&&(Ve.flags|=2048,So(9,{destroy:void 0},_5.bind(null,p,o),null)),[d,b,n]}function _5(n,r){n.action=r}function dv(n){var r=Kt(),o=_t;if(o!==null)return uv(r,o,n);Kt(),r=r.memoizedState,o=Kt();var d=o.queue.dispatch;return o.memoizedState=n,[r,d,!1]}function So(n,r,o,d){return n={tag:n,create:o,deps:d,inst:r,next:null},r=Ve.updateQueue,r===null&&(r=Lu(),Ve.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 Kt().memoizedState}function Iu(n,r,o,d){var p=Hi();Ve.flags|=n,p.memoizedState=So(1|r,{destroy:void 0},o,d===void 0?null:d)}function Pu(n,r,o,d){var p=Kt();d=d===void 0?null:d;var b=p.memoizedState.inst;_t!==null&&d!==null&&Cf(d,_t.memoizedState.deps)?p.memoizedState=So(r,b,o,d):(Ve.flags|=n,p.memoizedState=So(1|r,b,o,d))}function fv(n,r){Iu(8390656,8,n,r)}function Lf(n,r){Pu(2048,8,n,r)}function b5(n){Ve.flags|=4;var r=Ve.updateQueue;if(r===null)r=Lu(),Ve.updateQueue=r,r.events=[n];else{var o=r.events;o===null?r.events=[n]:o.push(n)}}function mv(n){var r=Kt().memoizedState;return b5({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=Kt();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=Kt();r=r===void 0?null:r;var d=o.memoizedState;if(r!==null&&Cf(r,d[1]))return d[0];if(d=n(),xa){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[d,r],d}function zf(n,r,o){return o===void 0||(js&1073741824)!==0&&(tt&261930)===0?n.memoizedState=r:(n.memoizedState=o,n=y1(),Ve.lanes|=n,Er|=n,o)}function yv(n,r,o,d){return dn(o,r)?o:vo.current!==null?(n=zf(n,o,d),dn(n,r)||(Jt=!0),n):(js&42)===0||(js&1073741824)!==0&&(tt&261930)===0?(Jt=!0,n.memoizedState=o):(n=y1(),Ve.lanes|=n,Er|=n,r)}function Sv(n,r,o,d,p){var b=W.p;W.p=b!==0&&8>b?b:8;var S=O.T,k={};O.T=k,Uf(n,!1,r,o);try{var B=p(),J=O.S;if(J!==null&&J(k,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var se=f5(B,d);zl(n,r,se,_n(n))}else zl(n,r,d,_n(n))}catch(le){zl(n,r,{then:function(){},status:"rejected",reason:le},_n())}finally{W.p=b,S!==null&&k.types!==null&&(S.types=k.types),O.T=S}}function v5(){}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?v5: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),zl(n,r.next.queue,{},_n())}function Pf(){return Ei(ec)}function Cv(){return Kt().memoizedState}function kv(){return Kt().memoizedState}function x5(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var o=_n();n=br(o);var d=vr(r,n,o);d!==null&&(sn(d,r,o),Dl(d,r,o)),r={cache:mf()},n.payload=r;return}r=r.return}}function y5(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();zl(n,r,o,d)}function zl(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===Ve||r!==null&&r===Ve}function Tv(n,r){xo=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,ze(n,o)}}var Il={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};Il.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(xa){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[d,r],d},useReducer:function(n,r,o){var d=Hi();if(o!==void 0){var p=o(r);if(xa){wn(!0);try{o(r)}finally{wn(!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=y5.bind(null,Ve,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,Ve,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,Ve,n.queue,!0,!1),Hi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,o){var d=Ve,p=Hi();if(nt){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),St===null)throw Error(s(349));(tt&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,So(9,{destroy:void 0},Qb.bind(null,d,b,o,r),null),o},useId:function(){var n=Hi(),r=St.identifierPrefix;if(nt){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=m5++,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,Ve,!0,o),o.dispatch=r,[n,r]},useMemoCache:Mf,useCacheRefresh:function(){return Hi().memoizedState=x5.bind(null,Ve)},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=Kt();return yv(o,_t.memoizedState,n,r)},useTransition:function(){var n=zu(Ls)[0],r=Kt().memoizedState;return[typeof n=="boolean"?n:Bl(n),r]},useSyncExternalStore:Xb,useId:Cv,useHostTransitionStatus:Pf,useFormState:cv,useActionState:cv,useOptimistic:function(n,r){var o=Kt();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=Kt();return _t===null?zf(o,n,r):yv(o,_t.memoizedState,n,r)},useTransition:function(){var n=Df(Ls)[0],r=Kt().memoizedState;return[typeof n=="boolean"?n:Bl(n),r]},useSyncExternalStore:Xb,useId:Cv,useHostTransitionStatus:Pf,useFormState:dv,useActionState:dv,useOptimistic:function(n,r){var o=Kt();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=br(d);p.payload=r,o!=null&&(p.callback=o),r=vr(n,p,d),r!==null&&(sn(r,n,d),Dl(r,n,d))},enqueueReplaceState:function(n,r,o){n=n._reactInternals;var d=_n(),p=br(d);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=vr(n,p,d),r!==null&&(sn(r,n,d),Dl(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var o=_n(),d=br(o);d.tag=2,r!=null&&(d.callback=r),r=vr(n,d,o),r!==null&&(sn(r,n,o),Dl(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?!El(o,d)||!El(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 ya(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=br(o),o.tag=3,o.payload={element:null},o.callback=function(){Hu(n,r)},o}function Iv(n){return n=br(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"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function S5(n,r,o,d,p){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=o.alternate,r!==null&&mo(r,o,p,!0),o=fn.current,o!==null){switch(o.tag){case 31:case 13:return Mn===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(nt)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}),Nl(kn(n,o)))):(d!==cf&&(r=Error(s(423),{cause:d}),Nl(kn(r,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,d=kn(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=kn(b,o),Gl===null?Gl=[b]:Gl.push(b),It!==4&&(It=2),r===null)return!0;d=kn(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"&&(Cr===null||!Cr.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):va(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 pa(r),d=kf(n,r,o,S,b,p),k=Nf(),n!==null&&!Jt?(Tf(n,r,p),Bs(n,r,p)):(nt&&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:El,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(El(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 Gf(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?Gb(r,b):Sf(),Kb(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),Gb(r,b),yr(),r.memoizedState=null):(n!==null&&ku(r,null),Sf(),yr());return Ci(n,r,p,o),r.child}function Pl(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(),Kb(r),n!==null&&mo(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 va(r,n.child,null,o),n=Fu(r,r.pendingProps),n.flags|=2,mn(r),r.memoizedState=null,n}function w5(n,r,o){var d=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(nt){if(d.mode==="hidden")return n=Fu(r,d),r.lanes=536870912,Pl(null,n);if(Ef(r),(n=kt)?(n=nx(n,An),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:fr!==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 pr(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||mo(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,da(n,S),sn(d,n,S),qf;Ju(),r=qv(n,r,o)}else n=b.treeContext,kt=Rn(S.nextSibling),wi=r,nt=!0,mr=null,An=!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 Gf(n,r,o,d,p){return pa(r),o=kf(n,r,o,d,void 0,p),d=Nf(),n!==null&&!Jt?(Tf(n,r,p),Bs(n,r,p)):(nt&&d&&of(r),r.flags|=1,Ci(n,r,o,p),r.child)}function Gv(n,r,o,d,p,b){return pa(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)):(nt&&d&&of(r),r.flags|=1,Ci(n,r,o,b),r.child)}function Kv(n,r,o,d,p){if(pa(r),r.stateNode===null){var b=co,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):co,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),jl(r,d,b,p),Ol(),b.state=r.memoizedState),typeof b.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){b=r.stateNode;var k=r.memoizedProps,B=ya(o,k);b.props=B;var J=b.context,se=o.contextType;S=co,typeof se=="object"&&se!==null&&(S=Ei(se));var le=o.getDerivedStateFromProps;se=typeof le=="function"||typeof b.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,se||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k||J!==S)&&Ov(r,b,d,S),_r=!1;var ie=r.memoizedState;b.state=ie,jl(r,d,b,p),Ol(),J=r.memoizedState,k||ie!==J||_r?(typeof le=="function"&&(Ff(r,o,le,d),J=r.memoizedState),(B=_r||Dv(r,o,B,d,ie,J,S))?(se||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=J),b.props=d,b.state=J,b.context=S,d=B):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{b=r.stateNode,vf(n,r),S=r.memoizedProps,se=ya(o,S),b.props=se,le=r.pendingProps,ie=b.context,J=o.contextType,B=co,typeof J=="object"&&J!==null&&(B=Ei(J)),k=o.getDerivedStateFromProps,(J=typeof k=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==le||ie!==B)&&Ov(r,b,d,B),_r=!1,ie=r.memoizedState,b.state=ie,jl(r,d,b,p),Ol();var ne=r.memoizedState;S!==le||ie!==ne||_r||n!==null&&n.dependencies!==null&&Eu(n.dependencies)?(typeof k=="function"&&(Ff(r,o,k,d),ne=r.memoizedState),(se=_r||Dv(r,o,se,d,ie,ne,B)||n!==null&&n.dependencies!==null&&Eu(n.dependencies))?(J||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,ne,B),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,ne,B)),typeof b.componentDidUpdate=="function"&&(r.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=ne),b.props=d,b.state=ne,b.context=B,d=se):(typeof b.componentDidUpdate!="function"||S===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&ie===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=va(r,n.child,null,p),r.child=va(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 fa(),r.flags|=256,Ci(n,r,o,d),r.child}var Kf={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:(Gt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,n===null){if(nt){if(p?xr(r):yr(),(n=kt)?(n=nx(n,An),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:fr!==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 pr(r);return Rm(n)?r.lanes=32:r.lanes=536870912,null}var k=d.children;return d=d.fallback,p?(yr(),p=r.mode,k=Vu({mode:"hidden",children:k},p),d=ha(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=Kf,Pl(null,d)):(xr(r),Xf(r,k))}var B=n.memoizedState;if(B!==null&&(k=B.dehydrated,k!==null)){if(b)r.flags&256?(xr(r),r.flags&=-257,r=Zf(n,r,o)):r.memoizedState!==null?(yr(),r.child=n.child,r.flags|=128,r=null):(yr(),k=d.fallback,p=r.mode,d=Vu({mode:"visible",children:d.children},p),k=ha(k,p,o,null),k.flags|=2,d.return=r,k.return=r,d.sibling=k,r.child=d,va(r,n.child,null,o),d=r.child,d.memoizedState=Wf(o),d.childLanes=Yf(n,S,o),r.memoizedState=Kf,r=Pl(null,d));else if(xr(r),Rm(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var J=S.dgst;S=J,d=Error(s(419)),d.stack="",d.digest=S,Nl({value:d,source:null,stack:null}),r=Zf(n,r,o)}else if(Jt||mo(n,r,o,!1),S=(o&n.childLanes)!==0,Jt||S){if(S=St,S!==null&&(d=$t(S,o),d!==0&&d!==B.retryLane))throw B.retryLane=d,da(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=B.treeContext,kt=Rn(k.nextSibling),wi=r,nt=!0,mr=null,An=!1,n!==null&&Rb(r,n),r=Xf(r,d.children),r.flags|=4096);return r}return p?(yr(),k=d.fallback,p=r.mode,B=n.child,J=B.sibling,d=Ms(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,J!==null?k=Ms(J,k):(k=ha(k,p,o,null),k.flags|=2),k.return=r,d.return=r,d.sibling=k,r.child=d,Pl(null,d),d=r.child,k=n.child.memoizedState,k===null?k=Wf(o):(p=k.cachePool,p!==null?(B=Zt._currentValue,p=p.parent!==B?{parent:B,pool:B}:p):p=zb(),k={baseLanes:k.baseLanes|o,cachePool:p}),d.memoizedState=k,d.childLanes=Yf(n,S,o),r.memoizedState=Kf,Pl(n.child,d)):(xr(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 va(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=Gt.current,k=(S&2)!==0;if(k?(S=S&1|2,r.flags|=128):S&=1,ue(Gt,S),Ci(n,r,d,o),d=nt?kl: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),Er|=r.lanes,(o&r.childLanes)===0)if(n!==null){if(mo(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 E5(n,r,o){switch(r.tag){case 3:Oe(r,r.stateNode.containerInfo),gr(r,Zt,n.memoizedState.cache),fa();break;case 27:case 5:pe(r);break;case 4:Oe(r,r.stateNode.containerInfo);break;case 10:gr(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?(xr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Yv(n,r,o):(xr(r),n=Bs(n,r,o),n!==null?n.sibling:null);xr(r);break;case 19:var p=(n.flags&128)!==0;if(d=(o&r.childLanes)!==0,d||(mo(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(Gt,Gt.current),d)break;return null;case 22:return r.lanes=0,$v(n,r,o,r.pendingProps);case 24:gr(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,E5(n,r,o);Jt=(n.flags&131072)!==0}else Jt=!1,nt&&(r.flags&1048576)!==0&&Mb(r,kl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=_a(r.elementType),r.type=n,typeof n=="function")sf(n)?(d=ya(n,d),r.tag=1,r=Kv(null,r,n,d,o)):(r.tag=0,r=Gf(null,r,n,d,o));else{if(n!=null){var p=n.$$typeof;if(p===A){r.tag=11,r=Uv(null,r,n,d,o);break e}else if(p===j){r.tag=14,r=Hv(null,r,n,d,o);break e}}throw r=Z(n)||n,Error(s(306,r,""))}}return r;case 0:return Gf(n,r,r.type,r.pendingProps,o);case 1:return d=r.type,p=ya(d,r.pendingProps),Kv(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),jl(r,d,null,o);var S=r.memoizedState;if(d=S.cache,gr(r,Zt,d),d!==b.cache&&ff(r,[Zt],o,!0),Ol(),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=kn(Error(s(424)),r),Nl(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=Rn(n.firstChild),wi=r,nt=!0,mr=null,An=!0,o=$b(r,null,d,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(fa(),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:nt||(o=r.type,n=r.pendingProps,d=ad(me.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 pe(r),n===null&&nt&&(d=r.stateNode=ax(r.type,r.pendingProps,me.current),wi=r,An=!0,p=kt,Ar(r.type)?(Dm=p,kt=Rn(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&&nt&&((p=d=kt)&&(d=eT(d,r.type,r.pendingProps,An),d!==null?(r.stateNode=d,wi=r,kt=Rn(d.firstChild),An=!1,p=!0):p=!1),p||pr(r)),pe(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,p5,null,null,o),ec._currentValue=p),$u(n,r),Ci(n,r,d,o),r.child;case 6:return n===null&&nt&&((n=o=kt)&&(o=tT(o,r.pendingProps,An),o!==null?(r.stateNode=o,wi=r,kt=null,n=!0):n=!1),n||pr(r)),null;case 13:return Yv(n,r,o);case 4:return Oe(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=va(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,gr(r,r.type,d.value),Ci(n,r,d.children,o),r.child;case 9:return p=r.type._context,d=r.pendingProps.children,pa(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 w5(n,r,o);case 22:return $v(n,r,o,r.pendingProps);case 24:return pa(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),gr(r,Zt,p)):((n.lanes&o)!==0&&(vf(n,r),jl(r,null,null,o),Ol()),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),gr(r,Zt,d)):(d=b.cache,gr(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 ba=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 ba=Tu,_f}function qu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ue():536870912,n.lanes|=r,ko|=r)}function Ul(n,r){if(!nt)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 C5(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)&&(fo(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(Pe(r),o=me.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=te.current,fo(r)?Db(r):(n=ax(p,d,o),r.stateNode=n,zs(r))}return Nt(r),null;case 5:if(Pe(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=te.current,fo(r))Db(r);else{var S=ad(me.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=me.current,fo(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||pr(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=fo(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 fa(),(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=fo(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 fa(),(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(Y(Gt),d=r.memoizedState,d===null)return Nt(r),null;if(p=(r.flags&128)!==0,b=d.rendering,b===null)if(p)Ul(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,Ul(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(Gt,Gt.current&1|2),nt&&Rs(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Ot()>Xu&&(r.flags|=128,p=!0,Ul(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),Ul(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!nt)return Nt(r),null}else 2*Ot()-d.renderingStartTime>Xu&&o!==536870912&&(r.flags|=128,p=!0,Ul(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=Gt.current,ue(Gt,p?o&1|2:o&1),nt&&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&&Y(ga),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 k5(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 Pe(r),null;case 31:if(r.memoizedState!==null){if(mn(r),r.alternate===null)throw Error(s(340));fa()}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));fa()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return Y(Gt),null;case 4:return ye(),null;case 10:return Os(r.type),null;case 22:case 23:return mn(r),wf(),n!==null&&Y(ga),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:Pe(r);break;case 4:ye();break;case 31:r.memoizedState!==null&&mn(r);break;case 13:mn(r);break;case 19:Y(Gt);break;case 10:Os(r.type);break;case 22:case 23:mn(r),wf(),n!==null&&Y(ga);break;case 24:Os(Zt)}}function Hl(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 Sr(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 B=o,J=k;try{J()}catch(se){pt(p,B,se)}}}d=d.next}while(d!==b)}}catch(se){pt(r,r.return,se)}}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=ya(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(d){pt(n,r,d)}}function Fl(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;W5(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&&Ar(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&&Ar(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=_e));else if(d!==4&&(d===27&&Ar(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 Gu(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&&Ar(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(Gu(n,r,o),n=n.sibling;n!==null;)Gu(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 N5(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,B=-1,J=0,se=0,le=n,ie=null;t:for(;;){for(var ne;le!==o||p!==0&&le.nodeType!==3||(k=S+p),le!==b||d!==0&&le.nodeType!==3||(B=S+d),le.nodeType===3&&(S+=le.nodeValue.length),(ne=le.firstChild)!==null;)ie=le,le=ne;for(;;){if(le===n)break t;if(ie===o&&++J===p&&(k=S),ie===b&&++se===d&&(B=S),(ne=le.nextSibling)!==null)break;le=ie,ie=le.parentNode}le=ne}o=k===-1||B===-1?null:{start:k,end:B}}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 ke=ya(o.type,p);n=d.getSnapshotBeforeUpdate(ke,b),d.__reactInternalSnapshotBeforeUpdate=n}catch(Le){pt(o,o.return,Le)}}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&&Hl(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=ya(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&&Fl(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&&Fl(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=B5.bind(null,o),iT(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&&hl(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;Ar(o.type)&&(Rt=o.stateNode,Ji=!1),Ps(n,r,o),Zl(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),jo(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:Sr(2,o,r),ei||Sr(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{jo(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{jo(n)}catch(o){pt(r,r.return,o)}}function T5(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 Ku(n,r){var o=T5(n);r.forEach(function(d){if(!o.has(d)){o.add(d);var p=z5.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(Ar(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 Kn=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&&(Sr(3,n,n.return),Hl(3,n),Sr(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=Kn;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[ra]||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{Be(p,"")}catch(ke){pt(n,n.return,ke)}}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(ke){pt(n,n.return,ke)}}break;case 3:if(cd=null,p=Kn,Kn=od(r.containerInfo),en(r,n),Kn=p,tn(n),d&4&&o!==null&&o.memoizedState.isDehydrated)try{jo(r.containerInfo)}catch(ke){pt(n,n.return,ke)}sm&&(sm=!1,f1(n));break;case 4:d=Kn,Kn=od(n.stateNode.containerInfo),en(r,n),tn(n),Kn=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,Ku(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,Ku(n,d)));break;case 22:p=n.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,J=Is,se=ei;if(Is=J||p,ei=se||B,en(r,n),ei=se,Is=J,tn(n),d&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||B||Is||ei||Sa(n)),o=null,r=n;;){if(r.tag===5||r.tag===26){if(o===null){B=o=r;try{if(b=B.stateNode,p)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=B.stateNode;var le=B.memoizedProps.style,ie=le!=null&&le.hasOwnProperty("display")?le.display:null;k.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ke){pt(B,B.return,ke)}}}else if(r.tag===6){if(o===null){B=r;try{B.stateNode.nodeValue=p?"":B.memoizedProps}catch(ke){pt(B,B.return,ke)}}}else if(r.tag===18){if(o===null){B=r;try{var ne=B.stateNode;p?ix(ne,!0):ix(B.stateNode,!1)}catch(ke){pt(B,B.return,ke)}}}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,Ku(n,o))));break;case 19:en(r,n),tn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ku(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);Gu(n,b,p);break;case 5:var S=o.stateNode;o.flags&32&&(Be(S,""),o.flags&=-33);var k=im(n);Gu(n,k,S);break;case 3:case 4:var B=o.stateNode.containerInfo,J=im(n);nm(n,J,B);break;default:throw Error(s(161))}}catch(se){pt(n,n.return,se)}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 Sa(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Sr(4,r,r.return),Sa(r);break;case 1:ss(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&i1(r,r.return,o),Sa(r);break;case 27:Zl(r.stateNode);case 26:case 5:ss(r,r.return),Sa(r);break;case 22:r.memoizedState===null&&Sa(r);break;case 30:Sa(r);break;default:Sa(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),Hl(4,b);break;case 1:if(Hs(p,b,o),d=b,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(J){pt(d,d.return,J)}if(d=b,p=d.updateQueue,p!==null){var k=d.stateNode;try{var B=p.shared.hiddenCallbacks;if(B!==null)for(p.shared.hiddenCallbacks=null,p=0;p<B.length;p++)Vb(B[p],k)}catch(J){pt(d,d.return,J)}}o&&S&64&&t1(b),Fl(b,b.return);break;case 27:r1(b);case 26:case 5:Hs(p,b,o),o&&d===null&&S&4&&n1(b),Fl(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),Fl(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&&Tl(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&&Tl(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&&Hl(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&&Tl(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(B){pt(r,r.return,B)}}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):$l(n,r):b._visibility&2?Wn(n,r,o,d):(b._visibility|=2,wo(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 wo(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,B=d,J=S.flags;switch(S.tag){case 0:case 11:case 15:wo(b,S,k,B,p),Hl(8,S);break;case 23:break;case 22:var se=S.stateNode;S.memoizedState!==null?se._visibility&2?wo(b,S,k,B,p):$l(b,S):(se._visibility|=2,wo(b,S,k,B,p)),p&&J&2048&&rm(S.alternate,S);break;case 24:wo(b,S,k,B,p),p&&J&2048&&am(S.alternate,S);break;default:wo(b,S,k,B,p)}r=r.sibling}}function $l(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:$l(o,d),p&2048&&rm(d.alternate,d);break;case 24:$l(o,d),p&2048&&am(d.alternate,d);break;default:$l(o,d)}r=r.sibling}}var Vl=8192;function Eo(n,r,o){if(n.subtreeFlags&Vl)for(n=n.child;n!==null;)p1(n,r,o),n=n.sibling}function p1(n,r,o){switch(n.tag){case 26:Eo(n,r,o),n.flags&Vl&&n.memoizedState!==null&&mT(o,Kn,n.memoizedState,n.memoizedProps);break;case 5:Eo(n,r,o);break;case 3:case 4:var d=Kn;Kn=od(n.stateNode.containerInfo),Eo(n,r,o),Kn=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Vl,Vl=16777216,Eo(n,r,o),Vl=d):Eo(n,r,o));break;default:Eo(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 ql(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:ql(n),n.flags&2048&&Sr(9,n,n.return);break;case 3:ql(n);break;case 12:ql(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)):ql(n);break;default:ql(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:Sr(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:Sr(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:Tl(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 A5={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}},M5=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Qe=null,tt=0,mt=0,pn=null,wr=!1,Co=!1,om=!1,Fs=0,It=0,Er=0,wa=0,lm=0,gn=0,ko=0,Gl=null,nn=null,cm=!1,Yu=0,v1=0,Xu=1/0,Zu=null,Cr=null,ai=0,kr=null,No=null,$s=0,um=0,dm=null,x1=null,Kl=0,hm=null;function _n(){return(ut&2)!==0&&tt!==0?tt&-tt:O.T!==null?bm():Qa()}function y1(){if(gn===0)if((tt&536870912)===0||nt){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)&&(To(n,0),Nr(n,tt,gn,!1)),yt(n,o),((ut&2)===0||n!==St)&&(n===St&&((ut&2)===0&&(wa|=o),It===4&&Nr(n,tt,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?O5(n,r):mm(n,r,!0),b=d;do{if(p===0){Co&&!d&&Nr(n,r,0,!1);break}else{if(o=n.current.alternate,b&&!R5(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=Gl;var B=k.current.memoizedState.isDehydrated;if(B&&(To(k,S).flags|=256),S=mm(k,S,!1),S!==2){if(om&&!B){k.errorRecoveryDisabledLanes|=b,wa|=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){To(n,0),Nr(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:Nr(d,r,gn,!wr);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(Nr(d,r,gn,!wr),z(d,0,!0)!==0)break e;$s=r,d.timeoutHandle=J1(w1.bind(null,d,o,nn,Zu,cm,r,gn,wa,ko,wr,b,"Throttled",-0,0),p);break e}w1(d,o,nn,Zu,cm,r,gn,wa,ko,wr,b,null,-0,0)}}break}while(!0);rs(n)}function w1(n,r,o,d,p,b,S,k,B,J,se,le,ie,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:_e},p1(r,b,le);var ke=(b&62914560)===b?Yu-Ot():(b&4194048)===b?v1-Ot():0;if(ke=pT(le,ke),ke!==null){$s=b,n.cancelPendingCommit=ke(R1.bind(null,n,r,b,o,d,p,S,k,B,se,le,null,ie,ne)),Nr(n,b,S,!J);return}}R1(n,r,b,o,d,p,S,k,B)}function R5(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 Nr(n,r,o,d){r&=~lm,r&=~wa,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&&we(n,o,r)}function Qu(){return(ut&6)===0?(Wl(0),!1):!0}function fm(){if(Qe!==null){if(mt===0)var n=Qe.return;else n=Qe,Ds=ma=null,Af(n),bo=null,Ml=0,n=Qe;for(;n!==null;)e1(n.alternate,n),n=n.return;Qe=null}}function To(n,r){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,Z5(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),$s=0,fm(),St=n,Qe=o=Ms(n.current,null),tt=r,mt=0,pn=null,wr=!1,Co=ae(n,r),om=!1,ko=gn=lm=wa=Er=It=0,nn=Gl=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){Ve=null,O.H=Il,r===_o||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,Qe===null&&(It=1,Hu(n,kn(r,n.current)))}function C1(){var n=fn.current;return n===null?!0:(tt&4194048)===tt?Mn===null:(tt&62914560)===tt||(tt&536870912)!==0?n===Mn:!1}function k1(){var n=O.H;return O.H=Il,n===null?Il:n}function N1(){var n=O.A;return O.A=A5,n}function Ju(){It=4,wr||(tt&4194048)!==tt&&fn.current!==null||(Co=!0),(Er&134217727)===0&&(wa&134217727)===0||St===null||Nr(St,tt,gn,!1)}function mm(n,r,o){var d=ut;ut|=2;var p=k1(),b=N1();(St!==n||tt!==r)&&(Zu=null,To(n,r)),r=!1;var S=It;e:do try{if(mt!==0&&Qe!==null){var k=Qe,B=pn;switch(mt){case 8:fm(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var J=mt;if(mt=0,pn=null,Ao(n,k,B,J),o&&Co){S=0;break e}break;default:J=mt,mt=0,pn=null,Ao(n,k,B,J)}}D5(),S=It;break}catch(se){E1(n,se)}while(!0);return r&&n.shellSuspendCounter++,Ds=ma=null,ut=d,O.H=p,O.A=b,Qe===null&&(St=null,tt=0,vu()),S}function D5(){for(;Qe!==null;)T1(Qe)}function O5(n,r){var o=ut;ut|=2;var d=k1(),p=N1();St!==n||tt!==r?(Zu=null,Xu=Ot()+500,To(n,r)):Co=ae(n,r);e:do try{if(mt!==0&&Qe!==null){r=Qe;var b=pn;t:switch(mt){case 1:mt=0,pn=null,Ao(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,Ao(n,r,b,7));break;case 5:var S=null;switch(Qe.tag){case 26:S=Qe.memoizedState;case 5:case 27:var k=Qe;if(S?mx(S):k.stateNode.complete){mt=0,pn=null;var B=k.sibling;if(B!==null)Qe=B;else{var J=k.return;J!==null?(Qe=J,ed(J)):Qe=null}break t}}mt=0,pn=null,Ao(n,r,b,5);break;case 6:mt=0,pn=null,Ao(n,r,b,6);break;case 8:fm(),It=6;break e;default:throw Error(s(462))}}j5();break}catch(se){E1(n,se)}while(!0);return Ds=ma=null,O.H=d,O.A=p,ut=o,Qe!==null?0:(St=null,tt=0,vu(),It)}function j5(){for(;Qe!==null&&!ll();)T1(Qe)}function T1(n){var r=Qv(n.alternate,n,Fs);n.memoizedProps=n.pendingProps,r===null?ed(n):Qe=r}function A1(n){var r=n,o=r.alternate;switch(r.tag){case 15:case 0:r=Gv(o,r,r.pendingProps,r.type,void 0,tt);break;case 11:r=Gv(o,r,r.pendingProps,r.type.render,r.ref,tt);break;case 5:Af(r);default:e1(o,r),r=Qe=Nb(r,Fs),r=Qv(o,r,Fs)}n.memoizedProps=n.pendingProps,r===null?ed(n):Qe=r}function Ao(n,r,o,d){Ds=ma=null,Af(r),bo=null,Ml=0;var p=r.return;try{if(S5(n,p,r,o,tt)){It=1,Hu(n,kn(o,n.current)),Qe=null;return}}catch(b){if(p!==null)throw Qe=p,b;It=1,Hu(n,kn(o,n.current)),Qe=null;return}r.flags&32768?(nt||d===1?n=!0:Co||(tt&536870912)!==0?n=!1:(wr=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,wr);return}n=r.return;var o=C5(r.alternate,r,Fs);if(o!==null){Qe=o;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=n}while(r!==null);It===0&&(It=5)}function M1(n,r){do{var o=k5(n.alternate,n);if(o!==null){o.flags&=32767,Qe=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=o}while(n!==null);It=6,Qe=null}function R1(n,r,o,d,p,b,S,k,B){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,Te(n,o,b,S,k,B),n===St&&(Qe=St=null,tt=0),No=r,kr=n,$s=o,um=b,dm=p,x1=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,I5(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=W.p,W.p=2,S=ut,ut|=4;try{N5(n,r,o)}finally{ut=S,W.p=p,O.T=d}}ai=1,D1(),O1(),j1()}}function D1(){if(ai===1){ai=0;var n=kr,r=No,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=O.T,O.T=null;var d=W.p;W.p=2;var p=ut;ut|=4;try{h1(r,n);var b=km,S=bb(n.containerInfo),k=b.focusedElem,B=b.selectionRange;if(S!==k&&k&&k.ownerDocument&&_b(k.ownerDocument.documentElement,k)){if(B!==null&&Xh(k)){var J=B.start,se=B.end;if(se===void 0&&(se=J),"selectionStart"in k)k.selectionStart=J,k.selectionEnd=Math.min(se,k.value.length);else{var le=k.ownerDocument||document,ie=le&&le.defaultView||window;if(ie.getSelection){var ne=ie.getSelection(),ke=k.textContent.length,Le=Math.min(B.start,ke),vt=B.end===void 0?Le:Math.min(B.end,ke);!ne.extend&&Le>vt&&(S=vt,vt=Le,Le=S);var G=gb(k,Le),P=gb(k,vt);if(G&&P&&(ne.rangeCount!==1||ne.anchorNode!==G.node||ne.anchorOffset!==G.offset||ne.focusNode!==P.node||ne.focusOffset!==P.offset)){var Q=le.createRange();Q.setStart(G.node,G.offset),ne.removeAllRanges(),Le>vt?(ne.addRange(Q),ne.extend(P.node,P.offset)):(Q.setEnd(P.node,P.offset),ne.addRange(Q))}}}}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,W.p=d,O.T=o}}n.current=r,ai=2}}function O1(){if(ai===2){ai=0;var n=kr,r=No,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=O.T,O.T=null;var d=W.p;W.p=2;var p=ut;ut|=4;try{o1(n,r.alternate,r)}finally{ut=p,W.p=d,O.T=o}}ai=3}}function j1(){if(ai===4||ai===3){ai=0,Wa();var n=kr,r=No,o=$s,d=x1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?ai=5:(ai=0,No=kr=null,L1(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Cr=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=W.p,W.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,W.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,Wl(0)}}function L1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Tl(r)))}function td(){return D1(),O1(),j1(),B1()}function B1(){if(ai!==5)return!1;var n=kr,r=um;um=0;var o=Cs($s),d=O.T,p=W.p;try{W.p=32>o?32:o,O.T=null,o=dm,dm=null;var b=kr,S=$s;if(ai=0,No=kr=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,Wl(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(Es,b)}catch{}return!0}finally{W.p=p,O.T=d,L1(n,r)}}function z1(n,r,o){r=kn(o,r),r=Vf(n.stateNode,r,2),n=vr(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"&&(Cr===null||!Cr.has(d))){n=kn(o,n),o=Iv(2),d=vr(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 M5;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=L5.bind(null,n,r,o),r.then(n,n))}function L5(n,r,o){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,St===n&&(tt&o)===o&&(It===4||It===3&&(tt&62914560)===tt&&300>Ot()-Yu?(ut&2)===0&&To(n,0):lm|=o,ko===tt&&(ko=0)),rs(n)}function I1(n,r){r===0&&(r=Ue()),n=da(n,r),n!==null&&(yt(n,r),rs(n))}function B5(n){var r=n.memoizedState,o=0;r!==null&&(o=r.retryLane),I1(n,o)}function z5(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 I5(n,r){return rr(n,r)}var id=null,Mo=null,gm=!1,nd=!1,_m=!1,Tr=0;function rs(n){n!==Mo&&n.next===null&&(Mo===null?id=Mo=n:Mo=Mo.next=n),nd=!0,gm||(gm=!0,U5())}function Wl(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=tt,b=z(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 P5(){P1()}function P1(){nd=gm=!1;var n=0;Tr!==0&&X5()&&(n=Tr);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&&(Mo=o)):(o=d,(n!==0||(b&3)!==0)&&(nd=!0)),d=p}ai!==0&&ai!==5||Wl(n),Tr!==0&&(Tr=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,B=p[S];B===-1?((k&o)===0||(k&d)!==0)&&(p[S]=ve(k,r)):B<=r&&(n.expiredLanes|=k),b&=~k}if(r=St,o=tt,o=z(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=ar;break;default:o=ws}return d=H1.bind(null,n),o=rr(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=tt;return d=z(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 U5(){Q5(function(){(ut&6)!==0?rr(xi,P5):P1()})}function bm(){if(Tr===0){var n=po;n===0&&(n=rt,rt<<=1,(rt&261888)===0&&(rt=256)),Tr=n}return Tr}function $1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:dr(""+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 H5(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(Tr!==0){var B=S?V1(p,S):new FormData(p);If(o,{pending:!0,data:B,method:p.method,action:b},null,B)}}else typeof b=="function"&&(k.preventDefault(),B=S?V1(p,S):new FormData(p),If(o,{pending:!0,data:B,method:p.method,action:b},b,B))},currentTarget:p}]})}}for(var vm=0;vm<ef.length;vm++){var xm=ef[vm],F5=xm.toLowerCase(),$5=xm[0].toUpperCase()+xm.slice(1);Gn(F5,"on"+$5)}Gn(yb,"onAnimationEnd"),Gn(Sb,"onAnimationIteration"),Gn(wb,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(r5,"onTransitionRun"),Gn(a5,"onTransitionStart"),Gn(o5,"onTransitionCancel"),Gn(Eb,"onTransitionEnd"),fe("onMouseEnter",["mouseout","mouseover"]),fe("onMouseLeave",["mouseout","mouseover"]),fe("onPointerEnter",["pointerout","pointerover"]),fe("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 Yl="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(" "),V5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yl));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],B=k.instance,J=k.currentTarget;if(k=k.listener,B!==b&&p.isPropagationStopped())break e;b=k,p.currentTarget=J;try{b(p)}catch(se){bu(se)}p.currentTarget=null,b=B}else for(S=0;S<d.length;S++){if(k=d[S],B=k.instance,J=k.currentTarget,k=k.listener,B!==b&&p.isPropagationStopped())break e;b=k,p.currentTarget=J;try{b(p)}catch(se){bu(se)}p.currentTarget=null,b=B}}}}function Je(n,r){var o=r[dl];o===void 0&&(o=r[dl]=new Set);var d=n+"__bubble";o.has(d)||(G1(r,n,2,!1),o.add(d))}function ym(n,r,o){var d=0;r&&(d|=4),G1(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"&&(V5.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 G1(n,r,o,d){switch(yx(r)){case 2:var p=bT;break;case 8:p=vT;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 B=S.tag;if((B===3||B===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;k!==null;){if(S=Ui(k),S===null)return;if(B=S.tag,B===5||B===6||B===26||B===27){d=b=S;continue e}k=k.parentNode}}d=d.return}du(function(){var J=b,se=$e(o),le=[];e:{var ie=Cb.get(n);if(ie!==void 0){var ne=pu,ke=n;switch(n){case"keypress":if(fu(o)===0)break e;case"keydown":case"keyup":ne=z3;break;case"focusin":ke="focus",ne=qh;break;case"focusout":ke="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=C3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=U3;break;case yb:case Sb:case wb:ne=T3;break;case Eb:ne=F3;break;case"scroll":case"scrollend":ne=w3;break;case"wheel":ne=V3;break;case"copy":case"cut":case"paste":ne=M3;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=G3}var Le=(r&4)!==0,vt=!Le&&(n==="scroll"||n==="scrollend"),G=Le?ie!==null?ie+"Capture":null:ie;Le=[];for(var P=J,Q;P!==null;){var oe=P;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||G===null||(oe=_l(P,G),oe!=null&&Le.push(Xl(P,oe,Q))),vt)break;P=P.return}0<Le.length&&(ie=new ne(ie,ke,null,o,se),le.push({event:ie,listeners:Le}))}}if((r&7)===0){e:{if(ie=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",ie&&o!==Ae&&(ke=o.relatedTarget||o.fromElement)&&(Ui(ke)||ke[or]))break e;if((ne||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,ne?(ke=o.relatedTarget||o.toElement,ne=J,ke=ke?Ui(ke):null,ke!==null&&(vt=l(ke),Le=ke.tag,ke!==vt||Le!==5&&Le!==27&&Le!==6)&&(ke=null)):(ne=null,ke=J),ne!==ke)){if(Le=eb,oe="onMouseLeave",G="onMouseEnter",P="mouse",(n==="pointerout"||n==="pointerover")&&(Le=ib,oe="onPointerLeave",G="onPointerEnter",P="pointer"),vt=ne==null?ie:lr(ne),Q=ke==null?ie:lr(ke),ie=new Le(oe,P+"leave",ne,o,se),ie.target=vt,ie.relatedTarget=Q,oe=null,Ui(se)===J&&(Le=new Le(G,P+"enter",ke,o,se),Le.target=Q,Le.relatedTarget=vt,oe=Le),vt=oe,ne&&ke)t:{for(Le=q5,G=ne,P=ke,Q=0,oe=G;oe;oe=Le(oe))Q++;oe=0;for(var je=P;je;je=Le(je))oe++;for(;0<Q-oe;)G=Le(G),Q--;for(;0<oe-Q;)P=Le(P),oe--;for(;Q--;){if(G===P||P!==null&&G===P.alternate){Le=G;break t}G=Le(G),P=Le(P)}Le=null}else Le=null;ne!==null&&K1(le,ie,ne,Le,!1),ke!==null&&vt!==null&&K1(le,vt,ke,Le,!0)}}e:{if(ie=J?lr(J):window,ne=ie.nodeName&&ie.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ie.type==="file")var ot=ub;else if(lb(ie))if(db)ot=i5;else{ot=e5;var Me=J3}else ne=ie.nodeName,!ne||ne.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?J&&ur(J.elementType)&&(ot=ub):ot=t5;if(ot&&(ot=ot(n,J))){cb(le,ot,o,se);break e}Me&&Me(n,ie,J),n==="focusout"&&J&&ie.type==="number"&&J.memoizedProps.value!=null&&no(ie,"number",ie.value)}switch(Me=J?lr(J):window,n){case"focusin":(lb(Me)||Me.contentEditable==="true")&&(ao=Me,Zh=J,Cl=null);break;case"focusout":Cl=Zh=ao=null;break;case"mousedown":Qh=!0;break;case"contextmenu":case"mouseup":case"dragend":Qh=!1,vb(le,o,se);break;case"selectionchange":if(s5)break;case"keydown":case"keyup":vb(le,o,se)}var qe;if(Kh)e:{switch(n){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ro?ab(n,o)&&(it="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(it="onCompositionStart");it&&(nb&&o.locale!=="ko"&&(ro||it!=="onCompositionStart"?it==="onCompositionEnd"&&ro&&(qe=Q_()):(hr=se,Fh="value"in hr?hr.value:hr.textContent,ro=!0)),Me=rd(J,it),0<Me.length&&(it=new tb(it,n,null,o,se),le.push({event:it,listeners:Me}),qe?it.data=qe:(qe=ob(o),qe!==null&&(it.data=qe)))),(qe=W3?Y3(n,o):X3(n,o))&&(it=rd(J,"onBeforeInput"),0<it.length&&(Me=new tb("onBeforeInput","beforeinput",null,o,se),le.push({event:Me,listeners:it}),Me.data=qe)),H5(le,n,J,o,se)}q1(le,r)})}function Xl(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=_l(n,o),p!=null&&d.unshift(Xl(n,p,b)),p=_l(n,r),p!=null&&d.push(Xl(n,p,b))),n.tag===3)return d;n=n.return}return[]}function q5(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function K1(n,r,o,d,p){for(var b=r._reactName,S=[];o!==null&&o!==d;){var k=o,B=k.alternate,J=k.stateNode;if(k=k.tag,B!==null&&B===d)break;k!==5&&k!==26&&k!==27||J===null||(B=J,p?(J=_l(o,b),J!=null&&S.unshift(Xl(o,J,B))):p||(J=_l(o,b),J!=null&&S.push(Xl(o,J,B)))),o=o.return}S.length!==0&&n.push({event:r,listeners:S})}var G5=/\r\n?/g,K5=/\u0000|\uFFFD/g;function W1(n){return(typeof n=="string"?n:""+n).replace(G5,`
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===""||Be(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&Be(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=dr(""+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=dr(""+d),n.setAttribute(o,d);break;case"onClick":d!=null&&(n.onclick=_e);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(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=dr(""+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":Je("beforetoggle",n),Je("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"?Be(n,d):(typeof d=="number"||typeof d=="bigint")&&Be(n,""+d);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"onClick":d!=null&&(n.onclick=_e);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!aa.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":Je("error",n),Je("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":Je("invalid",n);var k=b=S=p=null,B=null,J=null;for(d in o)if(o.hasOwnProperty(d)){var se=o[d];if(se!=null)switch(d){case"name":p=se;break;case"type":S=se;break;case"checked":B=se;break;case"defaultChecked":J=se;break;case"value":b=se;break;case"defaultValue":k=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(s(137,r));break;default:bt(n,r,d,se,o,null)}}oa(n,b,k,B,J,S,p,!1);return;case"select":Je("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":Je("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)}so(n,d,p,b);return;case"option":for(B in o)o.hasOwnProperty(B)&&(d=o[B],d!=null)&&(B==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":bt(n,r,B,d,o,null));return;case"dialog":Je("beforetoggle",n),Je("toggle",n),Je("cancel",n),Je("close",n);break;case"iframe":case"object":Je("load",n);break;case"video":case"audio":for(d=0;d<Yl.length;d++)Je(Yl[d],n);break;case"image":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"embed":case"source":case"link":Je("error",n),Je("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in o)if(o.hasOwnProperty(J)&&(d=o[J],d!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:bt(n,r,J,d,o,null)}return;default:if(ur(r)){for(se in o)o.hasOwnProperty(se)&&(d=o[se],d!==void 0&&Em(n,r,se,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 W5(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,B=null,J=null,se=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":B=le;default:d.hasOwnProperty(ne)||bt(n,r,ne,null,d,le)}}for(var ie in d){var ne=d[ie];if(le=o[ie],d.hasOwnProperty(ie)&&(ne!=null||le!=null))switch(ie){case"type":b=ne;break;case"name":p=ne;break;case"checked":J=ne;break;case"defaultChecked":se=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,ie,ne,d,le)}}ml(n,S,k,B,J,se,b,p);return;case"select":ne=S=k=ie=null;for(b in o)if(B=o[b],o.hasOwnProperty(b)&&B!=null)switch(b){case"value":break;case"multiple":ne=B;default:d.hasOwnProperty(b)||bt(n,r,b,null,d,B)}for(p in d)if(b=d[p],B=o[p],d.hasOwnProperty(p)&&(b!=null||B!=null))switch(p){case"value":ie=b;break;case"defaultValue":k=b;break;case"multiple":S=b;default:b!==B&&bt(n,r,p,b,d,B)}r=k,o=S,d=ne,ie!=null?Si(n,!!o,ie,!1):!!d!=!!o&&(r!=null?Si(n,!!o,r,!0):Si(n,!!o,o?[]:"",!1));return;case"textarea":ne=ie=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":ie=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,ie,ne);return;case"option":for(var ke in o)ie=o[ke],o.hasOwnProperty(ke)&&ie!=null&&!d.hasOwnProperty(ke)&&(ke==="selected"?n.selected=!1:bt(n,r,ke,null,d,ie));for(B in d)ie=d[B],ne=o[B],d.hasOwnProperty(B)&&ie!==ne&&(ie!=null||ne!=null)&&(B==="selected"?n.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":bt(n,r,B,ie,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 Le in o)ie=o[Le],o.hasOwnProperty(Le)&&ie!=null&&!d.hasOwnProperty(Le)&&bt(n,r,Le,null,d,ie);for(J in d)if(ie=d[J],ne=o[J],d.hasOwnProperty(J)&&ie!==ne&&(ie!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:bt(n,r,J,ie,d,ne)}return;default:if(ur(r)){for(var vt in o)ie=o[vt],o.hasOwnProperty(vt)&&ie!==void 0&&!d.hasOwnProperty(vt)&&Em(n,r,vt,void 0,d,ie);for(se in d)ie=d[se],ne=o[se],!d.hasOwnProperty(se)||ie===ne||ie===void 0&&ne===void 0||Em(n,r,se,ie,d,ne);return}}for(var G in o)ie=o[G],o.hasOwnProperty(G)&&ie!=null&&!d.hasOwnProperty(G)&&bt(n,r,G,null,d,ie);for(le in d)ie=d[le],ne=o[le],!d.hasOwnProperty(le)||ie===ne||ie==null&&ne==null||bt(n,r,le,ie,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 Y5(){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 B=o[d],J=B.startTime;if(J>k)break;var se=B.transferSize,le=B.initiatorType;se&&X1(le)&&(B=B.responseEnd,S+=se*(B<k?1:(k-J)/(B-J)))}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 X5(){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,Z5=typeof clearTimeout=="function"?clearTimeout:void 0,ex=typeof Promise=="function"?Promise:void 0,Q5=typeof queueMicrotask=="function"?queueMicrotask:typeof ex<"u"?function(n){return ex.resolve(null).then(n).catch(J5)}:J1;function J5(n){setTimeout(function(){throw n})}function Ar(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),jo(r);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")Zl(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Zl(o);for(var b=o.firstChild;b;){var S=b.nextSibling,k=b.nodeName;b[ra]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=S}}else o==="body"&&Zl(n.ownerDocument.body);o=p}while(o);jo(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),hl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function eT(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[ra])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=Rn(n.nextSibling),n===null)break}return null}function tT(n,r,o){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Rn(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=Rn(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 iT(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 Rn(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 Rn(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 Zl(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);hl(n)}var Dn=new Map,ox=new Set;function od(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Vs=W.d;W.d={f:nT,r:sT,D:rT,C:aT,L:oT,m:lT,X:uT,S:cT,M:dT};function nT(){var n=Vs.f(),r=Qu();return n||r}function sT(n){var r=ks(n);r!==null&&r.tag===5&&r.type==="form"?Ev(r):Vs.r(n)}var Ro=typeof document>"u"?null:document;function lx(n,r,o){var d=Ro;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 rT(n){Vs.D(n),lx("dns-prefetch",n,null)}function aT(n,r){Vs.C(n,r),lx("preconnect",n,r)}function oT(n,r,o){Vs.L(n,r,o);var d=Ro;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=Do(n);break;case"script":b=Oo(n)}Dn.has(b)||(n=_({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:n,as:r},o),Dn.set(b,n),d.querySelector(p)!==null||r==="style"&&d.querySelector(Ql(b))||r==="script"&&d.querySelector(Jl(b))||(r=d.createElement("link"),ki(r,"link",n),Yt(r),d.head.appendChild(r)))}}function lT(n,r){Vs.m(n,r);var o=Ro;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=Oo(n)}if(!Dn.has(b)&&(n=_({rel:"modulepreload",href:n},r),Dn.set(b,n),o.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Jl(b)))return}d=o.createElement("link"),ki(d,"link",n),Yt(d),o.head.appendChild(d)}}}function cT(n,r,o){Vs.S(n,r,o);var d=Ro;if(d&&n){var p=cr(d).hoistableStyles,b=Do(n);r=r||"default";var S=p.get(b);if(!S){var k={loading:0,preload:null};if(S=d.querySelector(Ql(b)))k.loading=5;else{n=_({rel:"stylesheet",href:n,"data-precedence":r},o),(o=Dn.get(b))&&Om(n,o);var B=S=d.createElement("link");Yt(B),ki(B,"link",n),B._p=new Promise(function(J,se){B.onload=J,B.onerror=se}),B.addEventListener("load",function(){k.loading|=1}),B.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 uT(n,r){Vs.X(n,r);var o=Ro;if(o&&n){var d=cr(o).hoistableScripts,p=Oo(n),b=d.get(p);b||(b=o.querySelector(Jl(p)),b||(n=_({src:n,async:!0},r),(r=Dn.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 dT(n,r){Vs.M(n,r);var o=Ro;if(o&&n){var d=cr(o).hoistableScripts,p=Oo(n),b=d.get(p);b||(b=o.querySelector(Jl(p)),b||(n=_({src:n,async:!0,type:"module"},r),(r=Dn.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=me.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=Do(o.href),o=cr(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=Do(o.href);var b=cr(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(Ql(n)))&&!b._p&&(S.instance=b,S.state.loading=5),Dn.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},Dn.set(n,o),b||hT(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=Oo(o),o=cr(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 Do(n){return'href="'+Zi(n)+'"'}function Ql(n){return'link[rel="stylesheet"]['+n+"]"}function ux(n){return _({},n,{"data-precedence":n.precedence,precedence:null})}function hT(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 Oo(n){return'[src="'+Zi(n)+'"]'}function Jl(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=Do(o.href);var b=n.querySelector(Ql(p));if(b)return r.state.loading|=4,r.instance=b,Yt(b),b;d=ux(o),(p=Dn.get(p))&&Om(d,p),b=(n.ownerDocument||n).createElement("link"),Yt(b);var S=b;return S._p=new Promise(function(k,B){S.onload=k,S.onerror=B}),ki(b,"link",d),r.state.loading|=4,ld(b,o.precedence,n),r.instance=b;case"script":return b=Oo(o.src),(p=n.querySelector(Jl(b)))?(r.instance=p,Yt(p),p):(d=o,(p=Dn.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[ra]||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 fT(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 mT(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=Do(d.href),b=r.querySelector(Ql(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=Dn.get(p))&&Om(d,p),b=b.createElement("link"),Yt(b);var S=b;S._p=new Promise(function(k,B){S.onload=k,S.onerror=B}),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 pT(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*Y5());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(gT,n),dd=null,ud.call(n))}function gT(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 ec={$$typeof:R,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function _T(n,r,o,d,p,b,S,k,B){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=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=B,this.incompleteTransitions=new Map}function px(n,r,o,d,p,b,S,k,B,J,se,le){return n=new _T(n,r,o,S,B,J,se,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=co,n):co}function _x(n,r,o,d,p,b){p=gx(p),d.context===null?d.context=p:d.pendingContext=p,d=br(r),d.payload={element:o},b=b===void 0?null:b,b!==null&&(d.callback=b),o=vr(n,d,r),o!==null&&(sn(o,n,r),Dl(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=da(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=da(n,r);o!==null&&sn(o,n,r),Bm(n,r)}}var fd=!0;function bT(n,r,o,d){var p=O.T;O.T=null;var b=W.p;try{W.p=2,zm(n,r,o,d)}finally{W.p=b,O.T=p}}function vT(n,r,o,d){var p=O.T;O.T=null;var b=W.p;try{W.p=8,zm(n,r,o,d)}finally{W.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(yT(p,n,r,o,d))d.stopPropagation();else if(Sx(n,d),r&4&&-1<xT.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 B=1<<31-yi(S);k.entanglements[1]|=B,S&=~B}rs(b),(ut&6)===0&&(Xu=Ot()+500,Wl(0))}}break;case 31:case 13:k=da(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=$e(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 Ya:return 32;case ar:return 268435456;default:return 32}default:return 32}}var Um=!1,Mr=null,Rr=null,Dr=null,tc=new Map,ic=new Map,Or=[],xT="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":Mr=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":tc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(r.pointerId)}}function nc(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 yT(n,r,o,d,p){switch(r){case"focusin":return Mr=nc(Mr,n,r,o,d,p),!0;case"dragenter":return Rr=nc(Rr,n,r,o,d,p),!0;case"mouseover":return Dr=nc(Dr,n,r,o,d,p),!0;case"pointerover":var b=p.pointerId;return tc.set(b,nc(tc.get(b)||null,n,r,o,d,p)),!0;case"gotpointercapture":return b=p.pointerId,ic.set(b,nc(ic.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,Ja(n.priority,function(){xx(o)});return}}else if(r===31){if(r=h(o),r!==null){n.blockedOn=r,Ja(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);Ae=d,o.target.dispatchEvent(d),Ae=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 ST(){Um=!1,Mr!==null&&pd(Mr)&&(Mr=null),Rr!==null&&pd(Rr)&&(Rr=null),Dr!==null&&pd(Dr)&&(Dr=null),tc.forEach(Ex),ic.forEach(Ex)}function gd(n,r){n.blockedOn===r&&(n.blockedOn=null,Um||(Um=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ST)))}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 jo(n){function r(B){return gd(B,n)}Mr!==null&&gd(Mr,n),Rr!==null&&gd(Rr,n),Dr!==null&&gd(Dr,n),tc.forEach(r),ic.forEach(r);for(var o=0;o<Or.length;o++){var d=Or[o];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Or.length&&(o=Or[0],o.blockedOn===null);)wx(o),o.blockedOn===null&&Or.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[or]=null}};function bd(n){this._internalRoot=n}bd.prototype.unstable_scheduleHydration=function(n){if(n){var r=Qa();n={blockedOn:null,target:n,priority:r};for(var o=0;o<Or.length&&r!==0&&r<Or[o].priority;o++);Or.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"));W.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 wT={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(wT),fi=vd}catch{}}return rc.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[or]=r.current,Sm(n),new Hm(r)},rc.hydrateRoot=function(n,r,o){if(!a(n))throw Error(s(299));var d=!1,p="",b=jv,S=Lv,k=Bv,B=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&&(B=o.formState)),r=px(n,1,!0,r,o??null,d,p,B,b,S,k,kx),r.context=gx(null),o=r.current,d=_n(),d=Mt(d),p=br(d),p.callback=null,vr(o,p,d),o=d,r.current.lanes=o,yt(r,o),rs(r),n[or]=r.current,Sm(n),new bd(r)},rc.version="19.2.6",rc}var zx;function OT(){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=DT(),Vm.exports}var V2=OT();const q2=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();const jT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const LT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());const Ix=e=>{const t=LT(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 BT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},zT=E.createContext({}),IT=()=>E.useContext(zT),PT=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=""}=IT()??{},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:q2("lucide",x,a),...!l&&!BT(h)&&{"aria-hidden":"true"},...h},[...c.map(([w,C])=>E.createElement(w,C)),...Array.isArray(l)?l:[l]])});const be=(e,t)=>{const i=E.forwardRef(({className:s,...a},l)=>E.createElement(PT,{ref:l,iconNode:t,className:q2(`lucide-${jT(Ix(e))}`,`lucide-${e}`,s),...a}));return i.displayName=Ix(e),i};const UT=[["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"}]],La=be("activity",UT);const HT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],FT=be("arrow-down",HT);const $T=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],VT=be("arrow-up",$T);const qT=[["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=be("bot",qT);const GT=[["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"}]],G2=be("box",GT);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"}]],WT=be("braces",KT);const YT=[["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=be("brain",YT);const XT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],el=be("check",XT);const ZT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],es=be("chevron-down",ZT);const QT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],JT=be("chevron-left",QT);const eA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zr=be("chevron-right",eA);const tA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],H0=be("chevron-up",tA);const iA=[["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"}]],nA=be("clipboard-copy",iA);const sA=[["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"}]],W2=be("code-xml",sA);const rA=[["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"}]],Y2=be("copy",rA);const aA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Px=be("corner-down-left",aA);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=be("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=be("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=be("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=be("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=be("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=be("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=be("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"}]],X2=be("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=be("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=be("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"}]],Z2=be("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=be("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=be("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"}]],Q2=be("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=be("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=be("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=be("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=be("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"}]],$a=be("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=be("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"}]],J2=be("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"}]],Zs=be("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=be("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=be("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"}]],GA=be("image",qA);const KA=[["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=be("inbox",KA);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=be("key-round",WA);const XA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ki=be("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=be("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"}]],eE=be("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=be("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"}]],tE=be("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=be("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=be("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=be("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=be("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=be("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=be("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=be("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=be("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=be("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=be("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=be("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"}]],iE=be("plug",w4);const E4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pn=be("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=be("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=be("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"}]],nE=be("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=be("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"}]],sE=be("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=be("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=be("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=be("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=be("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"}]],G0=be("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=be("square-terminal",U4);const F4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Nh=be("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=be("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"}]],G4=be("table-2",q4);const K4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],rE=be("terminal",K4);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"}]],Gc=be("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=be("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=be("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=be("wrench",J4);const tM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sn=be("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=be("zap",iM);class aE extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function Xe(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 aE(s?.error||"Port already in use",s.conflict):new Error(s?.error||i.statusText);return s}async function Gi(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 Xe(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function Kc(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 Xe(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function sM(){return(await Xe("/api/agent")).agent}async function rM(e){return(await Xe(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function aM(){return(await Xe("/api/agent/usage")).usage}async function oM(){return(await Xe("/api/agent/claude-settings")).settings}async function lM(e){return(await Xe("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function cM(){const e=await Xe("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function uM(e,t,i){await Xe("/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 Xe("/api/databases")).connections}async function fM(){return(await Xe("/api/databases/detect")).detected}async function mM(e){await Kc("/api/databases",e)}async function pM(e){return Kc("/api/databases/test",e)}async function gM(e){await Xe(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function _M(e){return(await Xe(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function bM(e,t,i=100,s=0){return Xe(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}&offset=${s}`)}async function vM(e=100){return(await Xe(`/api/errors?limit=${e}`)).incidents}async function xM(e){return Xe(`/api/errors/${e}/prompt`)}async function yM(e,t=!1){return Xe(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function SM(e=200){return(await Xe(`/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 Xe(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function CM(){return(await Xe("/api/git/files")).files}async function kM(){return(await Xe("/api/git/file-sizes")).files}async function NM(e){const t=await Xe(`/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 Xe("/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 Xe(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function RM(){return(await Xe("/api/log-sources")).sources}async function DM(e){return(await Kc("/api/log-sources",e)).sources}async function oE(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 Xe(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}async function OM(){return Xe("/api/dashboard")}async function jM(e){await Xe(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function LM(e,t,i){t.includes(i)||await Gi("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function BM(e,t,i){t.includes(i)&&await Gi("/api/bundles",{name:e,originalName:e,services:t.filter(s=>s!==i).join(",")})}async function lE(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),Xe(`/api/fs/directories?${i.toString()}`)}async function cE(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 Xe(`/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 Xe(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function IM(e){const t=await Xe(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function Ux(e,t){return Xe(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function PM(e,t,i){return Xe(`/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 Xe(`/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 Xe(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function FM(e){return Kc("/api/services/test",e)}async function $M(e,t){return Kc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function VM(){return(await Xe("/api/terminal/sessions")).sessions}async function Bd(e){return(await Xe("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function qM(e){await Xe(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function uE(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=uE(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=uE(e))&&(s&&(s+=" "),s+=t);return s}const Hx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fx=Dc,dE=(e,t)=>i=>{var s;if(t?.variants==null)return Fx(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=Hx(g)||Hx(_);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 Fx(e,c,m,i?.class,i?.className)},GM=(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},KM=(e,t)=>({classGroupId:e,validator:t}),hE=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Qd="-",$x=[],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 fE(h,m,t)},getConflictingClassGroupIds:(c,h)=>{if(h){const m=s[c],f=i[c];return m?f?GM(f,m):m:f||$x}return i[c]||$x}}},fE=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],l=i.nextPart.get(a);if(l){const f=fE(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=hE();for(const s in e){const a=e[s];K0(a,i,s,t)}return i},K0=(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:mE(t,e);s.classGroupId=i},t6=(e,t,i,s)=>{if(n6(e)){K0(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(KM(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];K0(m,mE(t,h),i,s)}},mE=(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=hE(),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="!",Vx=":",r6=[],qx=(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===Vx){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 qx(l,x,v,y)};if(t){const a=t+Vx,l=s;s=c=>c.startsWith(a)?l(c.slice(a.length)):qx(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 j=w.substring(0,C);T=s(j);const M=T&&c[T]?s(w):void 0;M&&M!==T&&(T=M,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 R=x.length===0?"":x.length===1?x[0]:l(x).join(":"),A=y?R+xg:R,L=A+T;if(h.indexOf(L)>-1)continue;h.push(L);const F=a(T,N);for(let j=0;j<F.length;++j){const M=F[j];h.push(A+M)}f=_+(f.length>0?" "+f:f)}return f},h6=(...e)=>{let t=0,i,s,a="";for(;t<e.length;)(i=e[t++])&&(s=pE(i))&&(a&&(a+=" "),a+=s);return a},pE=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=pE(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},gE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_E=/^\((?:(\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)\(.+\)$/,Lr=e=>p6.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),as=e=>!!e&&Number.isInteger(Number(e)),Ym=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),qs=e=>g6.test(e),bE=()=>!0,y6=e=>_6.test(e)&&!b6.test(e),W0=()=>!1,S6=e=>v6.test(e),w6=e=>x6.test(e),E6=e=>!Ee(e)&&!Ce(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=>Qr(e,yE,W0),Ee=e=>gE.test(e),Ea=e=>Qr(e,SE,y6),Gx=e=>Qr(e,j6,Ke),N6=e=>Qr(e,EE,bE),T6=e=>Qr(e,wE,W0),Kx=e=>Qr(e,vE,W0),A6=e=>Qr(e,xE,w6),xd=e=>Qr(e,CE,S6),Ce=e=>_E.test(e),ac=e=>Va(e,SE),M6=e=>Va(e,wE),Wx=e=>Va(e,vE),R6=e=>Va(e,yE),D6=e=>Va(e,xE),yd=e=>Va(e,CE,!0),O6=e=>Va(e,EE,!0),Qr=(e,t,i)=>{const s=gE.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},Va=(e,t,i=!1)=>{const s=_E.exec(e);return s?s[1]?t(s[1]):i:!1},vE=e=>e==="position"||e==="percentage",xE=e=>e==="image"||e==="url",yE=e=>e==="length"||e==="size"||e==="bg-size",SE=e=>e==="length",j6=e=>e==="number",wE=e=>e==="family-name",EE=e=>e==="number"||e==="weight",CE=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"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),Ce,Ee],F=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],M=()=>[Ce,Ee,m],H=()=>[Lr,"full","auto",...M()],U=()=>[as,"none","subgrid",Ce,Ee],V=()=>["auto",{span:["full",as,Ce,Ee]},as,Ce,Ee],ee=()=>[as,"auto",Ce,Ee],K=()=>["auto","min","max","fr",Ce,Ee],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...M()],W=()=>[Lr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],X=()=>[Lr,"screen","full","dvw","lvw","svw","min","max","fit",...M()],$=()=>[Lr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],I=()=>[e,Ce,Ee],D=()=>[...A(),Wx,Kx,{position:[Ce,Ee]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",R6,k6,{size:[Ce,Ee]}],te=()=>[Ym,ac,Ea],re=()=>["","none","full",f,Ce,Ee],me=()=>["",Ke,ac,Ea],xe=()=>["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=()=>[Ke,Ym,Wx,Kx],pe=()=>["","none",y,Ce,Ee],Pe=()=>["none",Ke,Ce,Ee],st=()=>["none",Ke,Ce,Ee],Ie=()=>[Ke,Ce,Ee],Ft=()=>[Lr,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[bE],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",Ke],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lr,Ee,Ce,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,Ee]}],"container-named":[C6],columns:[{columns:[Ke,Ee,Ce,h]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],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",Ce,Ee]}],basis:[{basis:[Lr,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Lr,"auto","initial","none",Ee]}],grow:[{grow:["",Ke,Ce,Ee]}],shrink:[{shrink:["",Ke,Ce,Ee]}],order:[{order:[as,"first","last","none",Ce,Ee]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m: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":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[h,"screen",...W()]}],"min-w":[{"min-w":[h,"screen","none",...W()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[c]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",i,ac,Ea]}],"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,Ee]}],"font-family":[{font:[M6,T6,t]}],"font-features":[{"font-features":[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ce,Ee]}],"line-clamp":[{"line-clamp":[Ke,"none",Ce,Gx]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ce,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ce,Ea]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ce,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[as,Ce,Ee]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ce,Ee]}],"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:Y()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},as,Ce,Ee],radial:["",Ce,Ee],conic:[as,Ce,Ee]},D6,A6]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ce,Ee]}],"outline-w":[{outline:["",Ke,ac,Ea]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",g,yd,xd]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",_,yd,xd]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Ke,Ea]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",v,yd,xd]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Ke,Ce,Ee]}],"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":[Ke]}],"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":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"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":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"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":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"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":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"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":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"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":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"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":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ce,Ee]}],"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":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"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":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,Ee]}],filter:[{filter:["","none",Ce,Ee]}],blur:[{blur:pe()}],brightness:[{brightness:[Ke,Ce,Ee]}],contrast:[{contrast:[Ke,Ce,Ee]}],"drop-shadow":[{"drop-shadow":["","none",x,yd,xd]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Ke,Ce,Ee]}],"hue-rotate":[{"hue-rotate":[Ke,Ce,Ee]}],invert:[{invert:["",Ke,Ce,Ee]}],saturate:[{saturate:[Ke,Ce,Ee]}],sepia:[{sepia:["",Ke,Ce,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,Ee]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ce,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ce,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ce,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ce,Ee]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ce,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ce,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ce,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ce,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ce,Ee]}],ease:[{ease:["linear","initial",N,Ce,Ee]}],delay:[{delay:[Ke,Ce,Ee]}],animate:[{animate:["none",T,Ce,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ce,Ee]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Pe()}],"rotate-x":[{"rotate-x":Pe()}],"rotate-y":[{"rotate-y":Pe()}],"rotate-z":[{"rotate-z":Pe()}],scale:[{scale:st()}],"scale-x":[{"scale-x":st()}],"scale-y":[{"scale-y":st()}],"scale-z":[{"scale-z":st()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[Ce,Ee,"","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,Ce,Ee]}],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ce,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ce,Ee]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Ke,ac,Ea,Gx]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},B6=f6(L6);function he(...e){return B6(Dc(e))}const kE=dE("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 de({className:e,variant:t,size:i,...s}){return u.jsx("button",{className:he(kE({variant:t,size:i,className:e})),...s})}const NE=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 Wr={},TE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function AE(e){return typeof e=="object"&&e!==null}const ME=e=>/^0[^.\s]+$/u.test(e);function RE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Un=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,In=e=>e/1e3;function DE(e,t){return t?e*(1e3/t):0}const OE=(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=OE(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 Un;const a=l=>$6(l,0,1,e,i);return l=>l===0||l===1?l:OE(a(l),t,s)}const jE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LE=e=>t=>1-e(1-t),BE=Yc(.33,1.53,.69,.99),J0=LE(BE),zE=jE(J0),IE=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)),PE=LE(e_),UE=jE(e_),V6=Yc(.42,0,1,1),q6=Yc(0,0,.58,1),HE=Yc(.42,0,.58,1),G6=e=>Array.isArray(e)&&typeof e[0]!="number",FE=e=>Array.isArray(e)&&typeof e[0]=="number",K6={linear:Un,easeIn:V6,easeInOut:HE,easeOut:q6,circIn:e_,circInOut:UE,circOut:PE,backIn:J0,backInOut:zE,backOut:BE,anticipate:IE},W6=e=>typeof e=="string",Yx=e=>{if(FE(e)){Z0(e.length===4);const[t,i,s,a]=e;return Yc(t,i,s,a)}else if(W6(e))return K6[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 $E(e,t){let i=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>i=!0,c=Sd.reduce((R,A)=>(R[A]=Y6(l),R),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:g,update:_,preRender:v,render:x,postRender:y}=c,w=()=>{const R=Wr.useManualTiming,A=R?a.timestamp:performance.now();i=!1,R||(a.delta=s?1e3/60:Math.max(Math.min(A-a.timestamp,X6),1)),a.timestamp=A,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((R,A)=>{const L=c[A];return R[A]=(F,j=!1,M=!1)=>(i||C(),L.schedule(F,j,M)),R},{}),cancel:R=>{for(let A=0;A<Sd.length;A++)c[Sd[A]].cancel(R)},state:a,steps:c}}const{schedule:wt,cancel:Yr,state:Ni,steps:Xm}=$E(typeof requestAnimationFrame<"u"?requestAnimationFrame:Un,!0);let zd;function Z6(){zd=void 0}const Vi={now:()=>(zd===void 0&&Vi.set(Ni.isProcessing||Wr.useManualTiming?Ni.timestamp:performance.now()),zd),set:e=>{zd=e,queueMicrotask(Z6)}},VE=e=>t=>typeof t=="string"&&t.startsWith(e),qE=VE("--"),Q6=VE("var(--"),t_=e=>Q6(e)?J6.test(e.split("/*")[0].trim()):!1,J6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Xx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const tl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jc={...tl,transform:e=>_s(0,1,e)},wd={...tl,default:1},kc=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)),GE=(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={...tl,transform:e=>Math.round(iR(e))},Da={test:n_("rgb","red"),parse:GE("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:s=1})=>"rgba("+Zm.transform(e)+", "+Zm.transform(t)+", "+Zm.transform(i)+", "+kc(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:Da.transform},Xc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ur=Xc("deg"),ms=Xc("%"),Ne=Xc("px"),sR=Xc("vh"),rR=Xc("vw"),Zx={...ms,parse:e=>ms.parse(e)/100,transform:e=>ms.transform(e*100)},$o={test:n_("hsl","hue"),parse:GE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(e)+", "+ms.transform(kc(t))+", "+ms.transform(kc(i))+", "+kc(jc.transform(s))+")"},ii={test:e=>Da.test(e)||yg.test(e)||$o.test(e),parse:e=>Da.test(e)?Da.parse(e):$o.test(e)?$o.parse(e):yg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Da.transform(e):$o.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",WE="color",lR="var",cR="var(",Qx="${}",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 Xo(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(WE),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,Qx)).split(Qx);return{values:i,split:h,indexes:s,types:a}}function dR(e){return Xo(e).values}function YE({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+=kc(s[l]):c===WE?a+=ii.transform(s[l]):a+=s[l]}return a}}function hR(e){return YE(Xo(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=Xo(e);return YE(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,Da,$o],bR=e=>_R.find(t=>t.test(e));function Jx(e){const t=bR(e);if(!t)return!1;let i=t.parse(e);return t===$o&&(i=gR(i)),i}const ey=(e,t)=>{const i=Jx(e),s=Jx(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),Da.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)?ey:wR:Array.isArray(e)?XE:typeof e=="object"?ii.test(e)?ey:yR:eh}function XE(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=Xo(e),a=Xo(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(XE(SR(s,a),a.values),i):eh(e,t)};function ZE(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:()=>Yr(t),now:()=>Ni.isProcessing?Ni.timestamp:Vi.now()}},QE=(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:In(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,In(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 ty(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(!ty(e,MR)&&ty(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:-In(i.velocity||0)}),y=v||0,w=f/(2*Math.sqrt(m*g)),C=c-l,N=In(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 R,A,L,F,j,M;if(w<1)L=wg(N,w),F=(y+w*N*C)/L,R=U=>{const V=Math.exp(-w*N*U);return c-V*(F*Math.sin(L*U)+C*Math.cos(L*U))},j=w*N*F+C*L,M=w*N*C-F*L,A=U=>Math.exp(-w*N*U)*(j*Math.sin(L*U)+M*Math.cos(L*U));else if(w===1){R=V=>c-Math.exp(-N*V)*(C+(y+N*C)*V);const U=y+N*C;A=V=>Math.exp(-N*V)*(N*U*V-y)}else{const U=N*Math.sqrt(w*w-1);R=Z=>{const q=Math.exp(-w*N*Z),O=Math.min(U*Z,300);return c-q*((y+w*N*C)*Math.sinh(O)+U*C*Math.cosh(O))/U};const V=(y+w*N*C)/U,ee=w*N*V-C*U,K=w*N*C-V*U;A=Z=>{const q=Math.exp(-w*N*Z),O=Math.min(U*Z,300);return q*(ee*Math.sinh(O)+K*Math.cosh(O))}}const H={calculatedDuration:x&&_||null,velocity:U=>yn(A(U)),next:U=>{if(!x&&w<1){const ee=Math.exp(-w*N*U),K=Math.sin(L*U),Z=Math.cos(L*U),q=c-ee*(F*K+C*Z),O=yn(ee*(j*K+M*Z));return h.done=Math.abs(O)<=s&&Math.abs(c-q)<=a,h.value=h.done?c:q,h}const V=R(U);if(x)h.done=U>=_;else{const ee=yn(A(U));h.done=Math.abs(ee)<=s&&Math.abs(c-V)<=a}return h.value=h.done?c:V,h},toString:()=>{const U=Math.min(r_(H),th),V=QE(ee=>H.next(U*ee).value,U,30);return U+"ms "+V},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 JE(e,t,i){const s=Math.max(t-DR,0);return DE(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=M=>h!==void 0&&M<h||m!==void 0&&M>m,y=M=>h===void 0?m:m===void 0||Math.abs(h-M)<Math.abs(m-M)?h:m;let w=i*t;const C=_+w,N=c===void 0?C:c(C);N!==C&&(w=N-_);const T=M=>-w*Math.exp(-M/s),R=M=>N+T(M),A=M=>{const H=T(M),U=R(M);v.done=Math.abs(H)<=f,v.value=v.done?N:U};let L,F;const j=M=>{x(v.value)&&(L=M,F=ih({keyframes:[v.value,y(v.value)],velocity:JE(R,M,v.value),damping:a,stiffness:l,restDelta:f,restSpeed:g}))};return j(0),{calculatedDuration:null,next:M=>{let H=!1;return!F&&L===void 0&&(H=!0,A(M),j(M)),L!==void 0&&M>=L?F.next(M-L):(!H&&A(M),v)}}}function OR(e,t,i){const s=[],a=i||Wr.mix||ZE,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]||Un: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||HE).splice(0,e.length-1)}function Nc({duration:e=300,keyframes:t,times:i,ease:s="easeInOut"}){const a=G6(s)?s.map(Yx):Yx(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:Nc,keyframes:Nc,spring:ih};function eC(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;eC(t);const{type:i=Nc,repeat:s=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:h}=t;const m=i||Nc;m!==Nc&&typeof h[0]!="number"&&(this.mixKeyframes=Wc(HR,ZE(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 R=this.currentTime,A=s;if(_){const M=Math.min(this.currentTime,a)/h;let H=Math.floor(M),U=M%1;!U&&M>=1&&(U=1),U===1&&H--,H=Math.min(H,_+1),H%2&&(v==="reverse"?(U=1-U,x&&(U-=x/h)):v==="mirror"&&(A=c)),R=_s(0,1,U)*h}let L;T?(this.delayState.value=g[0],L=this.delayState):L=A.next(R),l&&!T&&(L.value=l(L.value));let{done:F}=L;!T&&m!==null&&(F=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return j&&y!==Eg&&(L.value=Th(g,this.options,C,this.speed)),w&&w(L.value),j&&this.finish(),L}then(t,i){return this.finished.then(t,i)}get duration(){return In(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(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 JE(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=In(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 Oa=e=>e*180/Math.PI,Cg=e=>{const t=Oa(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=>Oa(Math.atan(e[1])),skewY:e=>Oa(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),iy=Cg,ny=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sy=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:ny,scaleY:sy,scale:e=>(ny(e)+sy(e))/2,rotateX:e=>kg(Oa(Math.atan2(e[6],e[5]))),rotateY:e=>kg(Oa(Math.atan2(-e[2],e[0]))),rotateZ:iy,rotate:iy,skewX:e=>Oa(Math.atan(e[4])),skewY:e=>Oa(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(GR);return typeof l=="function"?l(c):c[l]}const qR=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Tg(i,t)};function GR(e){return parseFloat(e.trim())}const il=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nl=new Set(il),ry=e=>e===tl||e===Ne,KR=new Set(["x","y","z"]),WR=il.filter(e=>!KR.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 $r={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")};$r.translateX=$r.x;$r.translateY=$r.y;const Ba=new Set;let Ag=!1,Mg=!1,Rg=!1;function tC(){if(Mg){const e=Array.from(Ba).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,Ba.forEach(e=>e.complete(Rg)),Ba.clear()}function iC(){Ba.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mg=!0)})}function XR(){Rg=!0,iC(),tC(),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?(Ba.add(this),Ag||(Ag=!0,wt.read(iC),wt.resolveKeyframes(tC))):(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),Ba.delete(this)}cancel(){this.state==="scheduled"&&(Ba.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ZR=e=>e.startsWith("--");function nC(e,t,i){ZR(t)?e.style.setProperty(t,i):e.style[t]=i}const QR={};function sC(e,t){const i=RE(e);return()=>QR[t]??i()}const JR=sC(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),rC=sC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_c=([e,t,i,s])=>`cubic-bezier(${e}, ${t}, ${i}, ${s})`,ay={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_c([0,.65,.55,1]),circOut:_c([.55,0,1,.45]),backIn:_c([.31,.01,.66,-.59]),backOut:_c([.33,1.53,.69,.99])};function aC(e,t){if(e)return typeof e=="function"?rC()?QE(e,t):"ease-out":FE(e)?_c(e):Array.isArray(e)?e.map(i=>aC(i,t)||ay.easeOut):ay[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 _=aC(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 oC(e){return typeof e=="function"&&"applyToOptions"in e}function t8({type:e,...t}){return oC(e)&&rC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class lC 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),nC(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 In(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(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),Un):a(this)}}const cC={anticipate:IE,backInOut:zE,circInOut:UE};function i8(e){return e in cC}function n8(e){typeof e.ease=="string"&&i8(e.ease)&&(e.ease=cC[e.ease])}const tp=10;class s8 extends lC{constructor(t){n8(t),eC(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&&_&&nC(l,_,g),i.setWithVelocity(h.sample(Math.max(0,m-f)).value,g,f),h.stop()}}const oy=(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=oy(a,t),h=oy(l,t);return!c||!h?!1:r8(e)||(i==="spring"||oC(i))&&s}function Dg(e){e.duration=0,e.type="keyframes"}const uC=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=RE(()=>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&&(uC.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,(Wr.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(Un),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 dC(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 hC(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 TE(c)?parseFloat(c):c}return t_(a)?hC(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:nl.has(e)?e.startsWith("scale")?_8(t[1]):g8:v8;function fC(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?fC(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)),(Wr.instantAnimations||Wr.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 ly(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]=ly(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]=ly(s);t=t(i!==void 0?i:e.custom,a,l)}return t}function za(e,t,i){const s=e.getProps();return u_(s,t,i!==void 0?i:s.custom,e)}const mC=new Set(["width","height","top","left","right","bottom",...il]),cy=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>cy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,cy);return DE(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 Zo(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,Zo(i))}function k8(e){return Og(e)?e[e.length-1]||0:e}function N8(e,t){const i=za(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&&Wr.WillChange){const s=new Wr.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function d_(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const A8="framerAppearId",pC="data-"+d_(A8);function gC(e){return e.props[pC]}function M8({protectedKeys:e,needsAnimating:t},i){const s=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function _C(e,t,{delay:i=0,transitionOverride:s,type:a}={}){let{transition:l,transitionEnd:c,...h}=t;const m=e.getDefaultTransition();l=l?fC(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 A=gC(e);if(A){const L=window.MotionHandoffAnimation(A,v,wt);L!==null&&(w.startTime=L,N=!0)}}jg(e,v);const T=f??e.shouldReduceMotion;x.start(c_(v,x,y,T&&mC.has(v)?{type:!1}:w,e,N));const R=x.animation;R&&g.push(R)}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=za(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(_C(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)+dC(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"?za(e,t,i.custom):t;s=Promise.all(_C(e,a,i))}return s.then(()=>{e.notify("AnimationComplete",t)})}const O8={test:e=>e==="auto",parse:e=>e},bC=e=>t=>t.test(e),vC=[tl,Ne,ms,Ur,rR,sR,O8],uy=e=>vC.find(bC(e));function j8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ME(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))}},dy={...tl,transform:Math.round},I8={rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:wd,scaleX:wd,scaleY:wd,scaleZ:wd,skew:Ur,skewX:Ur,skewY:Ur,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:jc,originX:Zx,originY:Zx,originZ:Ne},h_={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...I8,zIndex:dy,fillOpacity:jc,strokeOpacity:jc,numOctaves:dy},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},xC=e=>P8[e],U8=new Set([Bg,zg]);function yC(e,t){let i=xC(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)&&Xo(l).values.length&&(a=e[s]),s++}if(a&&i)for(const l of t)e[l]=yC(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=hC(_,i.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=_)}}if(this.resolveNoneKeyframes(),!mC.has(s)||t.length!==2)return;const[a,l]=t,c=uy(a),h=uy(l),m=Xx(a),f=Xx(l);if(m!==f&&$r[s]){this.needsMeasurement=!0;return}if(c!==h)if(ry(c)&&ry(h))for(let g=0;g<t.length;g++){const _=t[g];typeof _=="string"&&(t[g]=parseFloat(_))}else $r[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=$r[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]=$r[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 SC(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 wC=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function V8(e){return AE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:f_}=$E(queueMicrotask,!1),Xn={x:!1,y:!1};function EC(){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 CC(e,t){const i=SC(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[i,a,()=>s.abort()]}function G8(e){return!(e.pointerType==="touch"||EC())}function K8(e,t,i={}){const[s,a,l]=CC(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(!G8(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 kC=(e,t)=>t?e===t?!0:kC(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 hy(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=hy(()=>{if(Id.has(i))return;ip(i,"down");const a=hy(()=>{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 fy(e){return m_(e)&&!EC()}const my=new WeakSet;function J8(e,t,i={}){const[s,a,l]=CC(e,i),c=h=>{const m=h.currentTarget;if(!fy(h)||my.has(h))return;Id.add(m),i.stopPropagation&&my.add(h);const f=t(m,h),g=(x,y)=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",v),Id.has(m)&&Id.delete(m),fy(x)&&typeof f=="function"&&f(x,{success:y})},_=x=>{g(x,m===window||m===document||i.useGlobalTarget||kC(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 AE(e)&&"ownerSVGElement"in e}const Pd=new WeakMap;let Ud;const NC=(e,t,i)=>(s,a)=>a&&a[0]?a[0][e+"Size"]:p_(s)&&"getBBox"in s?s.getBBox()[t]:s[i],eD=NC("inline","width","offsetWidth"),tD=NC("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=SC(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 Vo;function aD(){Vo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hd.forEach(t=>t(e))},window.addEventListener("resize",Vo)}function oD(e){return Hd.add(e),Vo||aD(),()=>{Hd.delete(e),!Hd.size&&typeof Vo=="function"&&(window.removeEventListener("resize",Vo),Vo=void 0)}}function py(e,t){return typeof e=="function"?oD(e):rD(e,t)}function lD(e){return p_(e)&&e.tagName==="svg"}const cD=[...vC,ii,Jn],uD=e=>cD.find(bC(e)),gy=()=>({translate:0,scale:1,origin:0,originPoint:0}),qo=()=>({x:gy(),y:gy()}),_y=()=>({min:0,max:0}),ui=()=>({x:_y(),y:_y()}),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 TC(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,Zo(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,Zo(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},AC={current:!1},fD=typeof window<"u";function mD(){if(AC.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 by=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sh={};function MC(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=TC(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:(AC.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(),Yr(this.notifyUpdate),Yr(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&&uC.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:h,times:m,ease:f,duration:g}=i.accelerate,_=new lC({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=nl.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<by.length;s++){const a=by[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=Zo(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"&&(TE(s)||ME(s))?s=parseFloat(s):!uD(s)&&Jn.test(i)&&(s=yC(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 RC 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 Jr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function DC({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 Ta(e){return Pg(e)||OC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function OC(e){return vy(e.x)||vy(e.y)}function vy(e){return e&&e!=="0%"}function rh(e,t,i){const s=e-i,a=t*s;return i+a}function xy(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=xy(e.min,t,i,s,a),e.max=xy(e.max,t,i,s,a)}function jC(e,{x:t,y:i}){Ug(e.x,t.translate,t.scale,t.originPoint),Ug(e.y,i.translate,i.scale,i.originPoint)}const yy=.999999999999,Sy=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,jC(e,c)),s&&Ta(l.latestValues)&&Fd(e,l.latestValues,l.layout?.layoutBox))}t.x<Sy&&t.x>yy&&(t.x=1),t.y<Sy&&t.y>yy&&(t.y=1)}function hs(e,t){e.min+=t,e.max+=t}function wy(e,t,i,s,a=.5){const l=At(e.min,e.max,a);Ug(e,t,i,l,s)}function Ey(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Fd(e,t,i){const s=i??e;wy(e.x,Ey(t.x,s.x),t.scaleX,t.scale,t.originX),wy(e.y,Ey(t.y,s.y),t.scaleY,t.scale,t.originY)}function LC(e,t){return DC(bD(e.getBoundingClientRect(),t))}function xD(e,t,i){const s=LC(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=il.length;function wD(e,t,i){let s="",a=!0;for(let l=0;l<SD;l++){const c=il[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=wC(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(nl.has(m)){c=!0;continue}else if(qE(m)){a[m]=f;continue}else{const g=wC(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 BC(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 Cy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const oc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const i=Cy(e,t.target.x),s=Cy(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:{...oc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:oc,borderTopRightRadius:oc,borderBottomLeftRadius:oc,borderBottomRightRadius:oc,boxShadow:ED};function zC(e,{layout:t,layoutId:i}){return nl.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])||zC(c,e)||i?.getValue(c)?.liveStyle!==void 0)&&(l[c]=s[c]);return l}function CD(e){return window.getComputedStyle(e)}class kD extends RC{constructor(){super(...arguments),this.type="html",this.renderInstance=BC}readValueFromInstance(t,i){if(nl.has(i))return this.projection?.isProjecting?Ng(i):qR(t,i);{const s=CD(t),a=(qE(i)?s.getPropertyValue(i):s[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return LC(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 IC(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 PC=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"]),UC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function RD(e,t,i,s){BC(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(PC.has(a)?a:d_(a),t.attrs[a])}function HC(e,t,i){const s=v_(e,t,i);for(const a in e)if(Ai(e[a])||Ai(t[a])){const l=il.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[l]=e[a]}return s}class DD extends RC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ui}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(nl.has(i)){const s=xC(i);return s&&s.default||0}return i=PC.has(i)?i:d_(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return HC(t,i,s)}build(t,i,s){IC(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,a){RD(t,i,s,a)}mount(t){this.isSVGTag=UC(t.tagName),super.mount(t)}}const OD=__.length;function FC(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?FC(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 $C(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=ky(),s=!0,a=!1;const l=f=>(g,_)=>{const v=za(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,_=FC(e.parent)||{},v=[],x=new Set;let y={},w=1/0;for(let N=0;N<LD;N++){const T=jD[N],R=i[T],A=g[T]!==void 0?g[T]:_[T],L=Lc(A),F=T===f?R.isActive:null;F===!1&&(w=N);let j=A===_[T]&&A!==g[T]&&L;if(j&&(s||a)&&e.manuallyAnimateOnMount&&(j=!1),R.protectedKeys={...y},!R.isActive&&F===null||!A&&!R.prevProp||Ah(A)||typeof A=="boolean")continue;if(T==="exit"&&R.isActive&&F!==!0){R.prevResolvedValues&&(y={...y,...R.prevResolvedValues});continue}const M=ID(R.prevProp,A);let H=M||T===f&&R.isActive&&!j&&L||N>w&&L,U=!1;const V=Array.isArray(A)?A:[A];let ee=V.reduce(l(T),{});F===!1&&(ee={});const{prevResolvedValues:K={}}=R,Z={...K,...ee},q=X=>{H=!0,x.has(X)&&(U=!0,x.delete(X)),R.needsAnimating[X]=!0;const $=e.getValue(X);$&&($.liveStyle=!1)};for(const X in Z){const $=ee[X],I=K[X];if(y.hasOwnProperty(X))continue;let D=!1;Og($)&&Og(I)?D=!$C($,I):D=$!==I,D?$!=null?q(X):x.add(X):$!==void 0&&x.has(X)?q(X):R.protectedKeys[X]=!0}R.prevProp=A,R.prevResolvedValues=ee,R.isActive&&(y={...y,...ee}),(s||a)&&e.blockInitialAnimation&&(H=!1);const O=j&&M;H&&(!O||U)&&v.push(...V.map(X=>{const $={type:T};if(typeof X=="string"&&(s||a)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:I}=e,D=za(I,X);if(I.enteringChildren&&D){const{delayChildren:Y}=D.transition||{};$.delay=dC(I.enteringChildren,e,Y)}}return{animation:X,options:$}}))}if(x.size){const N={};if(typeof g.initial!="boolean"){const T=za(e,Array.isArray(g.initial)?g.initial[0]:g.initial);T&&T.transition&&(N.transition=T.transition)}x.forEach(T=>{const R=e.getBaseTarget(T),A=e.getValue(T);A&&(A.liveStyle=!0),N[T]=R??null}),v.push({animation:N})}let 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=ky(),a=!0}}}function ID(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$C(t,e):!1}function Ca(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ky(){return{animate:Ca(!0),whileInView:Ca(),whileHover:Ca(),whileTap:Ca(),whileDrag:Ca(),whileFocus:Ca(),exit:Ca()}}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 Ny(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const VC=1e-4,PD=1-VC,UD=1+VC,qC=.01,HD=0-qC,FD=0+qC;function qi(e){return e.max-e.min}function $D(e,t,i){return Math.abs(e-t)<=i}function Ty(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 Tc(e,t,i,s){Ty(e.x,t.x,i.x,s?s.originX:void 0),Ty(e.y,t.y,i.y,s?s.originY:void 0)}function Ay(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){Ay(e.x,t.x,i.x,s?.x),Ay(e.y,t.y,i.y,s?.y)}function My(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){My(e.x,t.x,i.x,s?.x),My(e.y,t.y,i.y,s?.y)}function Ry(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=Ry(e.min,t,i,h,a),e.max=Ry(e.max,t,i,h,a)}function Dy(e,t,[i,s,a],l,c){qD(e,t[i],t[s],t[a],t.scale,l,c)}const GD=["x","scaleX","originX"],KD=["y","scaleY","originY"];function Oy(e,t,i,s){Dy(e.x,t,GD,i?i.x:void 0,s?s.x:void 0),Dy(e.y,t,KD,i?i.y:void 0,s?s.y:void 0)}function jy(e){return e.translate===0&&e.scale===1}function GC(e){return jy(e.x)&&jy(e.y)}function Ly(e,t){return e.min===t.min&&e.max===t.max}function WD(e,t){return Ly(e.x,t.x)&&Ly(e.y,t.y)}function By(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function KC(e,t){return By(e.x,t.x)&&By(e.y,t.y)}function zy(e){return qi(e.x)/qi(e.y)}function Iy(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 WC=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],XD=WC.length,Py=e=>typeof e=="string"?parseFloat(e):e,Uy=e=>typeof e=="number"||Ne.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=WC[c];let m=Hy(t,h),f=Hy(i,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||Uy(m)===Uy(f)?(e[h]=Math.max(At(Py(m),Py(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 Hy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const QD=YC(0,.5,PE),JD=YC(.5,.95,Un);function YC(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:Zo(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&&(Yr(s),e(l-t))};return wt.setup(s,!0),()=>Yr(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 XC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=gC(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&&XC(s)}function ZC({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(Vy)))})}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 R={...l_(y,"layout"),onPlay:w,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(g,T)}else _||Vy(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(),Yr(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&&XC(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(Fy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($y);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($y),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&&!GC(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,g=f!==this.prevTransformTemplateValue;c&&this.instance&&(h||Ta(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)),Ta(_.latestValues)&&Fd(f,_.latestValues,_.layout?.layoutBox)}return Ta(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(!Ta(f.latestValues))continue;let g;f.instance&&(Pg(f.latestValues)&&f.updateSnapshot(),g=ui(),Yn(g,f.measurePageBox())),Oy(h,f.latestValues,f.snapshot?.layoutBox,g)}return Ta(this.latestValues)&&Oy(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),jC(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)||OC(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():(Ny(this.prevProjectionDelta.x,this.projectionDelta.x),Ny(this.prevProjectionDelta.y,this.projectionDelta.y)),Tc(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==v||!Iy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Iy(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=qo(),this.projectionDelta=qo(),this.projectionDeltaWithTransform=qo()}setAnimationOrigin(c,h=!1){const m=this.snapshot,f=m?m.latestValues:{},g={...this.latestValues},_=qo();(!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 R;this.mixTargetDelta=A=>{const L=A/1e3;qy(_.x,c.x,L),qy(_.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),R&&WD(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=ui()),Yn(R,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&&(Yr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{Vd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zo(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&&QC(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),Tc(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&&!Ta(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 R=C.length;for(let A=0;A<R;A++)c[C[A]]=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(Fy),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 QC(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=qo();Tc(c,i,t.layoutBox);const h=qo();l?Tc(h,e.applyTransform(s,!0),t.measuredBox):Tc(h,i,t.layoutBox);const m=!GC(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 Fy(e){e.clearMeasurements()}function hO(e){e.isLayoutDirty=!0,e.updateLayout()}function $y(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 Vy(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 qy(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 Gy(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){Gy(e.x,t.x,i.x,s),Gy(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),Wy=Ky("applewebkit/")&&!Ky("chrome/")?Math.round:Un;function Yy(e){e.min=Wy(e.min),e.max=Wy(e.max)}function SO(e){Yy(e.x),Yy(e.y)}function QC(e,t,i){return e==="position"||e==="preserve-aspect"&&!$D(zy(t),zy(i),.2)}function wO(e){return e!==e.root&&e.scroll?.wasRoot}const EO=ZC({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},JC=ZC({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"}),ek=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 tk=E.createContext({strict:!1}),Xy={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 Zy=!1;function kO(){if(Zy)return;const e={};for(const t in Xy)e[t]={isEnabled:i=>Xy[t].some(s=>!!i[s])};MC(e),Zy=!0}function ik(){return kO(),pD()}function NO(e){const t=ik();for(const i in e)t[i]={...t[i],...e[i]};MC(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 nk=e=>!oh(e);function AO(e){typeof e=="function"&&(nk=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])||(nk(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}),[Qy(t),Qy(i)])}function Qy(e){return Array.isArray(e)?e.join(" "):e}const x_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sk(e,t,i){for(const s in t)!Ai(t[s])&&!zC(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 sk(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 rk=()=>({...x_(),attrs:{}});function BO(e,t,i,s){const a=E.useMemo(()=>{const l=rk();return IC(l,t,UC(s),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};sk(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=TC(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 R=N[T];if(Array.isArray(R)){const A=g?R.length-1:0;R=R[A]}R!==null&&(a[T]=R)}for(const T in w)a[T]=w[T]}}}return a}const ak=e=>(t,i)=>{const s=E.useContext(Rh),a=E.useContext(Y0),l=()=>PO(e,t,s,a);return i?l():z6(l)},HO=ak({scrapeMotionValuesFromProps:v_,createRenderState:x_}),FO=ak({scrapeMotionValuesFromProps:HC,createRenderState:rk}),$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 ok=E.createContext({});function Ho(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(tk),m=E.useContext(Y0),f=E.useContext(ek),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(ok);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&GO(v.current,i,a,w);const C=E.useRef(!1);E.useInsertionEffect(()=>{y&&C.current&&y.update(i,m)});const N=i[pC],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 GO(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:lk(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||h&&Ho(h),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:s,crossfade:_,layoutScroll:m,layoutRoot:f,layoutAnchor:g})}function lk(e){if(e)return e.options.allowProjection!==!1?e.projection:lk(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(ek),...f,layoutId:KO(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 KO({layoutId:e}){const t=E.useContext(NE).id;return t&&e!==void 0?t+"-"+e:e}function WO(e,t){E.useContext(tk).strict}function YO(e){const t=ik(),{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 Jr{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 Jr{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=za(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 Ac(e,t,i,s){return Bc(e,t,ij(i),s)}const ck=({current:e})=>e?e.ownerDocument.defaultView:null,Jy=(e,t)=>Math.abs(e-t);function nj(e,t){const i=Jy(e.x,t.x),s=Jy(e.y,t.y);return Math.sqrt(i**2+s**2)}const eS=new Set(["auto","scroll"]);class uk{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:R}=this.handlers;y||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=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(Ac(this.contextWindow,"pointermove",this.handlePointerMove),Ac(this.contextWindow,"pointerup",this.handlePointerUp),Ac(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let i=t.parentElement;for(;i;){const s=getComputedStyle(i);(eS.has(s.overflowX)||eS.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(),Yr(this.updatePoint)}}function Ed(e,t){return t?{point:t(e.point)}:e}function tS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lp({point:e},t){return{point:e,delta:tS(e,dk(t)),offset:tS(e,sj(t)),velocity:rj(t,.1)}}function sj(e){return e[0]}function dk(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=dk(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=In(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 iS(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:iS(e.x,i,a),y:iS(e.y,t,s)}}function nS(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:nS(e.x,t.x),y:nS(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:sS(e,"left","right"),y:sS(e,"top","bottom")}}function sS(e,t,i){return{min:rS(e,t),max:rS(e,i)}}function rS(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:R}=this.visualElement;if(R&&R.layout){const A=R.layout.layoutBox[N];A&&(T=qi(A)*(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 uk(t,{onSessionStart:l,onStart:c,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:s,contextWindow:ck(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&&Ho(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&&!Ho(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||!Ho(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=DC(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(!Ho(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=Ac(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();Ho(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 aS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function mj(e,t,i){const s=py(e,aS(i)),a=py(t,aS(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 Jr{constructor(t){super(t),this.removeGroupControls=Un,this.removeListeners=Un,this.controls=new fj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Un}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 Jr{constructor(){super(...arguments),this.removePointerDownListener=Un}onPointerDown(t){this.session=new uk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ck(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=Ac(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 hk(e){const[t,i]=CO(),s=E.useContext(NE);return u.jsx(bj,{...e,layoutGroup:s,switchLayoutGroup:E.useContext(ok),isPresent:t,safeToRemove:i})}const vj={pan:{Feature:_j},drag:{Feature:gj,ProjectionNode:JC,MeasureLayout:hk}};function oS(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 Jr{mount(){const{current:t}=this.node;t&&(this.unmount=K8(t,(i,s)=>(oS(this.node,s,"Start"),a=>oS(this.node,a,"End"))))}unmount(){}}class yj extends Jr{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 lS(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 Jr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=J8(t,(a,l)=>(lS(this.node,l,"Start"),(c,{success:h})=>lS(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 Jr{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:JC,MeasureLayout:hk}},Dj={...tj,...Mj,...vj,...Rj},hp=XO(Dj,ZO),We=({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=A=>{A.stopPropagation(),l?.()},R=A=>{A.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:he("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(Ki,{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:R,type:"button",children:u.jsx(Sn,{className:"size-3.5"})})]})};function Oj(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const jj=dE("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:he(jj({variant:t,className:e})),...i})}function Js({className:e,...t}){return u.jsx("div",{className:he("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function er({className:e,...t}){return u.jsx("div",{className:he("grid gap-1.5 p-4",e),...t})}function tr({className:e,...t}){return u.jsx("h3",{className:he("text-sm font-semibold tracking-tight",e),...t})}function ea({className:e,...t}){return u.jsx("p",{className:he("text-sm text-muted-foreground",e),...t})}function ir({className:e,...t}){return u.jsx("div",{className:he("p-4 pt-0",e),...t})}const cS=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>cS&&g.splice(0,g.length-cS),g})}catch{}}),()=>{c.close()}},[]);const l=[...e].reverse();return u.jsxs(Js,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(er,{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(La,{className:"size-4 text-muted-foreground"}),u.jsx(tr,{children:"Live MCP Tool Calls"}),u.jsx(We,{variant:"outline",size:"small",children:e.length})]}),u.jsx(We,{variant:"outline",size:"small",icon:u.jsx("span",{className:he("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),u.jsx(ea,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),u.jsx(ir,{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(We,{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(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(er,{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(tr,{children:"Recent Projects"})]}),u.jsx(We,{variant:"outline",size:"small",children:e.projects.length})]}),u.jsx(ea,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),u.jsx(ir,{className:"p-0",children:e.projects.length?u.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>u.jsxs("li",{className:he("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(We,{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 sl({className:e}){return u.jsx("svg",{className:he("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:he("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:he("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(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(er,{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(tr,{children:"Project Memory"})]}),u.jsx(We,{variant:"outline",size:"small",children:a})]}),u.jsx(ea,{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(ir,{className:"space-y-2 p-3",children:[i?u.jsx(uS,{title:i,preview:s,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(l=>u.jsx(uS,{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 uS({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(Zr,{className:he("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"})}),Gj=()=>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,Kj=0;const ni={toasts:[],listeners:new Set,add(e,t,i,s,a,l){const c=Kj++,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 A=w-1;A>y;A--)a?N+=(e[A-1]?.measuredHeight||63)+10:N+=20;const T=-C,R=a?1:1-.05*C;return`translate3d(0, calc(100% - ${N}px), ${T}px) scale(${R})`},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(Gj,{})}),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=V2.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(sl,{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:Bn(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:Bn(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:Bn(e.cacheReadInputTokens)}),u.jsx(Bi,{label:"Cache create",value:Bn(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:hS(e.durationMs)}),u.jsx(Bi,{label:"API",value:hS(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:[Bn(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:Bn(e.inputTokens)}),u.jsx(Bi,{label:"Output",value:Bn(e.outputTokens)}),u.jsx(Bi,{label:"Cache read",value:Bn(e.cachedInputTokens)}),u.jsx(Bi,{label:"Reasoning",value:Bn(e.reasoningOutputTokens)}),u.jsx(Bi,{label:"Total",value:Bn(e.totalTokens)}),u.jsx(Bi,{label:"Last turn",value:Bn(e.lastTotalTokens)}),u.jsx(Bi,{label:"Context",value:e.contextWindow?Bn(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(dS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?u.jsx(dS,{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 dS({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:he("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:he("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 Bn(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function hS(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(sl,{})},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(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(er,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(J2,{className:"size-4 text-muted-foreground"}),u.jsx(tr,{children:c?"Token Usage & Rate Limits":"Token & Cost Usage"}),u.jsx(We,{variant:"outline",size:"small",icon:l.icon,children:l.label}),i?u.jsx(We,{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(ea,{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(ir,{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(fS,{agent:"Codex CLI"}):s?.claude?u.jsx(Yj,{usage:s.claude}):a?null:u.jsx(fS,{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(de,{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:he("gap-1.5",e),children:[u.jsx(sl,{className:"size-3.5"}),"Co-author"]})}function fS({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(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(er,{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(G0,{className:"size-4 text-muted-foreground"}),u.jsx(tr,{children:"Skills"})]}),u.jsx(We,{variant:"outline",size:"small",children:e.skills.length})]}),u.jsx(ea,{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(ir,{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(We,{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(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(er,{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(iE,{className:"size-4 text-muted-foreground"}),u.jsx(tr,{children:"MCP Servers"})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(We,{variant:"outline",size:"small",children:m.length}),u.jsx(de,{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(ea,{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(ir,{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(We,{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(Ki,{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:he("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(sl,{className:"size-4"})},{id:"codex",label:"Codex",icon:u.jsx(Qc,{className:"size-4"})}],o7=[{id:"overview",label:"Overview",icon:u.jsx(J2,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:u.jsx(K2,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:u.jsx(iE,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:u.jsx(La,{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:he("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:he("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 mS=0;const pS=()=>(mS+=1,`t${Date.now()}-${mS}`);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,R)=>{_(L=>L.filter(F=>F.requestId!==T));const A=x.current;if(A)try{await uM(A,T,R)}catch{}},[]),w=E.useCallback(()=>{v.current?.abort(),v.current=null,s(!1)},[]),C=E.useCallback(async T=>{const R=T.trim();if(!R||i)return;l(null);const A={id:pS(),role:"user",text:R,tools:[]},L=pS(),F={id:L,role:"assistant",text:"",tools:[]};t(H=>[...H,A,F]);const j=H=>t(U=>U.map(V=>V.id===L?H(V):V)),M=new AbortController;v.current=M,s(!0);try{await dM(R,x.current,H=>{switch(H.type){case"session":x.current=H.sessionId;break;case"text":j(U=>({...U,text:U.text+H.text}));break;case"tool_use":j(U=>({...U,tools:[...U.tools,{id:H.id,name:H.name,input:H.input,status:"running"}]}));break;case"tool_result":j(U=>({...U,tools:U.tools.map(V=>V.id===H.id?{...V,preview:H.preview,isError:H.isError,status:"done"}:V)}));break;case"approval_request":_(U=>[...U,{requestId:H.requestId,name:H.name,input:H.input}]);break;case"error":l(H.message);break;case"done":break}},M.signal)}catch(H){M.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 fk=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,x]=E.useState(!1),y=E.useRef([]),w=E.useCallback(()=>_(F=>F+1),[]),C=E.useCallback(()=>f(null),[]),N=E.useCallback(()=>{l(!0),x(!0)},[]),T=E.useCallback(F=>{l(!0),h(j=>j.trim()?`${j.replace(/\s*$/,"")} ${F} `:`${F} `),w()},[w]);E.useEffect(()=>{if(i)return;const F=y.current.shift();F&&s(F)},[i,s]);const R=E.useCallback(({prompt:F,source:j,mode:M="send"})=>(l(!0),f(j??null),M==="draft"?(h(F),w(),{queued:!1}):i?(y.current.push(F),{queued:!0}):(s(F),{queued:!1})),[i,s,w]),A=E.useCallback(()=>{y.current=[],f(null),t.clear()},[t]),L={...t,clear:A,open:a,setOpen:l,draft:c,setDraft:h,insertPath:T,activeSource:m,clearSource:C,focusNonce:g,sendToAgent:R,onboarding:v,setOnboarding:x,startOnboard:N};return u.jsx(fk.Provider,{value:L,children:e})}function Jc(){const e=E.useContext(fk);if(!e)throw new Error("useAgentDock must be used within an AgentProvider");return e}const d7=["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(`
15
+ `);function h7(e){const t=e?.trim();return[t?`Onboard this repository into NoMoreIDE and get it running: ${t}`:"I want to add a project to NoMoreIDE from a Git URL. First ask me for the repository URL (for example: `https://github.com/owner/repo`).","","Then set it up end-to-end yourself — don't make me fill in a form:","1. Call the `nomoreide_onboard_repo` tool with the URL to clone and analyze it."," It returns the clone path, a profile, and ranked proposals.","2. Pick the best proposal. Only ask me if it's genuinely ambiguous (e.g. several"," equally-likely apps in a monorepo) — otherwise choose sensible defaults.","3. Install dependencies if needed (run the install command in the clone path).","4. Register it with `nomoreide_register_service` using the returned clone path as"," the cwd, then register it as a git repo with `nomoreide_git_register_repository`"," so it shows in the Git tab.","5. Start it with `nomoreide_start_service` and confirm it came up (check its logs).","","Keep me posted as you go, but keep decisions to yourself unless you're truly stuck.","When it's running, end your message with the service name in a fenced `service`","block so I get Start / Open buttons for it, e.g.:","```service","backend","```"].join(`
16
+ `)}function f7(e,t,i,s,a){const l=s.map(c=>`- ${c.name}: ${c.dataType}${c.primaryKey?" (PK)":""}${c.nullable?"":" NOT NULL"}`).join(`
17
+ `);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(`
18
+ `)}const S_="application/x-nomoreide-path";function mk(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function pk(e,t){e.setData(S_,t)}function gS(e){return e.types.includes(S_)}function m7(e){return e.getData(S_)||null}function gk(e){return{draggable:!0,onDragStart:t=>{pk(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const p7=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),g7=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),_7=new Set(["conf","config","ini","toml","yaml","yml"]),b7=new Set(["csv","json","sql","xml"]),v7=new Set(["md","mdx","rst","txt"]),x7=new Set(["gif","jpeg","jpg","png","svg","webp"]),y7=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),S7=new Set(["css","less","sass","scss"]);function w7(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return y7.has(t)||t.endsWith(".lock")?"lock":E7(t)?"test":g7.has(t)||_7.has(i)?"config":S7.has(i)?"style":x7.has(i)?"image":v7.has(i)?"document":b7.has(i)?"data":p7.has(i)?"code":"generic"}function E7(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function w_({path:e,className:t}){const i=w7(e),s=C7[i];return u.jsx(s,{"aria-label":`${i} file`,className:he("size-3.5 shrink-0",k7[i],t)})}const C7={code:SA,config:B4,data:Kr,document:NA,generic:Q2,image:GA,lock:QA,style:u4,test:MA},k7={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 N7(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function T7({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),lE(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(de,{"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(Ki,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?u.jsxs(de,{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(de,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})})]}),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?"":N7(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($a,{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 A7=/```options[^\n]*\n([\s\S]*?)```/g,M7=/```service[^\n]*\n([\s\S]*?)```/g,R7=/```(?:options|service)[^\n]*\n[\s\S]*$/;function D7(e){const t=[];let i=null,s=e.replace(A7,(a,l)=>{for(const c of l.split(`
19
+ `)){const h=c.replace(/^[-*\d.)\s]+/,"").trim();h&&t.push(h)}return""});return s=s.replace(M7,(a,l)=>{const c=l.split(`
20
+ `).map(h=>h.trim()).find(Boolean);return c&&(i=c),""}),s=s.replace(R7,""),{body:s.trim(),options:t,service:i}}function O7({options:e,disabled:t,onChoose:i}){return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(s=>u.jsx(de,{className:"h-7",disabled:t,onClick:()=>i(s),size:"sm",type:"button",variant:"outline",children:s},s))})}function j7({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(de,{className:"h-7",onClick:()=>t(e),size:"sm",type:"button",children:[u.jsx(V0,{})," Start"]}),i?u.jsxs(de,{className:"h-7",onClick:()=>i(e),size:"sm",type:"button",variant:"outline",children:[u.jsx(F0,{})," Open"]}):null]})]})}function L7(e){return Math.min(e,Math.max(1,Math.ceil(e/22)))}function B7(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+L7(c.length-s.current.length));s.current=h,i(h)});return()=>cancelAnimationFrame(l)},[t,e]),t}function z7(){return u.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(Ki,{className:"size-3.5 animate-spin"}),u.jsx("span",{children:"Thinking…"})]})}function I7({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:R,clearSource:A,focusNonce:L,sendToAgent:F,onboarding:j,setOnboarding:M}=Jc(),[H,U]=E.useState(""),[V,ee]=E.useState(!1),[K,Z]=E.useState(!1),[q,O]=E.useState(!1),W=E.useRef(null),X=E.useRef(null),$=E.useRef(null);E.useEffect(()=>{y&&requestAnimationFrame(()=>X.current?.focus())},[y,L]),E.useEffect(()=>{if(!y)return;const pe=Pe=>{$.current?.contains(Pe.target)||w(!1)};return document.addEventListener("pointerdown",pe),()=>document.removeEventListener("pointerdown",pe)},[y,w]),E.useEffect(()=>{const pe=st=>{st.dataTransfer&&gS(st.dataTransfer)&&ee(!0)},Pe=()=>{ee(!1),Z(!1)};return document.addEventListener("dragstart",pe),document.addEventListener("dragend",Pe),document.addEventListener("drop",Pe),()=>{document.removeEventListener("dragstart",pe),document.removeEventListener("dragend",Pe),document.removeEventListener("drop",Pe)}},[]);const I=E.useRef(!0);function D(){const pe=W.current;pe&&(I.current=pe.scrollHeight-pe.scrollTop-pe.clientHeight<48)}E.useEffect(()=>{const pe=W.current;pe&&I.current&&(pe.scrollTop=pe.scrollHeight)},[a,y]);async function Y(){const pe=C;N(""),I.current=!0,await g(pe)}function ue(pe){pe.trim()&&(N(""),M(!1),U(""),I.current=!0,F({prompt:h7(pe),source:{type:"repo-onboard",label:"Onboard repo"}}))}function te(pe){I.current=!0,g(pe)}async function re(pe){try{await Gi(`/api/services/${encodeURIComponent(pe)}/start`,{}),s(`Starting ${pe}…`)}catch(Pe){i(Pe instanceof Error?Pe.message:`Could not start ${pe}.`)}}function me(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),Y())}function xe(pe){gS(pe.dataTransfer)&&(pe.preventDefault(),pe.dataTransfer.dropEffect="copy",y||w(!0),Z(!0))}function Oe(pe){pe.currentTarget.contains(pe.relatedTarget)||Z(!1)}function ye(pe){Z(!1);const Pe=m7(pe.dataTransfer);Pe&&(pe.preventDefault(),T(Pe))}return u.jsx("div",{ref:$,className:he("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]":V?"h-12":"h-9",V&&!K&&"border-primary/60 bg-primary/5",K&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),onDragOver:xe,onDragLeave:Oe,onDrop:ye,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(_S,{provider:m,className:"size-4 text-primary"}),u.jsx("span",{className:"text-sm font-medium",children:m?.label??"Agent"}),R?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(G0,{className:"size-3"}),u.jsx("span",{className:"max-w-40 truncate",children:R.label}),u.jsx("button",{"aria-label":"Clear source",className:"opacity-60 hover:opacity-100",onClick:A,type:"button",children:u.jsx(Sn,{className:"size-3"})})]}):null,l?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[u.jsx(Ki,{className:"size-3 animate-spin"})," thinking…"]}):null,u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e?u.jsx(de,{"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(de,{"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(Gc,{})}),u.jsx(de,{"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:W,className:"min-h-0 flex-1 space-y-3 overflow-auto px-3 py-3",onScroll:D,children:[a.length===0?u.jsx(P7,{configured:h,provider:m,onOnboard:()=>M(!0)}):a.map((pe,Pe)=>u.jsx(F7,{turn:pe,streaming:l&&Pe===a.length-1,isLast:Pe===a.length-1,onChoose:te,onStartService:re,onOpenService:t},pe.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(pe=>u.jsx(V7,{prompt:pe,onRespond:x},pe.requestId))}):null,u.jsxs("div",{className:he("relative shrink-0 border-t border-border p-2 transition-colors",V&&"bg-primary/5"),children:[q?u.jsx(T7,{onClose:()=>O(!1),onPick:pe=>{O(!1),T(pe)}}):null,j?u.jsxs("form",{className:"mb-2 flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 p-1.5",onSubmit:pe=>{pe.preventDefault(),ue(H)},children:[u.jsx(Zs,{className:"size-4 shrink-0 text-primary"}),u.jsx("input",{autoFocus:!0,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onChange:pe=>U(pe.target.value),placeholder:"Paste a repo URL — e.g. https://github.com/owner/repo",value:H}),u.jsx(de,{disabled:!H.trim(),size:"sm",type:"submit",children:"Onboard"}),u.jsx(de,{"aria-label":"Cancel onboarding",className:"size-7",onClick:()=>{M(!1),U("")},size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})})]}):H7(C)&&!l?u.jsxs("button",{className:"mb-2 flex w-full items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-1.5 text-left text-xs text-primary transition-colors hover:bg-primary/10",onClick:()=>ue(C),type:"button",children:[u.jsx(Zs,{className:"size-3.5 shrink-0"}),u.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Onboard ",u.jsx("span",{className:"font-mono",children:C.trim()})," as a service"]}),u.jsx(Px,{className:"size-3.5 shrink-0 opacity-60"})]}):null,u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsx(de,{"aria-label":"Attach a file or folder",className:"size-9 shrink-0",disabled:h===!1,onClick:()=>O(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:q?"secondary":"outline",children:u.jsx(x4,{})}),u.jsx("textarea",{ref:X,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:pe=>N(pe.target.value),onKeyDown:me,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(de,{onClick:_,size:"sm",type:"button",variant:"outline",children:[u.jsx(Nh,{})," Stop"]}):u.jsxs(de,{disabled:!C.trim()||h===!1,onClick:()=>{Y()},size:"sm",type:"button",children:["Send ",u.jsx(Px,{})]})]})]})]}):u.jsx("button",{className:he("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",V?"font-medium text-primary":"text-muted-foreground"),onClick:()=>w(!0),type:"button",children:V?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(_S,{provider:m,className:"size-4 text-primary"}),l?u.jsxs("span",{className:"flex items-center gap-2 text-foreground",children:[u.jsx(Ki,{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 _S({provider:e,className:t}){return e?.id==="claude"?u.jsx(sl,{className:t}):e?.id==="codex"?u.jsx(Qc,{className:t}):u.jsx(G0,{className:t})}function P7({configured:e,provider:t,onOnboard:i}){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.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[u.jsx("p",{children:t?.intro??'This is the active agent, running in your workspace with full tools - e.g. "restart the api and tail its logs", "what changed in git and why?", "fix the failing test".'}),u.jsxs("button",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/40 bg-primary/5 px-2.5 py-1 text-primary transition-colors hover:bg-primary/10",onClick:i,type:"button",children:[u.jsx(Zs,{className:"size-3.5"}),"Onboard a repo from a URL"]})]})}const U7=/^(?:https?:\/\/|git@|ssh:\/\/)\S+$/i;function H7(e){const t=e.trim();return t.includes(`
21
+ `)||t.includes(" ")||!U7.test(t)?!1:/github\.com|gitlab\.|bitbucket\.|\.git$/i.test(t)}function F7({turn:e,streaming:t,isLast:i,onChoose:s,onStartService:a,onOpenService:l}){const c=B7(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}=D7(c);return u.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(g=>u.jsx($7,{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(O7,{options:m,onChoose:s}):null,f&&!t?u.jsx(j7,{service:f,onStart:a,onOpen:l}):null,t&&!h?u.jsx(z7,{}):null]})}function $7({tool:e}){const t=_k(e.input);return u.jsxs("div",{className:he("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(Ki,{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 V7({prompt:e,onRespond:t}){const i=_k(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(de,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[u.jsx(Sn,{})," Deny"]}),u.jsxs(de,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[u.jsx(el,{})," Allow"]})]})}function _k(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}function ct({className:e,type:t,...i}){return u.jsx("input",{type:t,className:he("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=$2();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(de,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})})]}),u.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const mp={host:"",port:"",user:"",password:"",database:"",ssl:!1},q7="localhost";function qg(e,t,{includePassword:i=!0}={}){const s=e==="mysql"?"mysql":"postgres",a=t.host.trim()||q7,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 Gg(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:bS(t.username),password:bS(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function G7(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 bS(e){try{return decodeURIComponent(e)}catch{return e}}const K7=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function W7({onClose:e,onSaved:t,initial:i}){const{error:s,success:a}=Ii(),l=!!i,c=E.useMemo(()=>Y7(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"}),[R,A]=E.useState(!1),[L,F]=E.useState(!1);E.useEffect(()=>{l||fM().then(C).catch(()=>C([]))},[l]);const j=h==="sqlite",M=j?_.trim():qg(h,x),H=j?!!_.trim():!!(x.host.trim()&&x.database.trim());function U(){T({status:"idle"})}function V($,I){return qg($,I,{includePassword:!1})}function ee($){m($),U(),$!=="sqlite"&&v(V($,x))}function K($){const I={...x,...$};y(I),v(V(h,I)),U()}function Z($){U();const I=G7($),D=I??h;I&&I!==h&&m(I);const Y=I==="sqlite"?null:Gg($);if(!Y){v($);return}Y.password?(y(Y),v(V(D,Y))):(y({...Y,password:x.password}),v($))}function q($){m($.engine);const I=$.engine==="sqlite"?null:Gg($.url);I?(y(I),v(V($.engine,I))):v($.url),U(),f.trim()||g(X7($))}function O(){return f.trim()?j?_.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 W(){if(H){A(!0),U();try{const $=await pM({engine:h,url:M});T($.ok?{status:"ok",message:"Connected"}:{status:"fail",message:$.error??"Connection failed"})}catch($){T({status:"fail",message:$ instanceof Error?$.message:String($)})}finally{A(!1)}}}async function X(){const $=O();if($){s($);return}F(!0);try{await mM({name:f.trim(),engine:h,url:M}),a(`Saved connection "${f.trim()}".`),t(),e()}catch(I){s(I instanceof Error?I.message:String(I))}finally{F(!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($=>u.jsxs("button",{type:"button",onClick:()=>q($),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:$.maskedUrl,children:[u.jsx(We,{variant:"outline",size:"small",children:$.engine}),u.jsx("span",{className:"font-mono",children:$.service}),u.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",$.key]})]},`${$.service}:${$.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:K7.map($=>u.jsx(de,{size:"sm",variant:h===$.value?"default":"outline",onClick:()=>ee($.value),disabled:l,type:"button",children:$.label},$.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(ct,{value:f,onChange:$=>g($.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]}),j?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(ct,{value:x.host,onChange:$=>K({host:$.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(ct,{value:x.port,onChange:$=>K({port:$.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(ct,{value:x.user,onChange:$=>K({user:$.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(ct,{type:"password",value:x.password,onChange:$=>K({password:$.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(ct,{value:x.database,onChange:$=>K({database:$.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:$=>K({ssl:$.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:j?"Database file path":"Connection URL"}),u.jsx(ct,{value:_,onChange:$=>Z($.target.value),placeholder:j?"/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:j?"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(el,{className:"size-3.5"}):u.jsx(Sn,{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(de,{variant:"outline",size:"sm",onClick:()=>{W()},disabled:R||!H,type:"button",children:[R?u.jsx(Ki,{className:"animate-spin"}):null,"Test connection"]}),u.jsxs(de,{size:"sm",onClick:()=>{X()},disabled:L,type:"button",children:[L?u.jsx(Ki,{className:"animate-spin"}):null,l?"Save changes":"Save"]})]})]})})}function Y7(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=Gg(e.url),i=t?{...t,password:""}:mp;return{engine:e.engine,name:e.name,fields:i,url:qg(e.engine,i,{includePassword:!1})}}function X7(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function Z7({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(de,{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(We,{variant:"outline",size:"small",children:f.engine}):null,u.jsx(es,{className:he("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(We,{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:he("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(el,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(de,{"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(de,{"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(Gc,{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(de,{className:"w-full",onClick:()=>{s(),h(!1)},size:"sm",type:"button",children:[u.jsx(Pn,{className:"size-3"}),"Add connection"]})})]}):null]})}function bk({id:e,className:t}){return e==="codex"?u.jsx(Qc,{className:he("text-foreground",t)}):e==="gemini"?u.jsx(Ij,{className:he("text-[#1A73E8]",t)}):u.jsx(sl,{className:he("text-[#D97757]",t)})}function Q7({className:e}){const{provider:t}=Jc();return u.jsx(bk,{id:t?.id,className:e})}function J7({onAsk:e,label:t,className:i}){const{provider:s}=Jc(),a=t??`Ask ${s?.label??"Claude"}`;return u.jsx("button",{"aria-label":a,className:he("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(bk,{id:s?.id,className:"size-3.5"})})}function eL({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:he("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 tL({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:f7(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(",")}
22
+ ${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(J7,{label:"Ask AI about this row",onAsk:()=>c(g)}),u.jsx(eL,{label:"Row actions",items:[{label:"Copy as JSON",icon:u.jsx(WT,{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 iL(){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 nL=[50,100,500,1e3];function sL(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 M=!1;return v(!0),_M(e).then(H=>{M||(i(H),a(H[0]?.qualifiedName??null))}).catch(H=>{M||m(H instanceof Error?H.message:String(H))}).finally(()=>{M||v(!1)}),()=>{M=!0}},[e]),E.useEffect(()=>{if(c(null),g(null),!e||!s)return;let M=!1;return y(!0),bM(e,s,w,N).then(H=>{M||c(H)}).catch(H=>{M||g(H instanceof Error?H.message:String(H))}).finally(()=>{M||y(!1)}),()=>{M=!0}},[e,s,w,N]);const R=N>0,A=l?l.rowCount===w:!1;function L(M){C(M),T(0)}function F(){A&&T(M=>M+w)}function j(){T(M=>Math.max(0,M-w))}return{tables:t,selectedTable:s,setSelectedTable:a,sample:l,tablesError:h,rowsError:f,loadingTables:_,loadingRows:x,limit:w,offset:N,canPrev:R,canNext:A,changePageSize:L,nextPage:F,prevPage:j}}function rL(){const{connections:e,loading:t,error:i,refresh:s}=iL(),{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(Ki,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),u.jsx(Z7,{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(aL,{connection:c}):u.jsx(oL,{onAdd:()=>f({mode:"add"})})}),m?u.jsx(W7,{initial:m.mode==="edit"?m.target:void 0,onClose:()=>f(null),onSaved:s}):null]})}function aL({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}=sL(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(G4,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),u.jsx(We,{variant:"outline",size:"small",children:t.length}),h?u.jsx(Ki,{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:he("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:nL.map(C=>u.jsxs("option",{value:C,children:[C," / page"]},C))}),u.jsx(de,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:w,disabled:!_,type:"button",children:"Prev"}),u.jsx(de,{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(Ki,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):a?u.jsx(tL,{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 oL({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(de,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[u.jsx(Pn,{}),"Add connection"]})]})})}function lL({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(We,{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(We,{variant:"outline",size:"small",children:["×",e.count]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(de,{onClick:()=>{g()},disabled:h,size:"sm",variant:"outline",children:[u.jsx(l4,{}),h?"Bundling…":"Copy repro bundle"]}),u.jsxs(de,{onClick:()=>{f()},disabled:s,size:"sm",children:[l?u.jsx(el,{}):u.jsx(nA,{}),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(Z2,{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(`
23
+ `)}),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 vS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function cL(){const[e,t]=E.useState([]),[i,s]=E.useState(!1),[a,l]=E.useState(null),c=E.useCallback(h=>{t(m=>vS([...m.filter(f=>f.id!==h.id),h]))},[]);return E.useEffect(()=>{let h=!0;vM().then(f=>{h&&t(vS(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 uL(){const{incidents:e,connected:t,error:i}=cL(),[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(We,{variant:"outline",size:"small",children:e.length})]}),u.jsx(We,{variant:"outline",size:"small",icon:u.jsx("span",{className:he("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:he("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(We,{variant:"outline",size:"small",children:["×",c.count]}):null,u.jsx(We,{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(lL,{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 dL={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 Fr({label:e,children:t,side:i="bottom",className:s}){return u.jsxs("span",{className:he("group/tt relative inline-flex",s),children:[t,u.jsx("span",{role:"tooltip",className:he("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",dL[i]),children:e})]})}function hL({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(de,{onClick:s,size:"sm",type:"button",variant:"outline",children:[t?u.jsx(el,{className:"size-3.5"}):u.jsx(Y2,{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 jn({className:e,...t}){return u.jsx("label",{className:he("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>',fL={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"}},mL={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"},pL={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"}},gL={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"},_L={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"},bL={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"},vL={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"},xL={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"},yL={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/"},xS={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"}},SL={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"},wL={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 EL(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=EL(e),s=CL[i.kind];return u.jsx("span",{"aria-label":`${i.label} process`,className:he("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(rE,{className:t?"size-3.5":"size-4"})})}const CL={bun:mL,cargo:xS,deno:pL,dotnet:fL,docker:gL,generic:null,go:_L,node:bL,npm:vL,pnpm:xL,python:yL,rust:xS,vite:SL,yarn:wL},kL=[{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"}],yS=[{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 NL({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(`
24
+ `)}):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(nE,{}),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 Gi(c,N),y(`${a} requested for ${l}.`),await h(),v(null),m?.()}catch(T){T instanceof aE?v(T.conflict):x(zc(a,l,T))}finally{g(!1)}}const C=u.jsxs(de,{"aria-label":a,className:`${AL[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(Fr,{label:a,children:C}):C,_?u.jsx(TL,{busy:f,conflict:_,onCancel:()=>v(null),onKillAndStart:()=>w({strategy:"killHolder"}),targetLabel:l}):null]})}function TL({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})`:""}
25
+ ${l.command}`:"unknown process"}),u.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[u.jsx(de,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),u.jsxs(de,{onClick:()=>window.open(c,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[u.jsx(F0,{}),"Open in browser"]}),u.jsx(de,{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 AL={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 ML({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??""),[R,A]=E.useState(s?.composeFile??""),[L,F]=E.useState(s?.composeService??""),[j,M]=E.useState(s?.host??""),[H,U]=E.useState(null),[V,ee]=E.useState(!1);E.useEffect(()=>{U(null)},[_,x,w,h]);function K(){g(""),v(""),y(e),C(""),T(""),A(""),F(""),M(""),U(null)}async function Z(O){O.preventDefault();try{const W={name:f,kind:h,cwd:x,port:w,description:N};(h==="local"||h==="ssh")&&(W.command=_),h==="docker-compose"&&(W.composeFile=R,W.composeService=L),h==="ssh"&&(W.host=j),await Gi("/api/services",W),c||K(),l(c?`${f} updated.`:`${f} added.`),await t(),i?.()}catch(W){a(zc(c?"Update service":"Add service",f||"service",W))}}async function q(){if(!_.trim()){a("Test command failed for service: command is required.");return}ee(!0);try{U(await FM({command:_,cwd:x,port:w}))}catch(O){a(zc("Test command",f||"service",O))}finally{ee(!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:R,setComposeFile:A,composeService:L,setComposeService:F,host:j,setHost:M,testResult:H,testing:V,submit:Z,testCommand:q}}function SS({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:R,setComposeService:A,host:L,setHost:F,testResult:j,testing:M,submit:H,testCommand:U}=ML({cwd:e,onRefresh:t,onSaved:i,initialService:s}),V=yS.find(q=>q.value===l),ee=l==="local"&&f.trim().length>0&&_.trim().length>0,K="grid gap-2 rounded-md border border-border bg-muted/30 p-3",Z="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:`${K} sm:col-span-2`,children:[u.jsx("legend",{className:Z,children:"Step 1 · Service kind"}),u.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:yS.map(q=>u.jsx(de,{className:"justify-center",disabled:a,onClick:()=>c(q.value),size:"sm",type:"button",variant:l===q.value?"default":"outline",children:q.label},q.value))}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:V.hint})]}),u.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[u.jsxs("fieldset",{className:K,children:[u.jsx("legend",{className:Z,children:"Step 2 · Identity"}),u.jsxs(jn,{children:["Name",u.jsx(ct,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.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(jn,{children:["Description",u.jsx(ct,{className:"h-8 text-sm",name:"description",onChange:q=>C(q.target.value),placeholder:"API server",value:w})]})]}),u.jsxs("fieldset",{className:K,children:[u.jsx("legend",{className:Z,children:"Step 4 · Networking (optional)"}),u.jsxs(jn,{children:["Port",u.jsx(ct,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>y(q.target.value),placeholder:"3001",value:x})]})]})]}),l==="local"?u.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:Z,children:"Step 3 · Local command"}),u.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:kL.map(q=>u.jsxs(de,{className:"justify-start gap-1.5",onClick:()=>{g(q.command),C(q.description)},size:"sm",type:"button",variant:"outline",children:[u.jsx(E_,{command:q.badgeCommand??q.command,compact:!0}),u.jsx("span",{className:"truncate",children:q.label})]},q.label))}),u.jsxs(jn,{children:["Command",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>g(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(jn,{children:["Working Directory",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:_})]})]}):null,l==="docker-compose"?u.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:Z,children:"Step 3 · Docker Compose target"}),u.jsxs(jn,{children:["Compose Service",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>A(q.target.value),placeholder:"api",required:!0,value:R})]}),u.jsxs(jn,{children:["Compose File (optional)",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>T(q.target.value),placeholder:"docker-compose.yml",value:N})]}),u.jsxs(jn,{children:["Working Directory (where compose file lives)",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:_})]})]}):null,l==="ssh"?u.jsxs("fieldset",{className:`${K} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:Z,children:"Step 3 · SSH connection"}),u.jsxs(jn,{children:["SSH Host (alias from ~/.ssh/config)",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>F(q.target.value),placeholder:"devbox",required:!0,value:L})]}),u.jsxs(jn,{children:["Remote Command",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>g(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(jn,{children:["Remote Working Directory",u.jsx(ct,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.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]}),j?u.jsx(NL,{result:j}):null,u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[l==="local"?u.jsxs(de,{disabled:M||!ee,onClick:U,type:"button",variant:"outline",children:[u.jsx(rE,{}),M?"Testing...":"Test Command"]}):null,u.jsx(de,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function vk({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 Gi("/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(jn,{children:["Group name",u.jsx(ct,{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(de,{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 RL=900*1e3,bc=12,_p=200;function DL({events:e}){const[t,i]=E.useState(null),[s,a]=E.useState(null),{rows:l,windowStart:c,windowEnd:h}=E.useMemo(()=>OL(e),[e]),m=t?l.find(f=>f.service===t)??null:null;return u.jsxs(u.Fragment,{children:[u.jsxs(Js,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(er,{className:"border-b border-border px-3 py-2",children:[u.jsxs(tr,{className:"flex items-center gap-2",children:[u.jsx(La,{className:"size-3.5"}),"Runtime Monitor"]}),u.jsx(ea,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),u.jsx(ir,{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(LL,{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(La,{}),onClose:()=>i(null),title:m.service,children:u.jsx(zL,{onSelect:a,row:m})}):null,s?u.jsx(Xs,{icon:u.jsx(La,{}),onClose:()=>a(null),title:s.title,children:u.jsx(IL,{event:s})}):null]})}function OL(e){const t=Date.now(),i=t,s=t-RL;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,R)=>T.timestamp.localeCompare(R.timestamp)),_=new Array(bc).fill(0),v=new Array(bc).fill(null);for(const T of g){const R=new Date(T.timestamp).getTime(),A=Math.max(s,Math.min(i,R)),L=Math.min(bc-1,Math.floor((A-s)/c*bc));_[L]+=1;const F=v[L];v[L]=jL(F,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 jL(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function LL({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:he("size-2 shrink-0 rounded-full",xk(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(Zr,{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(${bc}, minmax(0, 1fr))`},children:t.buckets.map((l,c)=>u.jsx(BL,{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 BL({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:he("rounded-sm",PL(i)),style:{opacity:s},title:`${e} event${e===1?"":"s"}`})}function zL({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:he("size-2 shrink-0 rounded-full",xk(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 IL({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:he("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",UL(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 xk(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function PL(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function UL(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 HL({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:qL(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:he("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",FL(e.status)),children:[u.jsx("span",{className:"inline-flex shrink-0",children:u.jsx(La,{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:[VL(t.cpuPercent)," CPU"]}),u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(t4,{className:"size-3"}),$L(t.rssMb)," RAM"]})]}):null]})}function FL(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 $L(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function VL(e){return`${e.toFixed(1)}%`}function qL(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function GL({ports:e}){const t=e.filter(s=>s.state==="occupied").length,i=e.filter(s=>s.state==="managed").length;return u.jsxs(Js,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(er,{className:"border-b border-border px-3 py-2",children:[u.jsxs(tr,{className:"flex items-center gap-2",children:[u.jsx(a4,{className:"size-3.5"}),"Ports"]}),u.jsxs(ea,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),u.jsx(ir,{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(KL,{port:s})]},s.port))}):u.jsx(ch,{label:"No configured ports yet."})})]})}function KL({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(We,{className:he(e&&"max-w-36 truncate"),variant:s,children:i})}function WL({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(ct,{"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 YL({className:e,containerRef:t,emptyText:i,logs:s,query:a}){return u.jsx("div",{className:he("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:he("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,ZL(l.text,a)]})]},`${l.timestamp}-${l.stream}-${c}`)):u.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function XL(e){return`${e.timestamp} ${e.stream} ${e.text}`}function ZL(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 wS(e){return`${e.kind}:${e.name}`}function QL(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 cE(e.name,i);g||(a(x.logs),m(x.queryable),c(void 0))}else{const x=await oE(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 JL=[{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 yk({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 $=window.setTimeout(()=>C(t),300);return()=>window.clearTimeout($)},[t]);const N=E.useMemo(()=>{const $={};_&&($.since=_),x&&($.level=x);const I=w.trim();return I&&($.grep=I),$},[_,x,w]),{logs:T,error:R,queryable:A}=QL(e,s,N),L=g||A,F=E.useRef(null),j=E.useRef(!0),[M,H]=E.useState([]),[U,V]=E.useState(!1),ee=JSON.stringify(N);E.useEffect(()=>{H([])},[ee,e.kind,e.name]);const K=E.useMemo(()=>{const $=T??[];if(M.length===0)return $;const I=new Set(M.map(D=>D.cursor).filter(Boolean));return[...M,...$.filter(D=>!D.cursor||!I.has(D.cursor))]},[T,M]),Z=(M[0]??(T??[])[0])?.cursor;async function q(){if(!(!L||!Z||U)){V(!0),j.current=!1;try{const $={...N,before:Z,lines:200},I=e.kind==="source"?await oE(e.name,$):(await cE(e.name,$)).logs;I.length&&H(D=>{const Y=new Set(D.map(te=>te.cursor).filter(Boolean));return[...I.filter(te=>!te.cursor||!Y.has(te.cursor)),...D]})}finally{V(!1)}}}const O=t.trim().toLowerCase(),W=E.useMemo(()=>{let $=K;return l&&($=$.filter(I=>I.stream==="stderr")),O&&($=$.filter(I=>XL(I).toLowerCase().includes(O))),$},[K,l,O]);E.useEffect(()=>{const $=F.current;if(!$)return;const I=()=>{const D=$.scrollHeight-$.scrollTop-$.clientHeight;j.current=D<40};return I(),$.addEventListener("scroll",I,{passive:!0}),()=>$.removeEventListener("scroll",I)},[]),E.useEffect(()=>{if(!s||!j.current||W.length===0)return;const $=F.current;$&&($.scrollTop=$.scrollHeight)},[s,W]);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(WL,{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:$=>v($.target.value),value:_,children:JL.map($=>u.jsx("option",{value:$.value,children:$.label},$.label))}),u.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:$=>y($.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(ES,{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(ES,{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&&Z?u.jsxs(de,{disabled:U,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[u.jsx(H0,{}),U?"Loading…":"Load older"]}):null,f?u.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),R?u.jsx("div",{className:"text-red-600",children:R}):null,u.jsx(YL,{className:he("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:F,emptyText:X,logs:W,query:t})]})}function ES({active:e,activeClassName:t,children:i,onClick:s}){return u.jsx(de,{"aria-pressed":e,className:e?t:void 0,onClick:s,size:"sm",type:"button",variant:"outline",children:i})}function e9(e,t){return e.kind===t.kind&&e.name===t.name}function t9({options:e,target:t,onChange:i,className:s}){const a=e.findIndex(c=>e9(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 i9({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(yk,{fill:!0,hideStdout:l,query:t,setHideStdout:c,setQuery:i,setStreaming:a,streaming:s,target:{kind:"service",name:e},trailing:u.jsxs(de,{onClick:()=>m(g=>!g),size:"sm",type:"button",variant:"outline",children:[h?u.jsx(tE,{}):u.jsx(eE,{}),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(de,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})})]}),u.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const n9={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 s9({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,R]=E.useState(),[A,L]=E.useState(!1);async function F(){L(!0),R(void 0);try{const j={name:i.trim(),kind:"command"};a==="file"?(j.kind="file",j.path=m.trim()):a==="ssh"?(j.kind="ssh",j.host=c.trim(),j.path=m.trim()):a==="command"?(j.kind="command",j.command=g.trim(),v.trim()&&(j.cwd=v.trim())):a==="journald"?(j.driver="journald",j.unit=y.trim(),c.trim()&&(j.host=c.trim())):a==="docker"&&(j.driver="docker",j.container=C.trim(),c.trim()&&(j.host=c.trim()));const M=await DM(j);t(M,j.name),e()}catch(j){R(j instanceof Error?j.message:String(j))}finally{L(!1)}}return u.jsx(Xs,{icon:u.jsx(sE,{}),onClose:e,size:"md",title:"Add log source",children:u.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:j=>{j.preventDefault(),F()},children:[u.jsx(Gs,{label:"Name",children:u.jsx(ct,{autoFocus:!0,onChange:j=>s(j.target.value),placeholder:"PROD",value:i})}),u.jsxs(Gs,{label:"Type",children:[u.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:j=>l(j.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:n9[a]})]}),a==="journald"||a==="docker"?u.jsx(Gs,{label:"Host (optional — leave blank to run locally)",children:u.jsx(ct,{onChange:j=>h(j.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:c})}):null,a==="journald"?u.jsx(Gs,{label:"Unit",children:u.jsx(ct,{onChange:j=>w(j.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?u.jsx(Gs,{label:"Container",children:u.jsx(ct,{onChange:j=>N(j.target.value),placeholder:"brainctl-api",value:C})}):null,a==="ssh"?u.jsx(Gs,{label:"Host",children:u.jsx(ct,{onChange:j=>h(j.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:c})}):null,a==="file"||a==="ssh"?u.jsx(Gs,{label:a==="ssh"?"Remote path":"File path",children:u.jsx(ct,{onChange:j=>f(j.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?u.jsxs(u.Fragment,{children:[u.jsx(Gs,{label:"Command",children:u.jsx(ct,{onChange:j=>_(j.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:g})}),u.jsx(Gs,{label:"Working directory (optional)",children:u.jsx(ct,{onChange:j=>x(j.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(de,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),u.jsx(de,{disabled:A||!i.trim(),size:"sm",type:"submit",children:A?"Saving…":"Add source"})]})]})})}function Gs({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 CS=4;function r9({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 R=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return R?{0:R}:{}}),_=E.useRef(1);E.useEffect(()=>{let R=!1;return RM().then(A=>{R||a(A)}),()=>{R=!0}},[]);const v=[...e.map(R=>({target:{kind:"service",name:R},label:R,group:"Services"})),...s.map(R=>({target:{kind:"source",name:R.name},label:R.name,group:"Log sources"}))],x=v.map(R=>R.target);function y(){if(h.length>=CS||x.length===0)return;const R=_.current++,A=new Set(Object.values(f).map(wS)),L=x.find(F=>!A.has(wS(F)))??x[0];m(F=>[...F,R]),g(F=>({...F,[R]:L}))}function w(R){m(A=>A.filter(L=>L!==R)),g(A=>{const L={...A};return delete L[R],L})}function C(R,A){g(L=>({...L,[R]:A}))}function N(R,A){a(R);const L=h[0];L!==void 0&&C(L,{kind:"source",name:A})}const T=u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:"Logs"}),u.jsxs(de,{onClick:()=>c(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(Pn,{}),"Add source"]}),u.jsxs(de,{disabled:h.length>=CS||x.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[u.jsx(Pn,{}),"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(de,{className:"mt-2",onClick:()=>c(!0),size:"sm",type:"button",children:[u.jsx(Pn,{}),"Add a log source"]})]})}):u.jsx("div",{className:he("grid h-full min-h-0 gap-3",h.length>1?"lg:grid-cols-2":"grid-cols-1",h.length>2?"lg:grid-rows-2":"grid-rows-1"),children:h.map(R=>u.jsx(a9,{onChangeTarget:A=>C(R,A),onRemove:h.length>1?()=>w(R):void 0,options:v,target:f[R]??x[0]},R))})}),l?u.jsx(s9,{onAdded:N,onClose:()=>c(!1)}):null]})}function a9({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(yk,{fill:!0,hideStdout:m,leading:u.jsx(t9,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:l,setStreaming:h,streaming:c,target:t,trailing:s?u.jsx(de,{"aria-label":"Remove pane",onClick:s,size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})}):void 0})})}function o9({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(X2,{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(Gc,{size:14})})})]},c)})})]})})}function l9({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(de,{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:he("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($a,{size:14}):u.jsx(Q2,{size:14}),u.jsx("span",{className:"flex-1 truncate font-mono",children:x.name}),!y&&x.format?u.jsx(We,{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 Sk(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function c9(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 U=!1;return g(!0),T(void 0),(async()=>{try{const V=await IM(e);if(U)return;a(V.files),V.files.length>0?c(ee=>ee??V.files[0].path):(c(void 0),m(void 0))}catch(V){U||T(V instanceof Error?V.message:String(V))}finally{U||g(!1)}})(),()=>{U=!0}},[e]);const R=E.useCallback(async U=>{v(!0),T(void 0);try{const V=await Ux(e,U),ee={path:V.path,relativePath:V.relativePath,format:V.format};V.format==="env"?m({info:ee,exists:V.exists,rows:V.entries.map(K=>({...K,reveal:!1}))}):m({info:ee,exists:V.exists,text:V.format==="json"?Sk(V.content):V.content}),C(!1)}catch(V){T(V instanceof Error?V.message:String(V))}finally{v(!1)}},[e]);E.useEffect(()=>{l&&R(l)},[l,R]);function A(U,V){m(ee=>{if(!ee?.rows)return ee;const K=ee.rows.map((Z,q)=>q===U?{...Z,...V}:Z);return{...ee,rows:K}}),C(!0)}function L(){m(U=>U?.rows?{...U,rows:[...U.rows,{key:"",value:"",secret:!1,reveal:!0}]}:U),C(!0)}function F(U){m(V=>V?.rows?{...V,rows:V.rows.filter((ee,K)=>K!==U)}:V),C(!0)}function j(U){m(V=>V&&{...V,text:U}),C(!0)}async function M(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const U=await PM(e,h.info.path,h.rows.map(V=>({key:V.key.trim(),value:V.value})));m({info:{path:U.path,relativePath:U.relativePath,format:U.format},exists:U.exists,rows:U.entries.map(V=>({...V,reveal:!1}))}),i(`Saved ${U.entries.length} entries to ${U.relativePath}.`)}else if(h.text!==void 0){const U=await UM(e,h.info.path,h.text);m({info:{path:U.path,relativePath:U.relativePath,format:U.format},exists:U.exists,text:U.content}),i(`Saved ${U.relativePath}.`)}C(!1)}catch(U){t(U instanceof Error?U.message:String(U))}finally{y(!1)}}}async function H(U){try{const V=await Ux(e,U),ee={path:V.path,relativePath:V.relativePath,format:V.format};return a(K=>K.some(Z=>Z.path===ee.path)?K:[...K,ee]),c(ee.path),i(`Loaded ${ee.relativePath}.`),!0}catch(V){return t(V instanceof Error?V.message:String(V)),!1}}return{files:s,selectedPath:l,setSelectedPath:c,loaded:h,loadingList:f,loadingFile:_,saving:x,dirty:w,error:N,addRow:L,removeRow:F,updateRow:A,updateText:j,save:M,pickFile:H}}function u9({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}=c9(e),[C,N]=E.useState(!1),[T,R]=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:A=>s(A.target.value),value:i??"",children:t.map(A=>u.jsxs("option",{value:A.path,children:[A.relativePath," [",A.format,"]"]},A.path))}):u.jsx("span",{className:"text-muted-foreground",children:"none detected"}),u.jsxs(de,{onClick:()=>R(!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(de,{onClick:()=>N(A=>!A),size:"sm",type:"button",variant:"outline",children:[C?u.jsx(X2,{}):u.jsx($0,{}),C?"Hide secrets":"Reveal secrets"]}),u.jsxs(de,{onClick:g,size:"sm",type:"button",variant:"outline",children:[u.jsx(Pn,{})," Add"]})]}):null,u.jsxs(de,{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:he(c&&"opacity-60 transition-opacity"),children:u.jsx(o9,{revealAll:C,rows:a.rows,onAdd:g,onRemove:_,onUpdate:v})}):a?.text!==void 0?u.jsxs("div",{className:he("space-y-1",c&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?u.jsx("div",{className:"flex justify-end",children:u.jsx(de,{onClick:()=>x(Sk(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:A=>x(A.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(l9,{onClose:()=>R(!1),onPick:A=>{w(A).then(L=>{L&&R(!1)})},serviceName:e}):null]})}function d9({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 Gi(`/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(de,{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(de,{onClick:()=>{navigator.clipboard.writeText(v),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[u.jsx(Y2,{})," Copy"]}),u.jsx(de,{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(de,{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:he("py-1 pr-3 text-right",h9(x.status)),children:x.status}),u.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:f9(x.resBytes)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:x.durationMs.toFixed(1)})]},x.id))})]})})]})}function h9(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 f9(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function m9({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(p9,{series:t,now:l}):u.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"})}function p9({series:e,now:t}){const{samples:i}=e,s=E.useMemo(()=>kS(i,m=>m.cpu),[i]),a=E.useMemo(()=>kS(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?AS(c):"—",sub:l?`since ${l.toLocaleTimeString()}`:"not running"}),u.jsx(Td,{accent:"#f59e0b",label:"Samples",value:String(i.length),sub:h?`over ${AS(h)}`:"collecting…"})]}),u.jsx(TS,{label:"CPU",samples:i,pick:m=>m.cpu,summary:s,color:"#22c55e",suffix:"%",unit:"percent"}),u.jsx(TS,{label:"Memory (RSS)",samples:i,pick:m=>m.rss,summary:a,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function kS(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 Lo=160,NS=44,g9=20;function TS({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=_9(f),_=0,v=g-_||1,x=t[0].t,y=t[t.length-1].t,w=Math.max(1,y-x),C=U=>(U-x)/w*1e3,N=U=>(1-(U-_)/v)*1e3,T=t.map(U=>`${C(U.t).toFixed(1)},${N(i(U)).toFixed(1)}`),R=`M0,1000 L${T.join(" L")} L1000,1000 Z`,A=`M${T.join(" L")}`,L=C(y),F=N(s.last),j=N(s.avg),M=[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:NS,height:Lo},children:M.map(U=>u.jsx("span",{className:"pr-1 leading-none",children:b9(_+U*v,c)},U))}),u.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:Lo},children:[M.map((U,V)=>u.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-border/40",style:{top:`${U===1?0:U===0?Lo-1:(1-U)*Lo}px`,borderStyle:V===M.length-1?"solid":"dashed"}},U)),u.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-dashed",style:{top:`${j/1e3*Lo}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:R,fill:`url(#${h})`}),u.jsx("path",{d:A,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:`${F/1e3*Lo}px`,backgroundColor:a,boxShadow:`0 0 0 4px ${a}33`}})]})]}),u.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:g9,paddingLeft:NS},children:u.jsx("div",{className:"relative flex-1",children:Array.from({length:H+1},(U,V)=>{const ee=V/H,K=x+ee*w;return u.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${ee*100}%`,transform:V===0?"translateX(0)":V===H?"translateX(-100%)":"translateX(-50%)"},children:v9(K-y)},V)})})})]})]})}function _9(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 b9(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 AS(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 v9(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 x9({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:he("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:s.command})]},s.pid)})})]})})}var y9=2,S9=1,w9=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(y9,Math.floor(g/e.css.cell.width)),rows:Math.max(S9,Math.floor(f/e.css.cell.height))}}};var wk=Object.defineProperty,E9=Object.getOwnPropertyDescriptor,C9=(e,t)=>{for(var i in t)wk(e,i,{get:t[i],enumerable:!0})},Ht=(e,t,i,s)=>{for(var a=s>1?void 0:s?E9(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&&wk(t,i,a),a},Se=(e,t)=>(i,s)=>t(i,s,e),MS="Terminal input",Kg={get:()=>MS,set:e=>MS=e},RS="Too much output to announce, navigate to rows manually to read",Wg={get:()=>RS,set:e=>RS=e};function k9(e){return e.replace(/\r?\n/g,"\r")}function N9(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function T9(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function A9(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");Ek(a,t,i,s)}}function Ek(e,t,i,s){e=k9(e),e=N9(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Ck(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 DS(e,t,i,s,a){Ck(e,t,i),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Hr(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 M9=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}},R9=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}},kk="",Vr=" ",eu=class Nk{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 Nk;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 Tk{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 Tk(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Hn=class Ak 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 Ak;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?Hr(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()]}},OS="di$target",Yg="di$dependencies",vp=new Map;function D9(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");O9(t,i,a)};return t._id=e,vp.set(e,t),t}function O9(e,t,i){t[OS]===t?t[Yg].push({id:e,index:i}):(t[Yg]=[{id:e,index:i}],t[OS]=t)}var Wi=vi("BufferService"),Mk=vi("CoreMouseService"),qa=vi("CoreService"),j9=vi("CharsetService"),N_=vi("InstantiationService"),Rk=vi("LogService"),Yi=vi("OptionsService"),Dk=vi("OscLinkService"),L9=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 Hn,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):B9(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([Se(0,Wi),Se(1,Yi),Se(2,Dk)],Xg);function B9(e,t){if(confirm(`Do you want to navigate to ${t}?
26
+
27
+ 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"),nr=vi("CoreBrowserService"),T_=vi("MouseService"),sr=vi("RenderService"),z9=vi("SelectionService"),Ok=vi("CharacterJoinerService"),rl=vi("ThemeService"),jk=vi("LinkProviderService"),I9=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?jS.isErrorNoTelemetry(e)?new jS(e.message+`
28
+
29
+ `+e.stack):new Error(e.message+`
30
+
31
+ `+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)}},P9=new I9;function qd(e){U9(e)||P9.onUnexpectedError(e)}var Zg="Canceled";function U9(e){return e instanceof H9?!0:e instanceof Error&&e.name===Zg&&e.message===Zg}var H9=class extends Error{constructor(){super(Zg),this.name=this.message}};function F9(e){return new Error(`Illegal argument: ${e}`)}var jS=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 Lk extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Lk.prototype)}};function bn(e,t=0){return e[e.length-(1+t)]}var $9;(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})($9||={});function V9(e,t){let i=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(i,arguments))),a}}var Bk;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*a(A){yield A}e.single=a;function l(A){return t(A)?A:a(A)}e.wrap=l;function c(A){return A||i}e.from=c;function*h(A){for(let L=A.length-1;L>=0;L--)yield A[L]}e.reverse=h;function m(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(A){return A[Symbol.iterator]().next().value}e.first=f;function g(A,L){let F=0;for(let j of A)if(L(j,F++))return!0;return!1}e.some=g;function _(A,L){for(let F of A)if(L(F))return F}e.find=_;function*v(A,L){for(let F of A)L(F)&&(yield F)}e.filter=v;function*x(A,L){let F=0;for(let j of A)yield L(j,F++)}e.map=x;function*y(A,L){let F=0;for(let j of A)yield*L(j,F++)}e.flatMap=y;function*w(...A){for(let L of A)yield*L}e.concat=w;function C(A,L,F){let j=F;for(let M of A)j=L(j,M);return j}e.reduce=C;function*N(A,L,F=A.length){for(L<0&&(L+=A.length),F<0?F+=A.length:F>A.length&&(F=A.length);L<F;L++)yield A[L]}e.slice=N;function T(A,L=Number.POSITIVE_INFINITY){let F=[];if(L===0)return[F,A];let j=A[Symbol.iterator]();for(let M=0;M<L;M++){let H=j.next();if(H.done)return[F,e.empty()];F.push(H.value)}return[F,{[Symbol.iterator](){return j}}]}e.consume=T;async function R(A){let L=[];for await(let F of A)L.push(F);return Promise.resolve(L)}e.asyncToArray=R})(Bk||={});function Ua(e){if(Bk.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 q9(...e){return Dt(()=>Ua(e))}function Dt(e){return{dispose:V9(()=>{e()})}}var zk=class Ik{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{Ua(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?Ik.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)}};zk.DISABLE_DISPOSED_WARNING=!1;var qr=zk,Ye=class{constructor(){this._store=new qr,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)}};Ye.None=Object.freeze({dispose(){}});var Qo=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,LS=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}},G9=globalThis.performance&&typeof globalThis.performance.now=="function",K9=class Pk{static create(t){return new Pk(t)}constructor(t){this._now=G9&&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=()=>Ye.None;function t(ee,K){return _(ee,()=>{},0,void 0,!0,void 0,K)}e.defer=t;function i(ee){return(K,Z=null,q)=>{let O=!1,W;return W=ee(X=>{if(!O)return W?W.dispose():O=!0,K.call(Z,X)},null,q),O&&W.dispose(),W}}e.once=i;function s(ee,K,Z){return f((q,O=null,W)=>ee(X=>q.call(O,K(X)),null,W),Z)}e.map=s;function a(ee,K,Z){return f((q,O=null,W)=>ee(X=>{K(X),q.call(O,X)},null,W),Z)}e.forEach=a;function l(ee,K,Z){return f((q,O=null,W)=>ee(X=>K(X)&&q.call(O,X),null,W),Z)}e.filter=l;function c(ee){return ee}e.signal=c;function h(...ee){return(K,Z=null,q)=>{let O=q9(...ee.map(W=>W(X=>K.call(Z,X))));return g(O,q)}}e.any=h;function m(ee,K,Z,q){let O=Z;return s(ee,W=>(O=K(O,W),O),q)}e.reduce=m;function f(ee,K){let Z,q={onWillAddFirstListener(){Z=ee(O.fire,O)},onDidRemoveLastListener(){Z?.dispose()}},O=new ge(q);return K?.add(O),O.event}function g(ee,K){return K instanceof Array?K.push(ee):K&&K.add(ee),ee}function _(ee,K,Z=100,q=!1,O=!1,W,X){let $,I,D,Y=0,ue,te={leakWarningThreshold:W,onWillAddFirstListener(){$=ee(me=>{Y++,I=K(I,me),q&&!D&&(re.fire(I),I=void 0),ue=()=>{let xe=I;I=void 0,D=void 0,(!q||Y>1)&&re.fire(xe),Y=0},typeof Z=="number"?(clearTimeout(D),D=setTimeout(ue,Z)):D===void 0&&(D=0,queueMicrotask(ue))})},onWillRemoveListener(){O&&Y>0&&ue?.()},onDidRemoveLastListener(){ue=void 0,$.dispose()}},re=new ge(te);return X?.add(re),re.event}e.debounce=_;function v(ee,K=0,Z){return e.debounce(ee,(q,O)=>q?(q.push(O),q):[O],K,void 0,!0,void 0,Z)}e.accumulate=v;function x(ee,K=(q,O)=>q===O,Z){let q=!0,O;return l(ee,W=>{let X=q||!K(W,O);return q=!1,O=W,X},Z)}e.latch=x;function y(ee,K,Z){return[e.filter(ee,K,Z),e.filter(ee,q=>!K(q),Z)]}e.split=y;function w(ee,K=!1,Z=[],q){let O=Z.slice(),W=ee(I=>{O?O.push(I):$.fire(I)});q&&q.add(W);let X=()=>{O?.forEach(I=>$.fire(I)),O=null},$=new ge({onWillAddFirstListener(){W||(W=ee(I=>$.fire(I)),q&&q.add(W))},onDidAddFirstListener(){O&&(K?setTimeout(X):X())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return q&&q.add($),$.event}e.buffer=w;function C(ee,K){return(Z,q,O)=>{let W=K(new T);return ee(function(X){let $=W.evaluate(X);$!==N&&Z.call(q,$)},void 0,O)}}e.chain=C;let N=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(K){return this.steps.push(K),this}forEach(K){return this.steps.push(Z=>(K(Z),Z)),this}filter(K){return this.steps.push(Z=>K(Z)?Z:N),this}reduce(K,Z){let q=Z;return this.steps.push(O=>(q=K(q,O),q)),this}latch(K=(Z,q)=>Z===q){let Z=!0,q;return this.steps.push(O=>{let W=Z||!K(O,q);return Z=!1,q=O,W?O:N}),this}evaluate(K){for(let Z of this.steps)if(K=Z(K),K===N)break;return K}}function R(ee,K,Z=q=>q){let q=(...$)=>X.fire(Z(...$)),O=()=>ee.on(K,q),W=()=>ee.removeListener(K,q),X=new ge({onWillAddFirstListener:O,onDidRemoveLastListener:W});return X.event}e.fromNodeEventEmitter=R;function A(ee,K,Z=q=>q){let q=(...$)=>X.fire(Z(...$)),O=()=>ee.addEventListener(K,q),W=()=>ee.removeEventListener(K,q),X=new ge({onWillAddFirstListener:O,onDidRemoveLastListener:W});return X.event}e.fromDOMEventEmitter=A;function L(ee){return new Promise(K=>i(ee)(K))}e.toPromise=L;function F(ee){let K=new ge;return ee.then(Z=>{K.fire(Z)},()=>{K.fire(void 0)}).finally(()=>{K.dispose()}),K.event}e.fromPromise=F;function j(ee,K){return ee(Z=>K.fire(Z))}e.forward=j;function M(ee,K,Z){return K(Z),ee(q=>K(q))}e.runAndSubscribe=M;class H{constructor(K,Z){this._observable=K,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{K.addObserver(this)},onDidRemoveLastListener:()=>{K.removeObserver(this)}};this.emitter=new ge(q),Z&&Z.add(this.emitter)}beginUpdate(K){this._counter++}handlePossibleChange(K){}handleChange(K,Z){this._hasChanged=!0}endUpdate(K){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(ee,K){return new H(ee,K).emitter.event}e.fromObservable=U;function V(ee){return(K,Z,q)=>{let O=0,W=!1,X={beginUpdate(){O++},endUpdate(){O--,O===0&&(ee.reportChanges(),W&&(W=!1,K.call(Z)))},handlePossibleChange(){},handleChange(){W=!0}};ee.addObserver(X),ee.reportChanges();let $={dispose(){ee.removeObserver(X)}};return q instanceof qr?q.add($):Array.isArray(q)&&q.push($),$}}e.fromObservableLight=V})(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 K9,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 W9=i0,Y9=-1,Uk=class Hk{constructor(t,i,s=(Hk._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 Q9(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}};Uk._idPool=1;var X9=Uk,Z9=class Fk{constructor(t){this.value=t}static create(){let t=new Error;return new Fk(t.stack??"")}print(){console.warn(this.value.split(`
32
+ `).slice(2).join(`
33
+ `))}},Q9=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},J9=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},eB=0,xp=class{constructor(e){this.value=e,this.id=eB++}},tB=2,iB,ge=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new X9(t?.onListenerError??qd,this._options?.leakWarningThreshold??Y9):void 0,this._perfMon=this._options?._profName?new W9(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 J9(`${h}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(this._options?.onListenerError||qd)(f),Ye.None}if(this._disposed)return Ye.None;i&&(t=t.bind(i));let a=new xp(t),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=Z9.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof xp?(this._deliveryQueue??=new nB,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 qr?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*tB<=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}},nB=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 ge,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ge,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};s0.INSTANCE=new s0;var A_=s0;function sB(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}A_.INSTANCE.onDidChangeZoomLevel;function rB(e){return A_.INSTANCE.getZoomFactor(e)}A_.INSTANCE.onDidChangeFullscreen;var al=typeof navigator=="object"?navigator.userAgent:"",r0=al.indexOf("Firefox")>=0,aB=al.indexOf("AppleWebKit")>=0,M_=al.indexOf("Chrome")>=0,oB=!M_&&al.indexOf("Safari")>=0;al.indexOf("Electron/")>=0;al.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,sB(Ys,e,({matches:i})=>{yp&&t.matches||(yp=i)})}var Go="en",a0=!1,o0=!1,Gd=!1,$k=!1,Ad,Kd=Go,BS=Go,lB,Ws,Ia=globalThis,xn;typeof Ia.vscode<"u"&&typeof Ia.vscode.process<"u"?xn=Ia.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(xn=process);var cB=typeof xn?.versions?.electron=="string",uB=cB&&xn?.type==="renderer";if(typeof xn=="object"){a0=xn.platform==="win32",o0=xn.platform==="darwin",Gd=xn.platform==="linux",Gd&&xn.env.SNAP&&xn.env.SNAP_REVISION,xn.env.CI||xn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ad=Go,Kd=Go;let e=xn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ad=t.userLocale,BS=t.osLocale,Kd=t.resolvedLanguage||Go,lB=t.languagePack?.translationsConfigFile}catch{}$k=!0}else typeof navigator=="object"&&!uB?(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,Gd=Ws.indexOf("Linux")>=0,Ws?.indexOf("Mobi")>=0,Kd=globalThis._VSCODE_NLS_LANGUAGE||Go,Ad=navigator.language.toLowerCase(),BS=Ad):console.error("Unable to resolve platform.");var Vk=a0,ps=o0,dB=Gd,zS=$k,bs=Ws,Br=Kd,hB;(e=>{function t(){return Br}e.value=t;function i(){return Br.length===2?Br==="en":Br.length>=3?Br[0]==="e"&&Br[1]==="n"&&Br[2]==="-":!1}e.isDefaultVariant=i;function s(){return Br==="en"}e.isDefault=s})(hB||={});var fB=typeof Ia.postMessage=="function"&&!Ia.importScripts;(()=>{if(fB){let e=[];Ia.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}),Ia.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var mB=!!(bs&&bs.indexOf("Chrome")>=0);bs&&bs.indexOf("Firefox")>=0;!mB&&bs&&bs.indexOf("Safari")>=0;bs&&bs.indexOf("Edg/")>=0;bs&&bs.indexOf("Android")>=0;var Bo=typeof navigator=="object"?navigator:{};zS||document.queryCommandSupported&&document.queryCommandSupported("copy")||Bo&&Bo.clipboard&&Bo.clipboard.writeText,zS||Bo&&Bo.clipboard&&Bo.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_,IS=new R_,PS=new R_,pB=new Array(230),qk;(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 IS.keyCodeToStr(h)}e.toUserSettingsUS=s;function a(h){return PS.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function l(h){return IS.strToKeyCode(h)||PS.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})(qk||={});var gB=class Gk{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 Gk&&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 _B([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},_B=class{constructor(e){if(e.length===0)throw F9("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 bB(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return qk.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(r0)switch(t){case 59:return 85;case 60:if(dB)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(aB&&(ps&&t===93||!ps&&t===92))return 57;return pB[t]||0}var vB=ps?256:2048,xB=512,yB=1024,SB=ps?2048:256,US=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=bB(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|=vB),this.altKey&&(t|=xB),this.shiftKey&&(t|=yB),this.metaKey&&(t|=SB),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new gB(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},HS=new WeakMap;function wB(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 EB=class{static getSameOriginWindowChain(e){let t=HS.get(e);if(!t){t=[],HS.set(e,t);let i=e,s;do s=wB(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=EB.getPositionOfChildWindowRelativeToAncestorWindow(t,i.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},FS=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")oB&&Vk?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)}}}),CB;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof kB?!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})})(CB||={});var kB=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 ge),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))}},NB=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}},TB;(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})(TB||={});var $S=class Ln{static fromArray(t){return new Ln(i=>{i.emitMany(t)})}static fromPromise(t){return new Ln(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Ln(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Ln(async i=>{await Promise.all(t.map(async s=>{for await(let a of s)i.emitOne(a)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ge,queueMicrotask(async()=>{let s={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(s)),this.resolve()}catch(a){this.reject(a)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ti.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Ln(async s=>{for await(let a of t)s.emitOne(i(a))})}map(t){return Ln.map(this,t)}static filter(t,i){return new Ln(async s=>{for await(let a of t)i(a)&&s.emitOne(a)})}filter(t){return Ln.filter(this,t)}static coalesce(t){return Ln.filter(t,i=>!!i)}coalesce(){return Ln.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Ln.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())}};$S.EMPTY=$S.fromArray([]);var{getWindow:fs,getWindowId:AB,onDidRegisterWindow:MB}=(function(){let e=new Map,t={window:Ys,disposables:new qr};e.set(Ys.vscodeWindowId,t);let i=new ge,s=new ge,a=new ge;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 Ye.None;let h=new qr,m={window:c,disposables:h.add(new qr)};return e.set(c.vscodeWindowId,m),h.add(Dt(()=>{e.delete(c.vscodeWindowId),s.fire(c)})),h.add(He(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}}})(),RB=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 He(e,t,i,s){return new RB(e,t,i,s)}var VS=function(e,t,i,s){return He(e,t,i,s)},O_,DB=class extends NB{constructor(e){super(),this.defaultTarget=e&&fs(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},qS=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(qS.sort),c.shift().execute();s.set(l,!1)};O_=(l,c,h=0)=>{let m=AB(l),f=new qS(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 OB(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"},jB=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 Mc(e){return new jB(e)}var Wk=class{constructor(){this._hooks=new qr,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(He(l,pi.POINTER_MOVE,c=>{if(c.buttons!==i){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(He(l,pi.POINTER_UP,c=>this.stopMonitoring(!0)))}};function LB(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 vc=class Li extends Ye{constructor(){super(),this.dispatched=!1,this.targets=new LS,this.ignoreTargets=new LS,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ti.runAndSubscribe(MB,({window:t,disposables:i})=>{i.add(He(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(He(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(He(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Ys,disposables:this._store}))}static addTarget(t){if(!Li.isTouchDevice())return Ye.None;Li.INSTANCE||(Li.INSTANCE=new Li);let i=Li.INSTANCE.targets.push(t);return Dt(i)}static ignoreTarget(t){if(!Li.isTouchDevice())return Ye.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)}};vc.SCROLL_FRICTION=-.005,vc.HOLD_DELAY=700,vc.CLEAR_TAP_COUNT_TIME=400,Ht([LB],vc,"isTouchDevice",1);var BB=vc,j_=class extends Ye{onclick(e,t){this._register(He(e,pi.CLICK,i=>t(new Md(fs(e),i))))}onmousedown(e,t){this._register(He(e,pi.MOUSE_DOWN,i=>t(new Md(fs(e),i))))}onmouseover(e,t){this._register(He(e,pi.MOUSE_OVER,i=>t(new Md(fs(e),i))))}onmouseleave(e,t){this._register(He(e,pi.MOUSE_LEAVE,i=>t(new Md(fs(e),i))))}onkeydown(e,t){this._register(He(e,pi.KEY_DOWN,i=>t(new US(i))))}onkeyup(e,t){this._register(He(e,pi.KEY_UP,i=>t(new US(i))))}oninput(e,t){this._register(He(e,pi.INPUT,t))}onblur(e,t){this._register(He(e,pi.BLUR,t))}onfocus(e,t){this._register(He(e,pi.FOCUS,t))}onchange(e,t){this._register(He(e,pi.CHANGE,t))}ignoreGesture(e){return BB.ignoreTarget(e)}},GS=11,zB=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=GS+"px",this.domNode.style.height=GS+"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 Wk),this._register(VS(this.bgDomNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(VS(this.domNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new DB),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()}},IB=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}}},PB=class extends Ye{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new IB(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 WS(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=WS.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*FB(s)}}function UB(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var WS=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),UB(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 HB(e){return Math.pow(e,3)}function FB(e){return 1-HB(1-e)}var $B=class extends Ye{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new 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":"")))}},VB=140,Yk=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 $B(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Wk),this._shouldRender=!0,this.domNode=Mc(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(He(this.domNode.domNode,pi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new zB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Mc(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(He(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=OB(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(Vk&&c>VB){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()}},Xk=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)}},qB=class extends Yk{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Xk(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}},GB=class extends Yk{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Xk(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}},KB=500,YS=50,WB=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=rB(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 WB(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 YB=d0,XB=class extends j_{constructor(e,t,i){super(),this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ge),this.onWillScroll=this._onWillScroll.event,this._options=QB(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 GB(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new qB(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=Mc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Mc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Mc(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=Ua(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 FS(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ua(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new FS(i))};this._mouseWheelToDispose.push(He(this._listenOnDomNode,pi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=YB.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=YS*a,g=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,g)}if(l){let f=YS*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(),KB)}},ZB=class extends XB{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 QB(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 Ye{constructor(e,t,i,s,a,l,c,h){super(),this._bufferService=i,this._optionsService=c,this._renderService=h,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new PB({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 ZB(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(`
34
+ `)})),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([Se(2,Wi),Se(3,nr),Se(4,Mk),Se(5,rl),Se(6,Yi),Se(7,sr)],h0);var f0=class extends Ye{constructor(e,t,i,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(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([Se(1,Wi),Se(2,nr),Se(3,tu),Se(4,sr)],f0);var JB=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},zr={full:0,left:0,center:0,right:0},lc={full:0,left:0,center:0,right:0},hh=class extends Ye{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 JB,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);zr.full=this._canvas.width,zr.left=e,zr.center=t,zr.right=e,this._refreshDrawHeightConstants(),lc.full=1,lc.left=1,lc.center=1+zr.left,lc.right=1+zr.left+zr.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(lc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-os[e.position||"full"]/2),zr[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([Se(2,Wi),Se(3,tu),Se(4,sr),Se(5,Yi),Se(6,rl),Se(7,nr)],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=`
35
+ `,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 Zk;(e=>e.ST=`${ce.ESC}\\`)(Zk||={});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([Se(2,Wi),Se(3,Yi),Se(4,qa),Se(5,sr)],m0);var gi=0,_i=0,bi=0,Ut=0,XS={css:"#00000000",rgba:0},si;(e=>{function t(a,l,c,h){return h!==void 0?`#${ka(a)}${ka(l)}${ka(c)}${ka(h)}`:`#${ka(a)}${ka(l)}${ka(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(Ks(f,g)<m){if(g<f){let x=s(c,h,m),y=Ks(f,Fi.relativeLuminance(x>>8));if(y<m){let w=a(c,h,m),C=Ks(f,Fi.relativeLuminance(w>>8));return y>C?x:w}return x}let _=a(c,h,m),v=Ks(f,Fi.relativeLuminance(_>>8));if(v<m){let x=s(c,h,m),y=Ks(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=Ks(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=Ks(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=Ks(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=Ks(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 ka(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ks(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var ez=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 Hn}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||Vr.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||Vr.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([Se(0,Wi)],fh);function tz(e){return 57508<=e&&e<=57558}function iz(e){return 9472<=e&&e<=9631}function nz(e){return tz(e)||iz(e)}function sz(){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 Hn,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,R=0,A=0,L=0,F=!1,j=0,M=!1,H=0,U=0,V=[],ee=f!==-1&&g!==-1;for(let K=0;K<y;K++){e.loadCell(K,this._workCell);let Z=this._workCell.getWidth();if(Z===0)continue;let q=!1,O=K>=U,W=K,X=this._workCell;if(v.length>0&&K===v[0][0]&&O){let Ie=v.shift(),Ft=this._isCellInSelection(Ie[0],t);for(T=Ie[0]+1;T<Ie[1];T++)O&&=Ft===this._isCellInSelection(T,t);O&&=!i||l<Ie[0]||l>=Ie[1],O?(q=!0,X=new ez(this._workCell,e.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),W=Ie[1]-1,Z=X.getWidth()):U=Ie[1]}let $=this._isCellInSelection(K,t),I=i&&K===l,D=ee&&K>=f&&K<=g,Y=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,Ie=>{Y=!0});let ue=X.getChars()||Vr;if(ue===" "&&(X.isUnderline()||X.isOverline())&&(ue=" "),H=Z*h-m.get(ue,X.isBold(),X.isItalic()),!w)w=this._document.createElement("span");else if(C&&($&&M||!$&&!M&&X.bg===R)&&($&&M&&x.selectionForeground||X.fg===A)&&X.extended.ext===L&&D===F&&H===j&&!I&&!q&&!Y&&O){X.isInvisible()?N+=Vr:N+=ue,C++;continue}else C&&(w.textContent=N),w=this._document.createElement("span"),C=0,N="";if(R=X.bg,A=X.fg,L=X.extended.ext,F=D,j=H,M=$,q&&l>=K&&l<=W&&(l=K),!this._coreService.isCursorHidden&&I&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&V.push("xterm-cursor-blink"),V.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline");break}}if(X.isBold()&&V.push("xterm-bold"),X.isItalic()&&V.push("xterm-italic"),X.isDim()&&V.push("xterm-dim"),X.isInvisible()?N=Vr:N=X.getChars()||Vr,X.isUnderline()&&(V.push(`xterm-underline-${X.extended.underlineStyle}`),N===" "&&(N=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${eu.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let Ie=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&Ie<8&&(Ie+=8),w.style.textDecorationColor=x.ansi[Ie].css}X.isOverline()&&(V.push("xterm-overline"),N===" "&&(N=" ")),X.isStrikethrough()&&V.push("xterm-strikethrough"),D&&(w.style.textDecoration="underline");let te=X.getFgColor(),re=X.getFgColorMode(),me=X.getBgColor(),xe=X.getBgColorMode(),Oe=!!X.isInverse();if(Oe){let Ie=te;te=me,me=Ie;let Ft=re;re=xe,xe=Ft}let ye,pe,Pe=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,Ie=>{Ie.options.layer!=="top"&&Pe||(Ie.backgroundColorRGB&&(xe=50331648,me=Ie.backgroundColorRGB.rgba>>8&16777215,ye=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(re=50331648,te=Ie.foregroundColorRGB.rgba>>8&16777215,pe=Ie.foregroundColorRGB),Pe=Ie.options.layer==="top")}),!Pe&&$&&(ye=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,me=ye.rgba>>8&16777215,xe=50331648,Pe=!0,x.selectionForeground&&(re=50331648,te=x.selectionForeground.rgba>>8&16777215,pe=x.selectionForeground)),Pe&&V.push("xterm-decoration-top");let st;switch(xe){case 16777216:case 33554432:st=x.ansi[me],V.push(`xterm-bg-${me}`);break;case 50331648:st=si.toColor(me>>16,me>>8&255,me&255),this._addStyle(w,`background-color:#${ZS((me>>>0).toString(16),"0",6)}`);break;default:Oe?(st=x.foreground,V.push("xterm-bg-257")):st=x.background}switch(ye||X.isDim()&&(ye=Tt.multiplyOpacity(st,.5)),re){case 16777216:case 33554432:X.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(w,st,x.ansi[te],X,ye,void 0)||V.push(`xterm-fg-${te}`);break;case 50331648:let Ie=si.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(w,st,Ie,X,ye,pe)||this._addStyle(w,`color:#${ZS(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,st,x.foreground,X,ye,pe)||Oe&&V.push("xterm-fg-257")}V.length&&(w.className=V.join(" "),V.length=0),!I&&!q&&!Y&&O?C++:w.textContent=N,H!==this.defaultSpacing&&(w.style.letterSpacing=`${H}px`),_.push(w),K=W}return w&&C&&(w.textContent=N),_}_applyMinimumContrast(e,t,i,s,a,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||nz(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([Se(1,Ok),Se(2,Yi),Se(3,nr),Se(4,qa),Se(5,tu),Se(6,rl)],p0);function ZS(e,t,i){for(;e.length<i;)e=t+e;return e}var rz=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}},az=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 oz(){return new az}var Ep="xterm-dom-renderer-owner-",On="xterm-rows",Dd="xterm-fg-",QS="xterm-bg-",cc="xterm-focus",Od="xterm-selection",lz=1,g0=class extends Ye{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=lz++,this._rowElements=[],this._selectionRenderModel=oz(),this.onRequestRedraw=this._register(new ge).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(On),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=sz(),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 rz(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} .${On} 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} .${On} { 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} .${On} .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} .${On}.${cc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${On}.${cc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${On}.${cc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${On} .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} .${QS}${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} .${QS}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(cc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(cc),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([Se(7,N_),Se(8,jh),Se(9,Yi),Se(10,Wi),Se(11,qa),Se(12,nr),Se(13,rl)],g0);var _0=class extends Ye{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ge),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new uz(this._optionsService))}catch{this._measureStrategy=this._register(new cz(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([Se(2,Yi)],_0);var Qk=class extends Ye{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},cz=class extends Qk{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}},uz=class extends Qk{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}},dz=class extends Ye{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new hz(this._window)),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ge),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ti.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(He(this._textarea,"focus",()=>this._isFocused=!0)),this._register(He(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}},hz=class extends Ye{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Qo),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Dt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=He(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)}},fz=class extends Ye{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 mz(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 mz(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([Se(0,sr),Se(1,jh)],b0);var pz=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=[]}},Jk={};C9(Jk,{getSafariVersion:()=>_z,isChromeOS:()=>nN,isFirefox:()=>eN,isIpad:()=>bz,isIphone:()=>vz,isLegacyEdge:()=>gz,isLinux:()=>B_,isMac:()=>mh,isNode:()=>Lh,isSafari:()=>tN,isWindows:()=>iN});var Lh=typeof process<"u"&&"title"in process,iu=Lh?"node":navigator.userAgent,nu=Lh?"node":navigator.platform,eN=iu.includes("Firefox"),gz=iu.includes("Edge"),tN=/^((?!chrome|android).)*safari/i.test(iu);function _z(){if(!tN)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),bz=nu==="iPad",vz=nu==="iPhone",iN=["Windows","Win16","Win32","WinCE"].includes(nu),B_=nu.indexOf("Linux")>=0,nN=/\bCrOS\b/.test(iu),sN=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()}},xz=class extends sN{_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())}}},yz=class extends sN{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ph=!Lh&&"requestIdleCallback"in window?yz:xz,Sz=class{constructor(){this._queue=new ph}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},v0=class extends Ye{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 Qo),this._pausedResizeTask=new Sz,this._observerDisposable=this._register(new Qo),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new ge),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ge),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ge),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new pz((f,g)=>this._renderRows(f,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new wz(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([Se(2,Yi),Se(3,jh),Se(4,qa),Se(5,tu),Se(6,Wi),Se(7,nr),Se(8,rl)],v0);var wz=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 Ez(e,t,i,s){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return Nz(a,l,e,t,i,s)+Bh(l,t,i,s)+Tz(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=kz(l>t?e:a,i)+(h-1)*i.cols+1+Cz(l>t?a:e);return Pc(m,Ic(c,s))}function Cz(e,t){return e-1}function kz(e,t){return t.cols-e}function Nz(e,t,i,s,a,l){return Bh(t,s,a,l).length===0?"":Pc(aN(e,t,e,t-Ha(t,a),!1,a).length,Ic("D",l))}function Bh(e,t,i,s){let a=e-Ha(e,i),l=t-Ha(t,i),c=Math.abs(a-l)-Az(e,t,i);return Pc(c,Ic(rN(e,t),s))}function Tz(e,t,i,s,a,l){let c;Bh(t,s,a,l).length>0?c=s-Ha(s,a):c=t;let h=s,m=Mz(e,t,i,s,a,l);return Pc(aN(e,c,i,h,m==="C",a).length,Ic(m,l))}function Az(e,t,i){let s=0,a=e-Ha(e,i),l=t-Ha(t,i);for(let c=0;c<Math.abs(a-l);c++){let h=rN(e,t)==="A"?-1:1;i.buffer.lines.get(a+h*c)?.isWrapped&&s++}return s}function Ha(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 Mz(e,t,i,s,a,l){let c;return Bh(i,s,a,l).length>0?c=s-Ha(s,a):c=t,e<i&&c<=s||e>=i&&c<s?"C":"D"}function rN(e,t){return e>t?"A":"B"}function aN(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 Rz=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 JS(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,Dz=15,Oz=50,jz=500,Lz=" ",Bz=new RegExp(Lz,"g"),x0=class extends Ye{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 Hn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ge),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ge),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new Rz(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(Bz," ")).join(iN?`\r
36
+ `:`
37
+ `)}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=JS(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*(Dz-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(),Oz)}_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<jz&&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=Ez(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 R=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):R>1&&(v+=R-1,h-=R-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 R=this._workCell.getChars().length;this._workCell.getWidth()===2?(_++,N++):R>1&&(x+=R-1,m+=R-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=JS(i,this._bufferService.cols)}};x0=Ht([Se(3,Wi),Se(4,qa),Se(5,T_),Se(6,Yi),Se(7,sr),Se(8,nr)],x0);var ew=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={}}},tw=class{constructor(){this._color=new ew,this._css=new ew}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})()),Aa=Bt.toColor("#ffffff"),xc=Bt.toColor("#000000"),iw=Bt.toColor("#ffffff"),nw=xc,uc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},zz=Aa,y0=class extends Ye{constructor(e){super(),this._optionsService=e,this._contrastCache=new tw,this._halfContrastCache=new tw,this._onChangeColors=this._register(new ge),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Aa,background:xc,cursor:iw,cursorAccent:nw,selectionForeground:void 0,selectionBackgroundTransparent:uc,selectionBackgroundOpaque:Tt.blend(xc,uc),selectionInactiveBackgroundTransparent:uc,selectionInactiveBackgroundOpaque:Tt.blend(xc,uc),scrollbarSliderBackground:Tt.opacity(Aa,.2),scrollbarSliderHoverBackground:Tt.opacity(Aa,.4),scrollbarSliderActiveBackground:Tt.opacity(Aa,.5),overviewRulerBorder:Aa,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,Aa),t.background=xt(e.background,xc),t.cursor=Tt.blend(t.background,xt(e.cursor,iw)),t.cursorAccent=Tt.blend(t.background,xt(e.cursorAccent,nw)),t.selectionBackgroundTransparent=xt(e.selectionBackground,uc),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,XS):void 0,t.selectionForeground===XS&&(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,zz),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([Se(0,Yi)],y0);function xt(e,t){if(e!==void 0)try{return Bt.toColor(e)}catch{}return t}var Iz=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)}},Pz=class{constructor(){this._services=new Iz,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=D9(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)}},Uz={trace:0,debug:1,info:2,warn:3,error:4,off:5},Hz="xterm.js: ",S0=class extends Ye{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Uz[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?"":Hz)+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([Se(0,Yi)],S0);var sw=class extends Ye{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ge),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ge),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ge),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let a=t-1;a>=0;a--)this.set(e+a+i,this.get(e+a));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ge=3,ti=Object.freeze(new eu),jd=0,kp=2,yc=class oN{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ge);let a=i||Hn.fromCharData([0,kk,1,0]);for(let l=0;l<t;++l)this.setCell(l,a);this.length=t}get(t){let i=this._data[t*Ge+0],s=i&2097151;return[this._data[t*Ge+1],i&2097152?this._combined[t]:s?Hr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Ge+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ge+0]=t|2097152|i[2]<<22):this._data[t*Ge+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ge+0]>>22}hasWidth(t){return this._data[t*Ge+0]&12582912}getFg(t){return this._data[t*Ge+1]}getBg(t){return this._data[t*Ge+2]}hasContent(t){return this._data[t*Ge+0]&4194303}getCodePoint(t){let i=this._data[t*Ge+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ge+0]&2097152}getString(t){let i=this._data[t*Ge+0];return i&2097152?this._combined[t]:i&2097151?Hr(i&2097151):""}isProtected(t){return this._data[t*Ge+2]&536870912}loadCell(t,i){return jd=t*Ge,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*Ge+0]=i.content,this._data[t*Ge+1]=i.fg,this._data[t*Ge+2]=i.bg}setCellFromCodepoint(t,i,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ge+0]=i|s<<22,this._data[t*Ge+1]=a.fg,this._data[t*Ge+2]=a.bg}addCodepointToCell(t,i,s){let a=this._data[t*Ge+0];a&2097152?this._combined[t]+=Hr(i):a&2097151?(this._combined[t]=Hr(a&2097151)+Hr(i),a&=-2097152,a|=2097152):a=i|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Ge+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 Hn;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 Hn;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*Ge;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 oN(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*Ge+0]&4194303)return t+(this._data[t*Ge+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ge+0]&4194303||this._data[t*Ge+2]&50331648)return t+(this._data[t*Ge+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<Ge;f++)this._data[(s+m)*Ge+f]=c[(i+m)*Ge+f];c[(i+m)*Ge+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ge;f++)this._data[(s+m)*Ge+f]=c[(i+m)*Ge+f];c[(i+m)*Ge+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*Ge+0],h=c&2097151,m=c&2097152?this._combined[i]:h?Hr(h):Vr;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 Fz(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,R=Math.min(N,T);g[_].copyCellsFrom(g[x],y,v,R,!1),v+=R,v===i&&(_++,v=0),y+=R,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 $z(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 Vz(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 qz(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 lN=class cN{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=cN._nextId++,this._onDispose=this.register(new ge),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ua(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};lN._nextId=1;var Gz=lN,hi={},Ma=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 rw=4294967295,aw=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=Ma,this.markers=[],this._nullCell=Hn.fromCharData([0,kk,1,0]),this._whitespaceCell=Hn.fromCharData([0,Vr,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 sw(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 yc(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>rw?rw: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 sw(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 yc(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 yc(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=Fz(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ti),i);if(s.length>0){let a=$z(this.lines,s);Vz(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 yc(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 R=this.ybase+this.y;if(R>=c&&R<c+m.length)continue}let f=m[m.length-1].getTrimmedLength(),g=qz(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 R=0;R<_;R++){let A=this.getBlankLine(ti,!0);x.push(A)}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 R=Math.min(N,w);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[C],N-R,w-R,R,!0),w-=R,w===0&&(y--,w=g[y]),N-=R,N===0){C--;let A=Math.max(C,0);N=Uc(m,A,this._cols)}}for(let R=0;R<m.length;R++)g[R]<e&&m[R].setCell(g[R],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 Gz(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)}},Kz=class extends Ye{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ge),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new aw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new aw(!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)}},uN=2,dN=1,w0=class extends Ye{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,uN),this.rows=Math.max(e.rawOptions.rows||0,dN),this.buffers=this._register(new Kz(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([Se(0,Yi)],w0);var zo={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:{}},Wz=["normal","bold","100","200","300","400","500","600","700","800","900"],Yz=class extends Ye{constructor(e){super(),this._onOptionChange=this._register(new ge),this.onOptionChange=this._onOptionChange.event;let t={...zo};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 zo))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in zo))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=zo[e]),!Xz(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=zo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Wz.includes(t)?t:zo[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 Xz(e){return e==="block"||e==="underline"||e==="bar"}function Sc(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]&&Sc(e[s],t-1);return i}var ow=Object.freeze({insertMode:!1}),lw=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 Ye{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ge),this.onData=this._onData.event,this._onUserInput=this._register(new ge),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ge),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Sc(ow),this.decPrivateModes=Sc(lw)}reset(){this.modes=Sc(ow),this.decPrivateModes=Sc(lw)}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([Se(0,Wi),Se(1,Rk),Se(2,Yi)],E0);var cw={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,uw={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 Ye{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ge),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(cw))this.addProtocol(s,cw[s]);for(let s of Object.keys(uw))this.addEncoding(s,uw[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([Se(0,Wi),Se(1,qa),Se(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]],Zz=[[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 Qz(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 Jz=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]:Qz(e,Zz)?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=ja.extractWidth(t);a===0?s=!1:a>i&&(i=a)}return ja.createPropertyValue(0,i,s)}},ja=class Xd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ge,this.onChange=this._onChange.event;let t=new Jz;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)}},eI=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 dw(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 dc=2147483647,tI=256,hN=class k0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>tI)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>dc?dc: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>dc?dc: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,dc):t}},hc=[],iI=class{constructor(){this._state=0,this._active=hc,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=hc}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=hc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||hc,!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=hc,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}},fc=[],nI=class{constructor(){this._handlers=Object.create(null),this._active=fc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=fc}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=fc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||fc,!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=fc,this._ident=0}},wc=new hN;wc.addParam(0);var hw=class{constructor(e){this._handler=e,this._data="",this._params=wc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():wc,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=wc,this._data="",this._hitLimit=!1,i));return this._params=wc,this._data="",this._hitLimit=!1,t}},sI=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}},zn=160,rI=(function(){let e=new sI(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(zn,0,2,0),e.add(zn,8,5,8),e.add(zn,6,0,6),e.add(zn,11,0,11),e.add(zn,13,13,13),e})(),aI=class extends Ye{constructor(e=rI){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 hN,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 iI),this._dcsParser=this._register(new nI),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:zn)],a>>4){case 2:for(let v=h+1;;++v){if(v>=t||(s=e[v])<32||s>126&&s<zn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<zn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<zn){this._printHandler(e,h,v),h=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<zn){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<zn){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<zn){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}}},oI=/^([\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})$/,lI=/^[\da-f]+$/;function fw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=oI.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),lI.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 cI(e,t=16){let[i,s,a]=e;return`rgb:${Mp(i,t)}/${Mp(s,t)}/${Mp(a,t)}`}var uI={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ir=131072,mw=10;function pw(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 gw=5e3,_w=0,dI=class extends Ye{constructor(e,t,i,s,a,l,c,h,m=new aI){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 M9,this._utf8Decoder=new R9,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ti.clone(),this._eraseAttrDataInternal=ti.clone(),this._onRequestBell=this._register(new ge),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ge),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ge),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ge),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ge),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ge),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ge),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ge),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ge),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new 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 hw((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"),gw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${gw} 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>Ir&&(l=this._parseStack.position+Ir)}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<Ir&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ir))),c||this._dirtyRowTracker.clearRange(),e.length>Ir)for(let f=l;f<e.length;f+=Ir){let g=f+Ir<e.length?f+Ir: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=ja.extractWidth(y);let w=ja.extractShouldJoin(y),C=w?ja.extractWidth(v):0;if(v=y,c&&this._onA11yChar.fire(Hr(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 yc&&_.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=>pw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new hw(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=ja.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,Ma),this._charsetService.setgCharset(1,Ma),this._charsetService.setgCharset(2,Ma),this._charsetService.setgCharset(3,Ma);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(!pw(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>mw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>mw&&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(bw(l))if(a==="?")t.push({type:0,index:l});else{let c=fw(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=fw(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]);bw(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,Ma),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(uI[e[0]],hi[e[1]]||Ma),!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 Hn;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&&(_w=e,e=t,t=_w),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};N0=Ht([Se(0,Wi)],N0);function bw(e){return 0<=e&&e<256}var hI=5e7,vw=12,fI=50,mI=class extends Ye{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>hI)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>=vw?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>=vw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>fI&&(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([Se(0,Wi)],T0);var xw=!1,pI=class extends Ye{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Qo),this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onData=this._register(new ge),this.onData=this._onData.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ge),this._instantiationService=new Pz,this.optionsService=this._register(new Yz(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(Rk,this._logService),this.coreService=this._register(this._instantiationService.createInstance(E0)),this._instantiationService.setService(qa,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(C0)),this._instantiationService.setService(Mk,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ja)),this._instantiationService.setService(L9,this.unicodeService),this._charsetService=this._instantiationService.createInstance(eI),this._instantiationService.setService(j9,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T0),this._instantiationService.setService(Dk,this._oscLinkService),this._inputHandler=this._register(new dI(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 mI((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 ge),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!xw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),xw=!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,uN),t=Math.max(t,dN),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(dw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(dw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Dt(()=>{for(let t of e)t.dispose()})}}},gI={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 _I(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=gI[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,bI=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,yw=0,vI=class extends Ye{constructor(){super(),this._decorations=new bI(e=>e?.marker.line),this._onDecorationRegistered=this._register(new ge),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ge),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Dt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new xI(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,yw=Rp+(a.options.width??1),e>=Rp&&e<yw&&(!i||(a.options.layer??"bottom")===i)&&s(a)})}},xI=class extends qr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ge),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ge),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=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()}},yI=1e3,SI=class{constructor(e,t=yI){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)}},Sw=20,gh=class extends Ye{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let 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 SI(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(`
38
+ `))),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(He(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<Sw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
39
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===Sw+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([Se(1,N_),Se(2,nr),Se(3,sr)],gh);var A0=class extends Ye{constructor(e,t,i,s,a){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ge),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ge),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Dt(()=>{Ua(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(He(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(He(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(He(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(He(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&&wI(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,Ua(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([Se(1,T_),Se(2,sr),Se(3,Wi),Se(4,jk)],A0);function wI(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 EI=class extends pI{constructor(e={}){super(e),this._linkifier=this._register(new Qo),this.browser=Jk,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Qo),this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ge),this.onKey=this._onKey.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ge),this.onBell=this._onBell.event,this._onFocus=this._register(new ge),this._onBlur=this._register(new ge),this._onA11yCharEmitter=this._register(new ge),this._onA11yTabEmitter=this._register(new ge),this._onWillOpen=this._register(new ge),this._setup(),this._decorationService=this._instantiationService.createInstance(vI),this._instantiationService.setService(tu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(fz),this._instantiationService.setService(jk,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};${cI(a)}${Zk.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(He(this.element,"copy",t=>{this.hasSelection()&&T9(t,this._selectionService)}));let e=t=>A9(t,this.textarea,this.coreService,this.optionsService);this._register(He(this.textarea,"paste",e)),this._register(He(this.element,"paste",e)),eN?this._register(He(this.element,"mousedown",t=>{t.button===2&&DS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(He(this.element,"contextmenu",t=>{DS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),B_&&this._register(He(this.element,"auxclick",t=>{t.button===1&&Ck(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(He(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(He(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(He(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(He(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(He(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(He(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(He(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(He(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",Kg.get()),nN||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(dz,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(nr,this._coreBrowserService),this._register(He(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(He(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(rl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(fh),this._instantiationService.setService(Ok,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(v0,this.rows,this.screenElement)),this._instantiationService.setService(sr,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(z9,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(He(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(He(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(He(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){Ek(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=_I(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)&&(CI(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 CI(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var kI=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)}},NI=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 Hn)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},ww=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 NI(t)}getNullCell(){return new Hn}},TI=class extends Ye{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ge),this.onBufferChange=this._onBufferChange.event,this._normal=new ww(this._core.buffers.normal,"normal"),this._alternate=new ww(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)}},AI=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)}},MI=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}},RI=["cols","rows"],ls=0,DI=class extends Ye{constructor(e){super(),this._core=this._register(new EI(e)),this._addonManager=this._register(new kI),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(RI.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 AI(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new MI(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 TI(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
40
+ `,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 Kg.get()},set promptLabel(e){Kg.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 fN({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 DI({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 w9;w.loadAddon(C),w.open(s.current),a.current=w,l.current=C;const N=new WebSocket(OI(e));c.current=N;const T=w.onData(A=>{N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({data:A,type:"input"}))});N.addEventListener("open",()=>{g("running"),v("Shell connected"),x()}),N.addEventListener("message",A=>{const L=jI(A.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(A=>A==="exited"?A:"exited"),v("Socket closed")}),N.addEventListener("error",()=>{g("error"),v("Terminal socket error")}),window.addEventListener("resize",x),window.setTimeout(x,0);const R=new ResizeObserver(()=>x());return R.observe(s.current),()=>{window.removeEventListener("resize",x),R.disconnect(),T.dispose(),N.close(),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:he("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(We,{className:he("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(de,{"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(nE,{}),"Restart"]}),u.jsxs(de,{"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 OI(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function jI(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function LI({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(de,{"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(tE,{}):u.jsx(eE,{}),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(fN,{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:he("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:g})}const BI=500;function zI(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(-BI))}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 II={running:"secondary",passed:"success",failed:"error",error:"error"},PI={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function UI({serviceName:e}){const{run:t,lines:i,error:s,starting:a,start:l}=zI(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(ct,{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(de,{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(We,{size:"small",variant:II[t.status],children:PI[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:he(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 HI({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(Na,{active:l==="logs",onClick:()=>c("logs"),children:"Logs"}),u.jsxs(Na,{active:l==="processes",onClick:()=>c("processes"),children:["Processes ",h.length?u.jsx(We,{variant:"secondary",size:"small",children:h.length}):null]}),u.jsx(Na,{active:l==="metrics",onClick:()=>c("metrics"),children:"Metrics"}),u.jsxs(Na,{active:l==="http",onClick:()=>c("http"),children:["HTTP",t?.inspector?.enabled?u.jsx(We,{variant:"success",size:"small",children:"on"}):null]}),u.jsx(Na,{active:l==="env",onClick:()=>c("env"),children:"Env"}),u.jsx(Na,{active:l==="tests",onClick:()=>c("tests"),children:"Tests"}),u.jsx(Na,{active:l==="terminal",onClick:()=>c("terminal"),children:"Terminal"})]}),l==="processes"?u.jsx(x9,{rows:h}):null,l==="metrics"?u.jsx(m9,{serviceName:e}):null,l==="http"?u.jsx(d9,{serviceName:e,status:t,timeline:s,onRefresh:a}):null,l==="env"?u.jsx(u9,{serviceName:e}):null,l==="tests"?u.jsx(UI,{serviceName:e}):null,l==="logs"?u.jsx(i9,{serviceName:e}):null,u.jsx(LI,{active:l==="terminal",serviceName:e},e)]})}function Na({active:e,onClick:t,children:i}){return u.jsx("button",{className:he("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 FI({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(A=>Ko(c[A.name]?.state));function T(A){!g||!A.dataTransfer.types.includes(Hc)||(A.preventDefault(),A.dataTransfer.dropEffect="copy",C(!0))}function R(A){if(!g)return;A.preventDefault(),C(!1);const L=A.dataTransfer.getData(Hc);L&&g(L)}return u.jsxs("section",{className:he("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>C(!1),onDrop:R,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(A=>!A),type:"button",children:[u.jsx(es,{className:he("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(We,{size:"small",variant:"secondary",children:t.services.length}):null]}),u.jsx(Fr,{label:"Edit group",children:u.jsx(de,{"aria-expanded":_,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(A=>!A),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 Gi(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await Gi(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const A=a[0];A&&f(A.name)}})]}),_?u.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:u.jsx(vk,{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(A=>u.jsx(mN,{service:A,status:c[A.name],health:l[A.name],ports:s,onRefresh:i,timeline:h,selected:m===A.name,onSelect:()=>f(A.name)},A.name)):u.jsx(dt,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function mN({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&&pk(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:he("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(pN,{kind:e.kind}),e.port?u.jsxs("span",{children:[":",e.port]}):null]})]}),u.jsx(gN,{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",Ew={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 pN({kind:e}){const t=Ew[e??"local"]??Ew.local;return u.jsx("span",{className:he("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 $I({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 Gi("/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(ct,{"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(de,{"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 VI(e){return`http://127.0.0.1:${e}`}function gN({state:e}){return u.jsx(We,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:he(e==="running"&&"font-mono"),children:e})}function qI({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,startOnboard:g}=Jc(),[_,v]=E.useState(!1),[x,y]=E.useState(!1),[w,C]=E.useState(!1),[N,T]=E.useState(!1),[R,A]=E.useState(!1),L=E.useRef({}),{error:F,message:j,success:M}=Ii(),H=E.useMemo(()=>new Set(e.config.bundles.flatMap(I=>I.services)),[e.config.bundles]),U=E.useMemo(()=>{const I=new Map;for(const D of e.config.bundles)for(const Y of D.services)I.has(Y)||I.set(Y,D.name);return I},[e.config.bundles]),V=E.useMemo(()=>e.config.services.filter(I=>!H.has(I.name)),[e.config.services,H]),ee=e.health??{},K=e.config.bundles.length>0||V.length>0;E.useEffect(()=>{!e.config.services.some(D=>D.name===l)&&a&&c(a)},[e.config.services,a,l]),E.useEffect(()=>{i&&e.config.services.some(I=>I.name===i)&&(c(i),s?.())},[i,e.config.services,s]);const Z=E.useMemo(()=>e.config.services.find(I=>I.name===l),[e.config.services,l]),q=l?e.runtime.services[l]:void 0,O=l?ee[l]:void 0;async function W(I,D){if(!I.services.includes(D))try{await LM(I.name,I.services,D),M(`Added ${D} to ${I.name}.`),await t()}catch(Y){F(Y instanceof Error?Y.message:String(Y))}}async function X(){if(Z){if(Ko(q?.state)){F(`Stop ${Z.name} before deleting it.`);return}if(window.confirm(`Delete service "${Z.name}"? This removes it from your config.`))try{await jM(Z.name),M(`Deleted ${Z.name}.`),await t()}catch(I){F(I instanceof Error?I.message:String(I))}}}async function $(I){const D=e.config.bundles.filter(Y=>Y.services.includes(I));if(D.length!==0)try{for(const Y of D)await BM(Y.name,Y.services,I);j({text:`Removed ${I} from ${D.map(Y=>Y.name).join(", ")}.`}),await t()}catch(Y){F(Y instanceof Error?Y.message:String(Y))}}return E.useEffect(()=>{const I=Object.fromEntries(e.config.services.map(Y=>[Y.name,e.runtime.services[Y.name]?.state??"stopped"])),D=L.current;if(Object.keys(D).length){const Y=new Map,ue=new Map;for(const te of e.config.services){const re=I[te.name],me=D[te.name];if(!me||me===re)continue;const xe=e.runtime.services[te.name],Oe=U.get(te.name);if(Oe){const ye=Y.get(Oe)??new Map;if(ye.set(re,(ye.get(re)??0)+1),Y.set(Oe,ye),re==="exited"){const pe=ue.get(Oe)??[];pe.push(xe?.exitCode),ue.set(Oe,pe)}continue}if(re==="running")M(`${te.name} is running.`);else if(re==="stopped")j({text:`${te.name} stopped.`});else if(re==="starting")j({text:`${te.name} is starting.`});else if(re==="exited"){const ye=xe?.exitCode===void 0||xe.exitCode===null?"":` with code ${xe.exitCode}`;F(`${te.name} exited${ye}.`)}}for(const[te,re]of Y)KI({exitCodes:ue.get(te)??[],groupName:te,showErrorToast:F,showMessageToast:j,showSuccessToast:M,transitions:re})}L.current=I},[e.config.services,e.runtime.services,U,F,j,M]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:he("grid h-full min-h-0 overflow-hidden bg-card/85",x?"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(Js,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsx(er,{className:"border-b border-border px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(tr,{className:"text-sm",children:"Services"}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(de,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>v(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(sE,{className:"size-3.5"}),"Logs"]}),u.jsx(GI,{onCreateGroup:()=>m("group"),onCreateService:()=>m("service"),onOnboardRepo:g,onCreateWithAi:()=>f({prompt:d7,source:{type:"service-setup",label:"Add a service"}})})]})]})}),u.jsx(ir,{className:"p-0",children:K?u.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(I=>u.jsx(FI,{group:I,onRefresh:t,ports:e.ports,allServices:e.config.services,health:ee,services:e.config.services.filter(D=>I.services.includes(D.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:l,onSelectService:c,onDropService:D=>{W(I,D)}},I.name)),V.length?u.jsxs("div",{className:he("transition-colors",R&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:I=>{I.dataTransfer.types.includes(Hc)&&(I.preventDefault(),I.dataTransfer.dropEffect="move",A(!0))},onDragLeave:()=>A(!1),onDrop:I=>{I.preventDefault(),A(!1);const D=I.dataTransfer.getData(Hc);D&&$(D)},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:V.length})]}),u.jsx("div",{className:"divide-y divide-border",children:V.map(I=>u.jsx(mN,{service:I,status:e.runtime.services[I.name],health:ee[I.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:l===I.name,onSelect:()=>c(I.name)},I.name))})]}):null]}):u.jsx(ch,{label:"No services registered yet."})})]})}),u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:Z?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:Z.name}),u.jsx(gN,{state:q?.state??"stopped"}),u.jsx(pN,{kind:Z.kind}),u.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[u.jsx($I,{service:Z,onRefresh:t}),(()=>{const I=q?.url??(Z.port?VI(Z.port):void 0);return I?u.jsx(Fr,{label:`Open ${I}`,children:u.jsx(de,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(I,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:u.jsx(F0,{})})}):null})(),O?.agentContext?u.jsx(Fr,{label:"Copy debug context for an AI agent",children:u.jsx(de,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>C(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Zd,{})})}):null,u.jsx(C_,{active:Ko(q?.state),baseUrl:`/api/services/${encodeURIComponent(Z.name)}`,compact:!0,targetLabel:Z.name,onRefresh:t}),u.jsx(Fr,{label:"Edit service",children:u.jsx(de,{"aria-label":`Edit ${Z.name}`,className:"size-7",onClick:()=>T(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Rc,{})})}),u.jsx(Fr,{label:Ko(q?.state)?"Stop before deleting":"Delete service",children:u.jsx(de,{"aria-label":`Delete ${Z.name}`,className:"size-7",disabled:Ko(q?.state),onClick:()=>{X()},size:"icon",type:"button",variant:"outline",children:u.jsx(Gc,{className:"text-destructive"})})}),u.jsx(Fr,{label:x?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:u.jsx(de,{"aria-label":x?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>y(I=>!I),size:"icon",type:"button",variant:"ghost",children:x?u.jsx(JT,{}):u.jsx(Zr,{})})})]})]}),Z.command?u.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Z.command,children:["$ ",Z.command]}):null,Z.cwd?u.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Z.cwd,children:Z.cwd}):null,u.jsx(HL,{health:O})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsx(HI,{serviceName:Z.name,status:q,health:O,timeline:e.timeline??[],onRefresh:t},Z.name)})]}):u.jsx(ch,{label:"Select a service to see details."})}),x?null:u.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[u.jsx(GL,{ports:e.ports}),u.jsx(DL,{events:e.timeline??[]})]})]}),w&&Z&&O?.agentContext?u.jsx(Xs,{icon:u.jsx(Zd,{}),onClose:()=>C(!1),title:`Agent context — ${Z.name}`,children:u.jsx("div",{className:"p-4",children:u.jsx(hL,{context:O.agentContext})})}):null,N&&Z?u.jsx(Xs,{icon:u.jsx(Rc,{}),onClose:()=>T(!1),size:"lg",title:`Edit Service — ${Z.name}`,children:u.jsx(SS,{cwd:e.cwd,initialService:Z,onRefresh:t,onSaved:()=>T(!1)})}):null,h?u.jsx(Xs,{icon:h==="service"?u.jsx(Pn,{}):u.jsx(G2,{}),onClose:()=>m(null),size:h==="service"?"lg":"md",title:h==="service"?"Add Service":"Create Group",children:h==="service"?u.jsx(SS,{cwd:e.cwd,onRefresh:t,onSaved:()=>m(null)}):u.jsx(vk,{services:V,onRefresh:t,onSaved:()=>m(null)})}):null,_?u.jsx(r9,{initialService:l||void 0,onClose:()=>v(!1),services:e.config.services.map(I=>I.name)}):null]})}function GI({onCreateService:e,onCreateGroup:t,onCreateWithAi:i,onOnboardRepo:s}){const[a,l]=E.useState(!1);function c(h){l(!1),h()}return u.jsxs("div",{className:"relative",children:[u.jsx(Fr,{label:"Add",side:"bottom",children:u.jsx(de,{"aria-expanded":a,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>l(h=>!h),size:"icon",type:"button",variant:"ghost",children:u.jsx(Pn,{})})}),a?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>l(!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:()=>c(e),role:"menuitem",type:"button",children:[u.jsx(Pn,{}),"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:()=>c(i),role:"menuitem",title:"Set up with AI — the agent walks you through it",type:"button",children:[u.jsx(Q7,{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:()=>c(t),role:"menuitem",type:"button",children:[u.jsx(G2,{}),"Create Group"]}),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:()=>c(s),role:"menuitem",type:"button",children:[u.jsx(Zs,{}),"Add from GitHub"]})]})]}):null]})}function KI({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 WI({data:e,onOpenService:t}){const i=E.useMemo(()=>YI(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(La,{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:he("size-2 shrink-0 rounded-full",ZI(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 YI(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:XI(i,e.health[i.name]),port:t.get(i.name)??QI(i.url),uptime:i.state==="running"?JI(i.startedAt):"starting…",url:i.url})).sort((i,s)=>i.name.localeCompare(s.name))}function XI(e,t){return e.state==="starting"?"starting":t?.status==="healthy"?"healthy":t?.status==="warning"?"warning":t?.status==="unhealthy"?"unhealthy":"healthy"}function ZI(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 QI(e){if(e)try{const t=new URL(e).port;return t?Number(t):void 0}catch{return}}function JI(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 eP(){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:he("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(Sn,{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(Pn,{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(fN,{active:m.id===i,sessionId:m.id})},m.id))})]})}const tP=800;function _N({activeHunkIndex:e=0,diff:t}){const i=nP(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>tP;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(de,{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:he("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",Cw(i,g)&&f.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:f.hunkIndex!==null&&Cw(i,g)?_=>{a.current[f.hunkIndex??0]=_}:void 0,children:[u.jsx(kw,{value:f.oldLine}),u.jsx(kw,{value:f.newLine}),u.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:f.content||" "})]},`${g}-${f.content}`))})})}function iP(e){return e.split(`
41
+ `).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 nP(e){const t=sP(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function sP(e){let t=null,i=null,s=null;return e.split(`
42
+ `).map(a=>{if(rP(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 Cw(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 rP(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 kw({value:e}){return u.jsx("span",{className:he("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function aP({branch:e,error:t,files:i,selectedFile:s,onSelectFile:a,root:l}){const c=E.useMemo(()=>uP(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(Zs,{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(We,{variant:"outline",children:e}):null,u.jsx(We,{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(oP,{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 oP({collapsed:e,group:t,onSelectFile:i,onToggle:s,root:a,selectedFile:l}){const c=e?Zr: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(We,{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(lP,{active:l===h.path,file:h,group:t.id,onClick:()=>i(h.path),root:a},h.path))})]})}function lP({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?gk(mk(a,t.path)):{};return u.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:he("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:he("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:cP(t,i)})]})}function cP(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function uP(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 dP(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 hP(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 Nw({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(()=>dP(t),[t]),g=E.useMemo(()=>hP(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($a,{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(We,{variant:"outline",children:l}):null,u.jsx(We,{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(bN,{depth:0,expanded:v,node:N,onSelectFile:a,onToggle:C,root:h,selectedFile:s,statusByPath:_},N.path))})]})}function bN({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?gk(mk(l,i.path)):{};if(i.isFile){const x=h.get(i.path),y=c===i.path;return u.jsxs("button",{className:he("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(fP,{file:x}):null]})}const _=m?es:Zr,v=m?Ch:$a;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(bN,{depth:e+1,expanded:t,node:x,onSelectFile:s,onToggle:a,root:l,selectedFile:c,statusByPath:h},x.path)):null]})}function fP({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:he("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}const mP="modulepreload",pP=function(e){return"/"+e},Tw={},gP=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=pP(f),f in Tw)return;Tw[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":mP,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,Aw;function _P(){if(Aw)return Dp;Aw=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(ae=>{const ve=z[ae],Ue=typeof ve;(Ue==="object"||Ue==="function")&&!Object.isFrozen(ve)&&e(ve)}),z}class t{constructor(ae){ae.data===void 0&&(ae.data={}),this.data=ae.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(z,...ae){const ve=Object.create(null);for(const Ue in z)ve[Ue]=z[Ue];return ae.forEach(function(Ue){for(const Ct in Ue)ve[Ct]=Ue[Ct]}),ve}const a="</span>",l=z=>!!z.scope,c=(z,{prefix:ae})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const ve=z.split(".");return[`${ae}${ve.shift()}`,...ve.map((Ue,Ct)=>`${Ue}${"_".repeat(Ct+1)}`)].join(" ")}return`${ae}${z}`};class h{constructor(ae,ve){this.buffer="",this.classPrefix=ve.classPrefix,ae.walk(this)}addText(ae){this.buffer+=i(ae)}openNode(ae){if(!l(ae))return;const ve=c(ae.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(ae){l(ae)&&(this.buffer+=a)}value(){return this.buffer}span(ae){this.buffer+=`<span class="${ae}">`}}const m=(z={})=>{const ae={children:[]};return Object.assign(ae,z),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 ve=m({scope:ae});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ae){return this.constructor._walk(ae,this.rootNode)}static _walk(ae,ve){return typeof ve=="string"?ae.addText(ve):ve.children&&(ae.openNode(ve),ve.children.forEach(Ue=>this._walk(ae,Ue)),ae.closeNode(ve)),ae}static _collapse(ae){typeof ae!="string"&&ae.children&&(ae.children.every(ve=>typeof ve=="string")?ae.children=[ae.children.join("")]:ae.children.forEach(ve=>{f._collapse(ve)}))}}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,ve){const Ue=ae.root;ve&&(Ue.scope=`language:${ve}`),this.add(Ue)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function _(z){return z?typeof z=="string"?z:z.source:null}function v(z){return w("(?=",z,")")}function x(z){return w("(?:",z,")*")}function y(z){return w("(?:",z,")?")}function w(...z){return z.map(ve=>_(ve)).join("")}function C(z){const ae=z[z.length-1];return typeof ae=="object"&&ae.constructor===Object?(z.splice(z.length-1,1),ae):{}}function N(...z){return"("+(C(z).capture?"":"?:")+z.map(Ue=>_(Ue)).join("|")+")"}function T(z){return new RegExp(z.toString()+"|").exec("").length-1}function R(z,ae){const ve=z&&z.exec(ae);return ve&&ve.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(z,{joinWith:ae}){let ve=0;return z.map(Ue=>{ve+=1;const Ct=ve;let yt=_(Ue),Te="";for(;yt.length>0;){const we=A.exec(yt);if(!we){Te+=yt;break}Te+=yt.substring(0,we.index),yt=yt.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?Te+="\\"+String(Number(we[1])+Ct):(Te+=we[0],we[0]==="("&&ve++)}return Te}).map(Ue=>`(${Ue})`).join(ae)}const F=/\b\B/,j="[a-zA-Z]\\w*",M="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",V="\\b(0b[01]+)",ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(z={})=>{const ae=/^#![ ]*\//;return z.binary&&(z.begin=w(ae,/.*\b/,z.binary,/\b.*/)),s({scope:"meta",begin:ae,end:/$/,relevance:0,"on:begin":(ve,Ue)=>{ve.index!==0&&Ue.ignoreMatch()}},z)},Z={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(z,ae,ve={}){const Ue=s({scope:"comment",begin:z,end:ae,contains:[]},ve);Ue.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 Ue.contains.push({begin:w(/[ ]+/,"(",Ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ue},$=X("//","$"),I=X("/\\*","\\*/"),D=X("#","$"),Y={scope:"number",begin:H,relevance:0},ue={scope:"number",begin:U,relevance:0},te={scope:"number",begin:V,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Z,{begin:/\[/,end:/\]/,relevance:0,contains:[Z]}]},me={scope:"title",begin:j,relevance:0},xe={scope:"title",begin:M,relevance:0},Oe={begin:"\\.\\s*"+M,relevance:0};var pe=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:te,BINARY_NUMBER_RE:V,COMMENT:X,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:$,C_NUMBER_MODE:ue,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(ae,ve)=>{ve.data._beginMatch=ae[1]},"on:end":(ae,ve)=>{ve.data._beginMatch!==ae[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:j,MATCH_NOTHING_RE:F,METHOD_GUARD:Oe,NUMBER_MODE:Y,NUMBER_RE:H,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:O,REGEXP_MODE:re,RE_STARTERS_RE:ee,SHEBANG:K,TITLE_MODE:me,UNDERSCORE_IDENT_RE:M,UNDERSCORE_TITLE_MODE:xe});function Pe(z,ae){z.input[z.index-1]==="."&&ae.ignoreMatch()}function st(z,ae){z.className!==void 0&&(z.scope=z.className,delete z.className)}function Ie(z,ae){ae&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=Pe,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function Ft(z,ae){Array.isArray(z.illegal)&&(z.illegal=N(...z.illegal))}function ta(z,ae){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function vs(z,ae){z.relevance===void 0&&(z.relevance=1)}const Ka=(z,ae)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},z);Object.keys(z).forEach(Ue=>{delete z[Ue]}),z.keywords=ve.keywords,z.begin=w(ve.beforeMatch,v(ve.begin)),z.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},z.relevance=0,delete ve.beforeMatch},ia=["of","and","for","in","not","or","if","then","parent","list","value"],na="keyword";function rr(z,ae,ve=na){const Ue=Object.create(null);return typeof z=="string"?Ct(ve,z.split(" ")):Array.isArray(z)?Ct(ve,z):Object.keys(z).forEach(function(yt){Object.assign(Ue,rr(z[yt],ae,yt))}),Ue;function Ct(yt,Te){ae&&(Te=Te.map(we=>we.toLowerCase())),Te.forEach(function(we){const ze=we.split("|");Ue[ze[0]]=[yt,xs(ze[0],ze[1])]})}}function xs(z,ae){return ae?Number(ae):ll(z)?0:1}function ll(z){return ia.includes(z.toLowerCase())}const Wa={},Ot=z=>{console.error(z)},ys=(z,...ae)=>{console.log(`WARN: ${z}`,...ae)},xi=(z,ae)=>{Wa[`${z}/${ae}`]||(console.log(`Deprecated as of ${z}. ${ae}`),Wa[`${z}/${ae}`]=!0)},Ss=new Error;function ws(z,ae,{key:ve}){let Ue=0;const Ct=z[ve],yt={},Te={};for(let we=1;we<=ae.length;we++)Te[we+Ue]=Ct[we],yt[we+Ue]=!0,Ue+=T(ae[we-1]);z[ve]=Te,z[ve]._emit=yt,z[ve]._multi=!0}function Ya(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ss;if(typeof z.beginScope!="object"||z.beginScope===null)throw Ot("beginScope must be object"),Ss;ws(z,z.begin,{key:"beginScope"}),z.begin=L(z.begin,{joinWith:""})}}function ar(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ss;if(typeof z.endScope!="object"||z.endScope===null)throw Ot("endScope must be object"),Ss;ws(z,z.end,{key:"endScope"}),z.end=L(z.end,{joinWith:""})}}function cl(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function Xa(z){cl(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),Ya(z),ar(z)}function Es(z){function ae(Te,we){return new RegExp(_(Te),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(we?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,ze){ze.position=this.position++,this.matchIndexes[this.matchAt]=ze,this.regexes.push([ze,we]),this.matchAt+=T(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(ze=>ze[1]);this.matcherRe=ae(L(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const ze=this.matcherRe.exec(we);if(!ze)return null;const $t=ze.findIndex((Cs,Qa)=>Qa>0&&Cs!==void 0),Mt=this.matchIndexes[$t];return ze.splice(0,$t),Object.assign(ze,Mt)}}class Ue{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const ze=new ve;return this.rules.slice(we).forEach(([$t,Mt])=>ze.addRule($t,Mt)),ze.compile(),this.multiRegexes[we]=ze,ze}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,ze){this.rules.push([we,ze]),ze.type==="begin"&&this.count++}exec(we){const ze=this.getMatcher(this.regexIndex);ze.lastIndex=this.lastIndex;let $t=ze.exec(we);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const Mt=this.getMatcher(0);Mt.lastIndex=this.lastIndex+1,$t=Mt.exec(we)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Ct(Te){const we=new Ue;return Te.contains.forEach(ze=>we.addRule(ze.begin,{rule:ze,type:"begin"})),Te.terminatorEnd&&we.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&we.addRule(Te.illegal,{type:"illegal"}),we}function yt(Te,we){const ze=Te;if(Te.isCompiled)return ze;[st,ta,Xa,Ka].forEach(Mt=>Mt(Te,we)),z.compilerExtensions.forEach(Mt=>Mt(Te,we)),Te.__beforeBegin=null,[Ie,Ft,vs].forEach(Mt=>Mt(Te,we)),Te.isCompiled=!0;let $t=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),$t=Te.keywords.$pattern,delete Te.keywords.$pattern),$t=$t||/\w+/,Te.keywords&&(Te.keywords=rr(Te.keywords,z.case_insensitive)),ze.keywordPatternRe=ae($t,!0),we&&(Te.begin||(Te.begin=/\B|\b/),ze.beginRe=ae(ze.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(ze.endRe=ae(ze.end)),ze.terminatorEnd=_(ze.end)||"",Te.endsWithParent&&we.terminatorEnd&&(ze.terminatorEnd+=(Te.end?"|":"")+we.terminatorEnd)),Te.illegal&&(ze.illegalRe=ae(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(Mt){return wn(Mt==="self"?Te:Mt)})),Te.contains.forEach(function(Mt){yt(Mt,ze)}),Te.starts&&yt(Te.starts,we),ze.matcher=Ct(ze),ze}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=s(z.classNameAliases||{}),yt(z)}function fi(z){return z?z.endsWithParent||fi(z.starts):!1}function wn(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(ae){return s(z,{variants:null},ae)})),z.cachedVariants?z.cachedVariants:fi(z)?s(z,{starts:z.starts?s(z.starts):null}):Object.isFrozen(z)?s(z):z}var yi="11.11.1";class ul extends Error{constructor(ae,ve){super(ae),this.name="HTMLInjectionError",this.html=ve}}const sa=i,Za=s,rt=Symbol("nomatch"),qn=7,ln=function(z){const ae=Object.create(null),ve=Object.create(null),Ue=[];let Ct=!0;const yt="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function ze(fe){return we.noHighlightRe.test(fe)}function $t(fe){let Re=fe.className+" ";Re+=fe.parentNode?fe.parentNode.className:"";const Ze=we.languageDetectRe.exec(Re);if(Ze){const ht=Ui(Ze[1]);return ht||(ys(yt.replace("{}",Ze[1])),ys("Falling back to no-highlight mode for this block.",fe)),ht?Ze[1]:"no-highlight"}return Re.split(/\s+/).find(ht=>ze(ht)||Ui(ht))}function Mt(fe,Re,Ze){let ht="",qt="";typeof Re=="object"?(ht=fe,Ze=Re.ignoreIllegals,qt=Re.language):(xi("10.7.0","highlight(lang, code, ...args) has been deprecated."),xi("10.7.0",`Please use highlight(code, options) instead.
43
+ https://github.com/highlightjs/highlight.js/issues/2277`),qt=fe,ht=Re),Ze===void 0&&(Ze=!0);const Oi={code:ht,language:qt};aa("before:highlight",Oi);const cn=Oi.result?Oi.result:Cs(Oi.language,Oi.code,Ze);return cn.code=Oi.code,aa("after:highlight",cn),cn}function Cs(fe,Re,Ze,ht){const qt=Object.create(null);function Oi(_e,Ae){return _e.keywords[Ae]}function cn(){if(!Be.keywords){Xt.addText(ft);return}let _e=0;Be.keywordPatternRe.lastIndex=0;let Ae=Be.keywordPatternRe.exec(ft),$e="";for(;Ae;){$e+=ft.substring(_e,Ae.index);const et=Si.case_insensitive?Ae[0].toLowerCase():Ae[0],jt=Oi(Be,et);if(jt){const[En,gl]=jt;if(Xt.addText($e),$e="",qt[et]=(qt[et]||0)+1,qt[et]<=qn&&(ur+=gl),En.startsWith("_"))$e+=Ae[0];else{const du=Si.classNameAliases[En]||En;un(Ae[0],du)}}else $e+=Ae[0];_e=Be.keywordPatternRe.lastIndex,Ae=Be.keywordPatternRe.exec(ft)}$e+=ft.substring(_e),Xt.addText($e)}function Xi(){if(ft==="")return;let _e=null;if(typeof Be.subLanguage=="string"){if(!ae[Be.subLanguage]){Xt.addText(ft);return}_e=Cs(Be.subLanguage,ft,!0,uu[Be.subLanguage]),uu[Be.subLanguage]=_e._top}else _e=Ja(ft,Be.subLanguage.length?Be.subLanguage:null);Be.relevance>0&&(ur+=_e.relevance),Xt.__addSublanguage(_e._emitter,_e.language)}function Et(){Be.subLanguage!=null?Xi():cn(),ft=""}function un(_e,Ae){_e!==""&&(Xt.startScope(Ae),Xt.addText(_e),Xt.endScope())}function lu(_e,Ae){let $e=1;const et=Ae.length-1;for(;$e<=et;){if(!_e._emit[$e]){$e++;continue}const jt=Si.classNameAliases[_e[$e]]||_e[$e],En=Ae[$e];jt?un(En,jt):(ft=En,cn(),ft=""),$e++}}function to(_e,Ae){return _e.scope&&typeof _e.scope=="string"&&Xt.openNode(Si.classNameAliases[_e.scope]||_e.scope),_e.beginScope&&(_e.beginScope._wrap?(un(ft,Si.classNameAliases[_e.beginScope._wrap]||_e.beginScope._wrap),ft=""):_e.beginScope._multi&&(lu(_e.beginScope,Ae),ft="")),Be=Object.create(_e,{parent:{value:Be}}),Be}function fl(_e,Ae,$e){let et=R(_e.endRe,$e);if(et){if(_e["on:end"]){const jt=new t(_e);_e["on:end"](Ae,jt),jt.isMatchIgnored&&(et=!1)}if(et){for(;_e.endsParent&&_e.parent;)_e=_e.parent;return _e}}if(_e.endsWithParent)return fl(_e.parent,Ae,$e)}function io(_e){return Be.matcher.regexIndex===0?(ft+=_e[0],1):(dr=!0,0)}function Uh(_e){const Ae=_e[0],$e=_e.rule,et=new t($e),jt=[$e.__beforeBegin,$e["on:begin"]];for(const En of jt)if(En&&(En(_e,et),et.isMatchIgnored))return io(Ae);return $e.skip?ft+=Ae:($e.excludeBegin&&(ft+=Ae),Et(),!$e.returnBegin&&!$e.excludeBegin&&(ft=Ae)),to($e,_e),$e.returnBegin?0:Ae.length}function Zi(_e){const Ae=_e[0],$e=Re.substring(_e.index),et=fl(Be,_e,$e);if(!et)return rt;const jt=Be;Be.endScope&&Be.endScope._wrap?(Et(),un(Ae,Be.endScope._wrap)):Be.endScope&&Be.endScope._multi?(Et(),lu(Be.endScope,_e)):jt.skip?ft+=Ae:(jt.returnEnd||jt.excludeEnd||(ft+=Ae),Et(),jt.excludeEnd&&(ft=Ae));do Be.scope&&Xt.closeNode(),!Be.skip&&!Be.subLanguage&&(ur+=Be.relevance),Be=Be.parent;while(Be!==et.parent);return et.starts&&to(et.starts,_e),jt.returnEnd?0:Ae.length}function ml(){const _e=[];for(let Ae=Be;Ae!==Si;Ae=Ae.parent)Ae.scope&&_e.unshift(Ae.scope);_e.forEach(Ae=>Xt.openNode(Ae))}let oa={};function no(_e,Ae){const $e=Ae&&Ae[0];if(ft+=_e,$e==null)return Et(),0;if(oa.type==="begin"&&Ae.type==="end"&&oa.index===Ae.index&&$e===""){if(ft+=Re.slice(Ae.index,Ae.index+1),!Ct){const et=new Error(`0 width match regex (${fe})`);throw et.languageName=fe,et.badRule=oa.rule,et}return 1}if(oa=Ae,Ae.type==="begin")return Uh(Ae);if(Ae.type==="illegal"&&!Ze){const et=new Error('Illegal lexeme "'+$e+'" for mode "'+(Be.scope||"<unnamed>")+'"');throw et.mode=Be,et}else if(Ae.type==="end"){const et=Zi(Ae);if(et!==rt)return et}if(Ae.type==="illegal"&&$e==="")return ft+=`
44
+ `,1;if(pl>1e5&&pl>Ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=$e,$e.length}const Si=Ui(fe);if(!Si)throw Ot(yt.replace("{}",fe)),new Error('Unknown language: "'+fe+'"');const cu=Es(Si);let so="",Be=ht||cu;const uu={},Xt=new we.__emitter(we);ml();let ft="",ur=0,Ts=0,pl=0,dr=!1;try{if(Si.__emitTokens)Si.__emitTokens(Re,Xt);else{for(Be.matcher.considerAll();;){pl++,dr?dr=!1:Be.matcher.considerAll(),Be.matcher.lastIndex=Ts;const _e=Be.matcher.exec(Re);if(!_e)break;const Ae=Re.substring(Ts,_e.index),$e=no(Ae,_e);Ts=_e.index+$e}no(Re.substring(Ts))}return Xt.finalize(),so=Xt.toHTML(),{language:fe,value:so,relevance:ur,illegal:!1,_emitter:Xt,_top:Be}}catch(_e){if(_e.message&&_e.message.includes("Illegal"))return{language:fe,value:sa(Re),illegal:!0,relevance:0,_illegalBy:{message:_e.message,index:Ts,context:Re.slice(Ts-100,Ts+100),mode:_e.mode,resultSoFar:so},_emitter:Xt};if(Ct)return{language:fe,value:sa(Re),illegal:!1,relevance:0,errorRaised:_e,_emitter:Xt,_top:Be};throw _e}}function Qa(fe){const Re={value:sa(fe),illegal:!1,relevance:0,_top:Te,_emitter:new we.__emitter(we)};return Re._emitter.addText(fe),Re}function Ja(fe,Re){Re=Re||we.languages||Object.keys(ae);const Ze=Qa(fe),ht=Re.filter(Ui).filter(lr).map(Et=>Cs(Et,fe,!1));ht.unshift(Ze);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(fe,Re,Ze){const ht=Re&&ve[Re]||Ze;fe.classList.add("hljs"),fe.classList.add(`language-${ht}`)}function Vt(fe){let Re=null;const Ze=$t(fe);if(ze(Ze))return;if(aa("before:highlightElement",{el:fe,language:Ze}),fe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",fe);return}if(fe.children.length>0&&(we.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(fe)),we.throwUnescapedHTML))throw new ul("One of your code blocks includes unescaped HTML.",fe.innerHTML);Re=fe;const ht=Re.textContent,qt=Ze?Mt(ht,{language:Ze,ignoreIllegals:!0}):Ja(ht);fe.innerHTML=qt.value,fe.dataset.highlighted="yes",ts(fe,Ze,qt.language),fe.result={language:qt.language,re:qt.relevance,relevance:qt.relevance},qt.secondBest&&(fe.secondBest={language:qt.secondBest.language,relevance:qt.secondBest.relevance}),aa("after:highlightElement",{el:fe,result:qt,text:ht})}function Di(fe){we=Za(we,fe)}const or=()=>{eo(),xi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function dl(){eo(),xi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ru=!1;function eo(){function fe(){eo()}if(document.readyState==="loading"){ru||window.addEventListener("DOMContentLoaded",fe,!1),ru=!0;return}document.querySelectorAll(we.cssSelector).forEach(Vt)}function au(fe,Re){let Ze=null;try{Ze=Re(z)}catch(ht){if(Ot("Language definition for '{}' could not be registered.".replace("{}",fe)),Ct)Ot(ht);else throw ht;Ze=Te}Ze.name||(Ze.name=fe),ae[fe]=Ze,Ze.rawDefinition=Re.bind(null,z),Ze.aliases&&ks(Ze.aliases,{languageName:fe})}function ra(fe){delete ae[fe];for(const Re of Object.keys(ve))ve[Re]===fe&&delete ve[Re]}function hl(){return Object.keys(ae)}function Ui(fe){return fe=(fe||"").toLowerCase(),ae[fe]||ae[ve[fe]]}function ks(fe,{languageName:Re}){typeof fe=="string"&&(fe=[fe]),fe.forEach(Ze=>{ve[Ze.toLowerCase()]=Re})}function lr(fe){const Re=Ui(fe);return Re&&!Re.disableAutodetect}function cr(fe){fe["before:highlightBlock"]&&!fe["before:highlightElement"]&&(fe["before:highlightElement"]=Re=>{fe["before:highlightBlock"](Object.assign({block:Re.el},Re))}),fe["after:highlightBlock"]&&!fe["after:highlightElement"]&&(fe["after:highlightElement"]=Re=>{fe["after:highlightBlock"](Object.assign({block:Re.el},Re))})}function Yt(fe){cr(fe),Ue.push(fe)}function ou(fe){const Re=Ue.indexOf(fe);Re!==-1&&Ue.splice(Re,1)}function aa(fe,Re){const Ze=fe;Ue.forEach(function(ht){ht[Ze]&&ht[Ze](Re)})}function Ns(fe){return xi("10.7.0","highlightBlock will be removed entirely in v12.0"),xi("10.7.0","Please use highlightElement now."),Vt(fe)}Object.assign(z,{highlight:Mt,highlightAuto:Ja,highlightAll:eo,highlightElement:Vt,highlightBlock:Ns,configure:Di,initHighlighting:or,initHighlightingOnLoad:dl,registerLanguage:au,unregisterLanguage:ra,listLanguages:hl,getLanguage:Ui,registerAliases:ks,autoDetection:lr,inherit:Za,addPlugin:Yt,removePlugin:ou}),z.debugMode=function(){Ct=!1},z.safeMode=function(){Ct=!0},z.versionString=yi,z.regex={concat:w,lookahead:v,either:N,optional:y,anyNumberOfTimes:x};for(const fe in pe)typeof pe[fe]=="object"&&e(pe[fe]);return Object.assign(z,pe),z},Ri=ln({});return Ri.newInstance=()=>ln({}),Dp=Ri,Ri.HighlightJS=Ri,Ri.default=Ri,Dp}var Op,Mw;function bP(){if(Mw)return Op;Mw=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,Rw;function vP(){if(Rw)return jp;Rw=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._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],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"],F=["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:[...R,...A,"set","shopt",...L,...F]},contains:[y,t.SHEBANG(),w,v,c,h,T,m,f,g,_,s]}}return jp=e,jp}var Lp,Dw;function xP(){if(Dw)return Lp;Dw=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],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:N,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,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(R,A,T,[v,{begin:t.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:g,keywords:N}}}return Lp=e,Lp}var Bp,Ow;function yP(){if(Ow)return Bp;Ow=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},F={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},j=[F,v,m,s,t.C_BLOCK_COMMENT_MODE,_,g],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:j.concat([{begin:/\(/,end:/\)/,keywords:L,contains:j.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(M,H,F,j,[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,jw;function SP(){if(jw)return zp;jw=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]},R={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},A=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,R,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,R,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+A+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:h,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,R],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,relevance:0,contains:[T,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}return zp=e,zp}var Ip,Lw;function wP(){if(Lw)return Ip;Lw=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,Bw;function EP(){if(Bw)return Pp;Bw=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,zw;function CP(){if(zw)return Up;zw=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,Iw;function kP(){if(Iw)return Hp;Iw=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}]},j=[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=j,C.contains=j;const V=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:h,contains:j}}];return g.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:h,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(V).concat(g).concat(j)}}return Hp=e,Hp}var Fp,Pw;function NP(){if(Pw)return Fp;Pw=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,Uw;function TP(){if(Uw)return $p;Uw=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,Hw;function AP(){if(Hw)return Vp;Hw=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,Fw;function MP(){if(Fw)return qp;Fw=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 Gp,$w;function RP(){if($w)return Gp;$w=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,_=(xe,{after:Oe})=>{const ye="</"+xe[0].slice(1);return xe.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:(xe,Oe)=>{const ye=xe[0].length+xe.index,pe=xe.input[ye];if(pe==="<"||pe===","){Oe.ignoreMatch();return}pe===">"&&(_(xe,{after:ye})||Oe.ignoreMatch());let Pe;const st=xe.input.substring(ye);if(Pe=st.match(/^\s*=/)){Oe.ignoreMatch();return}if((Pe=st.match(/^\s+extends\s+/))&&Pe.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})`,R="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",A={className:"number",variants:[{begin:`(\\b(${R})((${T})|\\.)?|(${T}))[eE][+-]?(${N})\\b`},{begin:`\\b(${R})\\b((${T})\\b|\\.)?|(${T})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},L={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},F={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"xml"}},j={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"css"}},M={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,L],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,L]},V={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]},ee=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,F,j,M,H,{match:/\$\d+/},A];L.contains=ee.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(ee)});const K=[].concat(V,L.contains),Z=K.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(K)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:Z},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"}}]},W={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)['"]/},$={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(xe){return g.concat("(?!",xe.join("|"),")")}const Y={match:g.concat(/\b/,D([...l,"super","import"].map(xe=>`${xe}\\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},te={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:Z,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,F,j,M,H,V,{match:/\$\d+/},A,W,{scope:"attr",match:v+g.lookahead(":"),relevance:0},me,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[V,f.REGEXP_MODE,{className:"function",begin:re,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:Z}]}]},{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"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+f.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[q,f.inherit(f.TITLE_MODE,{begin:v,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},Y,I,O,te,{match:/\$[(.]/}]}}return Gp=m,Gp}var Kp,Vw;function DP(){if(Vw)return Kp;Vw=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 Kp=e,Kp}var Wp,qw;function OP(){if(qw)return Wp;qw=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:`
45
+ `},y]}}return Wp=a,Wp}var Yp,Gw;function jP(){if(Gw)return Yp;Gw=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(K){return{className:"string",begin:"~?"+K+".*?"+K}},R=function(K,Z,q){return{className:K,begin:Z,relevance:q}},A={$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},L={begin:"\\(",end:"\\)",contains:N,keywords:A,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,R("variable","@@?"+y,10),R("variable","@\\{"+y+"\\}"),R("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},_.IMPORTANT,{beginKeywords:"and not"},_.FUNCTION_DISPATCH);const F=N.concat({begin:/\{/,end:/\}/,contains:C}),j={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(N)},M={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:A,returnEnd:!0,contains:N,relevance:0}},U={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:F}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:w,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,j,R("keyword","all\\b"),R("variable","@\\{"+y+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},_.CSS_NUMBER_MODE,R("selector-tag",w,0),R("selector-id","#"+w),R("selector-class","\\."+w,0),R("selector-tag","&",0),_.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},_.FUNCTION_DISPATCH]},ee={begin:y+`:(:)?(${v.join("|")})`,returnBegin:!0,contains:[V]};return C.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,H,U,ee,M,V,j,_.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:C}}return Yp=f,Yp}var Xp,Kw;function LP(){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,Ww;function BP(){if(Ww)return Zp;Ww=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,Yw;function zP(){if(Yw)return Qp;Yw=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 R=T==="\\1"?T:i.concat(T,N);return i.concat(i.concat("(?:",C,")"),N,/(?:\\.|[^\\\/])*?/,R,/(?:\\.|[^\\\/])*?/,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,Xw;function IP(){if(Xw)return Jp;Xw=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,Zw;function PP(){if(Zw)return eg;Zw=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":(q,O)=>{O.data._beginMatch=q[1]||q[2]},"on:end":(q,O)=>{O.data._beginMatch!==q[1]&&O.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
46
+ ]`,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"],R=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],L={keyword:T,literal:(q=>{const O=[];return q.forEach(W=>{O.push(W),W.toLowerCase()===W?O.push(W.toUpperCase()):O.push(W.toLowerCase())}),O})(N),built_in:R},F=q=>q.map(O=>O.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",F(R).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},M=i.concat(a,"\\b(?!\\()"),H={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,i.concat(/::/,i.lookahead(/(?!class\b)/)),M],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"}}]},U={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},V={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[U,h,H,t.C_BLOCK_COMMENT_MODE,w,C,j]},ee={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",F(T).join("\\b|"),"|",F(R).join("\\b|"),"\\b)"),a,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[V]};V.contains.push(ee);const K=[U,H,t.C_BLOCK_COMMENT_MODE,w,C,j],Z={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",...K]},...K,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:L,contains:[Z,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,ee,H,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},j,{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",Z,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,Qw;function UP(){if(Qw)return tg;Qw=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,Jw;function HP(){if(Jw)return ig;Jw=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return ig=e,ig}var ng,e2;function FP(){if(e2)return ng;e2=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,t2;function $P(){if(t2)return sg;t2=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,i2;function VP(){if(i2)return rg;i2=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,n2;function qP(){if(n2)return ag;n2=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,s2;function GP(){if(s2)return og;s2=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,r2;function KP(){if(r2)return lg;r2=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,a2;function WP(){if(a2)return cg;a2=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(F=>!_.includes(F)),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 R(F){return i.concat(/\b/,i.either(...F.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const A={scope:"keyword",match:R(x),relevance:0};function L(F,{exceptions:j,when:M}={}){const H=M;return j=j||[],F.map(U=>U.match(/\|\d+$/)||j.includes(U)?U:H(U)?`${U}|0`:U)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(w,{when:F=>F.length<3}),literal:c,type:m,built_in:v},contains:[{scope:"type",match:R(h)},A,T,C,a,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,s,N]}}return cg=e,cg}var ug,o2;function YP(){if(o2)return ug;o2=1;function e(M){return M?typeof M=="string"?M:M.source:null}function t(M){return i("(?=",M,")")}function i(...M){return M.map(U=>e(U)).join("")}function s(M){const H=M[M.length-1];return typeof H=="object"&&H.constructor===Object?(M.splice(M.length-1,1),H):{}}function a(...M){return"("+(s(M).capture?"":"?:")+M.map(V=>e(V)).join("|")+")"}const l=M=>i(/\b/,M,/\w$/.test(M)?/\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]/),R=i(N,T,"*"),A=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\(/,R,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],F=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function j(M){const H={match:/\s+/,relevance:0},U=M.COMMENT("/\\*","\\*/",{contains:["self"]}),V=[M.C_LINE_COMMENT_MODE,U],ee={match:[/\./,a(...c,...h)],className:{2:"keyword"}},K={match:i(/\./,a(...f)),relevance:0},Z=f.filter(rt=>typeof rt=="string").concat(["_|0"]),q=f.filter(rt=>typeof rt!="string").concat(m).map(l),O={variants:[{className:"keyword",match:a(...q,...h)}]},W={$pattern:a(/\b\w+/,/#\w+/),keyword:Z.concat(v),literal:g},X=[ee,K,O],$={match:i(/\./,a(...x)),relevance:0},I={className:"built_in",match:i(/\b/,a(...x),/(?=\()/)},D=[$,I],Y={match:/->/,relevance:0},ue={className:"operator",relevance:0,variants:[{match:C},{match:`\\.(\\.|${w})+`}]},te=[Y,ue],re="([0-9]_*)+",me="([0-9a-fA-F]_*)+",xe={className:"number",relevance:0,variants:[{match:`\\b(${re})(\\.(${re}))?([eE][+-]?(${re}))?\\b`},{match:`\\b0x(${me})(\\.(${me}))?([pP][+-]?(${re}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Oe=(rt="")=>({className:"subst",variants:[{match:i(/\\/,rt,/[0\\tnr"']/)},{match:i(/\\/,rt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ye=(rt="")=>({className:"subst",match:i(/\\/,rt,/[\t ]*(?:[\r\n]|\r\n)/)}),pe=(rt="")=>({className:"subst",label:"interpol",begin:i(/\\/,rt,/\(/),end:/\)/}),Pe=(rt="")=>({begin:i(rt,/"""/),end:i(/"""/,rt),contains:[Oe(rt),ye(rt),pe(rt)]}),st=(rt="")=>({begin:i(rt,/"/),end:i(/"/,rt),contains:[Oe(rt),pe(rt)]}),Ie={className:"string",variants:[Pe(),Pe("#"),Pe("##"),Pe("###"),st(),st("#"),st("##"),st("###")]},Ft=[M.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[M.BACKSLASH_ESCAPE]}],ta={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ft},vs=rt=>{const qn=i(rt,/\//),ln=i(/\//,rt);return{begin:qn,end:ln,contains:[...Ft,{scope:"comment",begin:`#(?!.*${ln})`,end:/$/}]}},Ka={scope:"regexp",variants:[vs("###"),vs("##"),vs("#"),ta]},ia={match:i(/`/,R,/`/)},na={className:"variable",match:/\$\d+/},rr={className:"variable",match:`\\$${T}+`},xs=[ia,na,rr],ll={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:F,contains:[...te,xe,Ie]}]}},Wa={scope:"keyword",match:i(/@/,a(...L),t(a(/\(/,/\s+/)))},Ot={scope:"meta",match:i(/@/,R)},ys=[ll,Wa,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:A,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(A)),relevance:0}]},Ss={begin:/</,end:/>/,keywords:W,contains:[...V,...X,...ys,Y,xi]};xi.contains.push(Ss);const ws={match:i(R,/\s*:/),keywords:"_|0",relevance:0},Ya={begin:/\(/,end:/\)/,relevance:0,keywords:W,contains:["self",ws,...V,Ka,...X,...D,...te,xe,Ie,...xs,...ys,xi]},ar={begin:/</,end:/>/,keywords:"repeat each",contains:[...V,xi]},cl={begin:a(t(i(R,/\s*:/)),t(i(R,/\s+/,R,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:R}]},Xa={begin:/\(/,end:/\)/,keywords:W,contains:[cl,...V,...X,...te,xe,Ie,...ys,xi,Ya],endsParent:!0,illegal:/["']/},Es={match:[/(func|macro)/,/\s+/,a(ia.match,R,C)],className:{1:"keyword",3:"title.function"},contains:[ar,Xa,H],illegal:[/\[/,/%/]},fi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ar,Xa,H],illegal:/\[|%/},wn={match:[/operator/,/\s+/,C],className:{1:"keyword",3:"title"}},yi={begin:[/precedencegroup/,/\s+/,A],className:{1:"keyword",3:"title"},contains:[xi],keywords:[..._,...g],end:/}/},ul={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},sa={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Za={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,R,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:W,contains:[ar,...X,{begin:/:/,end:/\{/,keywords:W,contains:[{scope:"title.class.inherited",match:A},...X],relevance:0}]};for(const rt of Ie.variants){const qn=rt.contains.find(Ri=>Ri.label==="interpol");qn.keywords=W;const ln=[...X,...D,...te,xe,Ie,...xs];qn.contains=[...ln,{begin:/\(/,end:/\)/,contains:["self",...ln]}]}return{name:"Swift",keywords:W,contains:[...V,Es,fi,ul,sa,Za,wn,yi,{beginKeywords:"import",end:/$/,contains:[...V],relevance:0},Ka,...X,...D,...te,xe,Ie,...xs,...ys,xi,Ya]}}return ug=j,ug}var dg,l2;function XP(){if(l2)return dg;l2=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,c2;function ZP(){if(c2)return hg;c2=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 pe="</"+Oe[0].slice(1);return Oe.input.indexOf(pe,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 pe=Oe[0].length+Oe.index,Pe=Oe.input[pe];if(Pe==="<"||Pe===","){ye.ignoreMatch();return}Pe===">"&&(v(Oe,{after:pe})||ye.ignoreMatch());let st;const Ie=Oe.input.substring(pe);if(st=Ie.match(/^\s*=/)){ye.ignoreMatch();return}if((st=Ie.match(/^\s+extends\s+/))&&st.index===0){ye.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":c},T="[0-9](_?[0-9])*",R=`\\.(${T})`,A="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",L={className:"number",variants:[{begin:`(\\b(${A})((${R})|\\.)?|(${R}))[eE][+-]?(${T})\\b`},{begin:`\\b(${A})\\b((${R})\\b|\\.)?|(${R})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},j={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,F],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},U={className:"string",begin:"`",end:"`",contains:[g.BACKSLASH_ESCAPE,F]},ee={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]},K=[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,M,H,U,{match:/\$\d+/},L];F.contains=K.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(K)});const Z=[].concat(ee,F.contains),q=Z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(Z)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:q},W={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]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(Oe){return _.concat("(?!",Oe.join("|"),")")}const ue={match:_.concat(/\b/,Y([...l,"super","import"].map(Oe=>`${Oe}\\s*\\(`)),x,_.lookahead(/\s*\(/)),className:"title.function",relevance:0},te={begin:_.concat(/\./,_.lookahead(_.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+g.UNDERSCORE_IDENT_RE+")\\s*=>",xe={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,_.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:X},illegal:/#(?![$_A-z])/,contains:[g.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,M,H,U,ee,{match:/\$\d+/},L,X,{scope:"attr",match:x+_.lookahead(":"),relevance:0},xe,{begin:"("+g.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[ee,g.REGEXP_MODE,{className:"function",begin:me,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:q}]}]},{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"]}]}]},I,{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},te,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ue,D,W,re,{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"],R={$pattern:e,keyword:t.concat(T),literal:i,built_in:h.concat(y),"variable.language":c},A={className:"meta",begin:"@"+x},L=(H,U,V)=>{const ee=H.contains.findIndex(K=>K.label===U);if(ee===-1)throw new Error("can not find mode to replace");H.contains.splice(ee,1,V)};Object.assign(v.keywords,R),v.exports.PARAMS_CONTAINS.push(A);const F=v.contains.find(H=>H.scope==="attr"),j=Object.assign({},F,{match:_.concat(x,_.lookahead(/\s*\?:/))});v.exports.PARAMS_CONTAINS.push([v.exports.CLASS_REFERENCE,F,j]),v.contains=v.contains.concat([A,w,C,j]),L(v,"shebang",g.SHEBANG()),L(v,"use_strict",N);const M=v.contains.find(H=>H.label==="func.def");return M.relevance=0,Object.assign(v,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),v}return hg=f,hg}var fg,u2;function QP(){if(u2)return fg;u2=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,d2;function JP(){if(d2)return mg;d2=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,h2;function eU(){if(h2)return pg;h2=1;var e=_P();return e.registerLanguage("xml",bP()),e.registerLanguage("bash",vP()),e.registerLanguage("c",xP()),e.registerLanguage("cpp",yP()),e.registerLanguage("csharp",SP()),e.registerLanguage("css",wP()),e.registerLanguage("markdown",EP()),e.registerLanguage("diff",CP()),e.registerLanguage("ruby",kP()),e.registerLanguage("go",NP()),e.registerLanguage("graphql",TP()),e.registerLanguage("ini",AP()),e.registerLanguage("java",MP()),e.registerLanguage("javascript",RP()),e.registerLanguage("json",DP()),e.registerLanguage("kotlin",OP()),e.registerLanguage("less",jP()),e.registerLanguage("lua",LP()),e.registerLanguage("makefile",BP()),e.registerLanguage("perl",zP()),e.registerLanguage("objectivec",IP()),e.registerLanguage("php",PP()),e.registerLanguage("php-template",UP()),e.registerLanguage("plaintext",HP()),e.registerLanguage("python",FP()),e.registerLanguage("python-repl",$P()),e.registerLanguage("r",VP()),e.registerLanguage("rust",qP()),e.registerLanguage("scss",GP()),e.registerLanguage("shell",KP()),e.registerLanguage("sql",WP()),e.registerLanguage("swift",YP()),e.registerLanguage("yaml",XP()),e.registerLanguage("typescript",ZP()),e.registerLanguage("vbnet",QP()),e.registerLanguage("wasm",JP()),e.HighlightJS=e,e.default=e,pg=e,pg}var tU=eU();const M0=CT(tU);function z_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ga=z_();function vN(e){Ga=e}var Ra={exec:()=>null};function Io(e){let t=[];return i=>{let s=Math.max(0,Math.min(3,i-1)),a=t[s];return a||(a=e(s),t[s]=a),a}}function at(e,t=""){let i=typeof e=="string"?e:e.source,s={replace:(a,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 iU=((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:Io(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Io(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Io(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Io(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Io(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Io(e=>new RegExp(`^ {0,${e}}>`))},nU=/^(?:[ \t]*(?:\n|$))+/,sU=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rU=/^ {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+|$)/,aU=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,I_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yN=at(xN).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(),oU=at(xN).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]+)*)/,lU=/^[^\n]+/,U_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cU=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",U_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),uU=at(/^(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]*?(?:-->|$))/,dU=at("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",H_).replace("tag",zh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),SN=at(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(),hU=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",SN).getRegex(),F_={blockquote:hU,code:sU,def:cU,fences:rU,heading:aU,hr:su,html:dU,lheading:yN,list:uU,newline:nU,paragraph:SN,table:Ra,text:lU},f2=at("^ *([^\\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(),fU={...F_,lheading:oU,table:f2,paragraph:at(P_).replace("hr",su).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",f2).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()},mU={...F_,html:at(`^ *(?: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:Ra,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(P_).replace("hr",su).replace("heading",` *#{1,6} *[^
47
+ ]`).replace("lheading",yN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pU=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gU=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wN=/^( {2,}|\\)\n(?!\s*$)/,_U=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,Ih=/[\s\p{P}\p{S}]/u,$_=/[^\s\p{P}\p{S}]/u,bU=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ih).getRegex(),EN=/(?!~)[\p{P}\p{S}]/u,vU=/(?!~)[\s\p{P}\p{S}]/u,xU=/(?:[^\s\p{P}\p{S}]|~)/u,yU=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",iU?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),CN=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,SU=at(CN,"u").replace(/punct/g,ol).getRegex(),wU=at(CN,"u").replace(/punct/g,EN).getRegex(),kN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",EU=at(kN,"gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,ol).getRegex(),CU=at(kN,"gu").replace(/notPunctSpace/g,xU).replace(/punctSpace/g,vU).replace(/punct/g,EN).getRegex(),kU=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,ol).getRegex(),NU=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ol).getRegex(),TU="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",AU=at(TU,"gu").replace(/notPunctSpace/g,$_).replace(/punctSpace/g,Ih).replace(/punct/g,ol).getRegex(),MU=at(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),RU=at(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),DU=at(H_).replace("(?:-->|$)","-->").getRegex(),OU=at("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",DU).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_h=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,jU=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",_h).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NN=at(/^!?\[(label)\]\[(ref)\]/).replace("label",_h).replace("ref",U_).getRegex(),TN=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",U_).getRegex(),LU=at("reflink|nolink(?!\\()","g").replace("reflink",NN).replace("nolink",TN).getRegex(),m2=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,V_={_backpedal:Ra,anyPunctuation:MU,autolink:RU,blockSkip:yU,br:wN,code:gU,del:Ra,delLDelim:Ra,delRDelim:Ra,emStrongLDelim:SU,emStrongRDelimAst:EU,emStrongRDelimUnd:kU,escape:pU,link:jU,nolink:TN,punctuation:bU,reflink:NN,reflinkSearch:LU,tag:OU,text:_U,url:Ra},BU={...V_,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",_h).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_h).getRegex()},R0={...V_,emStrongRDelimAst:CU,emStrongLDelim:wU,delLDelim:NU,delRDelim:AU,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",m2).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:at(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",m2).getRegex()},zU={...R0,br:at(wN).replace("{2,}","*").getRegex(),text:at(R0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ld={normal:F_,gfm:fU,pedantic:mU},mc={normal:V_,gfm:R0,breaks:zU,pedantic:BU},IU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p2=e=>IU[e];function us(e,t){if(t){if(zi.escapeTest.test(e))return e.replace(zi.escapeReplace,p2)}else if(zi.escapeTestNoEncode.test(e))return e.replace(zi.escapeReplaceNoEncode,p2);return e}function g2(e){try{e=encodeURI(e).replace(zi.percentDecode,"%")}catch{return null}return e}function _2(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 Pr(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 b2(e){let t=e.split(`
48
+ `),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(`
49
+ `)}function PU(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 UU(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 v2(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 HU(e,t,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
50
+ `).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(`
51
+ `)}var bh=class{options;rules;lexer;constructor(e){this.options=e||Ga}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]:b2(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=HU(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=Pr(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:Pr(t[0],`
52
+ `),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:Pr(t[0],`
53
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=Pr(t[0],`
54
+ `).split(`
55
+ `),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(`
56
+ `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
57
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
58
+ ${f}`:f,a=a?`${a}
59
+ ${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+`
60
+ `+i.join(`
61
+ `),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+`
62
+ `+i.join(`
63
+ `),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(`
64
+ `);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 _=UU(t[2].split(`
65
+ `,1)[0],t[1].length),v=e.split(`
66
+ `,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+`
67
+ `,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),R=this.rules.other.htmlBeginRegex(y),A=this.rules.other.blockquoteBeginRegex(y);for(;e;){let L=e.split(`
68
+ `,1)[0],F;if(v=L,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),F=v):F=v.replace(this.rules.other.tabCharGlobal," "),N.test(v)||T.test(v)||R.test(v)||A.test(v)||w.test(v)||C.test(v))break;if(F.search(this.rules.other.nonSpaceChar)>=y||!v.trim())g+=`
69
+ `+F.slice(y);else{if(x||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(_)||T.test(_)||C.test(_))break;g+=`
70
+ `+v}x=!v.trim(),f+=L+`
71
+ `,e=e.substring(L.length+1),_=F.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=b2(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:Pr(t[0],`
72
+ `),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=_2(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
73
+ `):[],l={type:"table",raw:Pr(t[0],`
74
+ `),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(_2(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:Pr(t[0],`
75
+ `),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)===`
76
+ `?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=Pr(i.slice(0,-1),"\\");if((i.length-l.length)%2===0)return}else{let l=PU(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)),v2(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 v2(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||Ga,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:mc.normal};this.options.pedantic?(i.block=Ld.pedantic,i.inline=mc.pedantic):this.options.gfm&&(i.block=Ld.gfm,this.options.breaks?i.inline=mc.breaks:i.inline=mc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Ld,inline:mc}}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,`
77
+ `),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+=`
78
+ `: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(`
79
+ `)?"":`
80
+ `)+l.raw,h.text+=`
81
+ `+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(`
82
+ `)?"":`
83
+ `)+l.raw,h.text+=`
84
+ `+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(`
85
+ `)?"":`
86
+ `)+l.raw,h.text+=`
87
+ `+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(`
88
+ `)?"":`
89
+ `)+l.raw,h.text+=`
90
+ `+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||Ga}space(e){return""}code({text:e,lang:t,escaped:i}){let s=(t||"").match(zi.notSpaceStart)?.[0],a=e.replace(zi.endingNewline,"")+`
91
+ `;return s?'<pre><code class="language-'+us(s)+'">'+(i?a:us(a,!0))+`</code></pre>
92
+ `:"<pre><code>"+(i?a:us(a,!0))+`</code></pre>
93
+ `}blockquote({tokens:e}){return`<blockquote>
94
+ ${this.parser.parse(e)}</blockquote>
95
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
96
+ `}hr(e){return`<hr>
97
+ `}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+`>
98
+ `+s+"</"+a+`>
99
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
100
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
101
+ `}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>
102
+ <thead>
103
+ `+t+`</thead>
104
+ `+s+`</table>
105
+ `}tablerow({text:e}){return`<tr>
106
+ ${e}</tr>
107
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
108
+ `}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=g2(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=g2(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||Ga,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}},Ec=class{options;block;constructor(e){this.options=e||Ga}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}},FU=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=Ec;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 Ec;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];Ec.passThroughHooks.has(l)?a[c]=f=>{if(this.defaults.async&&Ec.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+=`
109
+ 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}}},Fa=new FU;function gt(e,t){return Fa.parse(e,t)}gt.options=gt.setOptions=function(e){return Fa.setOptions(e),gt.defaults=Fa.defaults,vN(gt.defaults),gt};gt.getDefaults=z_;gt.defaults=Ga;gt.use=function(...e){return Fa.use(...e),gt.defaults=Fa.defaults,vN(gt.defaults),gt};gt.walkTokens=function(e,t){return Fa.walkTokens(e,t)};gt.parseInline=Fa.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=Ec;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Qn.parse;Zn.lex;function $U(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 VU({content:e}){const t=E.useMemo(()=>{const s=gt.parse(e,{async:!1,gfm:!0,breaks:!1});return $U(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 AN(e){return typeof e>"u"||e===null}function qU(e){return typeof e=="object"&&e!==null}function GU(e){return Array.isArray(e)?e:AN(e)?[]:[e]}function KU(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 WU(e,t){var i="",s;for(s=0;s<t;s+=1)i+=e;return i}function YU(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var XU=AN,ZU=qU,QU=GU,JU=WU,eH=YU,tH=KU,di={isNothing:XU,isObject:ZU,toArray:QU,repeat:JU,isNegativeZero:eH,extend:tH};function MN(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+=`
110
+
111
+ `+e.mark.snippet),s+" "+i):s}function Fc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=MN(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+": "+MN(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 iH(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+`
112
+ `+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+`
113
+ `,h+=di.repeat("-",t.indent+g+3+f.pos)+`^
114
+ `,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+`
115
+ `;return h.replace(/\n$/,"")}var nH=iH,sH=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],rH=["scalar","sequence","mapping"];function aH(e){var t={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(s){t[String(s)]=i})}),t}function oH(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(sH.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=aH(t.styleAliases||null),rH.indexOf(this.kind)===-1)throw new $i('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Mi=oH;function x2(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 lH(){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=x2(a,"implicit"),a.compiledExplicit=x2(a,"explicit"),a.compiledTypeMap=lH(a.compiledImplicit,a.compiledExplicit),a};var RN=j0,DN=new Mi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ON=new Mi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),jN=new Mi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),LN=new RN({explicit:[DN,ON,jN]});function cH(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function uH(){return null}function dH(e){return e===null}var BN=new Mi("tag:yaml.org,2002:null",{kind:"scalar",resolve:cH,construct:uH,predicate:dH,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function hH(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 fH(e){return e==="true"||e==="True"||e==="TRUE"}function mH(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var zN=new Mi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:hH,construct:fH,predicate:mH,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 pH(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function gH(e){return 48<=e&&e<=55}function _H(e){return 48<=e&&e<=57}function bH(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(!pH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!gH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!_H(e.charCodeAt(i)))return!1;s=!0}return!(!s||a==="_")}function vH(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 xH(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!di.isNegativeZero(e)}var IN=new Mi("tag:yaml.org,2002:int",{kind:"scalar",resolve:bH,construct:vH,predicate:xH,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"]}}),yH=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function SH(e){return!(e===null||!yH.test(e)||e[e.length-1]==="_")}function wH(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 EH=/^[-+]?[0-9]+e/;function CH(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),EH.test(i)?i.replace("e",".e"):i}function kH(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||di.isNegativeZero(e))}var PN=new Mi("tag:yaml.org,2002:float",{kind:"scalar",resolve:SH,construct:wH,predicate:kH,represent:CH,defaultStyle:"lowercase"}),UN=LN.extend({implicit:[BN,zN,IN,PN]}),HN=UN,FN=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),$N=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 NH(e){return e===null?!1:FN.exec(e)!==null||$N.exec(e)!==null}function TH(e){var t,i,s,a,l,c,h,m=0,f=null,g,_,v;if(t=FN.exec(e),t===null&&(t=$N.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 AH(e){return e.toISOString()}var VN=new Mi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:NH,construct:TH,instanceOf:Date,represent:AH});function MH(e){return e==="<<"||e===null}var qN=new Mi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:MH}),G_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
116
+ \r`;function RH(e){if(e===null)return!1;var t,i,s=0,a=e.length,l=G_;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 DH(e){var t,i,s=e.replace(/[\r\n=]/g,""),a=s.length,l=G_,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 OH(e){var t="",i=0,s,a,l=e.length,c=G_;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 jH(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var GN=new Mi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:RH,construct:DH,predicate:jH,represent:OH}),LH=Object.prototype.hasOwnProperty,BH=Object.prototype.toString;function zH(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,BH.call(a)!=="[object Object]")return!1;for(l in a)if(LH.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 IH(e){return e!==null?e:[]}var KN=new Mi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:zH,construct:IH}),PH=Object.prototype.toString;function UH(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],PH.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;l[t]=[a[0],s[a[0]]]}return!0}function HH(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 WN=new Mi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:UH,construct:HH}),FH=Object.prototype.hasOwnProperty;function $H(e){if(e===null)return!0;var t,i=e;for(t in i)if(FH.call(i,t)&&i[t]!==null)return!1;return!0}function VH(e){return e!==null?e:{}}var YN=new Mi("tag:yaml.org,2002:set",{kind:"mapping",resolve:$H,construct:VH}),K_=HN.extend({implicit:[VN,qN],explicit:[GN,KN,WN,YN]}),Xr=Object.prototype.hasOwnProperty,xh=1,XN=2,ZN=3,yh=4,bg=1,qH=2,y2=3,GH=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KH=/[\x85\u2028\u2029]/,WH=/[,\[\]\{\}]/,QN=/^(?:!|!!|![a-z\-]+!)$/i,JN=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function S2(e){return Object.prototype.toString.call(e)}function gs(e){return e===10||e===13}function Pa(e){return e===9||e===32}function on(e){return e===9||e===32||e===10||e===13}function Wo(e){return e===44||e===91||e===93||e===123||e===125}function YH(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function XH(e){return e===120?2:e===117?4:e===85?8:0}function ZH(e){return 48<=e&&e<=57?e-48:-1}function w2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
117
+ `: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 QH(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function e3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var t3=new Array(256),i3=new Array(256);for(var Po=0;Po<256;Po++)t3[Po]=w2(Po)?1:0,i3[Po]=w2(Po);function JH(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||K_,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 n3(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=nH(i),new $i(t,i)}function De(e,t){throw n3(e,t)}function Sh(e,t){e.onWarning&&e.onWarning.call(null,n3(e,t))}var E2={YAML:function(t,i,s){var a,l,c;t.version!==null&&De(t,"duplication of %YAML directive"),s.length!==1&&De(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&De(t,"ill-formed argument of the YAML directive"),l=parseInt(a[1],10),c=parseInt(a[2],10),l!==1&&De(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&&De(t,"TAG directive accepts exactly two arguments"),a=s[0],l=s[1],QN.test(a)||De(t,"ill-formed tag handle (first argument) of the TAG directive"),Xr.call(t.tagMap,a)&&De(t,'there is a previously declared suffix for "'+a+'" tag handle'),JN.test(l)||De(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{De(t,"tag prefix is malformed: "+l)}t.tagMap[a]=l}};function Gr(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||De(e,"expected valid JSON character");else GH.test(h)&&De(e,"the stream contains non-printable characters");e.result+=h}}function C2(e,t,i,s){var a,l,c,h;for(di.isObject(i)||De(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],Xr.call(t,l)||(e3(t,l,i[l]),s[l]=!0)}function Yo(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])&&De(e,"nested arrays are not supported inside keys"),typeof a=="object"&&S2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&S2(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)C2(e,t,l[f],i);else C2(e,t,l,i);else!e.json&&!Xr.call(i,a)&&Xr.call(t,a)&&(e.line=c||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,De(e,"duplicated mapping key")),e3(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++):De(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(;Pa(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(`
118
+ `,t-1))}function eF(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)||Wo(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&&Wo(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&&Wo(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&&Wo(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&&(Gr(e,l,c,!1),Y_(e,e.line-m),l=c=e.position,h=!1),Pa(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return Gr(e,l,c,!1),e.result?!0:(e.kind=_,e.result=v,!1)}function tF(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(Gr(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)?(Gr(e,s,a,!0),Y_(e,ri(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Ph(e)?De(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);De(e,"unexpected end of the stream within a single quoted scalar")}function iF(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 Gr(e,i,e.position,!0),e.position++,!0;if(h===92){if(Gr(e,i,e.position,!0),h=e.input.charCodeAt(++e.position),gs(h))ri(e,!1,t);else if(h<256&&t3[h])e.result+=i3[h],e.position++;else if((c=XH(h))>0){for(a=c,l=0;a>0;a--)h=e.input.charCodeAt(++e.position),(c=YH(h))>=0?l=(l<<4)+c:De(e,"expected hexadecimal character");e.result+=QH(l),e.position++}else De(e,"unknown escape sequence");i=s=e.position}else gs(h)?(Gr(e,i,s,!0),Y_(e,ri(e,!1,t)),i=s=e.position):e.position===e.lineStart&&Ph(e)?De(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}De(e,"unexpected end of the stream within a double quoted scalar")}function nF(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&&De(e,"expected the node content, but found ','"):De(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,Jo(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),Jo(e,t,xh,!1,!0),N=e.result),x?Yo(e,h,y,C,w,N,s,a,l):_?h.push(Yo(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}De(e,"unexpected end of the stream within a flow collection")}function sF(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?y2:qH:De(e,"repeat of a chomping mode identifier");else if((g=ZH(_))>=0)g===0?De(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?De(e,"repeat of an indentation width identifier"):(h=t+g-1,c=!0);else break;if(Pa(_)){do _=e.input.charCodeAt(++e.position);while(Pa(_));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===y2?e.result+=di.repeat(`
119
+ `,l?1+m:m):a===bg&&l&&(e.result+=`
120
+ `);break}for(s?Pa(_)?(f=!0,e.result+=di.repeat(`
121
+ `,l?1+m:m)):f?(f=!1,e.result+=di.repeat(`
122
+ `,m+1)):m===0?l&&(e.result+=" "):e.result+=di.repeat(`
123
+ `,m):e.result+=di.repeat(`
124
+ `,l?1+m:m),l=!0,c=!0,m=0,i=e.position;!gs(_)&&_!==0;)_=e.input.charCodeAt(++e.position);Gr(e,i,e.position,!1)}return!0}function k2(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,De(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,Jo(e,t,ZN,!1,!0),l.push(e.result),ri(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)De(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return h?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=l,!0):!1}function rF(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,De(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&&(Yo(e,_,v,x,y,null,c,h,m),x=y=w=null),N=!0,C=!0,a=!0):C?(C=!1,a=!0):De(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=s;else{if(c=e.line,h=e.lineStart,m=e.position,!Jo(e,i,XN,!1,!0))break;if(e.line===l){for(T=e.input.charCodeAt(e.position);Pa(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),on(T)||De(e,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(Yo(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)De(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=g,!0}else if(N)De(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=g,!0}if((e.line===l||e.lineIndent>t)&&(C&&(c=e.line,h=e.lineStart,m=e.position),Jo(e,t,yh,!0,a)&&(C?y=e.result:w=e.result),C||(Yo(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)De(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return C&&Yo(e,_,v,x,y,null,c,h,m),N&&(e.tag=f,e.anchor=g,e.kind="mapping",e.result=_),N}function aF(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&&De(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)):De(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!on(c);)c===33&&(s?De(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),QN.test(a)||De(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),WH.test(l)&&De(e,"tag suffix cannot contain flow indicator characters")}l&&!JN.test(l)&&De(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{De(e,"tag name is malformed: "+l)}return i?e.tag=l:Xr.call(e.tagMap,a)?e.tag=e.tagMap[a]+l:a==="!"?e.tag="!"+l:a==="!!"?e.tag="tag:yaml.org,2002:"+l:De(e,'undeclared tag handle "'+a+'"'),!0}function oF(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&De(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!on(i)&&!Wo(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function lF(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)&&!Wo(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Xr.call(e.anchorMap,i)||De(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],ri(e,!0,-1),!0}function Jo(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||ZN===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(;aF(e)||oF(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||XN===i?w=t:w=t+1,C=e.position-e.lineStart,m===1?h&&(k2(e,C)||rF(e,C,w))||nF(e,w)?g=!0:(c&&sF(e,w)||tF(e,w)||iF(e,w)?g=!0:lF(e)?(g=!0,(e.tag!==null||e.anchor!==null)&&De(e,"alias node should not have any properties")):eF(e,w,xh===i)&&(g=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(g=h&&k2(e,C))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&De(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),_=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(Xr.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||De(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&De(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):De(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||g}function cF(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&&De(e,"directive name must not be less than one character in length");c!==0;){for(;Pa(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),Xr.call(E2,s)?E2[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&&De(e,"directives end mark is expected"),Jo(e,e.lineIndent-1,yh,!1,!0),ri(e,!0,-1),e.checkLineBreaks&&KH.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)De(e,"end of the stream or a document separator is expected");else return}function s3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
125
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new JH(e,t),s=e.indexOf("\0");for(s!==-1&&(i.position=s,De(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)cF(i);return i.documents}function uF(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var s=s3(e,i);if(typeof t!="function")return s;for(var a=0,l=s.length;a<l;a+=1)t(s[a])}function dF(e,t){var i=s3(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 hF=uF,fF=dF,r3={loadAll:hF,load:fF},a3=Object.prototype.toString,o3=Object.prototype.hasOwnProperty,X_=65279,mF=9,$c=10,pF=13,gF=32,_F=33,bF=34,L0=35,vF=37,xF=38,yF=39,SF=42,l3=44,wF=45,wh=58,EF=61,CF=62,kF=63,NF=64,c3=91,u3=93,TF=96,d3=123,AF=124,h3=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 MF=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],RF=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function DF(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&&o3.call(m.styleAliases,h)&&(h=m.styleAliases[h]),i[c]=h;return i}function OF(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 jF=1,Vc=2;function LF(e){this.schema=e.schema||K_,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=DF(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:jF,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 N2(e,t){for(var i=di.repeat(" ",t),s=0,a=-1,l="",c,h=e.length;s<h;)a=e.indexOf(`
126
+ `,s),a===-1?(c=e.slice(s),s=h):(c=e.slice(s,a+1),s=a+1),c.length&&c!==`
127
+ `&&(l+=i),l+=c;return l}function B0(e,t){return`
128
+ `+di.repeat(" ",e.indent*t)}function BF(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===gF||e===mF}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 T2(e){return qc(e)&&e!==X_&&e!==pF&&e!==$c}function A2(e,t,i){var s=T2(e),a=s&&!Eh(e);return(i?s:s&&e!==l3&&e!==c3&&e!==u3&&e!==d3&&e!==h3)&&e!==L0&&!(t===wh&&!a)||T2(t)&&!Eh(t)&&e===L0||t===wh&&a}function zF(e){return qc(e)&&e!==X_&&!Eh(e)&&e!==wF&&e!==kF&&e!==wh&&e!==l3&&e!==c3&&e!==u3&&e!==d3&&e!==h3&&e!==L0&&e!==xF&&e!==SF&&e!==_F&&e!==AF&&e!==EF&&e!==CF&&e!==yF&&e!==bF&&e!==vF&&e!==NF&&e!==TF}function IF(e){return!Eh(e)&&e!==wh}function Cc(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 f3(e){var t=/^\n* /;return t.test(e)}var m3=1,z0=2,p3=3,g3=4,Fo=5;function PF(e,t,i,s,a,l,c,h){var m,f=0,g=null,_=!1,v=!1,x=s!==-1,y=-1,w=zF(Cc(e,0))&&IF(Cc(e,e.length-1));if(t||c)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Cc(e,m),!qc(f))return Fo;w=w&&A2(f,g,h),g=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Cc(e,m),f===$c)_=!0,x&&(v=v||m-y-1>s&&e[y+1]!==" ",y=m);else if(!qc(f))return Fo;w=w&&A2(f,g,h),g=f}v=v||x&&m-y-1>s&&e[y+1]!==" "}return!_&&!v?w&&!c&&!a(e)?m3:l===Vc?Fo:z0:i>9&&f3(e)?Fo:c?l===Vc?Fo:z0:v?g3:p3}function UF(e,t,i,s,a){e.dump=(function(){if(t.length===0)return e.quotingType===Vc?'""':"''";if(!e.noCompatMode&&(MF.indexOf(t)!==-1||RF.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 BF(e,f)}switch(PF(t,h,e.indent,c,m,e.quotingType,e.forceQuotes&&!s,a)){case m3:return t;case z0:return"'"+t.replace(/'/g,"''")+"'";case p3:return"|"+M2(t,e.indent)+R2(N2(t,l));case g3:return">"+M2(t,e.indent)+R2(N2(HF(t,c),l));case Fo:return'"'+FF(t)+'"';default:throw new $i("impossible error: invalid scalar style")}})()}function M2(e,t){var i=f3(e)?String(t):"",s=e[e.length-1]===`
129
+ `,a=s&&(e[e.length-2]===`
130
+ `||e===`
131
+ `),l=a?"+":s?"":"-";return i+l+`
132
+ `}function R2(e){return e[e.length-1]===`
133
+ `?e.slice(0,-1):e}function HF(e,t){for(var i=/(\n+)([^\n]*)/g,s=(function(){var f=e.indexOf(`
134
+ `);return f=f!==-1?f:e.length,i.lastIndex=f,D2(e.slice(0,f),t)})(),a=e[0]===`
135
+ `||e[0]===" ",l,c;c=i.exec(e);){var h=c[1],m=c[2];l=m[0]===" ",s+=h+(!a&&!l&&m!==""?`
136
+ `:"")+D2(m,t),a=l}return s}function D2(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+=`
137
+ `+e.slice(a,l),a=l+1),c=h;return m+=`
138
+ `,e.length-a>t&&c>a?m+=e.slice(a,c)+`
139
+ `+e.slice(c+1):m+=e.slice(a),m.slice(1)}function FF(e){for(var t="",i=0,s,a=0;a<e.length;i>=65536?a+=2:a++)i=Cc(e,a),s=Pi[i],!s&&qc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=s||OF(i);return t}function $F(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)),(Qs(e,t,h,!1,!1)||typeof h>"u"&&Qs(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function O2(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)),(Qs(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&Qs(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 VF(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)),Qs(e,t,m,!1,!1)&&(e.dump.length>1024&&(g+="? "),g+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Qs(e,t,f,!1,!1)&&(g+=e.dump,s+=g));e.tag=a,e.dump="{"+s+"}"}function qF(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)),Qs(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)),Qs(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 j2(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,a3.call(h.represent)==="[object Function]")s=h.represent(t,m);else if(o3.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 Qs(e,t,i,s,a,l,c){e.tag=null,e.dump=i,j2(e,i,!1)||j2(e,i,!0);var h=a3.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?(qF(e,t,e.dump,a),v&&(e.dump="&ref_"+_+e.dump)):(VF(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?O2(e,t-1,e.dump,a):O2(e,t,e.dump,a),v&&(e.dump="&ref_"+_+e.dump)):($F(e,t,e.dump),v&&(e.dump="&ref_"+_+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&UF(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 GF(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 KF(e,t){t=t||{};var i=new LF(t);i.noRefs||GF(e,i);var s=e;return i.replacer&&(s=i.replacer.call({"":s},"",s)),Qs(i,0,s,!0,!0)?i.dump+`
140
+ `:""}var WF=KF,YF={dump:WF};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 XF=Mi,ZF=RN,QF=LN,JF=UN,e$=HN,t$=K_,i$=r3.load,n$=r3.loadAll,s$=YF.dump,r$=$i,a$={binary:GN,float:PN,map:jN,null:BN,pairs:WN,set:YN,timestamp:VN,bool:zN,int:IN,merge:qN,omap:KN,seq:ON,str:DN},o$=Z_("safeLoad","load"),l$=Z_("safeLoadAll","loadAll"),c$=Z_("safeDump","dump"),u$={Type:XF,Schema:ZF,FAILSAFE_SCHEMA:QF,JSON_SCHEMA:JF,CORE_SCHEMA:e$,DEFAULT_SCHEMA:t$,load:i$,loadAll:n$,dump:s$,YAMLException:r$,types:a$,safeLoad:o$,safeLoadAll:l$,safeDump:c$};function _3(e){return e!==null&&typeof e=="object"}function b3(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 v3(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function x3({label:e,value:t,depth:i,defaultOpen:s}){const[a,l]=E.useState(s),c={paddingLeft:`${i*1.1}rem`};if(!_3(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:he("whitespace-pre-wrap break-words",b3(t)),children:v3(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(Zr,{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(x3,{label:f,value:g,depth:i+1,defaultOpen:i<1},f)):null]})}function d$({content:e}){const t=E.useMemo(()=>{try{const s=u$.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(!_3(t.value))return u.jsx("div",{className:"p-4 font-mono text-[12px]",children:u.jsx("span",{className:b3(t.value),children:v3(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(x3,{label:s,value:a,depth:0,defaultOpen:!0},s))})}const h$=E.lazy(()=>gP(()=>import("./code-editor-DE2X-4w8.js"),[]).then(e=>({default:e.CodeEditor})));function f$(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function m$(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 p$(e,t){const i=e.endsWith(`
141
+ `)?e.slice(0,-1):e;return!t||!M0.getLanguage(t)?i.split(`
142
+ `).map(L2):i.split(`
143
+ `).map(s=>{if(!s)return"";try{return M0.highlight(s,{language:t,ignoreIllegals:!0}).value}catch{return L2(s)}})}function L2(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function g$({content:e,path:t}){const i=E.useMemo(()=>m$(t),[t]),s=E.useMemo(()=>p$(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 _$({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(()=>f$(e),[e]),[R,A]=E.useState("preview"),L=!!(a&&!a.binary&&!a.truncated),F=a?c!==a.content:!1;E.useEffect(()=>{A(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(U=>{H&&(l(U),h(U.content),x(!1))}).catch(U=>{H&&(_(U instanceof Error?U.message:String(U)),x(!1))}),()=>{H=!1}},[e]);async function j(){if(!(!e||!a||!F||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 M(){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:()=>A("preview"),"aria-pressed":R==="preview",className:he("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",R==="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:()=>A("source"),"aria-pressed":R==="source",className:he("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",R==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[u.jsx(W2,{className:"size-3.5"}),"Source"]})]}):null,t?u.jsx(de,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,m?u.jsxs(u.Fragment,{children:[u.jsxs(de,{disabled:!F||y,onClick:()=>{j()},size:"sm",type:"button",children:[u.jsx(q0,{}),"Apply"]}),u.jsxs(de,{disabled:y,onClick:M,size:"sm",type:"button",variant:"outline",children:[u.jsx(Sn,{}),"Cancel"]})]}):L?u.jsxs(de,{onClick:()=>{A("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(h$,{path:e,value:c,onChange:h})}):T&&R==="preview"?T==="markdown"?u.jsx(VU,{content:a.content}):u.jsx(d$,{content:a.content}):u.jsx(g$,{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 b$({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 B2(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 z2({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(Zr,{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(y3,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function y3({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(Zs,{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(Zr,{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(y3,{node:g,depth:t+1,onSelect:i,forceOpen:s},g.fullPath))}):null]})}function v$({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(_N,{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 x$({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:y$(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 y$(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 I2=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function pc(e){return I2[e%I2.length]}function S$({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=gc(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:gc(v,c),y1:0,x2:gc(v,c),y2:l,stroke:pc(v),strokeWidth:1.5},`t-${v}`)),u.jsx("line",{x1:g,y1:0,x2:g,y2:f,stroke:pc(e),strokeWidth:1.5}),i.map((v,x)=>{const y=gc(v.fromLane,c),w=gc(v.toLane,c);if(y===w)return u.jsx("line",{x1:y,y1:f,x2:w,y2:l,stroke:pc(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:pc(v.toLane),strokeWidth:1.5},`e-${x}`)}),u.jsx("circle",{cx:g,cy:f,r:_,fill:pc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function gc(e,t){return e*t+t/2}const P2=28;function w$({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(de,{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:P2},title:`${m.hash}
144
+ ${m.author} <${m.email}>
145
+ ${m.subject}`,children:[u.jsx(S$,{lane:m.lane,laneCount:Math.max(m.laneCount,a),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:P2}),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:C$(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:E$(m.timestamp)})]})},m.hash))})})]})}function E$(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 C$(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 U2=200;function k$(){const[e,t]=E.useState([]),[i,s]=E.useState(U2),[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,R]=E.useState(!1),[A,L]=E.useState(null);E.useEffect(()=>{let M=!0;return l(!0),h(null),SM(i).then(H=>{M&&(t(H),H.length>0&&!H.some(U=>U.hash===m)&&f(H[0].hash))}).catch(H=>{M&&h(H instanceof Error?H.message:String(H))}).finally(()=>{M&&l(!1)}),()=>{M=!1}},[i]),E.useEffect(()=>{if(!m){_([]),w(null);return}let M=!0;return x(null),EM(m).then(H=>{M&&(_(H),w(H[0]?.path??null))}).catch(H=>{M&&x(H instanceof Error?H.message:String(H))}),()=>{M=!1}},[m]),E.useEffect(()=>{if(!m){N("");return}let M=!0;return L(null),R(!0),wM(m,y??void 0).then(H=>{M&&N(H)}).catch(H=>{M&&L(H instanceof Error?H.message:String(H))}).finally(()=>{M&&R(!1)}),()=>{M=!1}},[m,y]);const F=E.useMemo(()=>e.reduce((M,H)=>Math.max(M,H.laneCount),1),[e]),j=e.find(M=>M.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:A,maxLanes:F,selectedCommit:j,loadMore:()=>s(M=>M+U2)}}function N$({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}=k$(),[C,N]=E.useState(""),T=E.useMemo(()=>{const M=C.trim().toLowerCase();return M?e.filter(H=>H.name.toLowerCase().includes(M)):e},[e,C]),R=E.useMemo(()=>B2(T.filter(M=>!M.remote)),[T]),A=E.useMemo(()=>B2(T.filter(M=>M.remote)),[T]),L=C.trim().length>0,F=E.useRef(new Map);function j(M){const H=M.remote?"remote":"branch",U=t.find(K=>K.refs.some(Z=>Z.kind===H&&Z.name===M.name));if(!U)return;l(U.hash);const V=F.current.get(U.hash),ee=V?.parentElement?.parentElement;!V||!ee||ee.scrollTo({top:Math.max(V.offsetTop-ee.clientHeight/2+V.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:M=>N(M.target.value),placeholder:"Search branches…",className:"w-full rounded border border-border bg-background px-2 py-1 text-[11px] outline-none focus:border-foreground"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[u.jsx(z2,{label:"Local",tree:R,onSelect:j,defaultOpen:!0,forceOpen:L}),u.jsx(z2,{label:"Remote",tree:A,onSelect:j,forceOpen:L})]})]}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[u.jsx(v$,{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(w$,{commits:t,loading:i,error:s,selectedHash:a,maxLanes:x,rowRefs:F,onSelect:l,onLoadMore:w}),u.jsx(x$,{files:c,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const P0=300,T$=600,A$=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 M$(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:!A$.has(t.slice(i+1))}function R$(e){return e>=T$?"danger":e>=P0?"warn":"ok"}const D$={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},O$={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function j$({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=>M$(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(Z2,{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(de,{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(W2,{}),"Code only"]}),u.jsxs(de,{size:"sm",variant:"outline",className:"h-7",onClick:f,disabled:s,type:"button",children:[s?u.jsx(Ki,{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(Ki,{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=R$(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:he("shrink-0 font-mono text-[11px] tabular-nums",O$[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:he("h-full rounded-full",D$[C]),style:{width:`${Math.max(2,y.lines/v*100)}%`}})})]})]})},y.path)})})]})}function L$({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),[R,A]=E.useState(null),[L,F]=E.useState(()=>new Set),j=e.git.status?.files??[],M=E.useMemo(()=>{const te=new Set(j.map(me=>me.path)),re=[...L].filter(me=>!te.has(me)).sort().map(me=>({path:me,index:" ",workingTree:"M"}));return[...j,...re]},[j,L]),H=E.useMemo(()=>M.map(te=>te.path),[M]),U=E.useMemo(()=>iP(x),[x]);E.useEffect(()=>{const te=M[0]?.path??"";c(re=>re&&M.some(me=>me.path===re)?re:te)},[M]),E.useEffect(()=>{if(t!=="all"||f.length>0)return;let te=!0;return v(null),CM().then(re=>{te&&g(re)}).catch(re=>{te&&v(re instanceof Error?re.message:String(re))}),()=>{te=!1}},[t,f.length]),E.useEffect(()=>{if(!l){y("");return}let te=!0;return C(null),AM(l).then(re=>{te&&(y(re),T(0),A(null))}).catch(re=>{te&&C(re instanceof Error?re.message:String(re))}),()=>{te=!1}},[l]);function V(te){T(0),A(null),c(te)}function ee(){const te=b$({activeHunkIndex:N,filePaths:H,hunkCount:U.hunks,pendingNextFilePath:R,selectedFile:l});te.kind==="hunk"?(A(null),T(te.activeHunkIndex)):te.kind==="confirm-next-file"?A(te.filePath):te.kind==="file"?V(te.filePath):A(null)}function K(){if(A(null),N>0){T(me=>me-1);return}const te=M.findIndex(me=>me.path===l),re=M[te-1];re&&V(re.path)}const Z=M.findIndex(te=>te.path===l),q=!!(U.hunks&&N<U.hunks-1||M[Z+1]),O=!!(N>0||M[Z-1]),W=R?`End of file. Click Next again to open ${R}.`:null,X=te=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${te?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,$=te=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${te?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,I=E.useMemo(()=>{const te=new Set(M.map(re=>re.path));for(const re of L)te.add(re);return te},[M,L]);if(!e.git.selectedRepository)return u.jsx(B$,{});function D(){h&&(i("changes"),a("changes"),V(h))}function Y(te){F(re=>new Set(re).add(te)),m(te),i("changes"),a("changes"),V(te)}function ue(te){m(te),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(N$,{branches:e.git.branches??[]}):t==="largest"?u.jsx(j$,{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(Nw,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:f,root:e.git.cwd,selectedFile:h,status:M})}),u.jsx(_$,{isModified:I.has(h),onFileSaved:Y,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:$(s==="changes"),onClick:()=>a("changes"),type:"button",children:"Changes"}),u.jsx("button",{"aria-label":"Show changed files as a tree",className:$(s==="tree"),onClick:()=>a("tree"),type:"button",children:"Tree"})]}),s==="changes"?u.jsx(aP,{branch:e.git.status?.branch||void 0,error:e.git.error,files:M,selectedFile:l,onSelectFile:V,root:e.git.cwd}):u.jsx(Nw,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:V,paths:H,root:e.git.cwd,selectedFile:l,status:M,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."}),U.additions||U.deletions?u.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",U.additions]}),u.jsxs("span",{className:"text-red-700",children:["-",U.deletions]})]}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[W?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:W}):null,u.jsxs(de,{disabled:!l||!O,onClick:K,size:"sm",type:"button",variant:"outline",children:[u.jsx(VT,{}),"Previous"]}),u.jsxs(de,{disabled:!l||!q,onClick:ee,size:"sm",type:"button",variant:"outline",children:[u.jsx(FT,{}),"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(_N,{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 B$(){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 z$({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),_=I$(l);return E.useEffect(()=>{a(e)},[e]),E.useEffect(()=>{let v=!0;return g(!0),m(null),lE(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(de,{"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(Ki,{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(de,{className:he("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($a,{className:"text-accent"}),u.jsx("span",{className:"truncate",children:v.name})]},v.path))]})]})}function I$(e){return!!(e&&e.parent!==e.path)}function H2(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function P$({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?H2(e.git.cwd):"Add Git project"),{error:w,success:C}=Ii(),N=H$({gitCwd:e.git.cwd});E.useEffect(()=>{l(e.git.cwd),_(e.git.cwd)},[e.git.cwd]),E.useEffect(()=>{if(!i)return;function j(M){v.current&&M.target instanceof Node&&!v.current.contains(M.target)&&s(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[i]);async function T(j){try{await Gi("/api/git/select",{name:j}),s(!1),await t(),C(`Switched to ${j}.`)}catch(M){w(M instanceof Error?M.message:String(M))}}async function R(j){const M=j.trim();if(!U$(M)){const H="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h(H),w(H),!1}try{const H=H2(M);return await Gi("/api/git/repositories",{name:H,path:M}),h(null),await t(),C(`Added Git project ${H}.`),!0}catch(H){const U=H instanceof Error?H.message:String(H);return h(U),w(U),!1}}async function A(j){try{await MM(j),await t(),C(`Removed Git project ${j}.`)}catch(M){w(M instanceof Error?M.message:String(M))}}async function L(j){j.preventDefault(),await R(a)&&s(!1)}function F(){h(null),_(N.selectedPath),f(!0)}return u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:v,children:[u.jsxs(de,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>s(j=>!j),size:"sm",type:"button",variant:"outline",children:[u.jsx($a,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:y}),u.jsx(es,{className:he("ml-auto transition-transform",i&&"rotate-180")})]}),u.jsx(de,{"aria-label":"Add Git project",onClick:F,size:"sm",type:"button",variant:"outline",children:u.jsx(Pn,{})}),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(We,{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(j=>{const M=j.name===x?.name;return u.jsxs("div",{className:he("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",M&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(j.name)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:j.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:j.path})]}),M?u.jsx(el,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(de,{"aria-label":`Remove ${j.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{A(j.name)},size:"icon",title:`Remove ${j.name}`,type:"button",variant:"ghost",children:u.jsx(Gc,{className:"size-3.5 text-destructive"})})]},j.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(ct,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:j=>{l(j.target.value),h(null)},placeholder:"/absolute/path",value:a}),u.jsxs(de,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[u.jsx(Pn,{className:"size-3"}),"Add"]}),u.jsx(de,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:F,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(F$,{confirmLabel:N.confirmLabel,errorMessage:c,initialPath:N.initialPath,selectedPath:g,title:"Add Git Project",onCancel:()=>f(!1),onSelect:_,onUse:async()=>{await R(g)&&(f(!1),s(!1))}}):null]})}function U$(e){return e.startsWith("/")}function H$({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function F$({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($a,{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(de,{"aria-label":"Close folder picker",onClick:s,size:"icon",variant:"ghost",children:u.jsx(Sn,{})})]}),u.jsx(z$,{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(de,{onClick:s,type:"button",variant:"outline",children:"Cancel"}),u.jsx(de,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function $$({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(A=>!A.remote),w=e.filter(A=>A.remote);async function C(A,L){f(A),x(null),_(null);try{await L(),await s()}catch(F){x(F instanceof Error?F.message:String(F))}finally{f(null)}}async function N(A){await C(`switch:${A}`,async()=>{await Gi("/api/git/branches/switch",{name:A}),l(!1)})}async function T(){await C("fetch",async()=>{await Gi("/api/git/fetch",{}),_("Fetched latest branch refs.")})}async function R(A){A.preventDefault();const L=c.trim();if(!L){x("Branch name is required.");return}await C("create",async()=>{await Gi("/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(Zs,{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(de,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:u.jsx(kh,{className:he(m==="fetch"&&"animate-spin")})}),u.jsx(de,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:u.jsx(Sn,{})})]})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsxs(u.Fragment,{children:[u.jsx(F2,{branches:y,busy:m!==null,disabled:i,label:"Local",onSwitch:N}),u.jsx(F2,{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:R,children:[u.jsx(ct,{"aria-label":"New branch name",disabled:i||m!==null,onChange:A=>{h(A.target.value),x(null),_(null)},placeholder:"feature/new-work",value:c}),u.jsxs(de,{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(de,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>l(A=>!A),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[u.jsx(Zs,{className:"size-4"}),u.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),u.jsx(es,{className:he("size-4 transition-transform",a&&"rotate-180")})]})]})}function F2({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:he("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(We,{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 S3="nomoreide-theme-choice";function V$(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(S3);return e==="light"||e==="dark"?e:"dark"}function q$(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function G$(){const[e,t]=E.useState(()=>V$()),i=E.useRef(null);E.useEffect(()=>{q$(e),window.localStorage.setItem(S3,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:he(kE({variant:"outline",size:"sm"}),"px-2"),children:e==="dark"?u.jsx(V4,{}):u.jsx(s4,{})})}function K$(e=!1){return he("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 W$(e,t=!1){return he("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 Y$(e=!1,t=!1){return he("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 X$(e=!1){return he("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 Z$({docked:e,onToggleDock:t}){return u.jsxs("div",{className:he("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:he("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:he("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 Q$({className:e}){return u.jsxs("div",{className:he("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.42"]})]}),u.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function J$({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 R=T instanceof Error?T.message:String(T);m(R),_(R)}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:K$(x),children:[u.jsxs("div",{className:he("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(Q$,{className:he("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(Uo,{active:t==="services",badge:C,docked:x,icon:u.jsx(j4,{}),label:"Services",onClick:()=>i("services")}),u.jsx(Uo,{active:t==="git",docked:x,icon:u.jsx(Zs,{}),label:"Git Review",onClick:()=>i("git")}),u.jsx(Uo,{active:t==="errors",docked:x,icon:u.jsx(vg,{}),label:"Error Inbox",onClick:()=>i("errors")}),u.jsx(Uo,{active:t==="database",docked:x,icon:u.jsx(Kr,{}),label:"Database",onClick:()=>i("database")}),u.jsx(Uo,{active:t==="terminal",docked:x,icon:u.jsx(H4,{}),label:"Terminal",onClick:()=>i("terminal")}),u.jsx(Uo,{active:t==="agent",docked:x,icon:u.jsx(Zd,{}),label:"Agent",onClick:()=>i("agent")})]}),u.jsx(Z$,{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:he("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(We,{variant:"danger",children:h}):null,s&&t==="git"?u.jsx(P$,{data:s,onRefresh:w}):null,u.jsxs(de,{onClick:()=>{w({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[u.jsx(kh,{className:he(f&&"animate-spin")}),"Refresh"]}),u.jsx(G$,{})]})]}),s?u.jsx(WI,{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(qI,{data:s,onRefresh:w,focusService:l,onServiceFocused:()=>c(null)}):null,s&&t==="git"?u.jsx(L$,{data:s}):null,t==="agent"?u.jsx(l7,{}):null,t==="errors"?u.jsx(uL,{}):null,t==="database"?u.jsx(rL,{}):null,t==="terminal"?u.jsx(eP,{}):null]})]})]}),s&&t==="git"?u.jsx($$,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:w}):null,u.jsx(I7,{onOpenAgentPage:t==="agent"?void 0:()=>i("agent"),onOpenService:N=>{c(N),i("services"),w({silent:!0})}})]})})}function Uo({active:e,badge:t,docked:i,icon:s,label:a,onClick:l}){const c=t!==void 0&&t>0;return u.jsxs(de,{"aria-label":a,title:a,className:W$(e,i),variant:"ghost",onClick:l,type:"button",children:[u.jsx("span",{className:X$(i),children:s}),u.jsx("span",{className:Y$(i,c),children:a}),t!==void 0&&t>0?u.jsx(We,{appearance:t>0?"solid":"outline",className:he("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]})}V2.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(J$,{})}));export{u as j,E as r};