nomoreide 0.1.33 → 0.1.34

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,139 @@
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 e5(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jm={exports:{}},Zl={};var py;function t5(){if(py)return Zl;py=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 d in a)d!=="key"&&(l[d]=a[d])}else l=a;return a=l.ref,{$$typeof:e,type:s,key:c,ref:a!==void 0?a:null,props:l}}return Zl.Fragment=t,Zl.jsx=i,Zl.jsxs=i,Zl}var gy;function i5(){return gy||(gy=1,jm.exports=t5()),jm.exports}var h=i5(),Bm={exports:{}},Ue={};var _y;function n5(){if(_y)return Ue;_y=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"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function A(D,ie,ce){this.props=D,this.context=ie,this.refs=E,this.updater=ce||x}A.prototype.isReactComponent={},A.prototype.setState=function(D,ie){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,ie,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=A.prototype;function M(D,ie,ce){this.props=D,this.context=ie,this.refs=E,this.updater=ce||x}var R=M.prototype=new T;R.constructor=M,w(R,A.prototype),R.isPureReactComponent=!0;var z=Array.isArray;function U(){}var j={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function K(D,ie,ce){var le=ce.ref;return{$$typeof:e,type:D,key:ie,ref:le!==void 0?le:null,props:ce}}function H(D,ie){return K(D.type,ie,D.props)}function G(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function J(D){var ie={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ce){return ie[ce]})}var P=/\/+/g;function ee(D,ie){return typeof D=="object"&&D!==null&&D.key!=null?J(""+D.key):ie.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(U,U):(D.status="pending",D.then(function(ie){D.status==="pending"&&(D.status="fulfilled",D.value=ie)},function(ie){D.status==="pending"&&(D.status="rejected",D.reason=ie)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function N(D,ie,ce,le,he){var ge=typeof D;(ge==="undefined"||ge==="boolean")&&(D=null);var Se=!1;if(D===null)Se=!0;else switch(ge){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(D.$$typeof){case e:case t:Se=!0;break;case g:return Se=D._init,N(Se(D._payload),ie,ce,le,he)}}if(Se)return he=he(D),Se=le===""?"."+ee(D,0):le,z(he)?(ce="",Se!=null&&(ce=Se.replace(P,"$&/")+"/"),N(he,ie,ce,"",function(st){return st})):he!=null&&(G(he)&&(he=H(he,ce+(he.key==null||D&&D.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+Se)),ie.push(he)),1;Se=0;var ze=le===""?".":le+":";if(z(D))for(var Ee=0;Ee<D.length;Ee++)le=D[Ee],ge=ze+ee(le,Ee),Se+=N(le,ie,ce,ge,he);else if(Ee=y(D),typeof Ee=="function")for(D=Ee.call(D),Ee=0;!(le=D.next()).done;)le=le.value,ge=ze+ee(le,Ee++),Se+=N(le,ie,ce,ge,he);else if(ge==="object"){if(typeof D.then=="function")return N(q(D),ie,ce,le,he);throw ie=String(D),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.")}return Se}function F(D,ie,ce){if(D==null)return D;var le=[],he=0;return N(D,le,"","",function(ge){return ie.call(ce,ge,he++)}),le}function $(D){if(D._status===-1){var ie=D._result;ie=ie(),ie.then(function(ce){(D._status===0||D._status===-1)&&(D._status=1,D._result=ce)},function(ce){(D._status===0||D._status===-1)&&(D._status=2,D._result=ce)}),D._status===-1&&(D._status=0,D._result=ie)}if(D._status===1)return D._result.default;throw D._result}var Z=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ie=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(ie))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},W={map:F,forEach:function(D,ie,ce){F(D,function(){ie.apply(this,arguments)},ce)},count:function(D){var ie=0;return F(D,function(){ie++}),ie},toArray:function(D){return F(D,function(ie){return ie})||[]},only:function(D){if(!G(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ue.Activity=b,Ue.Children=W,Ue.Component=A,Ue.Fragment=i,Ue.Profiler=a,Ue.PureComponent=M,Ue.StrictMode=s,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(D){return j.H.useMemoCache(D)}},Ue.cache=function(D){return function(){return D.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(D,ie,ce){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var le=w({},D.props),he=D.key;if(ie!=null)for(ge in ie.key!==void 0&&(he=""+ie.key),ie)!O.call(ie,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&ie.ref===void 0||(le[ge]=ie[ge]);var ge=arguments.length-2;if(ge===1)le.children=ce;else if(1<ge){for(var Se=Array(ge),ze=0;ze<ge;ze++)Se[ze]=arguments[ze+2];le.children=Se}return K(D.type,he,le)},Ue.createContext=function(D){return D={$$typeof:c,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Ue.createElement=function(D,ie,ce){var le,he={},ge=null;if(ie!=null)for(le in ie.key!==void 0&&(ge=""+ie.key),ie)O.call(ie,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(he[le]=ie[le]);var Se=arguments.length-2;if(Se===1)he.children=ce;else if(1<Se){for(var ze=Array(Se),Ee=0;Ee<Se;Ee++)ze[Ee]=arguments[Ee+2];he.children=ze}if(D&&D.defaultProps)for(le in Se=D.defaultProps,Se)he[le]===void 0&&(he[le]=Se[le]);return K(D,ge,he)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(D){return{$$typeof:d,render:D}},Ue.isValidElement=G,Ue.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:$}},Ue.memo=function(D,ie){return{$$typeof:f,type:D,compare:ie===void 0?null:ie}},Ue.startTransition=function(D){var ie=j.T,ce={};j.T=ce;try{var le=D(),he=j.S;he!==null&&he(ce,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(U,Z)}catch(ge){Z(ge)}finally{ie!==null&&ce.types!==null&&(ie.types=ce.types),j.T=ie}},Ue.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ue.use=function(D){return j.H.use(D)},Ue.useActionState=function(D,ie,ce){return j.H.useActionState(D,ie,ce)},Ue.useCallback=function(D,ie){return j.H.useCallback(D,ie)},Ue.useContext=function(D){return j.H.useContext(D)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(D,ie){return j.H.useDeferredValue(D,ie)},Ue.useEffect=function(D,ie){return j.H.useEffect(D,ie)},Ue.useEffectEvent=function(D){return j.H.useEffectEvent(D)},Ue.useId=function(){return j.H.useId()},Ue.useImperativeHandle=function(D,ie,ce){return j.H.useImperativeHandle(D,ie,ce)},Ue.useInsertionEffect=function(D,ie){return j.H.useInsertionEffect(D,ie)},Ue.useLayoutEffect=function(D,ie){return j.H.useLayoutEffect(D,ie)},Ue.useMemo=function(D,ie){return j.H.useMemo(D,ie)},Ue.useOptimistic=function(D,ie){return j.H.useOptimistic(D,ie)},Ue.useReducer=function(D,ie,ce){return j.H.useReducer(D,ie,ce)},Ue.useRef=function(D){return j.H.useRef(D)},Ue.useState=function(D){return j.H.useState(D)},Ue.useSyncExternalStore=function(D,ie,ce){return j.H.useSyncExternalStore(D,ie,ce)},Ue.useTransition=function(){return j.H.useTransition()},Ue.version="19.2.6",Ue}var by;function R0(){return by||(by=1,Bm.exports=n5()),Bm.exports}var C=R0(),zm={exports:{}},Ql={},Im={exports:{}},Pm={};var vy;function s5(){return vy||(vy=1,(function(e){function t(N,F){var $=N.length;N.push(F);e:for(;0<$;){var Z=$-1>>>1,W=N[Z];if(0<a(W,F))N[Z]=F,N[$]=W,$=Z;else break e}}function i(N){return N.length===0?null:N[0]}function s(N){if(N.length===0)return null;var F=N[0],$=N.pop();if($!==F){N[0]=$;e:for(var Z=0,W=N.length,D=W>>>1;Z<D;){var ie=2*(Z+1)-1,ce=N[ie],le=ie+1,he=N[le];if(0>a(ce,$))le<W&&0>a(he,ce)?(N[Z]=he,N[le]=$,Z=le):(N[Z]=ce,N[ie]=$,Z=ie);else if(le<W&&0>a(he,$))N[Z]=he,N[le]=$,Z=le;else break e}}return F}function a(N,F){var $=N.sortIndex-F.sortIndex;return $!==0?$:N.id-F.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,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],f=[],g=1,b=null,v=3,y=!1,x=!1,w=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function R(N){for(var F=i(f);F!==null;){if(F.callback===null)s(f);else if(F.startTime<=N)s(f),F.sortIndex=F.expirationTime,t(m,F);else break;F=i(f)}}function z(N){if(w=!1,R(N),!x)if(i(m)!==null)x=!0,U||(U=!0,J());else{var F=i(f);F!==null&&q(z,F.startTime-N)}}var U=!1,j=-1,O=5,K=-1;function H(){return E?!0:!(e.unstable_now()-K<O)}function G(){if(E=!1,U){var N=e.unstable_now();K=N;var F=!0;try{e:{x=!1,w&&(w=!1,T(j),j=-1),y=!0;var $=v;try{t:{for(R(N),b=i(m);b!==null&&!(b.expirationTime>N&&H());){var Z=b.callback;if(typeof Z=="function"){b.callback=null,v=b.priorityLevel;var W=Z(b.expirationTime<=N);if(N=e.unstable_now(),typeof W=="function"){b.callback=W,R(N),F=!0;break t}b===i(m)&&s(m),R(N)}else s(m);b=i(m)}if(b!==null)F=!0;else{var D=i(f);D!==null&&q(z,D.startTime-N),F=!1}}break e}finally{b=null,v=$,y=!1}F=void 0}}finally{F?J():U=!1}}}var J;if(typeof M=="function")J=function(){M(G)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,ee=P.port2;P.port1.onmessage=G,J=function(){ee.postMessage(null)}}else J=function(){A(G,0)};function q(N,F){j=A(function(){N(e.unstable_now())},F)}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(N){N.callback=null},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(N){switch(v){case 1:case 2:case 3:var F=3;break;default:F=v}var $=v;v=F;try{return N()}finally{v=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(N,F){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var $=v;v=N;try{return F()}finally{v=$}},e.unstable_scheduleCallback=function(N,F,$){var Z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Z+$:Z):$=Z,N){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=$+W,N={id:g++,callback:F,priorityLevel:N,startTime:$,expirationTime:W,sortIndex:-1},$>Z?(N.sortIndex=$,t(f,N),i(m)===null&&N===i(f)&&(w?(T(j),j=-1):w=!0,q(z,$-Z))):(N.sortIndex=W,t(m,N),x||y||(x=!0,U||(U=!0,J()))),N},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(N){var F=v;return function(){var $=v;v=F;try{return N.apply(this,arguments)}finally{v=$}}}})(Pm)),Pm}var yy;function r5(){return yy||(yy=1,Im.exports=s5()),Im.exports}var Um={exports:{}},Li={};var xy;function a5(){if(xy)return Li;xy=1;var e=R0();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 b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:b==null?null:""+b,children:m,containerInfo:f,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,f){if(m==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Li.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Li.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)},Li.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()}},Li.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))},Li.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Li.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var g=f.as,b=d(g,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?s.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:y}):g==="script"&&s.d.X(m,{crossOrigin:b,integrity:v,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Li.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=d(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)},Li.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,b=d(g,f.crossOrigin);s.d.L(m,g,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Li.preloadModule=function(m,f){if(typeof m=="string")if(f){var g=d(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)},Li.requestFormReset=function(m){s.d.r(m)},Li.unstable_batchedUpdates=function(m,f){return m(f)},Li.useFormState=function(m,f,g){return c.H.useFormState(m,f,g)},Li.useFormStatus=function(){return c.H.useHostTransitionStatus()},Li.version="19.2.6",Li}var Sy;function S2(){if(Sy)return Um.exports;Sy=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(),Um.exports=a5(),Um.exports}var wy;function o5(){if(wy)return Ql;wy=1;var e=r5(),t=R0(),i=S2();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 d(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,u=r;;){var p=o.return;if(p===null)break;var _=p.alternate;if(_===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===_.child){for(_=p.child;_;){if(_===o)return m(p),n;if(_===u)return m(p),r;_=_.sibling}throw Error(s(188))}if(o.return!==u.return)o=p,u=_;else{for(var S=!1,k=p.child;k;){if(k===o){S=!0,o=p,u=_;break}if(k===u){S=!0,u=p,o=_;break}k=k.sibling}if(!S){for(k=_.child;k;){if(k===o){S=!0,o=_,u=p;break}if(k===u){S=!0,u=_,o=p;break}k=k.sibling}if(!S)throw Error(s(189))}}if(o.alternate!==u)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 b=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function J(n){return n===null||typeof n!="object"?null:(n=G&&n[G]||n["@@iterator"],typeof n=="function"?n:null)}var P=Symbol.for("react.client.reference");function ee(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===P?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case w:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case U:return"SuspenseList";case K:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case x:return"Portal";case M:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case R: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:ee(n.type)||"Memo";case O:r=n._payload,n=n._init;try{return ee(n(r))}catch{}}return null}var q=Array.isArray,N=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},Z=[],W=-1;function D(n){return{current:n}}function ie(n){0>W||(n.current=Z[W],Z[W]=null,W--)}function ce(n,r){W++,Z[W]=n.current,n.current=r}var le=D(null),he=D(null),ge=D(null),Se=D(null);function ze(n,r){switch(ce(ge,r),ce(he,n),ce(le,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?I1(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=I1(r),n=P1(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ie(le),ce(le,n)}function Ee(){ie(le),ie(he),ie(ge)}function st(n){n.memoizedState!==null&&ce(Se,n);var r=le.current,o=P1(r,n.type);r!==o&&(ce(he,n),ce(le,o))}function ot(n){he.current===n&&(ie(le),ie(he)),Se.current===n&&(ie(Se),Gl._currentValue=$)}var lt,Be;function Ft(n){if(lt===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);lt=r&&r[1]||"",Be=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+lt+n+Be}var Qr=!1;function xs(n,r){if(!n||Qr)return"";Qr=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(te){var Q=te}Reflect.construct(n,[],ae)}else{try{ae.call()}catch(te){Q=te}n.call(ae.prototype)}}else{try{throw Error()}catch(te){Q=te}(ae=n())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(te){if(te&&Q&&typeof te.stack=="string")return[te.stack,Q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=u.DetermineComponentFrameRoot(),S=_[0],k=_[1];if(S&&k){var L=S.split(`
4
+ `),X=k.split(`
5
+ `);for(p=u=0;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(u===L.length||p===X.length)for(u=L.length-1,p=X.length-1;1<=u&&0<=p&&L[u]!==X[p];)p--;for(;1<=u&&0<=p;u--,p--)if(L[u]!==X[p]){if(u!==1||p!==1)do if(u--,p--,0>p||L[u]!==X[p]){var ne=`
6
+ `+L[u].replace(" at new "," at ");return n.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",n.displayName)),ne}while(1<=u&&0<=p);break}}}finally{Qr=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Ft(o):""}function Fa(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 xs(n.type,!1);case 11:return xs(n.type.render,!1);case 1:return xs(n.type,!0);case 31:return Ft("Activity");default:return""}}function Jr(n){try{var r="",o=null;do r+=Fa(n,o),o=n,n=n.return;while(n);return r}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var ea=Object.prototype.hasOwnProperty,ir=e.unstable_scheduleCallback,Ss=e.unstable_cancelCallback,tl=e.unstable_shouldYield,$a=e.unstable_requestPaint,Ot=e.unstable_now,ws=e.unstable_getCurrentPriorityLevel,yi=e.unstable_ImmediatePriority,Es=e.unstable_UserBlockingPriority,Cs=e.unstable_NormalPriority,Va=e.unstable_LowPriority,nr=e.unstable_IdlePriority,il=e.log,qa=e.unstable_setDisableYieldValue,ks=null,fi=null;function yn(n){if(typeof il=="function"&&qa(n),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(ks,n)}catch{}}var xi=Math.clz32?Math.clz32:Ka,nl=Math.log,ta=Math.LN2;function Ka(n){return n>>>=0,n===0?32:31-(nl(n)/ta|0)|0}var tt=256,Hn=262144,rn=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 B(n,r,o){var u=n.pendingLanes;if(u===0)return 0;var p=0,_=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var k=u&134217727;return k!==0?(u=k&~_,u!==0?p=Ri(u):(S&=k,S!==0?p=Ri(S):o||(o=k&~n,o!==0&&(p=Ri(o))))):(k=u&~_,k!==0?p=Ri(k):S!==0?p=Ri(S):o||(o=u&~n,o!==0&&(p=Ri(o)))),p===0?0:r!==0&&r!==p&&(r&_)===0&&(_=p&-p,o=r&-r,_>=o||_===32&&(o&4194048)!==0)?r:p}function se(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function _e(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var n=rn;return rn<<=1,(rn&62914560)===0&&(rn=4194304),n}function Ct(n){for(var r=[],o=0;31>o;o++)r.push(n);return r}function yt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Ne(n,r,o,u,p,_){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,L=n.expirationTimes,X=n.hiddenUpdates;for(o=S&~o;0<o;){var ne=31-xi(o),ae=1<<ne;k[ne]=0,L[ne]=-1;var Q=X[ne];if(Q!==null)for(X[ne]=null,ne=0;ne<Q.length;ne++){var te=Q[ne];te!==null&&(te.lane&=-536870913)}o&=~ae}u!==0&&ye(n,u,0),_!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=_&~(S&~r))}function ye(n,r,o){n.pendingLanes|=r,n.suspendedLanes&=~r;var u=31-xi(r);n.entangledLanes|=r,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function je(n,r){var o=n.entangledLanes|=r;for(n=n.entanglements;o;){var u=31-xi(o),p=1<<u;p&r|n[u]&r&&(n[u]|=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 Ns(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ga(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:ly(n.type))}function Wa(n,r){var o=F.p;try{return F.p=n,r()}finally{F.p=o}}var Xn=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Xn,Di="__reactProps$"+Xn,sr="__reactContainer$"+Xn,sl="__reactEvents$"+Xn,tu="__reactListeners$"+Xn,Ya="__reactHandles$"+Xn,iu="__reactResources$"+Xn,ia="__reactMarker$"+Xn;function rl(n){delete n[Vt],delete n[Di],delete n[sl],delete n[tu],delete n[Ya]}function Ii(n){var r=n[Vt];if(r)return r;for(var o=n.parentNode;o;){if(r=o[sr]||o[Vt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(n=K1(n);n!==null;){if(o=n[Vt])return o;n=K1(n)}return r}n=o,o=n.parentNode}return null}function Ts(n){if(n=n[Vt]||n[sr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function rr(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function ar(n){var r=n[iu];return r||(r=n[iu]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Yt(n){n[ia]=!0}var nu=new Set,na={};function As(n,r){ue(n,r),ue(n+"Capture",r)}function ue(n,r){for(na[n]=r,n=0;n<r.length;n++)nu.add(r[n])}var Me=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),We={},ht={};function qt(n){return ea.call(ht,n)?!0:ea.call(We,n)?!1:Me.test(n)?ht[n]=!0:(We[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 u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+o)}}function an(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 Ki(n,r,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(r,o,""+u)}}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 on(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function su(n,r,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,_=u.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,_.call(this,S)}}),Object.defineProperty(n,r,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Xa(n){if(!n._valueTracker){var r=on(n)?"checked":"value";n._valueTracker=su(n,r,""+n[r])}}function al(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var o=r.getValue(),u="";return n&&(u=on(n)?n.checked?"true":"false":n.value),n=u,n!==o?(r.setValue(n),!0):!1}function Za(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 Od=/[\n"\\]/g;function Gi(n){return n.replace(Od,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ol(n,r,o,u,p,_,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?Qa(n,S,Et(r)):o!=null?Qa(n,S,Et(o)):u!=null&&n.removeAttribute("value"),p==null&&_!=null&&(n.defaultChecked=!!_),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 sa(n,r,o,u,p,_,S,k){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.type=_),r!=null||o!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){Xa(n);return}o=o!=null?""+Et(o):"",r=r!=null?""+Et(r):o,k||r===n.value||(n.value=r),n.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=k?n.checked:!!u,n.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),Xa(n)}function Qa(n,r,o){r==="number"&&Za(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Si(n,r,o,u){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&&u&&(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,u&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function ru(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 Ja(n,r,o,u){if(r==null){if(u!=null){if(o!=null)throw Error(s(92));if(q(u)){if(1<u.length)throw Error(s(93));u=u[0]}o=u}o==null&&(o=""),r=o}o=Et(r),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),Xa(n)}function Le(n,r){if(r){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=r;return}}n.textContent=r}var au=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 u=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":u?n.setProperty(r,o):typeof o!="number"||o===0||au.has(r)?r==="float"?n.cssFloat=o:n[r]=(""+o).trim():n[r]=o+"px"}function dt(n,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&o[p]!==u&&Xt(n,p,u)}else for(var _ in r)r.hasOwnProperty(_)&&Xt(n,_,r[_])}function or(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 Ms=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"]]),ll=/^[\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 lr(n){return ll.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function pe(){}var Te=null;function He(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ze=null,Lt=null;function xn(n){var r=Ts(n);if(r&&(n=r.stateNode)){var o=n[Di]||null;e:switch(n=r.stateNode,r.type){case"input":if(ol(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="'+Gi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var u=o[r];if(u!==n&&u.form===n.form){var p=u[Di]||null;if(!p)throw Error(s(90));ol(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)u=o[r],u.form===n.form&&al(u)}break e;case"textarea":ru(n,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Si(n,!!o.multiple,r,!1)}}}var cl=!1;function ou(n,r,o){if(cl)return n(r,o);cl=!0;try{var u=n(r);return u}finally{if(cl=!1,(Ze!==null||Lt!==null)&&(Wu(),Ze&&(r=Ze,n=Lt,Lt=Ze=null,xn(r),n)))for(r=0;r<n.length;r++)xn(n[r])}}function ul(n,r){var o=n.stateNode;if(o===null)return null;var u=o[Di]||null;if(u===null)return null;o=u[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":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(Rs)try{var hl={};Object.defineProperty(hl,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",hl,hl),window.removeEventListener("test",hl,hl)}catch{Ld=!1}var cr=null,jd=null,lu=null;function P_(){if(lu)return lu;var n,r=jd,o=r.length,u,p="value"in cr?cr.value:cr.textContent,_=p.length;for(n=0;n<o&&r[n]===p[n];n++);var S=o-n;for(u=1;u<=S&&r[o-u]===p[_-u];u++);return lu=p.slice(n,1<u?1-u:void 0)}function cu(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 uu(){return!0}function U_(){return!1}function Wi(n){function r(o,u,p,_,S){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=_,this.target=S,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(o=n[k],this[k]=o?o(_):_[k]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?uu:U_,this.isPropagationStopped=U_,this}return b(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=uu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=uu)},persist:function(){},isPersistent:uu}),r}var ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=Wi(ra),dl=b({},ra,{view:0,detail:0}),Q3=Wi(dl),Bd,zd,fl,du=b({},dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pd,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!==fl&&(fl&&n.type==="mousemove"?(Bd=n.screenX-fl.screenX,zd=n.screenY-fl.screenY):zd=Bd=0,fl=n),Bd)},movementY:function(n){return"movementY"in n?n.movementY:zd}}),H_=Wi(du),J3=b({},du,{dataTransfer:0}),eN=Wi(J3),tN=b({},dl,{relatedTarget:0}),Id=Wi(tN),iN=b({},ra,{animationName:0,elapsedTime:0,pseudoElement:0}),nN=Wi(iN),sN=b({},ra,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),rN=Wi(sN),aN=b({},ra,{data:0}),F_=Wi(aN),oN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lN={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"},cN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uN(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=cN[n])?!!r[n]:!1}function Pd(){return uN}var hN=b({},dl,{key:function(n){if(n.key){var r=oN[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=cu(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?lN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pd,charCode:function(n){return n.type==="keypress"?cu(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?cu(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),dN=Wi(hN),fN=b({},du,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$_=Wi(fN),mN=b({},dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pd}),pN=Wi(mN),gN=b({},ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),_N=Wi(gN),bN=b({},du,{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}),vN=Wi(bN),yN=b({},ra,{newState:0,oldState:0}),xN=Wi(yN),SN=[9,13,27,32],Ud=Rs&&"CompositionEvent"in window,ml=null;Rs&&"documentMode"in document&&(ml=document.documentMode);var wN=Rs&&"TextEvent"in window&&!ml,V_=Rs&&(!Ud||ml&&8<ml&&11>=ml),q_=" ",K_=!1;function G_(n,r){switch(n){case"keyup":return SN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W_(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var eo=!1;function EN(n,r){switch(n){case"compositionend":return W_(r);case"keypress":return r.which!==32?null:(K_=!0,q_);case"textInput":return n=r.data,n===q_&&K_?null:n;default:return null}}function CN(n,r){if(eo)return n==="compositionend"||!Ud&&G_(n,r)?(n=P_(),lu=jd=cr=null,eo=!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 V_&&r.locale!=="ko"?null:r.data;default:return null}}var kN={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 Y_(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!kN[n.type]:r==="textarea"}function X_(n,r,o,u){Ze?Lt?Lt.push(u):Lt=[u]:Ze=u,r=th(r,"onChange"),0<r.length&&(o=new hu("onChange","change",null,o,u),n.push({event:o,listeners:r}))}var pl=null,gl=null;function NN(n){D1(n,0)}function fu(n){var r=rr(n);if(al(r))return n}function Z_(n,r){if(n==="change")return r}var Q_=!1;if(Rs){var Hd;if(Rs){var Fd="oninput"in document;if(!Fd){var J_=document.createElement("div");J_.setAttribute("oninput","return;"),Fd=typeof J_.oninput=="function"}Hd=Fd}else Hd=!1;Q_=Hd&&(!document.documentMode||9<document.documentMode)}function eb(){pl&&(pl.detachEvent("onpropertychange",tb),gl=pl=null)}function tb(n){if(n.propertyName==="value"&&fu(gl)){var r=[];X_(r,gl,n,He(n)),ou(NN,r)}}function TN(n,r,o){n==="focusin"?(eb(),pl=r,gl=o,pl.attachEvent("onpropertychange",tb)):n==="focusout"&&eb()}function AN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return fu(gl)}function MN(n,r){if(n==="click")return fu(r)}function RN(n,r){if(n==="input"||n==="change")return fu(r)}function DN(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var ln=typeof Object.is=="function"?Object.is:DN;function _l(n,r){if(ln(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var o=Object.keys(n),u=Object.keys(r);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!ea.call(r,p)||!ln(n[p],r[p]))return!1}return!0}function ib(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function nb(n,r){var o=ib(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=r&&u>=r)return{node:o,offset:r-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ib(o)}}function sb(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?sb(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function rb(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Za(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=Za(n.document)}return r}function $d(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 ON=Rs&&"documentMode"in document&&11>=document.documentMode,to=null,Vd=null,bl=null,qd=!1;function ab(n,r,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;qd||to==null||to!==Za(u)||(u=to,"selectionStart"in u&&$d(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),bl&&_l(bl,u)||(bl=u,u=th(Vd,"onSelect"),0<u.length&&(r=new hu("onSelect","select",null,r,o),n.push({event:r,listeners:u}),r.target=to)))}function aa(n,r){var o={};return o[n.toLowerCase()]=r.toLowerCase(),o["Webkit"+n]="webkit"+r,o["Moz"+n]="moz"+r,o}var io={animationend:aa("Animation","AnimationEnd"),animationiteration:aa("Animation","AnimationIteration"),animationstart:aa("Animation","AnimationStart"),transitionrun:aa("Transition","TransitionRun"),transitionstart:aa("Transition","TransitionStart"),transitioncancel:aa("Transition","TransitionCancel"),transitionend:aa("Transition","TransitionEnd")},Kd={},ob={};Rs&&(ob=document.createElement("div").style,"AnimationEvent"in window||(delete io.animationend.animation,delete io.animationiteration.animation,delete io.animationstart.animation),"TransitionEvent"in window||delete io.transitionend.transition);function oa(n){if(Kd[n])return Kd[n];if(!io[n])return n;var r=io[n],o;for(o in r)if(r.hasOwnProperty(o)&&o in ob)return Kd[n]=r[o];return n}var lb=oa("animationend"),cb=oa("animationiteration"),ub=oa("animationstart"),LN=oa("transitionrun"),jN=oa("transitionstart"),BN=oa("transitioncancel"),hb=oa("transitionend"),db=new Map,Gd="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(" ");Gd.push("scrollEnd");function Fn(n,r){db.set(n,r),As(r,[n])}var mu=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)},Sn=[],no=0,Wd=0;function pu(){for(var n=no,r=Wd=no=0;r<n;){var o=Sn[r];Sn[r++]=null;var u=Sn[r];Sn[r++]=null;var p=Sn[r];Sn[r++]=null;var _=Sn[r];if(Sn[r++]=null,u!==null&&p!==null){var S=u.pending;S===null?p.next=p:(p.next=S.next,S.next=p),u.pending=p}_!==0&&fb(o,p,_)}}function gu(n,r,o,u){Sn[no++]=n,Sn[no++]=r,Sn[no++]=o,Sn[no++]=u,Wd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Yd(n,r,o,u){return gu(n,r,o,u),_u(n)}function la(n,r){return gu(n,null,null,r),_u(n)}function fb(n,r,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var p=!1,_=n.return;_!==null;)_.childLanes|=o,u=_.alternate,u!==null&&(u.childLanes|=o),_.tag===22&&(n=_.stateNode,n===null||n._visibility&1||(p=!0)),n=_,_=_.return;return n.tag===3?(_=n.stateNode,p&&r!==null&&(p=31-xi(o),n=_.hiddenUpdates,u=n[p],u===null?n[p]=[r]:u.push(r),r.lane=o|536870912),_):null}function _u(n){if(50<Ul)throw Ul=0,rm=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var so={};function zN(n,r,o,u){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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(n,r,o,u){return new zN(n,r,o,u)}function Xd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ds(n,r){var o=n.alternate;return o===null?(o=cn(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 mb(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 bu(n,r,o,u,p,_){var S=0;if(u=n,typeof n=="function")Xd(n)&&(S=1);else if(typeof n=="string")S=FT(n,o,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case K:return n=cn(31,o,r,p),n.elementType=K,n.lanes=_,n;case w:return ca(o.children,p,_,r);case E:S=8,p|=24;break;case A:return n=cn(12,o,r,p|2),n.elementType=A,n.lanes=_,n;case z:return n=cn(13,o,r,p),n.elementType=z,n.lanes=_,n;case U:return n=cn(19,o,r,p),n.elementType=U,n.lanes=_,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case M:S=10;break e;case T:S=9;break e;case R:S=11;break e;case j:S=14;break e;case O:S=16,u=null;break e}S=29,o=Error(s(130,n===null?"null":typeof n,"")),u=null}return r=cn(S,o,r,p),r.elementType=n,r.type=u,r.lanes=_,r}function ca(n,r,o,u){return n=cn(7,n,u,r),n.lanes=o,n}function Zd(n,r,o){return n=cn(6,n,null,r),n.lanes=o,n}function pb(n){var r=cn(18,null,null,0);return r.stateNode=n,r}function Qd(n,r,o){return r=cn(4,n.children!==null?n.children:[],n.key,r),r.lanes=o,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var gb=new WeakMap;function wn(n,r){if(typeof n=="object"&&n!==null){var o=gb.get(n);return o!==void 0?o:(r={value:n,source:r,stack:Jr(r)},gb.set(n,r),r)}return{value:n,source:r,stack:Jr(r)}}var ro=[],ao=0,vu=null,vl=0,En=[],Cn=0,ur=null,Zn=1,Qn="";function Os(n,r){ro[ao++]=vl,ro[ao++]=vu,vu=n,vl=r}function _b(n,r,o){En[Cn++]=Zn,En[Cn++]=Qn,En[Cn++]=ur,ur=n;var u=Zn;n=Qn;var p=32-xi(u)-1;u&=~(1<<p),o+=1;var _=32-xi(r)+p;if(30<_){var S=p-p%5;_=(u&(1<<S)-1).toString(32),u>>=S,p-=S,Zn=1<<32-xi(r)+p|o<<p|u,Qn=_+n}else Zn=1<<_|o<<p|u,Qn=n}function Jd(n){n.return!==null&&(Os(n,1),_b(n,1,0))}function ef(n){for(;n===vu;)vu=ro[--ao],ro[ao]=null,vl=ro[--ao],ro[ao]=null;for(;n===ur;)ur=En[--Cn],En[Cn]=null,Qn=En[--Cn],En[Cn]=null,Zn=En[--Cn],En[Cn]=null}function bb(n,r){En[Cn++]=Zn,En[Cn++]=Qn,En[Cn++]=ur,Zn=r.id,Qn=r.overflow,ur=n}var wi=null,kt=null,et=!1,hr=null,kn=!1,tf=Error(s(519));function dr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yl(wn(r,n)),tf}function vb(n){var r=n.stateNode,o=n.type,u=n.memoizedProps;switch(r[Vt]=n,r[Di]=u,o){case"dialog":Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":case"embed":Xe("load",r);break;case"video":case"audio":for(o=0;o<Fl.length;o++)Xe(Fl[o],r);break;case"source":Xe("error",r);break;case"img":case"image":case"link":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"input":Xe("invalid",r),sa(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Xe("invalid",r);break;case"textarea":Xe("invalid",r),Ja(r,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||u.suppressHydrationWarning===!0||B1(r.textContent,o)?(u.popover!=null&&(Xe("beforetoggle",r),Xe("toggle",r)),u.onScroll!=null&&Xe("scroll",r),u.onScrollEnd!=null&&Xe("scrollend",r),u.onClick!=null&&(r.onclick=pe),r=!0):r=!1,r||dr(n,!0)}function yb(n){for(wi=n.return;wi;)switch(wi.tag){case 5:case 31:case 13:kn=!1;return;case 27:case 3:kn=!0;return;default:wi=wi.return}}function oo(n){if(n!==wi)return!1;if(!et)return yb(n),et=!0,!1;var r=n.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||ym(n.type,n.memoizedProps)),o=!o),o&&kt&&dr(n),yb(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=q1(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));kt=q1(n)}else r===27?(r=kt,kr(n.type)?(n=Cm,Cm=null,kt=n):kt=r):kt=wi?Tn(n.stateNode.nextSibling):null;return!0}function ua(){kt=wi=null,et=!1}function nf(){var n=hr;return n!==null&&(Qi===null?Qi=n:Qi.push.apply(Qi,n),hr=null),n}function yl(n){hr===null?hr=[n]:hr.push(n)}var sf=D(null),ha=null,Ls=null;function fr(n,r,o){ce(sf,r._currentValue),r._currentValue=o}function js(n){n._currentValue=sf.current,ie(sf)}function rf(n,r,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),n===o)break;n=n.return}}function af(n,r,o,u){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var _=p.dependencies;if(_!==null){var S=p.child;_=_.firstContext;e:for(;_!==null;){var k=_;_=p;for(var L=0;L<r.length;L++)if(k.context===r[L]){_.lanes|=o,k=_.alternate,k!==null&&(k.lanes|=o),rf(_.return,o,n),u||(S=null);break e}_=k.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(s(341));S.lanes|=o,_=S.alternate,_!==null&&(_.lanes|=o),rf(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 lo(n,r,o,u){n=null;for(var p=r,_=!1;p!==null;){if(!_){if((p.flags&524288)!==0)_=!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;ln(p.pendingProps.value,S.value)||(n!==null?n.push(k):n=[k])}}else if(p===Se.current){if(S=p.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Gl):n=[Gl])}p=p.return}n!==null&&af(r,n,o,u),r.flags|=262144}function yu(n){for(n=n.firstContext;n!==null;){if(!ln(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function da(n){ha=n,Ls=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ei(n){return xb(ha,n)}function xu(n,r){return ha===null&&da(n),xb(n,r)}function xb(n,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},Ls===null){if(n===null)throw Error(s(308));Ls=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Ls=Ls.next=r;return o}var IN=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(o,u){n.push(u)}};this.abort=function(){r.aborted=!0,n.forEach(function(o){return o()})}},PN=e.unstable_scheduleCallback,UN=e.unstable_NormalPriority,Zt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function of(){return{controller:new IN,data:new Map,refCount:0}}function xl(n){n.refCount--,n.refCount===0&&PN(UN,function(){n.controller.abort()})}var Sl=null,lf=0,co=0,uo=null;function HN(n,r){if(Sl===null){var o=Sl=[];lf=0,co=hm(),uo={status:"pending",value:void 0,then:function(u){o.push(u)}}}return lf++,r.then(Sb,Sb),r}function Sb(){if(--lf===0&&Sl!==null){uo!==null&&(uo.status="fulfilled");var n=Sl;Sl=null,co=0,uo=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function FN(n,r){var o=[],u={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return n.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),u}var wb=N.S;N.S=function(n,r){a1=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&HN(n,r),wb!==null&&wb(n,r)};var fa=D(null);function cf(){var n=fa.current;return n!==null?n:xt.pooledCache}function Su(n,r){r===null?ce(fa,fa.current):ce(fa,r.pool)}function Eb(){var n=cf();return n===null?null:{parent:Zt._currentValue,pool:n}}var ho=Error(s(460)),uf=Error(s(474)),wu=Error(s(542)),Eu={then:function(){}};function Cb(n){return n=n.status,n==="fulfilled"||n==="rejected"}function kb(n,r,o){switch(o=n[o],o===void 0?n.push(r):o!==r&&(r.then(pe,pe),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Tb(n),n;default:if(typeof r.status=="string")r.then(pe,pe);else{if(n=xt,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,Tb(n),n}throw pa=r,ho}}function ma(n){try{var r=n._init;return r(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(pa=o,ho):o}}var pa=null;function Nb(){if(pa===null)throw Error(s(459));var n=pa;return pa=null,n}function Tb(n){if(n===ho||n===wu)throw Error(s(483))}var fo=null,wl=0;function Cu(n){var r=wl;return wl+=1,fo===null&&(fo=[]),kb(fo,n,r)}function El(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function ku(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 Ab(n){function r(V,I){if(n){var Y=V.deletions;Y===null?(V.deletions=[I],V.flags|=16):Y.push(I)}}function o(V,I){if(!n)return null;for(;I!==null;)r(V,I),I=I.sibling;return null}function u(V){for(var I=new Map;V!==null;)V.key!==null?I.set(V.key,V):I.set(V.index,V),V=V.sibling;return I}function p(V,I){return V=Ds(V,I),V.index=0,V.sibling=null,V}function _(V,I,Y){return V.index=Y,n?(Y=V.alternate,Y!==null?(Y=Y.index,Y<I?(V.flags|=67108866,I):Y):(V.flags|=67108866,I)):(V.flags|=1048576,I)}function S(V){return n&&V.alternate===null&&(V.flags|=67108866),V}function k(V,I,Y,re){return I===null||I.tag!==6?(I=Zd(Y,V.mode,re),I.return=V,I):(I=p(I,Y),I.return=V,I)}function L(V,I,Y,re){var De=Y.type;return De===w?ne(V,I,Y.props.children,re,Y.key):I!==null&&(I.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===O&&ma(De)===I.type)?(I=p(I,Y.props),El(I,Y),I.return=V,I):(I=bu(Y.type,Y.key,Y.props,null,V.mode,re),El(I,Y),I.return=V,I)}function X(V,I,Y,re){return I===null||I.tag!==4||I.stateNode.containerInfo!==Y.containerInfo||I.stateNode.implementation!==Y.implementation?(I=Qd(Y,V.mode,re),I.return=V,I):(I=p(I,Y.children||[]),I.return=V,I)}function ne(V,I,Y,re,De){return I===null||I.tag!==7?(I=ca(Y,V.mode,re,De),I.return=V,I):(I=p(I,Y),I.return=V,I)}function ae(V,I,Y){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Zd(""+I,V.mode,Y),I.return=V,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case y:return Y=bu(I.type,I.key,I.props,null,V.mode,Y),El(Y,I),Y.return=V,Y;case x:return I=Qd(I,V.mode,Y),I.return=V,I;case O:return I=ma(I),ae(V,I,Y)}if(q(I)||J(I))return I=ca(I,V.mode,Y,null),I.return=V,I;if(typeof I.then=="function")return ae(V,Cu(I),Y);if(I.$$typeof===M)return ae(V,xu(V,I),Y);ku(V,I)}return null}function Q(V,I,Y,re){var De=I!==null?I.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return De!==null?null:k(V,I,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:return Y.key===De?L(V,I,Y,re):null;case x:return Y.key===De?X(V,I,Y,re):null;case O:return Y=ma(Y),Q(V,I,Y,re)}if(q(Y)||J(Y))return De!==null?null:ne(V,I,Y,re,null);if(typeof Y.then=="function")return Q(V,I,Cu(Y),re);if(Y.$$typeof===M)return Q(V,I,xu(V,Y),re);ku(V,Y)}return null}function te(V,I,Y,re,De){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return V=V.get(Y)||null,k(I,V,""+re,De);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return V=V.get(re.key===null?Y:re.key)||null,L(I,V,re,De);case x:return V=V.get(re.key===null?Y:re.key)||null,X(I,V,re,De);case O:return re=ma(re),te(V,I,Y,re,De)}if(q(re)||J(re))return V=V.get(Y)||null,ne(I,V,re,De,null);if(typeof re.then=="function")return te(V,I,Y,Cu(re),De);if(re.$$typeof===M)return te(V,I,Y,xu(I,re),De);ku(I,re)}return null}function Ce(V,I,Y,re){for(var De=null,rt=null,Ae=I,$e=I=0,Je=null;Ae!==null&&$e<Y.length;$e++){Ae.index>$e?(Je=Ae,Ae=null):Je=Ae.sibling;var at=Q(V,Ae,Y[$e],re);if(at===null){Ae===null&&(Ae=Je);break}n&&Ae&&at.alternate===null&&r(V,Ae),I=_(at,I,$e),rt===null?De=at:rt.sibling=at,rt=at,Ae=Je}if($e===Y.length)return o(V,Ae),et&&Os(V,$e),De;if(Ae===null){for(;$e<Y.length;$e++)Ae=ae(V,Y[$e],re),Ae!==null&&(I=_(Ae,I,$e),rt===null?De=Ae:rt.sibling=Ae,rt=Ae);return et&&Os(V,$e),De}for(Ae=u(Ae);$e<Y.length;$e++)Je=te(Ae,V,$e,Y[$e],re),Je!==null&&(n&&Je.alternate!==null&&Ae.delete(Je.key===null?$e:Je.key),I=_(Je,I,$e),rt===null?De=Je:rt.sibling=Je,rt=Je);return n&&Ae.forEach(function(Rr){return r(V,Rr)}),et&&Os(V,$e),De}function Oe(V,I,Y,re){if(Y==null)throw Error(s(151));for(var De=null,rt=null,Ae=I,$e=I=0,Je=null,at=Y.next();Ae!==null&&!at.done;$e++,at=Y.next()){Ae.index>$e?(Je=Ae,Ae=null):Je=Ae.sibling;var Rr=Q(V,Ae,at.value,re);if(Rr===null){Ae===null&&(Ae=Je);break}n&&Ae&&Rr.alternate===null&&r(V,Ae),I=_(Rr,I,$e),rt===null?De=Rr:rt.sibling=Rr,rt=Rr,Ae=Je}if(at.done)return o(V,Ae),et&&Os(V,$e),De;if(Ae===null){for(;!at.done;$e++,at=Y.next())at=ae(V,at.value,re),at!==null&&(I=_(at,I,$e),rt===null?De=at:rt.sibling=at,rt=at);return et&&Os(V,$e),De}for(Ae=u(Ae);!at.done;$e++,at=Y.next())at=te(Ae,V,$e,at.value,re),at!==null&&(n&&at.alternate!==null&&Ae.delete(at.key===null?$e:at.key),I=_(at,I,$e),rt===null?De=at:rt.sibling=at,rt=at);return n&&Ae.forEach(function(JT){return r(V,JT)}),et&&Os(V,$e),De}function bt(V,I,Y,re){if(typeof Y=="object"&&Y!==null&&Y.type===w&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:e:{for(var De=Y.key;I!==null;){if(I.key===De){if(De=Y.type,De===w){if(I.tag===7){o(V,I.sibling),re=p(I,Y.props.children),re.return=V,V=re;break e}}else if(I.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===O&&ma(De)===I.type){o(V,I.sibling),re=p(I,Y.props),El(re,Y),re.return=V,V=re;break e}o(V,I);break}else r(V,I);I=I.sibling}Y.type===w?(re=ca(Y.props.children,V.mode,re,Y.key),re.return=V,V=re):(re=bu(Y.type,Y.key,Y.props,null,V.mode,re),El(re,Y),re.return=V,V=re)}return S(V);case x:e:{for(De=Y.key;I!==null;){if(I.key===De)if(I.tag===4&&I.stateNode.containerInfo===Y.containerInfo&&I.stateNode.implementation===Y.implementation){o(V,I.sibling),re=p(I,Y.children||[]),re.return=V,V=re;break e}else{o(V,I);break}else r(V,I);I=I.sibling}re=Qd(Y,V.mode,re),re.return=V,V=re}return S(V);case O:return Y=ma(Y),bt(V,I,Y,re)}if(q(Y))return Ce(V,I,Y,re);if(J(Y)){if(De=J(Y),typeof De!="function")throw Error(s(150));return Y=De.call(Y),Oe(V,I,Y,re)}if(typeof Y.then=="function")return bt(V,I,Cu(Y),re);if(Y.$$typeof===M)return bt(V,I,xu(V,Y),re);ku(V,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,I!==null&&I.tag===6?(o(V,I.sibling),re=p(I,Y),re.return=V,V=re):(o(V,I),re=Zd(Y,V.mode,re),re.return=V,V=re),S(V)):o(V,I)}return function(V,I,Y,re){try{wl=0;var De=bt(V,I,Y,re);return fo=null,De}catch(Ae){if(Ae===ho||Ae===wu)throw Ae;var rt=cn(29,Ae,null,V.mode);return rt.lanes=re,rt.return=V,rt}}}var ga=Ab(!0),Mb=Ab(!1),mr=!1;function hf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function df(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 pr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function gr(n,r,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(ct&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=_u(n),fb(n,null,o),r}return gu(n,u,r,o),_u(n)}function Cl(n,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var u=r.lanes;u&=n.pendingLanes,o|=u,r.lanes=o,je(n,o)}}function ff(n,r){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,_=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};_===null?p=_=S:_=_.next=S,o=o.next}while(o!==null);_===null?p=_=r:_=_.next=r}else p=_=r;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:_,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=r:n.next=r,o.lastBaseUpdate=r}var mf=!1;function kl(){if(mf){var n=uo;if(n!==null)throw n}}function Nl(n,r,o,u){mf=!1;var p=n.updateQueue;mr=!1;var _=p.firstBaseUpdate,S=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var L=k,X=L.next;L.next=null,S===null?_=X:S.next=X,S=L;var ne=n.alternate;ne!==null&&(ne=ne.updateQueue,k=ne.lastBaseUpdate,k!==S&&(k===null?ne.firstBaseUpdate=X:k.next=X,ne.lastBaseUpdate=L))}if(_!==null){var ae=p.baseState;S=0,ne=X=L=null,k=_;do{var Q=k.lane&-536870913,te=Q!==k.lane;if(te?(Qe&Q)===Q:(u&Q)===Q){Q!==0&&Q===co&&(mf=!0),ne!==null&&(ne=ne.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ce=n,Oe=k;Q=r;var bt=o;switch(Oe.tag){case 1:if(Ce=Oe.payload,typeof Ce=="function"){ae=Ce.call(bt,ae,Q);break e}ae=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Oe.payload,Q=typeof Ce=="function"?Ce.call(bt,ae,Q):Ce,Q==null)break e;ae=b({},ae,Q);break e;case 2:mr=!0}}Q=k.callback,Q!==null&&(n.flags|=64,te&&(n.flags|=8192),te=p.callbacks,te===null?p.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ne===null?(X=ne=te,L=ae):ne=ne.next=te,S|=Q;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;te=k,k=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ne===null&&(L=ae),p.baseState=L,p.firstBaseUpdate=X,p.lastBaseUpdate=ne,_===null&&(p.shared.lanes=0),xr|=S,n.lanes=S,n.memoizedState=ae}}function Rb(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function Db(n,r){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Rb(o[n],r)}var mo=D(null),Nu=D(0);function Ob(n,r){n=Vs,ce(Nu,n),ce(mo,r),Vs=n|r.baseLanes}function pf(){ce(Nu,Vs),ce(mo,mo.current)}function gf(){Vs=Nu.current,ie(mo),ie(Nu)}var un=D(null),Nn=null;function _r(n){var r=n.alternate;ce(Kt,Kt.current&1),ce(un,n),Nn===null&&(r===null||mo.current!==null||r.memoizedState!==null)&&(Nn=n)}function _f(n){ce(Kt,Kt.current),ce(un,n),Nn===null&&(Nn=n)}function Lb(n){n.tag===22?(ce(Kt,Kt.current),ce(un,n),Nn===null&&(Nn=n)):br()}function br(){ce(Kt,Kt.current),ce(un,un.current)}function hn(n){ie(un),Nn===n&&(Nn=null),ie(Kt)}var Kt=D(0);function Tu(n){for(var r=n;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||wm(o)||Em(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 Bs=0,Fe=null,gt=null,Qt=null,Au=!1,po=!1,_a=!1,Mu=0,Tl=0,go=null,$N=0;function zt(){throw Error(s(321))}function bf(n,r){if(r===null)return!1;for(var o=0;o<r.length&&o<n.length;o++)if(!ln(n[o],r[o]))return!1;return!0}function vf(n,r,o,u,p,_){return Bs=_,Fe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,N.H=n===null||n.memoizedState===null?_v:Lf,_a=!1,_=o(u,p),_a=!1,po&&(_=Bb(r,o,u,p)),jb(n),_}function jb(n){N.H=Rl;var r=gt!==null&&gt.next!==null;if(Bs=0,Qt=gt=Fe=null,Au=!1,Tl=0,go=null,r)throw Error(s(300));n===null||Jt||(n=n.dependencies,n!==null&&yu(n)&&(Jt=!0))}function Bb(n,r,o,u){Fe=n;var p=0;do{if(po&&(go=null),Tl=0,po=!1,25<=p)throw Error(s(301));if(p+=1,Qt=gt=null,n.updateQueue!=null){var _=n.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}N.H=bv,_=r(o,u)}while(po);return _}function VN(){var n=N.H,r=n.useState()[0];return r=typeof r.then=="function"?Al(r):r,n=n.useState()[0],(gt!==null?gt.memoizedState:null)!==n&&(Fe.flags|=1024),r}function yf(){var n=Mu!==0;return Mu=0,n}function xf(n,r,o){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~o}function Sf(n){if(Au){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Au=!1}Bs=0,Qt=gt=Fe=null,po=!1,Tl=Mu=0,go=null}function Pi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Fe.memoizedState=Qt=n:Qt=Qt.next=n,Qt}function Gt(){if(gt===null){var n=Fe.alternate;n=n!==null?n.memoizedState:null}else n=gt.next;var r=Qt===null?Fe.memoizedState:Qt.next;if(r!==null)Qt=r,gt=n;else{if(n===null)throw Fe.alternate===null?Error(s(467)):Error(s(310));gt=n,n={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Qt===null?Fe.memoizedState=Qt=n:Qt=Qt.next=n}return Qt}function Ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(n){var r=Tl;return Tl+=1,go===null&&(go=[]),n=kb(go,n,r),r=Fe,(Qt===null?r.memoizedState:Qt.next)===null&&(r=r.alternate,N.H=r===null||r.memoizedState===null?_v:Lf),n}function Du(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Al(n);if(n.$$typeof===M)return Ei(n)}throw Error(s(438,String(n)))}function wf(n){var r=null,o=Fe.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var u=Fe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Ru(),Fe.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(n),u=0;u<n;u++)o[u]=H;return r.index++,o}function zs(n,r){return typeof r=="function"?r(n):r}function Ou(n){var r=Gt();return Ef(r,gt,n)}function Ef(n,r,o){var u=n.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=o;var p=n.baseQueue,_=u.pending;if(_!==null){if(p!==null){var S=p.next;p.next=_.next,_.next=S}r.baseQueue=p=_,u.pending=null}if(_=n.baseState,p===null)n.memoizedState=_;else{r=p.next;var k=S=null,L=null,X=r,ne=!1;do{var ae=X.lane&-536870913;if(ae!==X.lane?(Qe&ae)===ae:(Bs&ae)===ae){var Q=X.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ae===co&&(ne=!0);else if((Bs&Q)===Q){X=X.next,Q===co&&(ne=!0);continue}else ae={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(k=L=ae,S=_):L=L.next=ae,Fe.lanes|=Q,xr|=Q;ae=X.action,_a&&o(_,ae),_=X.hasEagerState?X.eagerState:o(_,ae)}else Q={lane:ae,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(k=L=Q,S=_):L=L.next=Q,Fe.lanes|=ae,xr|=ae;X=X.next}while(X!==null&&X!==r);if(L===null?S=_:L.next=k,!ln(_,n.memoizedState)&&(Jt=!0,ne&&(o=uo,o!==null)))throw o;n.memoizedState=_,n.baseState=S,n.baseQueue=L,u.lastRenderedState=_}return p===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function Cf(n){var r=Gt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=n;var u=o.dispatch,p=o.pending,_=r.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do _=n(_,S.action),S=S.next;while(S!==p);ln(_,r.memoizedState)||(Jt=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),o.lastRenderedState=_}return[_,u]}function zb(n,r,o){var u=Fe,p=Gt(),_=et;if(_){if(o===void 0)throw Error(s(407));o=o()}else o=r();var S=!ln((gt||p).memoizedState,o);if(S&&(p.memoizedState=o,Jt=!0),p=p.queue,Tf(Ub.bind(null,u,p,n),[n]),p.getSnapshot!==r||S||Qt!==null&&Qt.memoizedState.tag&1){if(u.flags|=2048,_o(9,{destroy:void 0},Pb.bind(null,u,p,o,r),null),xt===null)throw Error(s(349));_||(Bs&127)!==0||Ib(u,r,o)}return o}function Ib(n,r,o){n.flags|=16384,n={getSnapshot:r,value:o},r=Fe.updateQueue,r===null?(r=Ru(),Fe.updateQueue=r,r.stores=[n]):(o=r.stores,o===null?r.stores=[n]:o.push(n))}function Pb(n,r,o,u){r.value=o,r.getSnapshot=u,Hb(r)&&Fb(n)}function Ub(n,r,o){return o(function(){Hb(r)&&Fb(n)})}function Hb(n){var r=n.getSnapshot;n=n.value;try{var o=r();return!ln(n,o)}catch{return!0}}function Fb(n){var r=la(n,2);r!==null&&Ji(r,n,2)}function kf(n){var r=Pi();if(typeof n=="function"){var o=n;if(n=o(),_a){yn(!0);try{o()}finally{yn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zs,lastRenderedState:n},r}function $b(n,r,o,u){return n.baseState=o,Ef(n,gt,typeof u=="function"?u:zs)}function qN(n,r,o,u,p){if(Bu(n))throw Error(s(485));if(n=r.action,n!==null){var _={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){_.listeners.push(S)}};N.T!==null?o(!0):_.isTransition=!1,u(_),o=r.pending,o===null?(_.next=r.pending=_,Vb(r,_)):(_.next=o.next,r.pending=o.next=_)}}function Vb(n,r){var o=r.action,u=r.payload,p=n.state;if(r.isTransition){var _=N.T,S={};N.T=S;try{var k=o(p,u),L=N.S;L!==null&&L(S,k),qb(n,r,k)}catch(X){Nf(n,r,X)}finally{_!==null&&S.types!==null&&(_.types=S.types),N.T=_}}else try{_=o(p,u),qb(n,r,_)}catch(X){Nf(n,r,X)}}function qb(n,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){Kb(n,r,u)},function(u){return Nf(n,r,u)}):Kb(n,r,o)}function Kb(n,r,o){r.status="fulfilled",r.value=o,Gb(r),n.state=o,r=n.pending,r!==null&&(o=r.next,o===r?n.pending=null:(o=o.next,r.next=o,Vb(n,o)))}function Nf(n,r,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=o,Gb(r),r=r.next;while(r!==u)}n.action=null}function Gb(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Wb(n,r){return r}function Yb(n,r){if(et){var o=xt.formState;if(o!==null){e:{var u=Fe;if(et){if(kt){t:{for(var p=kt,_=kn;p.nodeType!==8;){if(!_){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}_=p.data,p=_==="F!"||_==="F"?p:null}if(p){kt=Tn(p.nextSibling),u=p.data==="F!";break e}}dr(u)}u=!1}u&&(r=o[0])}}return o=Pi(),o.memoizedState=o.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wb,lastRenderedState:r},o.queue=u,o=mv.bind(null,Fe,u),u.dispatch=o,u=kf(!1),_=Of.bind(null,Fe,!1,u.queue),u=Pi(),p={state:r,dispatch:null,action:n,pending:null},u.queue=p,o=qN.bind(null,Fe,p,_,o),p.dispatch=o,u.memoizedState=n,[r,o,!1]}function Xb(n){var r=Gt();return Zb(r,gt,n)}function Zb(n,r,o){if(r=Ef(n,r,Wb)[0],n=Ou(zs)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Al(r)}catch(S){throw S===ho?wu:S}else u=r;r=Gt();var p=r.queue,_=p.dispatch;return o!==r.memoizedState&&(Fe.flags|=2048,_o(9,{destroy:void 0},KN.bind(null,p,o),null)),[u,_,n]}function KN(n,r){n.action=r}function Qb(n){var r=Gt(),o=gt;if(o!==null)return Zb(r,o,n);Gt(),r=r.memoizedState,o=Gt();var u=o.queue.dispatch;return o.memoizedState=n,[r,u,!1]}function _o(n,r,o,u){return n={tag:n,create:o,deps:u,inst:r,next:null},r=Fe.updateQueue,r===null&&(r=Ru(),Fe.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,r.lastEffect=n),n}function Jb(){return Gt().memoizedState}function Lu(n,r,o,u){var p=Pi();Fe.flags|=n,p.memoizedState=_o(1|r,{destroy:void 0},o,u===void 0?null:u)}function ju(n,r,o,u){var p=Gt();u=u===void 0?null:u;var _=p.memoizedState.inst;gt!==null&&u!==null&&bf(u,gt.memoizedState.deps)?p.memoizedState=_o(r,_,o,u):(Fe.flags|=n,p.memoizedState=_o(1|r,_,o,u))}function ev(n,r){Lu(8390656,8,n,r)}function Tf(n,r){ju(2048,8,n,r)}function GN(n){Fe.flags|=4;var r=Fe.updateQueue;if(r===null)r=Ru(),Fe.updateQueue=r,r.events=[n];else{var o=r.events;o===null?r.events=[n]:o.push(n)}}function tv(n){var r=Gt().memoizedState;return GN({ref:r,nextImpl:n}),function(){if((ct&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function iv(n,r){return ju(4,2,n,r)}function nv(n,r){return ju(4,4,n,r)}function sv(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 rv(n,r,o){o=o!=null?o.concat([n]):null,ju(4,4,sv.bind(null,r,n),o)}function Af(){}function av(n,r){var o=Gt();r=r===void 0?null:r;var u=o.memoizedState;return r!==null&&bf(r,u[1])?u[0]:(o.memoizedState=[n,r],n)}function ov(n,r){var o=Gt();r=r===void 0?null:r;var u=o.memoizedState;if(r!==null&&bf(r,u[1]))return u[0];if(u=n(),_a){yn(!0);try{n()}finally{yn(!1)}}return o.memoizedState=[u,r],u}function Mf(n,r,o){return o===void 0||(Bs&1073741824)!==0&&(Qe&261930)===0?n.memoizedState=r:(n.memoizedState=o,n=l1(),Fe.lanes|=n,xr|=n,o)}function lv(n,r,o,u){return ln(o,r)?o:mo.current!==null?(n=Mf(n,o,u),ln(n,r)||(Jt=!0),n):(Bs&42)===0||(Bs&1073741824)!==0&&(Qe&261930)===0?(Jt=!0,n.memoizedState=o):(n=l1(),Fe.lanes|=n,xr|=n,r)}function cv(n,r,o,u,p){var _=F.p;F.p=_!==0&&8>_?_:8;var S=N.T,k={};N.T=k,Of(n,!1,r,o);try{var L=p(),X=N.S;if(X!==null&&X(k,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ne=FN(L,u);Ml(n,r,ne,mn(n))}else Ml(n,r,u,mn(n))}catch(ae){Ml(n,r,{then:function(){},status:"rejected",reason:ae},mn())}finally{F.p=_,S!==null&&k.types!==null&&(S.types=k.types),N.T=S}}function WN(){}function Rf(n,r,o,u){if(n.tag!==5)throw Error(s(476));var p=uv(n).queue;cv(n,p,r,$,o===null?WN:function(){return hv(n),o(u)})}function uv(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zs,lastRenderedState:$},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zs,lastRenderedState:o},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function hv(n){var r=uv(n);r.next===null&&(r=n.alternate.memoizedState),Ml(n,r.next.queue,{},mn())}function Df(){return Ei(Gl)}function dv(){return Gt().memoizedState}function fv(){return Gt().memoizedState}function YN(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var o=mn();n=pr(o);var u=gr(r,n,o);u!==null&&(Ji(u,r,o),Cl(u,r,o)),r={cache:of()},n.payload=r;return}r=r.return}}function XN(n,r,o){var u=mn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Bu(n)?pv(r,o):(o=Yd(n,r,o,u),o!==null&&(Ji(o,n,u),gv(o,r,u)))}function mv(n,r,o){var u=mn();Ml(n,r,o,u)}function Ml(n,r,o,u){var p={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Bu(n))pv(r,p);else{var _=n.alternate;if(n.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var S=r.lastRenderedState,k=_(S,o);if(p.hasEagerState=!0,p.eagerState=k,ln(k,S))return gu(n,r,p,0),xt===null&&pu(),!1}catch{}if(o=Yd(n,r,p,u),o!==null)return Ji(o,n,u),gv(o,r,u),!0}return!1}function Of(n,r,o,u){if(u={lane:2,revertLane:hm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bu(n)){if(r)throw Error(s(479))}else r=Yd(n,o,u,2),r!==null&&Ji(r,n,2)}function Bu(n){var r=n.alternate;return n===Fe||r!==null&&r===Fe}function pv(n,r){po=Au=!0;var o=n.pending;o===null?r.next=r:(r.next=o.next,o.next=r),n.pending=r}function gv(n,r,o){if((o&4194048)!==0){var u=r.lanes;u&=n.pendingLanes,o|=u,r.lanes=o,je(n,o)}}var Rl={readContext:Ei,use:Du,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};Rl.useEffectEvent=zt;var _v={readContext:Ei,use:Du,useCallback:function(n,r){return Pi().memoizedState=[n,r===void 0?null:r],n},useContext:Ei,useEffect:ev,useImperativeHandle:function(n,r,o){o=o!=null?o.concat([n]):null,Lu(4194308,4,sv.bind(null,r,n),o)},useLayoutEffect:function(n,r){return Lu(4194308,4,n,r)},useInsertionEffect:function(n,r){Lu(4,2,n,r)},useMemo:function(n,r){var o=Pi();r=r===void 0?null:r;var u=n();if(_a){yn(!0);try{n()}finally{yn(!1)}}return o.memoizedState=[u,r],u},useReducer:function(n,r,o){var u=Pi();if(o!==void 0){var p=o(r);if(_a){yn(!0);try{o(r)}finally{yn(!1)}}}else p=r;return u.memoizedState=u.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},u.queue=n,n=n.dispatch=XN.bind(null,Fe,n),[u.memoizedState,n]},useRef:function(n){var r=Pi();return n={current:n},r.memoizedState=n},useState:function(n){n=kf(n);var r=n.queue,o=mv.bind(null,Fe,r);return r.dispatch=o,[n.memoizedState,o]},useDebugValue:Af,useDeferredValue:function(n,r){var o=Pi();return Mf(o,n,r)},useTransition:function(){var n=kf(!1);return n=cv.bind(null,Fe,n.queue,!0,!1),Pi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,o){var u=Fe,p=Pi();if(et){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),xt===null)throw Error(s(349));(Qe&127)!==0||Ib(u,r,o)}p.memoizedState=o;var _={value:o,getSnapshot:r};return p.queue=_,ev(Ub.bind(null,u,_,n),[n]),u.flags|=2048,_o(9,{destroy:void 0},Pb.bind(null,u,_,o,r),null),o},useId:function(){var n=Pi(),r=xt.identifierPrefix;if(et){var o=Qn,u=Zn;o=(u&~(1<<32-xi(u)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Mu++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=$N++,r="_"+r+"r_"+o.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Df,useFormState:Yb,useActionState:Yb,useOptimistic:function(n){var r=Pi();r.memoizedState=r.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Of.bind(null,Fe,!0,o),o.dispatch=r,[n,r]},useMemoCache:wf,useCacheRefresh:function(){return Pi().memoizedState=YN.bind(null,Fe)},useEffectEvent:function(n){var r=Pi(),o={impl:n};return r.memoizedState=o,function(){if((ct&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},Lf={readContext:Ei,use:Du,useCallback:av,useContext:Ei,useEffect:Tf,useImperativeHandle:rv,useInsertionEffect:iv,useLayoutEffect:nv,useMemo:ov,useReducer:Ou,useRef:Jb,useState:function(){return Ou(zs)},useDebugValue:Af,useDeferredValue:function(n,r){var o=Gt();return lv(o,gt.memoizedState,n,r)},useTransition:function(){var n=Ou(zs)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:Al(n),r]},useSyncExternalStore:zb,useId:dv,useHostTransitionStatus:Df,useFormState:Xb,useActionState:Xb,useOptimistic:function(n,r){var o=Gt();return $b(o,gt,n,r)},useMemoCache:wf,useCacheRefresh:fv};Lf.useEffectEvent=tv;var bv={readContext:Ei,use:Du,useCallback:av,useContext:Ei,useEffect:Tf,useImperativeHandle:rv,useInsertionEffect:iv,useLayoutEffect:nv,useMemo:ov,useReducer:Cf,useRef:Jb,useState:function(){return Cf(zs)},useDebugValue:Af,useDeferredValue:function(n,r){var o=Gt();return gt===null?Mf(o,n,r):lv(o,gt.memoizedState,n,r)},useTransition:function(){var n=Cf(zs)[0],r=Gt().memoizedState;return[typeof n=="boolean"?n:Al(n),r]},useSyncExternalStore:zb,useId:dv,useHostTransitionStatus:Df,useFormState:Qb,useActionState:Qb,useOptimistic:function(n,r){var o=Gt();return gt!==null?$b(o,gt,n,r):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:wf,useCacheRefresh:fv};bv.useEffectEvent=tv;function jf(n,r,o,u){r=n.memoizedState,o=o(u,r),o=o==null?r:b({},r,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var Bf={enqueueSetState:function(n,r,o){n=n._reactInternals;var u=mn(),p=pr(u);p.payload=r,o!=null&&(p.callback=o),r=gr(n,p,u),r!==null&&(Ji(r,n,u),Cl(r,n,u))},enqueueReplaceState:function(n,r,o){n=n._reactInternals;var u=mn(),p=pr(u);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=gr(n,p,u),r!==null&&(Ji(r,n,u),Cl(r,n,u))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var o=mn(),u=pr(o);u.tag=2,r!=null&&(u.callback=r),r=gr(n,u,o),r!==null&&(Ji(r,n,o),Cl(r,n,o))}};function vv(n,r,o,u,p,_,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,_,S):r.prototype&&r.prototype.isPureReactComponent?!_l(o,u)||!_l(p,_):!0}function yv(n,r,o,u){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,u),r.state!==n&&Bf.enqueueReplaceState(r,r.state,null)}function ba(n,r){var o=r;if("ref"in r){o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}if(n=n.defaultProps){o===r&&(o=b({},o));for(var p in n)o[p]===void 0&&(o[p]=n[p])}return o}function xv(n){mu(n)}function Sv(n){console.error(n)}function wv(n){mu(n)}function zu(n,r){try{var o=n.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Ev(n,r,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function zf(n,r,o){return o=pr(o),o.tag=3,o.payload={element:null},o.callback=function(){zu(n,r)},o}function Cv(n){return n=pr(n),n.tag=3,n}function kv(n,r,o,u){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var _=u.value;n.payload=function(){return p(_)},n.callback=function(){Ev(r,o,u)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){Ev(r,o,u),typeof p!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function ZN(n,r,o,u,p){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=o.alternate,r!==null&&lo(r,o,p,!0),o=un.current,o!==null){switch(o.tag){case 31:case 13:return Nn===null?Yu():o.alternate===null&&It===0&&(It=3),o.flags&=-257,o.flags|=65536,o.lanes=p,u===Eu?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([u]):r.add(u),lm(n,u,p)),!1;case 22:return o.flags|=65536,u===Eu?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([u]):o.add(u)),lm(n,u,p)),!1}throw Error(s(435,o.tag))}return lm(n,u,p),Yu(),!1}if(et)return r=un.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==tf&&(n=Error(s(422),{cause:u}),yl(wn(n,o)))):(u!==tf&&(r=Error(s(423),{cause:u}),yl(wn(r,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,u=wn(u,o),p=zf(n.stateNode,u,p),ff(n,p),It!==4&&(It=2)),!1;var _=Error(s(520),{cause:u});if(_=wn(_,o),Pl===null?Pl=[_]:Pl.push(_),It!==4&&(It=2),r===null)return!0;u=wn(u,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=zf(o.stateNode,u,n),ff(o,n),!1;case 1:if(r=o.type,_=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Sr===null||!Sr.has(_))))return o.flags|=65536,p&=-p,o.lanes|=p,p=Cv(p),kv(p,n,o,u),ff(o,p),!1}o=o.return}while(o!==null);return!1}var If=Error(s(461)),Jt=!1;function Ci(n,r,o,u){r.child=n===null?Mb(r,null,o,u):ga(r,n.child,o,u)}function Nv(n,r,o,u,p){o=o.render;var _=r.ref;if("ref"in u){var S={};for(var k in u)k!=="ref"&&(S[k]=u[k])}else S=u;return da(r),u=vf(n,r,o,S,_,p),k=yf(),n!==null&&!Jt?(xf(n,r,p),Is(n,r,p)):(et&&k&&Jd(r),r.flags|=1,Ci(n,r,u,p),r.child)}function Tv(n,r,o,u,p){if(n===null){var _=o.type;return typeof _=="function"&&!Xd(_)&&_.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=_,Av(n,r,_,u,p)):(n=bu(o.type,null,u,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(_=n.child,!Kf(n,p)){var S=_.memoizedProps;if(o=o.compare,o=o!==null?o:_l,o(S,u)&&n.ref===r.ref)return Is(n,r,p)}return r.flags|=1,n=Ds(_,u),n.ref=r.ref,n.return=r,r.child=n}function Av(n,r,o,u,p){if(n!==null){var _=n.memoizedProps;if(_l(_,u)&&n.ref===r.ref)if(Jt=!1,r.pendingProps=u=_,Kf(n,p))(n.flags&131072)!==0&&(Jt=!0);else return r.lanes=n.lanes,Is(n,r,p)}return Pf(n,r,o,u,p)}function Mv(n,r,o,u){var p=u.children,_=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(_=_!==null?_.baseLanes|o:o,n!==null){for(u=r.child=n.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~_}else u=0,r.child=null;return Rv(n,r,_,o,u)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Su(r,_!==null?_.cachePool:null),_!==null?Ob(r,_):pf(),Lb(r);else return u=r.lanes=536870912,Rv(n,r,_!==null?_.baseLanes|o:o,o,u)}else _!==null?(Su(r,_.cachePool),Ob(r,_),br(),r.memoizedState=null):(n!==null&&Su(r,null),pf(),br());return Ci(n,r,p,o),r.child}function Dl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Rv(n,r,o,u,p){var _=cf();return _=_===null?null:{parent:Zt._currentValue,pool:_},r.memoizedState={baseLanes:o,cachePool:_},n!==null&&Su(r,null),pf(),Lb(r),n!==null&&lo(n,r,u,!0),r.childLanes=p,null}function Iu(n,r){return r=Uu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function Dv(n,r,o){return ga(r,n.child,null,o),n=Iu(r,r.pendingProps),n.flags|=2,hn(r),r.memoizedState=null,n}function QN(n,r,o){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(et){if(u.mode==="hidden")return n=Iu(r,u),r.lanes=536870912,Dl(null,n);if(_f(r),(n=kt)?(n=V1(n,kn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ur!==null?{id:Zn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},o=pb(n),o.return=r,r.child=o,wi=r,kt=null)):n=null,n===null)throw dr(r);return r.lanes=536870912,null}return Iu(r,u)}var _=n.memoizedState;if(_!==null){var S=_.dehydrated;if(_f(r),p)if(r.flags&256)r.flags&=-257,r=Dv(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||lo(n,r,o,!1),p=(o&n.childLanes)!==0,Jt||p){if(u=xt,u!==null&&(S=$t(u,o),S!==0&&S!==_.retryLane))throw _.retryLane=S,la(n,S),Ji(u,n,S),If;Yu(),r=Dv(n,r,o)}else n=_.treeContext,kt=Tn(S.nextSibling),wi=r,et=!0,hr=null,kn=!1,n!==null&&bb(r,n),r=Iu(r,u),r.flags|=4096;return r}return n=Ds(n.child,{mode:u.mode,children:u.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Pu(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 Pf(n,r,o,u,p){return da(r),o=vf(n,r,o,u,void 0,p),u=yf(),n!==null&&!Jt?(xf(n,r,p),Is(n,r,p)):(et&&u&&Jd(r),r.flags|=1,Ci(n,r,o,p),r.child)}function Ov(n,r,o,u,p,_){return da(r),r.updateQueue=null,o=Bb(r,u,o,p),jb(n),u=yf(),n!==null&&!Jt?(xf(n,r,_),Is(n,r,_)):(et&&u&&Jd(r),r.flags|=1,Ci(n,r,o,_),r.child)}function Lv(n,r,o,u,p){if(da(r),r.stateNode===null){var _=so,S=o.contextType;typeof S=="object"&&S!==null&&(_=Ei(S)),_=new o(u,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Bf,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=u,_.state=r.memoizedState,_.refs={},hf(r),S=o.contextType,_.context=typeof S=="object"&&S!==null?Ei(S):so,_.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(jf(r,o,S,u),_.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(S=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),S!==_.state&&Bf.enqueueReplaceState(_,_.state,null),Nl(r,u,_,p),kl(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(n===null){_=r.stateNode;var k=r.memoizedProps,L=ba(o,k);_.props=L;var X=_.context,ne=o.contextType;S=so,typeof ne=="object"&&ne!==null&&(S=Ei(ne));var ae=o.getDerivedStateFromProps;ne=typeof ae=="function"||typeof _.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(k||X!==S)&&yv(r,_,u,S),mr=!1;var Q=r.memoizedState;_.state=Q,Nl(r,u,_,p),kl(),X=r.memoizedState,k||Q!==X||mr?(typeof ae=="function"&&(jf(r,o,ae,u),X=r.memoizedState),(L=mr||vv(r,o,L,u,Q,X,S))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=X),_.props=u,_.state=X,_.context=S,u=L):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{_=r.stateNode,df(n,r),S=r.memoizedProps,ne=ba(o,S),_.props=ne,ae=r.pendingProps,Q=_.context,X=o.contextType,L=so,typeof X=="object"&&X!==null&&(L=Ei(X)),k=o.getDerivedStateFromProps,(X=typeof k=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(S!==ae||Q!==L)&&yv(r,_,u,L),mr=!1,Q=r.memoizedState,_.state=Q,Nl(r,u,_,p),kl();var te=r.memoizedState;S!==ae||Q!==te||mr||n!==null&&n.dependencies!==null&&yu(n.dependencies)?(typeof k=="function"&&(jf(r,o,k,u),te=r.memoizedState),(ne=mr||vv(r,o,ne,u,Q,te,L)||n!==null&&n.dependencies!==null&&yu(n.dependencies))?(X||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(u,te,L),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(u,te,L)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=te),_.props=u,_.state=te,_.context=L,u=ne):(typeof _.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(r.flags|=1024),u=!1)}return _=u,Pu(n,r),u=(r.flags&128)!==0,_||u?(_=r.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,n!==null&&u?(r.child=ga(r,n.child,null,p),r.child=ga(r,null,o,p)):Ci(n,r,o,p),r.memoizedState=_.state,n=r.child):n=Is(n,r,p),n}function jv(n,r,o,u){return ua(),r.flags|=256,Ci(n,r,o,u),r.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hf(n){return{baseLanes:n,cachePool:Eb()}}function Ff(n,r,o){return n=n!==null?n.childLanes&~o:0,r&&(n|=fn),n}function Bv(n,r,o){var u=r.pendingProps,p=!1,_=(r.flags&128)!==0,S;if((S=_)||(S=n!==null&&n.memoizedState===null?!1:(Kt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,n===null){if(et){if(p?_r(r):br(),(n=kt)?(n=V1(n,kn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ur!==null?{id:Zn,overflow:Qn}:null,retryLane:536870912,hydrationErrors:null},o=pb(n),o.return=r,r.child=o,wi=r,kt=null)):n=null,n===null)throw dr(r);return Em(n)?r.lanes=32:r.lanes=536870912,null}var k=u.children;return u=u.fallback,p?(br(),p=r.mode,k=Uu({mode:"hidden",children:k},p),u=ca(u,p,o,null),k.return=r,u.return=r,k.sibling=u,r.child=k,u=r.child,u.memoizedState=Hf(o),u.childLanes=Ff(n,S,o),r.memoizedState=Uf,Dl(null,u)):(_r(r),$f(r,k))}var L=n.memoizedState;if(L!==null&&(k=L.dehydrated,k!==null)){if(_)r.flags&256?(_r(r),r.flags&=-257,r=Vf(n,r,o)):r.memoizedState!==null?(br(),r.child=n.child,r.flags|=128,r=null):(br(),k=u.fallback,p=r.mode,u=Uu({mode:"visible",children:u.children},p),k=ca(k,p,o,null),k.flags|=2,u.return=r,k.return=r,u.sibling=k,r.child=u,ga(r,n.child,null,o),u=r.child,u.memoizedState=Hf(o),u.childLanes=Ff(n,S,o),r.memoizedState=Uf,r=Dl(null,u));else if(_r(r),Em(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var X=S.dgst;S=X,u=Error(s(419)),u.stack="",u.digest=S,yl({value:u,source:null,stack:null}),r=Vf(n,r,o)}else if(Jt||lo(n,r,o,!1),S=(o&n.childLanes)!==0,Jt||S){if(S=xt,S!==null&&(u=$t(S,o),u!==0&&u!==L.retryLane))throw L.retryLane=u,la(n,u),Ji(S,n,u),If;wm(k)||Yu(),r=Vf(n,r,o)}else wm(k)?(r.flags|=192,r.child=n.child,r=null):(n=L.treeContext,kt=Tn(k.nextSibling),wi=r,et=!0,hr=null,kn=!1,n!==null&&bb(r,n),r=$f(r,u.children),r.flags|=4096);return r}return p?(br(),k=u.fallback,p=r.mode,L=n.child,X=L.sibling,u=Ds(L,{mode:"hidden",children:u.children}),u.subtreeFlags=L.subtreeFlags&65011712,X!==null?k=Ds(X,k):(k=ca(k,p,o,null),k.flags|=2),k.return=r,u.return=r,u.sibling=k,r.child=u,Dl(null,u),u=r.child,k=n.child.memoizedState,k===null?k=Hf(o):(p=k.cachePool,p!==null?(L=Zt._currentValue,p=p.parent!==L?{parent:L,pool:L}:p):p=Eb(),k={baseLanes:k.baseLanes|o,cachePool:p}),u.memoizedState=k,u.childLanes=Ff(n,S,o),r.memoizedState=Uf,Dl(n.child,u)):(_r(r),o=n.child,n=o.sibling,o=Ds(o,{mode:"visible",children:u.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 $f(n,r){return r=Uu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Uu(n,r){return n=cn(22,n,null,r),n.lanes=0,n}function Vf(n,r,o){return ga(r,n.child,null,o),n=$f(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function zv(n,r,o){n.lanes|=r;var u=n.alternate;u!==null&&(u.lanes|=r),rf(n.return,r,o)}function qf(n,r,o,u,p,_){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p,treeForkCount:_}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=u,S.tail=o,S.tailMode=p,S.treeForkCount=_)}function Iv(n,r,o){var u=r.pendingProps,p=u.revealOrder,_=u.tail;u=u.children;var S=Kt.current,k=(S&2)!==0;if(k?(S=S&1|2,r.flags|=128):S&=1,ce(Kt,S),Ci(n,r,u,o),u=et?vl:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&zv(n,o,r);else if(n.tag===19)zv(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&&Tu(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,_,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&Tu(n)===null){r.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}qf(r,!0,o,null,_,u);break;case"together":qf(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function Is(n,r,o){if(n!==null&&(r.dependencies=n.dependencies),xr|=r.lanes,(o&r.childLanes)===0)if(n!==null){if(lo(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=Ds(n,n.pendingProps),r.child=o,o.return=r;n.sibling!==null;)n=n.sibling,o=o.sibling=Ds(n,n.pendingProps),o.return=r;o.sibling=null}return r.child}function Kf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&yu(n)))}function JN(n,r,o){switch(r.tag){case 3:ze(r,r.stateNode.containerInfo),fr(r,Zt,n.memoizedState.cache),ua();break;case 27:case 5:st(r);break;case 4:ze(r,r.stateNode.containerInfo);break;case 10:fr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,_f(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(_r(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Bv(n,r,o):(_r(r),n=Is(n,r,o),n!==null?n.sibling:null);_r(r);break;case 19:var p=(n.flags&128)!==0;if(u=(o&r.childLanes)!==0,u||(lo(n,r,o,!1),u=(o&r.childLanes)!==0),p){if(u)return Iv(n,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ce(Kt,Kt.current),u)break;return null;case 22:return r.lanes=0,Mv(n,r,o,r.pendingProps);case 24:fr(r,Zt,n.memoizedState.cache)}return Is(n,r,o)}function Pv(n,r,o){if(n!==null)if(n.memoizedProps!==r.pendingProps)Jt=!0;else{if(!Kf(n,o)&&(r.flags&128)===0)return Jt=!1,JN(n,r,o);Jt=(n.flags&131072)!==0}else Jt=!1,et&&(r.flags&1048576)!==0&&_b(r,vl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(n=ma(r.elementType),r.type=n,typeof n=="function")Xd(n)?(u=ba(n,u),r.tag=1,r=Lv(null,r,n,u,o)):(r.tag=0,r=Pf(null,r,n,u,o));else{if(n!=null){var p=n.$$typeof;if(p===R){r.tag=11,r=Nv(null,r,n,u,o);break e}else if(p===j){r.tag=14,r=Tv(null,r,n,u,o);break e}}throw r=ee(n)||n,Error(s(306,r,""))}}return r;case 0:return Pf(n,r,r.type,r.pendingProps,o);case 1:return u=r.type,p=ba(u,r.pendingProps),Lv(n,r,u,p,o);case 3:e:{if(ze(r,r.stateNode.containerInfo),n===null)throw Error(s(387));u=r.pendingProps;var _=r.memoizedState;p=_.element,df(n,r),Nl(r,u,null,o);var S=r.memoizedState;if(u=S.cache,fr(r,Zt,u),u!==_.cache&&af(r,[Zt],o,!0),kl(),u=S.element,_.isDehydrated)if(_={element:u,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=jv(n,r,u,o);break e}else if(u!==p){p=wn(Error(s(424)),r),yl(p),r=jv(n,r,u,o);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,kt=Tn(n.firstChild),wi=r,et=!0,hr=null,kn=!0,o=Mb(r,null,u,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ua(),u===p){r=Is(n,r,o);break e}Ci(n,r,u,o)}r=r.child}return r;case 26:return Pu(n,r),n===null?(o=X1(r.type,null,r.pendingProps,null))?r.memoizedState=o:et||(o=r.type,n=r.pendingProps,u=ih(ge.current).createElement(o),u[Vt]=r,u[Di]=n,ki(u,o,n),Yt(u),r.stateNode=u):r.memoizedState=X1(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return st(r),n===null&&et&&(u=r.stateNode=G1(r.type,r.pendingProps,ge.current),wi=r,kn=!0,p=kt,kr(r.type)?(Cm=p,kt=Tn(u.firstChild)):kt=p),Ci(n,r,r.pendingProps.children,o),Pu(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&et&&((p=u=kt)&&(u=AT(u,r.type,r.pendingProps,kn),u!==null?(r.stateNode=u,wi=r,kt=Tn(u.firstChild),kn=!1,p=!0):p=!1),p||dr(r)),st(r),p=r.type,_=r.pendingProps,S=n!==null?n.memoizedProps:null,u=_.children,ym(p,_)?u=null:S!==null&&ym(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=vf(n,r,VN,null,null,o),Gl._currentValue=p),Pu(n,r),Ci(n,r,u,o),r.child;case 6:return n===null&&et&&((n=o=kt)&&(o=MT(o,r.pendingProps,kn),o!==null?(r.stateNode=o,wi=r,kt=null,n=!0):n=!1),n||dr(r)),null;case 13:return Bv(n,r,o);case 4:return ze(r,r.stateNode.containerInfo),u=r.pendingProps,n===null?r.child=ga(r,null,u,o):Ci(n,r,u,o),r.child;case 11:return Nv(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 u=r.pendingProps,fr(r,r.type,u.value),Ci(n,r,u.children,o),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,da(r),p=Ei(p),u=u(p),r.flags|=1,Ci(n,r,u,o),r.child;case 14:return Tv(n,r,r.type,r.pendingProps,o);case 15:return Av(n,r,r.type,r.pendingProps,o);case 19:return Iv(n,r,o);case 31:return QN(n,r,o);case 22:return Mv(n,r,o,r.pendingProps);case 24:return da(r),u=Ei(Zt),n===null?(p=cf(),p===null&&(p=xt,_=of(),p.pooledCache=_,_.refCount++,_!==null&&(p.pooledCacheLanes|=o),p=_),r.memoizedState={parent:u,cache:p},hf(r),fr(r,Zt,p)):((n.lanes&o)!==0&&(df(n,r),Nl(r,null,null,o),kl()),p=n.memoizedState,_=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),fr(r,Zt,u)):(u=_.cache,fr(r,Zt,u),u!==p.cache&&af(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 Ps(n){n.flags|=4}function Gf(n,r,o,u,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(d1())n.flags|=8192;else throw pa=Eu,uf}else n.flags&=-16777217}function Uv(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!ty(r))if(d1())n.flags|=8192;else throw pa=Eu,uf}function Hu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ie():536870912,n.lanes|=r,xo|=r)}function Ol(n,r){if(!et)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 u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function Nt(n){var r=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(r)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=u,n.childLanes=o,r}function eT(n,r,o){var u=r.pendingProps;switch(ef(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(r),null;case 1:return Nt(r),null;case 3:return o=r.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),js(Zt),Ee(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(oo(r)?Ps(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,nf())),Nt(r),null;case 26:var p=r.type,_=r.memoizedState;return n===null?(Ps(r),_!==null?(Nt(r),Uv(r,_)):(Nt(r),Gf(r,p,null,u,o))):_?_!==n.memoizedState?(Ps(r),Nt(r),Uv(r,_)):(Nt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ps(r),Nt(r),Gf(r,p,n,u,o)),null;case 27:if(ot(r),o=ge.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==u&&Ps(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return Nt(r),null}n=le.current,oo(r)?vb(r):(n=G1(p,u,o),r.stateNode=n,Ps(r))}return Nt(r),null;case 5:if(ot(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==u&&Ps(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return Nt(r),null}if(_=le.current,oo(r))vb(r);else{var S=ih(ge.current);switch(_){case 1:_=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:_=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":_=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":_=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":_=S.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?_.multiple=!0:u.size&&(_.size=u.size);break;default:_=typeof u.is=="string"?S.createElement(p,{is:u.is}):S.createElement(p)}}_[Vt]=r,_[Di]=u;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)_.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=_;e:switch(ki(_,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ps(r)}}return Nt(r),Gf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,o),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==u&&Ps(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(s(166));if(n=ge.current,oo(r)){if(n=r.stateNode,o=r.memoizedProps,u=null,p=wi,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}n[Vt]=r,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||B1(n.nodeValue,o)),n||dr(r,!0)}else n=ih(n).createTextNode(u),n[Vt]=r,r.stateNode=n}return Nt(r),null;case 31:if(o=r.memoizedState,n===null||n.memoizedState!==null){if(u=oo(r),o!==null){if(n===null){if(!u)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[Vt]=r}else ua(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),n=!1}else o=nf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return r.flags&256?(hn(r),r):(hn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Nt(r),null;case 13:if(u=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=oo(r),u!==null&&u.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 ua(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),p=!1}else p=nf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(hn(r),r):(hn(r),null)}return hn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),_=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(_=u.memoizedState.cachePool.pool),_!==p&&(u.flags|=2048)),o!==n&&o&&(r.child.flags|=8192),Hu(r,r.updateQueue),Nt(r),null);case 4:return Ee(),n===null&&pm(r.stateNode.containerInfo),Nt(r),null;case 10:return js(r.type),Nt(r),null;case 19:if(ie(Kt),u=r.memoizedState,u===null)return Nt(r),null;if(p=(r.flags&128)!==0,_=u.rendering,_===null)if(p)Ol(u,!1);else{if(It!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(_=Tu(n),_!==null){for(r.flags|=128,Ol(u,!1),n=_.updateQueue,r.updateQueue=n,Hu(r,n),r.subtreeFlags=0,n=o,o=r.child;o!==null;)mb(o,n),o=o.sibling;return ce(Kt,Kt.current&1|2),et&&Os(r,u.treeForkCount),r.child}n=n.sibling}u.tail!==null&&Ot()>Ku&&(r.flags|=128,p=!0,Ol(u,!1),r.lanes=4194304)}else{if(!p)if(n=Tu(_),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,Hu(r,n),Ol(u,!0),u.tail===null&&u.tailMode==="hidden"&&!_.alternate&&!et)return Nt(r),null}else 2*Ot()-u.renderingStartTime>Ku&&o!==536870912&&(r.flags|=128,p=!0,Ol(u,!1),r.lanes=4194304);u.isBackwards?(_.sibling=r.child,r.child=_):(n=u.last,n!==null?n.sibling=_:r.child=_,u.last=_)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Ot(),n.sibling=null,o=Kt.current,ce(Kt,p?o&1|2:o&1),et&&Os(r,u.treeForkCount),n):(Nt(r),null);case 22:case 23:return hn(r),gf(),u=r.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(o&536870912)!==0&&(r.flags&128)===0&&(Nt(r),r.subtreeFlags&6&&(r.flags|=8192)):Nt(r),o=r.updateQueue,o!==null&&Hu(r,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==o&&(r.flags|=2048),n!==null&&ie(fa),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),js(Zt),Nt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function tT(n,r){switch(ef(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return js(Zt),Ee(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return ot(r),null;case 31:if(r.memoizedState!==null){if(hn(r),r.alternate===null)throw Error(s(340));ua()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(hn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ua()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return ie(Kt),null;case 4:return Ee(),null;case 10:return js(r.type),null;case 22:case 23:return hn(r),gf(),n!==null&&ie(fa),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return js(Zt),null;case 25:return null;default:return null}}function Hv(n,r){switch(ef(r),r.tag){case 3:js(Zt),Ee();break;case 26:case 27:case 5:ot(r);break;case 4:Ee();break;case 31:r.memoizedState!==null&&hn(r);break;case 13:hn(r);break;case 19:ie(Kt);break;case 10:js(r.type);break;case 22:case 23:hn(r),gf(),n!==null&&ie(fa);break;case 24:js(Zt)}}function Ll(n,r){try{var o=r.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var p=u.next;o=p;do{if((o.tag&n)===n){u=void 0;var _=o.create,S=o.inst;u=_(),S.destroy=u}o=o.next}while(o!==p)}}catch(k){mt(r,r.return,k)}}function vr(n,r,o){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var _=p.next;u=_;do{if((u.tag&n)===n){var S=u.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,p=r;var L=o,X=k;try{X()}catch(ne){mt(p,L,ne)}}}u=u.next}while(u!==_)}}catch(ne){mt(r,r.return,ne)}}function Fv(n){var r=n.updateQueue;if(r!==null){var o=n.stateNode;try{Db(r,o)}catch(u){mt(n,n.return,u)}}}function $v(n,r,o){o.props=ba(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){mt(n,r,u)}}function jl(n,r){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(p){mt(n,r,p)}}function Jn(n,r){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(p){mt(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){mt(n,r,p)}else o.current=null}function Vv(n){var r=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(p){mt(n,n.return,p)}}function Wf(n,r,o){try{var u=n.stateNode;wT(u,n.type,o,r),u[Di]=r}catch(p){mt(n,n.return,p)}}function qv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&kr(n.type)||n.tag===4}function Yf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||qv(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&&kr(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 Xf(n,r,o){var u=n.tag;if(u===5||u===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=pe));else if(u!==4&&(u===27&&kr(n.type)&&(o=n.stateNode,r=null),n=n.child,n!==null))for(Xf(n,r,o),n=n.sibling;n!==null;)Xf(n,r,o),n=n.sibling}function Fu(n,r,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,r?o.insertBefore(n,r):o.appendChild(n);else if(u!==4&&(u===27&&kr(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(Fu(n,r,o),n=n.sibling;n!==null;)Fu(n,r,o),n=n.sibling}function Kv(n){var r=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);ki(r,u,o),r[Vt]=n,r[Di]=o}catch(_){mt(n,n.return,_)}}var Us=!1,ei=!1,Zf=!1,Gv=typeof WeakSet=="function"?WeakSet:Set,mi=null;function iT(n,r){if(n=n.containerInfo,bm=ch,n=rb(n),$d(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,_=u.focusNode;u=u.focusOffset;try{o.nodeType,_.nodeType}catch{o=null;break e}var S=0,k=-1,L=-1,X=0,ne=0,ae=n,Q=null;t:for(;;){for(var te;ae!==o||p!==0&&ae.nodeType!==3||(k=S+p),ae!==_||u!==0&&ae.nodeType!==3||(L=S+u),ae.nodeType===3&&(S+=ae.nodeValue.length),(te=ae.firstChild)!==null;)Q=ae,ae=te;for(;;){if(ae===n)break t;if(Q===o&&++X===p&&(k=S),Q===_&&++ne===u&&(L=S),(te=ae.nextSibling)!==null)break;ae=Q,Q=ae.parentNode}ae=te}o=k===-1||L===-1?null:{start:k,end:L}}else o=null}o=o||{start:0,end:0}}else o=null;for(vm={focusedElem:n,selectionRange:o},ch=!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,_=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&&_!==null){n=void 0,o=r,p=_.memoizedProps,_=_.memoizedState,u=o.stateNode;try{var Ce=ba(o.type,p);n=u.getSnapshotBeforeUpdate(Ce,_),u.__reactInternalSnapshotBeforeUpdate=n}catch(Oe){mt(o,o.return,Oe)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,o=n.nodeType,o===9)Sm(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Sm(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 Wv(n,r,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Fs(n,o),u&4&&Ll(5,o);break;case 1:if(Fs(n,o),u&4)if(n=o.stateNode,r===null)try{n.componentDidMount()}catch(S){mt(o,o.return,S)}else{var p=ba(o.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(S){mt(o,o.return,S)}}u&64&&Fv(o),u&512&&jl(o,o.return);break;case 3:if(Fs(n,o),u&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{Db(n,r)}catch(S){mt(o,o.return,S)}}break;case 27:r===null&&u&4&&Kv(o);case 26:case 5:Fs(n,o),r===null&&u&4&&Vv(o),u&512&&jl(o,o.return);break;case 12:Fs(n,o);break;case 31:Fs(n,o),u&4&&Zv(n,o);break;case 13:Fs(n,o),u&4&&Qv(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=hT.bind(null,o),RT(n,o))));break;case 22:if(u=o.memoizedState!==null||Us,!u){r=r!==null&&r.memoizedState!==null||ei,p=Us;var _=ei;Us=u,(ei=r)&&!_?$s(n,o,(o.subtreeFlags&8772)!==0):Fs(n,o),Us=p,ei=_}break;case 30:break;default:Fs(n,o)}}function Yv(n){var r=n.alternate;r!==null&&(n.alternate=null,Yv(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&rl(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,Yi=!1;function Hs(n,r,o){for(o=o.child;o!==null;)Xv(n,r,o),o=o.sibling}function Xv(n,r,o){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(ks,o)}catch{}switch(o.tag){case 26:ei||Jn(o,r),Hs(n,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ei||Jn(o,r);var u=Rt,p=Yi;kr(o.type)&&(Rt=o.stateNode,Yi=!1),Hs(n,r,o),Vl(o.stateNode),Rt=u,Yi=p;break;case 5:ei||Jn(o,r);case 6:if(u=Rt,p=Yi,Rt=null,Hs(n,r,o),Rt=u,Yi=p,Rt!==null)if(Yi)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(o.stateNode)}catch(_){mt(o,r,_)}else try{Rt.removeChild(o.stateNode)}catch(_){mt(o,r,_)}break;case 18:Rt!==null&&(Yi?(n=Rt,F1(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),Ao(n)):F1(Rt,o.stateNode));break;case 4:u=Rt,p=Yi,Rt=o.stateNode.containerInfo,Yi=!0,Hs(n,r,o),Rt=u,Yi=p;break;case 0:case 11:case 14:case 15:vr(2,o,r),ei||vr(4,o,r),Hs(n,r,o);break;case 1:ei||(Jn(o,r),u=o.stateNode,typeof u.componentWillUnmount=="function"&&$v(o,r,u)),Hs(n,r,o);break;case 21:Hs(n,r,o);break;case 22:ei=(u=ei)||o.memoizedState!==null,Hs(n,r,o),ei=u;break;default:Hs(n,r,o)}}function Zv(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Ao(n)}catch(o){mt(r,r.return,o)}}}function Qv(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Ao(n)}catch(o){mt(r,r.return,o)}}function nT(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Gv),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Gv),r;default:throw Error(s(435,n.tag))}}function $u(n,r){var o=nT(n);r.forEach(function(u){if(!o.has(u)){o.add(u);var p=dT.bind(null,n,u);u.then(p,p)}})}function Xi(n,r){var o=r.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u],_=n,S=r,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(kr(k.type)){Rt=k.stateNode,Yi=!1;break e}break;case 5:Rt=k.stateNode,Yi=!1;break e;case 3:case 4:Rt=k.stateNode.containerInfo,Yi=!0;break e}k=k.return}if(Rt===null)throw Error(s(160));Xv(_,S,p),Rt=null,Yi=!1,_=p.alternate,_!==null&&(_.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Jv(r,n),r=r.sibling}var $n=null;function Jv(n,r){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Xi(r,n),Zi(n),u&4&&(vr(3,n,n.return),Ll(3,n),vr(5,n,n.return));break;case 1:Xi(r,n),Zi(n),u&512&&(ei||o===null||Jn(o,o.return)),u&64&&Us&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var p=$n;if(Xi(r,n),Zi(n),u&512&&(ei||o===null||Jn(o,o.return)),u&4){var _=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":_=p.getElementsByTagName("title")[0],(!_||_[ia]||_[Vt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=p.createElement(u),p.head.insertBefore(_,p.querySelector("head > title"))),ki(_,u,o),_[Vt]=n,Yt(_),u=_;break e;case"link":var S=J1("link","href",p).get(u+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(_=S[k],_.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&_.getAttribute("rel")===(o.rel==null?null:o.rel)&&_.getAttribute("title")===(o.title==null?null:o.title)&&_.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}_=p.createElement(u),ki(_,u,o),p.head.appendChild(_);break;case"meta":if(S=J1("meta","content",p).get(u+(o.content||""))){for(k=0;k<S.length;k++)if(_=S[k],_.getAttribute("content")===(o.content==null?null:""+o.content)&&_.getAttribute("name")===(o.name==null?null:o.name)&&_.getAttribute("property")===(o.property==null?null:o.property)&&_.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&_.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}_=p.createElement(u),ki(_,u,o),p.head.appendChild(_);break;default:throw Error(s(468,u))}_[Vt]=n,Yt(_),u=_}n.stateNode=u}else ey(p,n.type,n.stateNode);else n.stateNode=Q1(p,u,n.memoizedProps);else _!==u?(_===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):_.count--,u===null?ey(p,n.type,n.stateNode):Q1(p,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Wf(n,n.memoizedProps,o.memoizedProps)}break;case 27:Xi(r,n),Zi(n),u&512&&(ei||o===null||Jn(o,o.return)),o!==null&&u&4&&Wf(n,n.memoizedProps,o.memoizedProps);break;case 5:if(Xi(r,n),Zi(n),u&512&&(ei||o===null||Jn(o,o.return)),n.flags&32){p=n.stateNode;try{Le(p,"")}catch(Ce){mt(n,n.return,Ce)}}u&4&&n.stateNode!=null&&(p=n.memoizedProps,Wf(n,p,o!==null?o.memoizedProps:p)),u&1024&&(Zf=!0);break;case 6:if(Xi(r,n),Zi(n),u&4){if(n.stateNode===null)throw Error(s(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(Ce){mt(n,n.return,Ce)}}break;case 3:if(rh=null,p=$n,$n=nh(r.containerInfo),Xi(r,n),$n=p,Zi(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Ao(r.containerInfo)}catch(Ce){mt(n,n.return,Ce)}Zf&&(Zf=!1,e1(n));break;case 4:u=$n,$n=nh(n.stateNode.containerInfo),Xi(r,n),Zi(n),$n=u;break;case 12:Xi(r,n),Zi(n);break;case 31:Xi(r,n),Zi(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,$u(n,u)));break;case 13:Xi(r,n),Zi(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(qu=Ot()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,$u(n,u)));break;case 22:p=n.memoizedState!==null;var L=o!==null&&o.memoizedState!==null,X=Us,ne=ei;if(Us=X||p,ei=ne||L,Xi(r,n),ei=ne,Us=X,Zi(n),u&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||L||Us||ei||va(n)),o=null,r=n;;){if(r.tag===5||r.tag===26){if(o===null){L=o=r;try{if(_=L.stateNode,p)S=_.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=L.stateNode;var ae=L.memoizedProps.style,Q=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;k.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ce){mt(L,L.return,Ce)}}}else if(r.tag===6){if(o===null){L=r;try{L.stateNode.nodeValue=p?"":L.memoizedProps}catch(Ce){mt(L,L.return,Ce)}}}else if(r.tag===18){if(o===null){L=r;try{var te=L.stateNode;p?$1(te,!0):$1(L.stateNode,!1)}catch(Ce){mt(L,L.return,Ce)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,$u(n,o))));break;case 19:Xi(r,n),Zi(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,$u(n,u)));break;case 30:break;case 21:break;default:Xi(r,n),Zi(n)}}function Zi(n){var r=n.flags;if(r&2){try{for(var o,u=n.return;u!==null;){if(qv(u)){o=u;break}u=u.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var p=o.stateNode,_=Yf(n);Fu(n,_,p);break;case 5:var S=o.stateNode;o.flags&32&&(Le(S,""),o.flags&=-33);var k=Yf(n);Fu(n,k,S);break;case 3:case 4:var L=o.stateNode.containerInfo,X=Yf(n);Xf(n,X,L);break;default:throw Error(s(161))}}catch(ne){mt(n,n.return,ne)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function e1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;e1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function Fs(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Wv(n,r.alternate,r),r=r.sibling}function va(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:vr(4,r,r.return),va(r);break;case 1:Jn(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&$v(r,r.return,o),va(r);break;case 27:Vl(r.stateNode);case 26:case 5:Jn(r,r.return),va(r);break;case 22:r.memoizedState===null&&va(r);break;case 30:va(r);break;default:va(r)}n=n.sibling}}function $s(n,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=n,_=r,S=_.flags;switch(_.tag){case 0:case 11:case 15:$s(p,_,o),Ll(4,_);break;case 1:if($s(p,_,o),u=_,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){mt(u,u.return,X)}if(u=_,p=u.updateQueue,p!==null){var k=u.stateNode;try{var L=p.shared.hiddenCallbacks;if(L!==null)for(p.shared.hiddenCallbacks=null,p=0;p<L.length;p++)Rb(L[p],k)}catch(X){mt(u,u.return,X)}}o&&S&64&&Fv(_),jl(_,_.return);break;case 27:Kv(_);case 26:case 5:$s(p,_,o),o&&u===null&&S&4&&Vv(_),jl(_,_.return);break;case 12:$s(p,_,o);break;case 31:$s(p,_,o),o&&S&4&&Zv(p,_);break;case 13:$s(p,_,o),o&&S&4&&Qv(p,_);break;case 22:_.memoizedState===null&&$s(p,_,o),jl(_,_.return);break;case 30:break;default:$s(p,_,o)}r=r.sibling}}function Qf(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&&xl(o))}function Jf(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&xl(n))}function Vn(n,r,o,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)t1(n,r,o,u),r=r.sibling}function t1(n,r,o,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Vn(n,r,o,u),p&2048&&Ll(9,r);break;case 1:Vn(n,r,o,u);break;case 3:Vn(n,r,o,u),p&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&xl(n)));break;case 12:if(p&2048){Vn(n,r,o,u),n=r.stateNode;try{var _=r.memoizedProps,S=_.id,k=_.onPostCommit;typeof k=="function"&&k(S,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(L){mt(r,r.return,L)}}else Vn(n,r,o,u);break;case 31:Vn(n,r,o,u);break;case 13:Vn(n,r,o,u);break;case 23:break;case 22:_=r.stateNode,S=r.alternate,r.memoizedState!==null?_._visibility&2?Vn(n,r,o,u):Bl(n,r):_._visibility&2?Vn(n,r,o,u):(_._visibility|=2,bo(n,r,o,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Qf(S,r);break;case 24:Vn(n,r,o,u),p&2048&&Jf(r.alternate,r);break;default:Vn(n,r,o,u)}}function bo(n,r,o,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=n,S=r,k=o,L=u,X=S.flags;switch(S.tag){case 0:case 11:case 15:bo(_,S,k,L,p),Ll(8,S);break;case 23:break;case 22:var ne=S.stateNode;S.memoizedState!==null?ne._visibility&2?bo(_,S,k,L,p):Bl(_,S):(ne._visibility|=2,bo(_,S,k,L,p)),p&&X&2048&&Qf(S.alternate,S);break;case 24:bo(_,S,k,L,p),p&&X&2048&&Jf(S.alternate,S);break;default:bo(_,S,k,L,p)}r=r.sibling}}function Bl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=n,u=r,p=u.flags;switch(u.tag){case 22:Bl(o,u),p&2048&&Qf(u.alternate,u);break;case 24:Bl(o,u),p&2048&&Jf(u.alternate,u);break;default:Bl(o,u)}r=r.sibling}}var zl=8192;function vo(n,r,o){if(n.subtreeFlags&zl)for(n=n.child;n!==null;)i1(n,r,o),n=n.sibling}function i1(n,r,o){switch(n.tag){case 26:vo(n,r,o),n.flags&zl&&n.memoizedState!==null&&$T(o,$n,n.memoizedState,n.memoizedProps);break;case 5:vo(n,r,o);break;case 3:case 4:var u=$n;$n=nh(n.stateNode.containerInfo),vo(n,r,o),$n=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=zl,zl=16777216,vo(n,r,o),zl=u):vo(n,r,o));break;default:vo(n,r,o)}}function n1(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 Il(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];mi=u,r1(u,n)}n1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)s1(n),n=n.sibling}function s1(n){switch(n.tag){case 0:case 11:case 15:Il(n),n.flags&2048&&vr(9,n,n.return);break;case 3:Il(n);break;case 12:Il(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Vu(n)):Il(n);break;default:Il(n)}}function Vu(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];mi=u,r1(u,n)}n1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:vr(8,r,r.return),Vu(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Vu(r));break;default:Vu(r)}n=n.sibling}}function r1(n,r){for(;mi!==null;){var o=mi;switch(o.tag){case 0:case 11:case 15:vr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:xl(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,mi=u;else e:for(o=n;mi!==null;){u=mi;var p=u.sibling,_=u.return;if(Yv(u),u===o){mi=null;break e}if(p!==null){p.return=_,mi=p;break e}mi=_}}}var sT={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}},rT=typeof WeakMap=="function"?WeakMap:Map,ct=0,xt=null,Ye=null,Qe=0,ft=0,dn=null,yr=!1,yo=!1,em=!1,Vs=0,It=0,xr=0,ya=0,tm=0,fn=0,xo=0,Pl=null,Qi=null,im=!1,qu=0,a1=0,Ku=1/0,Gu=null,Sr=null,ai=0,wr=null,So=null,qs=0,nm=0,sm=null,o1=null,Ul=0,rm=null;function mn(){return(ct&2)!==0&&Qe!==0?Qe&-Qe:N.T!==null?hm():Ga()}function l1(){if(fn===0)if((Qe&536870912)===0||et){var n=Hn;Hn<<=1,(Hn&3932160)===0&&(Hn=262144),fn=n}else fn=536870912;return n=un.current,n!==null&&(n.flags|=32),fn}function Ji(n,r,o){(n===xt&&(ft===2||ft===9)||n.cancelPendingCommit!==null)&&(wo(n,0),Er(n,Qe,fn,!1)),yt(n,o),((ct&2)===0||n!==xt)&&(n===xt&&((ct&2)===0&&(ya|=o),It===4&&Er(n,Qe,fn,!1)),es(n))}function c1(n,r,o){if((ct&6)!==0)throw Error(s(327));var u=!o&&(r&127)===0&&(r&n.expiredLanes)===0||se(n,r),p=u?lT(n,r):om(n,r,!0),_=u;do{if(p===0){yo&&!u&&Er(n,r,0,!1);break}else{if(o=n.current.alternate,_&&!aT(o)){p=om(n,r,!1),_=!1;continue}if(p===2){if(_=r,n.errorRecoveryDisabledLanes&_)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=Pl;var L=k.current.memoizedState.isDehydrated;if(L&&(wo(k,S).flags|=256),S=om(k,S,!1),S!==2){if(em&&!L){k.errorRecoveryDisabledLanes|=_,ya|=_,p=4;break e}_=Qi,Qi=p,_!==null&&(Qi===null?Qi=_:Qi.push.apply(Qi,_))}p=S}if(_=!1,p!==2)continue}}if(p===1){wo(n,0),Er(n,r,0,!0);break}e:{switch(u=n,_=p,_){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Er(u,r,fn,!yr);break e;case 2:Qi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=qu+300-Ot(),10<p)){if(Er(u,r,fn,!yr),B(u,0,!0)!==0)break e;qs=r,u.timeoutHandle=U1(u1.bind(null,u,o,Qi,Gu,im,r,fn,ya,xo,yr,_,"Throttled",-0,0),p);break e}u1(u,o,Qi,Gu,im,r,fn,ya,xo,yr,_,null,-0,0)}}break}while(!0);es(n)}function u1(n,r,o,u,p,_,S,k,L,X,ne,ae,Q,te){if(n.timeoutHandle=-1,ae=r.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pe},i1(r,_,ae);var Ce=(_&62914560)===_?qu-Ot():(_&4194048)===_?a1-Ot():0;if(Ce=VT(ae,Ce),Ce!==null){qs=_,n.cancelPendingCommit=Ce(b1.bind(null,n,r,_,o,u,p,S,k,L,ne,ae,null,Q,te)),Er(n,_,S,!X);return}}b1(n,r,_,o,u,p,S,k,L)}function aT(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 u=0;u<o.length;u++){var p=o[u],_=p.getSnapshot;p=p.value;try{if(!ln(_(),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 Er(n,r,o,u){r&=~tm,r&=~ya,n.suspendedLanes|=r,n.pingedLanes&=~r,u&&(n.warmLanes|=r),u=n.expirationTimes;for(var p=r;0<p;){var _=31-xi(p),S=1<<_;u[_]=-1,p&=~S}o!==0&&ye(n,o,r)}function Wu(){return(ct&6)===0?(Hl(0),!1):!0}function am(){if(Ye!==null){if(ft===0)var n=Ye.return;else n=Ye,Ls=ha=null,Sf(n),fo=null,wl=0,n=Ye;for(;n!==null;)Hv(n.alternate,n),n=n.return;Ye=null}}function wo(n,r){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,kT(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),qs=0,am(),xt=n,Ye=o=Ds(n.current,null),Qe=r,ft=0,dn=null,yr=!1,yo=se(n,r),em=!1,xo=fn=tm=ya=xr=It=0,Qi=Pl=null,im=!1,(r&8)!==0&&(r|=r&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=r;0<u;){var p=31-xi(u),_=1<<p;r|=n[p],u&=~_}return Vs=r,pu(),o}function h1(n,r){Fe=null,N.H=Rl,r===ho||r===wu?(r=Nb(),ft=3):r===uf?(r=Nb(),ft=4):ft=r===If?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,dn=r,Ye===null&&(It=1,zu(n,wn(r,n.current)))}function d1(){var n=un.current;return n===null?!0:(Qe&4194048)===Qe?Nn===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?n===Nn:!1}function f1(){var n=N.H;return N.H=Rl,n===null?Rl:n}function m1(){var n=N.A;return N.A=sT,n}function Yu(){It=4,yr||(Qe&4194048)!==Qe&&un.current!==null||(yo=!0),(xr&134217727)===0&&(ya&134217727)===0||xt===null||Er(xt,Qe,fn,!1)}function om(n,r,o){var u=ct;ct|=2;var p=f1(),_=m1();(xt!==n||Qe!==r)&&(Gu=null,wo(n,r)),r=!1;var S=It;e:do try{if(ft!==0&&Ye!==null){var k=Ye,L=dn;switch(ft){case 8:am(),S=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(r=!0);var X=ft;if(ft=0,dn=null,Eo(n,k,L,X),o&&yo){S=0;break e}break;default:X=ft,ft=0,dn=null,Eo(n,k,L,X)}}oT(),S=It;break}catch(ne){h1(n,ne)}while(!0);return r&&n.shellSuspendCounter++,Ls=ha=null,ct=u,N.H=p,N.A=_,Ye===null&&(xt=null,Qe=0,pu()),S}function oT(){for(;Ye!==null;)p1(Ye)}function lT(n,r){var o=ct;ct|=2;var u=f1(),p=m1();xt!==n||Qe!==r?(Gu=null,Ku=Ot()+500,wo(n,r)):yo=se(n,r);e:do try{if(ft!==0&&Ye!==null){r=Ye;var _=dn;t:switch(ft){case 1:ft=0,dn=null,Eo(n,r,_,1);break;case 2:case 9:if(Cb(_)){ft=0,dn=null,g1(r);break}r=function(){ft!==2&&ft!==9||xt!==n||(ft=7),es(n)},_.then(r,r);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Cb(_)?(ft=0,dn=null,g1(r)):(ft=0,dn=null,Eo(n,r,_,7));break;case 5:var S=null;switch(Ye.tag){case 26:S=Ye.memoizedState;case 5:case 27:var k=Ye;if(S?ty(S):k.stateNode.complete){ft=0,dn=null;var L=k.sibling;if(L!==null)Ye=L;else{var X=k.return;X!==null?(Ye=X,Xu(X)):Ye=null}break t}}ft=0,dn=null,Eo(n,r,_,5);break;case 6:ft=0,dn=null,Eo(n,r,_,6);break;case 8:am(),It=6;break e;default:throw Error(s(462))}}cT();break}catch(ne){h1(n,ne)}while(!0);return Ls=ha=null,N.H=u,N.A=p,ct=o,Ye!==null?0:(xt=null,Qe=0,pu(),It)}function cT(){for(;Ye!==null&&!tl();)p1(Ye)}function p1(n){var r=Pv(n.alternate,n,Vs);n.memoizedProps=n.pendingProps,r===null?Xu(n):Ye=r}function g1(n){var r=n,o=r.alternate;switch(r.tag){case 15:case 0:r=Ov(o,r,r.pendingProps,r.type,void 0,Qe);break;case 11:r=Ov(o,r,r.pendingProps,r.type.render,r.ref,Qe);break;case 5:Sf(r);default:Hv(o,r),r=Ye=mb(r,Vs),r=Pv(o,r,Vs)}n.memoizedProps=n.pendingProps,r===null?Xu(n):Ye=r}function Eo(n,r,o,u){Ls=ha=null,Sf(r),fo=null,wl=0;var p=r.return;try{if(ZN(n,p,r,o,Qe)){It=1,zu(n,wn(o,n.current)),Ye=null;return}}catch(_){if(p!==null)throw Ye=p,_;It=1,zu(n,wn(o,n.current)),Ye=null;return}r.flags&32768?(et||u===1?n=!0:yo||(Qe&536870912)!==0?n=!1:(yr=n=!0,(u===2||u===9||u===3||u===6)&&(u=un.current,u!==null&&u.tag===13&&(u.flags|=16384))),_1(r,n)):Xu(r)}function Xu(n){var r=n;do{if((r.flags&32768)!==0){_1(r,yr);return}n=r.return;var o=eT(r.alternate,r,Vs);if(o!==null){Ye=o;return}if(r=r.sibling,r!==null){Ye=r;return}Ye=r=n}while(r!==null);It===0&&(It=5)}function _1(n,r){do{var o=tT(n.alternate,n);if(o!==null){o.flags&=32767,Ye=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(n=n.sibling,n!==null)){Ye=n;return}Ye=n=o}while(n!==null);It=6,Ye=null}function b1(n,r,o,u,p,_,S,k,L){n.cancelPendingCommit=null;do Zu();while(ai!==0);if((ct&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(_=r.lanes|r.childLanes,_|=Wd,Ne(n,o,_,S,k,L),n===xt&&(Ye=xt=null,Qe=0),So=r,wr=n,qs=o,nm=_,sm=p,o1=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,fT(Cs,function(){return w1(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=N.T,N.T=null,p=F.p,F.p=2,S=ct,ct|=4;try{iT(n,r,o)}finally{ct=S,F.p=p,N.T=u}}ai=1,v1(),y1(),x1()}}function v1(){if(ai===1){ai=0;var n=wr,r=So,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=N.T,N.T=null;var u=F.p;F.p=2;var p=ct;ct|=4;try{Jv(r,n);var _=vm,S=rb(n.containerInfo),k=_.focusedElem,L=_.selectionRange;if(S!==k&&k&&k.ownerDocument&&sb(k.ownerDocument.documentElement,k)){if(L!==null&&$d(k)){var X=L.start,ne=L.end;if(ne===void 0&&(ne=X),"selectionStart"in k)k.selectionStart=X,k.selectionEnd=Math.min(ne,k.value.length);else{var ae=k.ownerDocument||document,Q=ae&&ae.defaultView||window;if(Q.getSelection){var te=Q.getSelection(),Ce=k.textContent.length,Oe=Math.min(L.start,Ce),bt=L.end===void 0?Oe:Math.min(L.end,Ce);!te.extend&&Oe>bt&&(S=bt,bt=Oe,Oe=S);var V=nb(k,Oe),I=nb(k,bt);if(V&&I&&(te.rangeCount!==1||te.anchorNode!==V.node||te.anchorOffset!==V.offset||te.focusNode!==I.node||te.focusOffset!==I.offset)){var Y=ae.createRange();Y.setStart(V.node,V.offset),te.removeAllRanges(),Oe>bt?(te.addRange(Y),te.extend(I.node,I.offset)):(Y.setEnd(I.node,I.offset),te.addRange(Y))}}}}for(ae=[],te=k;te=te.parentNode;)te.nodeType===1&&ae.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ae.length;k++){var re=ae[k];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}ch=!!bm,vm=bm=null}finally{ct=p,F.p=u,N.T=o}}n.current=r,ai=2}}function y1(){if(ai===2){ai=0;var n=wr,r=So,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=N.T,N.T=null;var u=F.p;F.p=2;var p=ct;ct|=4;try{Wv(n,r.alternate,r)}finally{ct=p,F.p=u,N.T=o}}ai=3}}function x1(){if(ai===4||ai===3){ai=0,$a();var n=wr,r=So,o=qs,u=o1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?ai=5:(ai=0,So=wr=null,S1(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Sr=null),Ns(o),r=r.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(ks,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=N.T,p=F.p,F.p=2,N.T=null;try{for(var _=n.onRecoverableError,S=0;S<u.length;S++){var k=u[S];_(k.value,{componentStack:k.stack})}}finally{N.T=r,F.p=p}}(qs&3)!==0&&Zu(),es(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===rm?Ul++:(Ul=0,rm=n):Ul=0,Hl(0)}}function S1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,xl(r)))}function Zu(){return v1(),y1(),x1(),w1()}function w1(){if(ai!==5)return!1;var n=wr,r=nm;nm=0;var o=Ns(qs),u=N.T,p=F.p;try{F.p=32>o?32:o,N.T=null,o=sm,sm=null;var _=wr,S=qs;if(ai=0,So=wr=null,qs=0,(ct&6)!==0)throw Error(s(331));var k=ct;if(ct|=4,s1(_.current),t1(_,_.current,S,o),ct=k,Hl(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(ks,_)}catch{}return!0}finally{F.p=p,N.T=u,S1(n,r)}}function E1(n,r,o){r=wn(o,r),r=zf(n.stateNode,r,2),n=gr(n,r,2),n!==null&&(yt(n,2),es(n))}function mt(n,r,o){if(n.tag===3)E1(n,n,o);else for(;r!==null;){if(r.tag===3){E1(r,n,o);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Sr===null||!Sr.has(u))){n=wn(o,n),o=Cv(2),u=gr(r,o,2),u!==null&&(kv(o,u,r,n),yt(u,2),es(u));break}}r=r.return}}function lm(n,r,o){var u=n.pingCache;if(u===null){u=n.pingCache=new rT;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(o)||(em=!0,p.add(o),n=uT.bind(null,n,r,o),r.then(n,n))}function uT(n,r,o){var u=n.pingCache;u!==null&&u.delete(r),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,xt===n&&(Qe&o)===o&&(It===4||It===3&&(Qe&62914560)===Qe&&300>Ot()-qu?(ct&2)===0&&wo(n,0):tm|=o,xo===Qe&&(xo=0)),es(n)}function C1(n,r){r===0&&(r=Ie()),n=la(n,r),n!==null&&(yt(n,r),es(n))}function hT(n){var r=n.memoizedState,o=0;r!==null&&(o=r.retryLane),C1(n,o)}function dT(n,r){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,p=n.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(r),C1(n,o)}function fT(n,r){return ir(n,r)}var Qu=null,Co=null,cm=!1,Ju=!1,um=!1,Cr=0;function es(n){n!==Co&&n.next===null&&(Co===null?Qu=Co=n:Co=Co.next=n),Ju=!0,cm||(cm=!0,pT())}function Hl(n,r){if(!um&&Ju){um=!0;do for(var o=!1,u=Qu;u!==null;){if(n!==0){var p=u.pendingLanes;if(p===0)var _=0;else{var S=u.suspendedLanes,k=u.pingedLanes;_=(1<<31-xi(42|n)+1)-1,_&=p&~(S&~k),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(o=!0,A1(u,_))}else _=Qe,_=B(u,u===xt?_:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(_&3)===0||se(u,_)||(o=!0,A1(u,_));u=u.next}while(o);um=!1}}function mT(){k1()}function k1(){Ju=cm=!1;var n=0;Cr!==0&&CT()&&(n=Cr);for(var r=Ot(),o=null,u=Qu;u!==null;){var p=u.next,_=N1(u,r);_===0?(u.next=null,o===null?Qu=p:o.next=p,p===null&&(Co=o)):(o=u,(n!==0||(_&3)!==0)&&(Ju=!0)),u=p}ai!==0&&ai!==5||Hl(n),Cr!==0&&(Cr=0)}function N1(n,r){for(var o=n.suspendedLanes,u=n.pingedLanes,p=n.expirationTimes,_=n.pendingLanes&-62914561;0<_;){var S=31-xi(_),k=1<<S,L=p[S];L===-1?((k&o)===0||(k&u)!==0)&&(p[S]=_e(k,r)):L<=r&&(n.expiredLanes|=k),_&=~k}if(r=xt,o=Qe,o=B(n,n===r?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===r&&(ft===2||ft===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Ss(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||se(n,o)){if(r=o&-o,r===n.callbackPriority)return r;switch(u!==null&&Ss(u),Ns(o)){case 2:case 8:o=Es;break;case 32:o=Cs;break;case 268435456:o=nr;break;default:o=Cs}return u=T1.bind(null,n),o=ir(o,u),n.callbackPriority=r,n.callbackNode=o,r}return u!==null&&u!==null&&Ss(u),n.callbackPriority=2,n.callbackNode=null,2}function T1(n,r){if(ai!==0&&ai!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Zu()&&n.callbackNode!==o)return null;var u=Qe;return u=B(n,n===xt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(c1(n,u,r),N1(n,Ot()),n.callbackNode!=null&&n.callbackNode===o?T1.bind(null,n):null)}function A1(n,r){if(Zu())return null;c1(n,r,!0)}function pT(){NT(function(){(ct&6)!==0?ir(yi,mT):k1()})}function hm(){if(Cr===0){var n=co;n===0&&(n=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Cr=n}return Cr}function M1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:lr(""+n)}function R1(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 gT(n,r,o,u,p){if(r==="submit"&&o&&o.stateNode===p){var _=M1((p[Di]||null).action),S=u.submitter;S&&(r=(r=S[Di]||null)?M1(r.formAction):S.getAttribute("formAction"),r!==null&&(_=r,S=null));var k=new hu("action","action",null,u,p);n.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Cr!==0){var L=S?R1(p,S):new FormData(p);Rf(o,{pending:!0,data:L,method:p.method,action:_},null,L)}}else typeof _=="function"&&(k.preventDefault(),L=S?R1(p,S):new FormData(p),Rf(o,{pending:!0,data:L,method:p.method,action:_},_,L))},currentTarget:p}]})}}for(var dm=0;dm<Gd.length;dm++){var fm=Gd[dm],_T=fm.toLowerCase(),bT=fm[0].toUpperCase()+fm.slice(1);Fn(_T,"on"+bT)}Fn(lb,"onAnimationEnd"),Fn(cb,"onAnimationIteration"),Fn(ub,"onAnimationStart"),Fn("dblclick","onDoubleClick"),Fn("focusin","onFocus"),Fn("focusout","onBlur"),Fn(LN,"onTransitionRun"),Fn(jN,"onTransitionStart"),Fn(BN,"onTransitionCancel"),Fn(hb,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),As("onBeforeInput",["compositionend","keypress","textInput","paste"]),As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fl="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(" "),vT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fl));function D1(n,r){r=(r&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],p=u.event;u=u.listeners;e:{var _=void 0;if(r)for(var S=u.length-1;0<=S;S--){var k=u[S],L=k.instance,X=k.currentTarget;if(k=k.listener,L!==_&&p.isPropagationStopped())break e;_=k,p.currentTarget=X;try{_(p)}catch(ne){mu(ne)}p.currentTarget=null,_=L}else for(S=0;S<u.length;S++){if(k=u[S],L=k.instance,X=k.currentTarget,k=k.listener,L!==_&&p.isPropagationStopped())break e;_=k,p.currentTarget=X;try{_(p)}catch(ne){mu(ne)}p.currentTarget=null,_=L}}}}function Xe(n,r){var o=r[sl];o===void 0&&(o=r[sl]=new Set);var u=n+"__bubble";o.has(u)||(O1(r,n,2,!1),o.add(u))}function mm(n,r,o){var u=0;r&&(u|=4),O1(o,n,u,r)}var eh="_reactListening"+Math.random().toString(36).slice(2);function pm(n){if(!n[eh]){n[eh]=!0,nu.forEach(function(o){o!=="selectionchange"&&(vT.has(o)||mm(o,!1,n),mm(o,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[eh]||(r[eh]=!0,mm("selectionchange",!1,r))}}function O1(n,r,o,u){switch(ly(r)){case 2:var p=GT;break;case 8:p=WT;break;default:p=Mm}o=p.bind(null,r,o,n),p=void 0,!Ld||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?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 gm(n,r,o,u,p){var _=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var k=u.stateNode.containerInfo;if(k===p)break;if(S===4)for(S=u.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;k!==null;){if(S=Ii(k),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){u=_=S;continue e}k=k.parentNode}}u=u.return}ou(function(){var X=_,ne=He(o),ae=[];e:{var Q=db.get(n);if(Q!==void 0){var te=hu,Ce=n;switch(n){case"keypress":if(cu(o)===0)break e;case"keydown":case"keyup":te=dN;break;case"focusin":Ce="focus",te=Id;break;case"focusout":Ce="blur",te=Id;break;case"beforeblur":case"afterblur":te=Id;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":te=H_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=eN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=pN;break;case lb:case cb:case ub:te=nN;break;case hb:te=_N;break;case"scroll":case"scrollend":te=Q3;break;case"wheel":te=vN;break;case"copy":case"cut":case"paste":te=rN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=$_;break;case"toggle":case"beforetoggle":te=xN}var Oe=(r&4)!==0,bt=!Oe&&(n==="scroll"||n==="scrollend"),V=Oe?Q!==null?Q+"Capture":null:Q;Oe=[];for(var I=X,Y;I!==null;){var re=I;if(Y=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Y===null||V===null||(re=ul(I,V),re!=null&&Oe.push($l(I,re,Y))),bt)break;I=I.return}0<Oe.length&&(Q=new te(Q,Ce,null,o,ne),ae.push({event:Q,listeners:Oe}))}}if((r&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",te=n==="mouseout"||n==="pointerout",Q&&o!==Te&&(Ce=o.relatedTarget||o.fromElement)&&(Ii(Ce)||Ce[sr]))break e;if((te||Q)&&(Q=ne.window===ne?ne:(Q=ne.ownerDocument)?Q.defaultView||Q.parentWindow:window,te?(Ce=o.relatedTarget||o.toElement,te=X,Ce=Ce?Ii(Ce):null,Ce!==null&&(bt=l(Ce),Oe=Ce.tag,Ce!==bt||Oe!==5&&Oe!==27&&Oe!==6)&&(Ce=null)):(te=null,Ce=X),te!==Ce)){if(Oe=H_,re="onMouseLeave",V="onMouseEnter",I="mouse",(n==="pointerout"||n==="pointerover")&&(Oe=$_,re="onPointerLeave",V="onPointerEnter",I="pointer"),bt=te==null?Q:rr(te),Y=Ce==null?Q:rr(Ce),Q=new Oe(re,I+"leave",te,o,ne),Q.target=bt,Q.relatedTarget=Y,re=null,Ii(ne)===X&&(Oe=new Oe(V,I+"enter",Ce,o,ne),Oe.target=Y,Oe.relatedTarget=bt,re=Oe),bt=re,te&&Ce)t:{for(Oe=yT,V=te,I=Ce,Y=0,re=V;re;re=Oe(re))Y++;re=0;for(var De=I;De;De=Oe(De))re++;for(;0<Y-re;)V=Oe(V),Y--;for(;0<re-Y;)I=Oe(I),re--;for(;Y--;){if(V===I||I!==null&&V===I.alternate){Oe=V;break t}V=Oe(V),I=Oe(I)}Oe=null}else Oe=null;te!==null&&L1(ae,Q,te,Oe,!1),Ce!==null&&bt!==null&&L1(ae,bt,Ce,Oe,!0)}}e:{if(Q=X?rr(X):window,te=Q.nodeName&&Q.nodeName.toLowerCase(),te==="select"||te==="input"&&Q.type==="file")var rt=Z_;else if(Y_(Q))if(Q_)rt=RN;else{rt=AN;var Ae=TN}else te=Q.nodeName,!te||te.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&or(X.elementType)&&(rt=Z_):rt=MN;if(rt&&(rt=rt(n,X))){X_(ae,rt,o,ne);break e}Ae&&Ae(n,Q,X),n==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&Qa(Q,"number",Q.value)}switch(Ae=X?rr(X):window,n){case"focusin":(Y_(Ae)||Ae.contentEditable==="true")&&(to=Ae,Vd=X,bl=null);break;case"focusout":bl=Vd=to=null;break;case"mousedown":qd=!0;break;case"contextmenu":case"mouseup":case"dragend":qd=!1,ab(ae,o,ne);break;case"selectionchange":if(ON)break;case"keydown":case"keyup":ab(ae,o,ne)}var $e;if(Ud)e:{switch(n){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else eo?G_(n,o)&&(Je="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Je="onCompositionStart");Je&&(V_&&o.locale!=="ko"&&(eo||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&eo&&($e=P_()):(cr=ne,jd="value"in cr?cr.value:cr.textContent,eo=!0)),Ae=th(X,Je),0<Ae.length&&(Je=new F_(Je,n,null,o,ne),ae.push({event:Je,listeners:Ae}),$e?Je.data=$e:($e=W_(o),$e!==null&&(Je.data=$e)))),($e=wN?EN(n,o):CN(n,o))&&(Je=th(X,"onBeforeInput"),0<Je.length&&(Ae=new F_("onBeforeInput","beforeinput",null,o,ne),ae.push({event:Ae,listeners:Je}),Ae.data=$e)),gT(ae,n,X,o,ne)}D1(ae,r)})}function $l(n,r,o){return{instance:n,listener:r,currentTarget:o}}function th(n,r){for(var o=r+"Capture",u=[];n!==null;){var p=n,_=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||_===null||(p=ul(n,o),p!=null&&u.unshift($l(n,p,_)),p=ul(n,r),p!=null&&u.push($l(n,p,_))),n.tag===3)return u;n=n.return}return[]}function yT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function L1(n,r,o,u,p){for(var _=r._reactName,S=[];o!==null&&o!==u;){var k=o,L=k.alternate,X=k.stateNode;if(k=k.tag,L!==null&&L===u)break;k!==5&&k!==26&&k!==27||X===null||(L=X,p?(X=ul(o,_),X!=null&&S.unshift($l(o,X,L))):p||(X=ul(o,_),X!=null&&S.push($l(o,X,L)))),o=o.return}S.length!==0&&n.push({event:r,listeners:S})}var xT=/\r\n?/g,ST=/\u0000|\uFFFD/g;function j1(n){return(typeof n=="string"?n:""+n).replace(xT,`
9
+ `).replace(ST,"")}function B1(n,r){return r=j1(r),j1(n)===r}function _t(n,r,o,u,p,_){switch(o){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Le(n,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Le(n,""+u);break;case"className":an(n,"class",u);break;case"tabIndex":an(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":an(n,o,u);break;case"style":dt(n,u,_);break;case"data":if(r!=="object"){an(n,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=lr(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="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 _=="function"&&(o==="formAction"?(r!=="input"&&_t(n,r,"name",p.name,p,null),_t(n,r,"formEncType",p.formEncType,p,null),_t(n,r,"formMethod",p.formMethod,p,null),_t(n,r,"formTarget",p.formTarget,p,null)):(_t(n,r,"encType",p.encType,p,null),_t(n,r,"method",p.method,p,null),_t(n,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=lr(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=pe);break;case"onScroll":u!=null&&Xe("scroll",n);break;case"onScrollEnd":u!=null&&Xe("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=lr(""+u),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":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):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":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":Xe("beforetoggle",n),Xe("toggle",n),Oi(n,"popover",u);break;case"xlinkActuate":Ki(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ki(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ki(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ki(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ki(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ki(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ki(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ki(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ki(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Oi(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Ms.get(o)||o,Oi(n,o,u))}}function _m(n,r,o,u,p,_){switch(o){case"style":dt(n,u,_);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=o}}break;case"children":typeof u=="string"?Le(n,u):(typeof u=="number"||typeof u=="bigint")&&Le(n,""+u);break;case"onScroll":u!=null&&Xe("scroll",n);break;case"onScrollEnd":u!=null&&Xe("scrollend",n);break;case"onClick":u!=null&&(n.onclick=pe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!na.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),_=n[Di]||null,_=_!=null?_[o]:null,typeof _=="function"&&n.removeEventListener(r,_,p),typeof u=="function")){typeof _!="function"&&_!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(r,u,p);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):Oi(n,o,u)}}}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":Xe("error",n),Xe("load",n);var u=!1,p=!1,_;for(_ in o)if(o.hasOwnProperty(_)){var S=o[_];if(S!=null)switch(_){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:_t(n,r,_,S,o,null)}}p&&_t(n,r,"srcSet",o.srcSet,o,null),u&&_t(n,r,"src",o.src,o,null);return;case"input":Xe("invalid",n);var k=_=S=p=null,L=null,X=null;for(u in o)if(o.hasOwnProperty(u)){var ne=o[u];if(ne!=null)switch(u){case"name":p=ne;break;case"type":S=ne;break;case"checked":L=ne;break;case"defaultChecked":X=ne;break;case"value":_=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,r));break;default:_t(n,r,u,ne,o,null)}}sa(n,_,k,L,X,S,p,!1);return;case"select":Xe("invalid",n),u=S=_=null;for(p in o)if(o.hasOwnProperty(p)&&(k=o[p],k!=null))switch(p){case"value":_=k;break;case"defaultValue":S=k;break;case"multiple":u=k;default:_t(n,r,p,k,o,null)}r=_,o=S,n.multiple=!!u,r!=null?Si(n,!!u,r,!1):o!=null&&Si(n,!!u,o,!0);return;case"textarea":Xe("invalid",n),_=p=u=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":u=k;break;case"defaultValue":p=k;break;case"children":_=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:_t(n,r,S,k,o,null)}Ja(n,u,p,_);return;case"option":for(L in o)o.hasOwnProperty(L)&&(u=o[L],u!=null)&&(L==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":_t(n,r,L,u,o,null));return;case"dialog":Xe("beforetoggle",n),Xe("toggle",n),Xe("cancel",n),Xe("close",n);break;case"iframe":case"object":Xe("load",n);break;case"video":case"audio":for(u=0;u<Fl.length;u++)Xe(Fl[u],n);break;case"image":Xe("error",n),Xe("load",n);break;case"details":Xe("toggle",n);break;case"embed":case"source":case"link":Xe("error",n),Xe("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(X in o)if(o.hasOwnProperty(X)&&(u=o[X],u!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:_t(n,r,X,u,o,null)}return;default:if(or(r)){for(ne in o)o.hasOwnProperty(ne)&&(u=o[ne],u!==void 0&&_m(n,r,ne,u,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(u=o[k],u!=null&&_t(n,r,k,u,o,null))}function wT(n,r,o,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,_=null,S=null,k=null,L=null,X=null,ne=null;for(te in o){var ae=o[te];if(o.hasOwnProperty(te)&&ae!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":L=ae;default:u.hasOwnProperty(te)||_t(n,r,te,null,u,ae)}}for(var Q in u){var te=u[Q];if(ae=o[Q],u.hasOwnProperty(Q)&&(te!=null||ae!=null))switch(Q){case"type":_=te;break;case"name":p=te;break;case"checked":X=te;break;case"defaultChecked":ne=te;break;case"value":S=te;break;case"defaultValue":k=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:te!==ae&&_t(n,r,Q,te,u,ae)}}ol(n,S,k,L,X,ne,_,p);return;case"select":te=S=k=Q=null;for(_ in o)if(L=o[_],o.hasOwnProperty(_)&&L!=null)switch(_){case"value":break;case"multiple":te=L;default:u.hasOwnProperty(_)||_t(n,r,_,null,u,L)}for(p in u)if(_=u[p],L=o[p],u.hasOwnProperty(p)&&(_!=null||L!=null))switch(p){case"value":Q=_;break;case"defaultValue":k=_;break;case"multiple":S=_;default:_!==L&&_t(n,r,p,_,u,L)}r=k,o=S,u=te,Q!=null?Si(n,!!o,Q,!1):!!u!=!!o&&(r!=null?Si(n,!!o,r,!0):Si(n,!!o,o?[]:"",!1));return;case"textarea":te=Q=null;for(k in o)if(p=o[k],o.hasOwnProperty(k)&&p!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:_t(n,r,k,null,u,p)}for(S in u)if(p=u[S],_=o[S],u.hasOwnProperty(S)&&(p!=null||_!=null))switch(S){case"value":Q=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==_&&_t(n,r,S,p,u,_)}ru(n,Q,te);return;case"option":for(var Ce in o)Q=o[Ce],o.hasOwnProperty(Ce)&&Q!=null&&!u.hasOwnProperty(Ce)&&(Ce==="selected"?n.selected=!1:_t(n,r,Ce,null,u,Q));for(L in u)Q=u[L],te=o[L],u.hasOwnProperty(L)&&Q!==te&&(Q!=null||te!=null)&&(L==="selected"?n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":_t(n,r,L,Q,u,te));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 Oe in o)Q=o[Oe],o.hasOwnProperty(Oe)&&Q!=null&&!u.hasOwnProperty(Oe)&&_t(n,r,Oe,null,u,Q);for(X in u)if(Q=u[X],te=o[X],u.hasOwnProperty(X)&&Q!==te&&(Q!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,r));break;default:_t(n,r,X,Q,u,te)}return;default:if(or(r)){for(var bt in o)Q=o[bt],o.hasOwnProperty(bt)&&Q!==void 0&&!u.hasOwnProperty(bt)&&_m(n,r,bt,void 0,u,Q);for(ne in u)Q=u[ne],te=o[ne],!u.hasOwnProperty(ne)||Q===te||Q===void 0&&te===void 0||_m(n,r,ne,Q,u,te);return}}for(var V in o)Q=o[V],o.hasOwnProperty(V)&&Q!=null&&!u.hasOwnProperty(V)&&_t(n,r,V,null,u,Q);for(ae in u)Q=u[ae],te=o[ae],!u.hasOwnProperty(ae)||Q===te||Q==null&&te==null||_t(n,r,ae,Q,u,te)}function z1(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ET(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var p=o[u],_=p.transferSize,S=p.initiatorType,k=p.duration;if(_&&k&&z1(S)){for(S=0,k=p.responseEnd,u+=1;u<o.length;u++){var L=o[u],X=L.startTime;if(X>k)break;var ne=L.transferSize,ae=L.initiatorType;ne&&z1(ae)&&(L=L.responseEnd,S+=ne*(L<k?1:(k-X)/(L-X)))}if(--u,r+=8*(_+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 bm=null,vm=null;function ih(n){return n.nodeType===9?n:n.ownerDocument}function I1(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 P1(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 ym(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 xm=null;function CT(){var n=window.event;return n&&n.type==="popstate"?n===xm?!1:(xm=n,!0):(xm=null,!1)}var U1=typeof setTimeout=="function"?setTimeout:void 0,kT=typeof clearTimeout=="function"?clearTimeout:void 0,H1=typeof Promise=="function"?Promise:void 0,NT=typeof queueMicrotask=="function"?queueMicrotask:typeof H1<"u"?function(n){return H1.resolve(null).then(n).catch(TT)}:U1;function TT(n){setTimeout(function(){throw n})}function kr(n){return n==="head"}function F1(n,r){var o=r,u=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(p),Ao(r);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")Vl(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Vl(o);for(var _=o.firstChild;_;){var S=_.nextSibling,k=_.nodeName;_[ia]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&_.rel.toLowerCase()==="stylesheet"||o.removeChild(_),_=S}}else o==="body"&&Vl(n.ownerDocument.body);o=p}while(o);Ao(r)}function $1(n,r){var o=n;n=0;do{var u=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||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}function Sm(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":Sm(o),rl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function AT(n,r,o,u){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ia])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(_=n.getAttribute("rel"),_==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(_!==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(_=n.getAttribute("src"),(_!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&_&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var _=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===_)return n}else return n;if(n=Tn(n.nextSibling),n===null)break}return null}function MT(n,r,o){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Tn(n.nextSibling),n===null))return null;return n}function V1(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Tn(n.nextSibling),n===null))return null;return n}function wm(n){return n.data==="$?"||n.data==="$~"}function Em(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function RT(n,r){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||o.readyState!=="loading")r();else{var u=function(){r(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Tn(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 Cm=null;function q1(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(r===0)return Tn(n.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}n=n.nextSibling}return null}function K1(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 G1(n,r,o){switch(r=ih(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 Vl(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);rl(n)}var An=new Map,W1=new Set;function nh(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ks=F.d;F.d={f:DT,r:OT,D:LT,C:jT,L:BT,m:zT,X:PT,S:IT,M:UT};function DT(){var n=Ks.f(),r=Wu();return n||r}function OT(n){var r=Ts(n);r!==null&&r.tag===5&&r.type==="form"?hv(r):Ks.r(n)}var ko=typeof document>"u"?null:document;function Y1(n,r,o){var u=ko;if(u&&typeof r=="string"&&r){var p=Gi(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),W1.has(p)||(W1.add(p),n={rel:n,crossOrigin:o,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),ki(r,"link",n),Yt(r),u.head.appendChild(r)))}}function LT(n){Ks.D(n),Y1("dns-prefetch",n,null)}function jT(n,r){Ks.C(n,r),Y1("preconnect",n,r)}function BT(n,r,o){Ks.L(n,r,o);var u=ko;if(u&&n&&r){var p='link[rel="preload"][as="'+Gi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Gi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Gi(o.imageSizes)+'"]')):p+='[href="'+Gi(n)+'"]';var _=p;switch(r){case"style":_=No(n);break;case"script":_=To(n)}An.has(_)||(n=b({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:n,as:r},o),An.set(_,n),u.querySelector(p)!==null||r==="style"&&u.querySelector(ql(_))||r==="script"&&u.querySelector(Kl(_))||(r=u.createElement("link"),ki(r,"link",n),Yt(r),u.head.appendChild(r)))}}function zT(n,r){Ks.m(n,r);var o=ko;if(o&&n){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Gi(u)+'"][href="'+Gi(n)+'"]',_=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=To(n)}if(!An.has(_)&&(n=b({rel:"modulepreload",href:n},r),An.set(_,n),o.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Kl(_)))return}u=o.createElement("link"),ki(u,"link",n),Yt(u),o.head.appendChild(u)}}}function IT(n,r,o){Ks.S(n,r,o);var u=ko;if(u&&n){var p=ar(u).hoistableStyles,_=No(n);r=r||"default";var S=p.get(_);if(!S){var k={loading:0,preload:null};if(S=u.querySelector(ql(_)))k.loading=5;else{n=b({rel:"stylesheet",href:n,"data-precedence":r},o),(o=An.get(_))&&km(n,o);var L=S=u.createElement("link");Yt(L),ki(L,"link",n),L._p=new Promise(function(X,ne){L.onload=X,L.onerror=ne}),L.addEventListener("load",function(){k.loading|=1}),L.addEventListener("error",function(){k.loading|=2}),k.loading|=4,sh(S,r,u)}S={type:"stylesheet",instance:S,count:1,state:k},p.set(_,S)}}}function PT(n,r){Ks.X(n,r);var o=ko;if(o&&n){var u=ar(o).hoistableScripts,p=To(n),_=u.get(p);_||(_=o.querySelector(Kl(p)),_||(n=b({src:n,async:!0},r),(r=An.get(p))&&Nm(n,r),_=o.createElement("script"),Yt(_),ki(_,"link",n),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},u.set(p,_))}}function UT(n,r){Ks.M(n,r);var o=ko;if(o&&n){var u=ar(o).hoistableScripts,p=To(n),_=u.get(p);_||(_=o.querySelector(Kl(p)),_||(n=b({src:n,async:!0,type:"module"},r),(r=An.get(p))&&Nm(n,r),_=o.createElement("script"),Yt(_),ki(_,"link",n),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},u.set(p,_))}}function X1(n,r,o,u){var p=(p=ge.current)?nh(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=No(o.href),o=ar(p).hoistableStyles,u=o.get(r),u||(u={type:"style",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=No(o.href);var _=ar(p).hoistableStyles,S=_.get(n);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(n,S),(_=p.querySelector(ql(n)))&&!_._p&&(S.instance=_,S.state.loading=5),An.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},An.set(n,o),_||HT(p,n,o,S.state))),r&&u===null)throw Error(s(528,""));return S}if(r&&u!==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=To(o),o=ar(p).hoistableScripts,u=o.get(r),u||(u={type:"script",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function No(n){return'href="'+Gi(n)+'"'}function ql(n){return'link[rel="stylesheet"]['+n+"]"}function Z1(n){return b({},n,{"data-precedence":n.precedence,precedence:null})}function HT(n,r,o,u){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=n.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),ki(r,"link",o),Yt(r),n.head.appendChild(r))}function To(n){return'[src="'+Gi(n)+'"]'}function Kl(n){return"script[async]"+n}function Q1(n,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var u=n.querySelector('style[data-href~="'+Gi(o.href)+'"]');if(u)return r.instance=u,Yt(u),u;var p=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Yt(u),ki(u,"style",p),sh(u,o.precedence,n),r.instance=u;case"stylesheet":p=No(o.href);var _=n.querySelector(ql(p));if(_)return r.state.loading|=4,r.instance=_,Yt(_),_;u=Z1(o),(p=An.get(p))&&km(u,p),_=(n.ownerDocument||n).createElement("link"),Yt(_);var S=_;return S._p=new Promise(function(k,L){S.onload=k,S.onerror=L}),ki(_,"link",u),r.state.loading|=4,sh(_,o.precedence,n),r.instance=_;case"script":return _=To(o.src),(p=n.querySelector(Kl(_)))?(r.instance=p,Yt(p),p):(u=o,(p=An.get(_))&&(u=b({},o),Nm(u,p)),n=n.ownerDocument||n,p=n.createElement("script"),Yt(p),ki(p,"link",u),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&&(u=r.instance,r.state.loading|=4,sh(u,o.precedence,n));return r.instance}function sh(n,r,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,_=p,S=0;S<u.length;S++){var k=u[S];if(k.dataset.precedence===r)_=k;else if(_!==p)break}_?_.parentNode.insertBefore(n,_.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(n,r.firstChild))}function km(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Nm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var rh=null;function J1(n,r,o){if(rh===null){var u=new Map,p=rh=new Map;p.set(o,u)}else p=rh,u=p.get(o),u||(u=new Map,p.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var _=o[p];if(!(_[ia]||_[Vt]||n==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var S=_.getAttribute(r)||"";S=n+S;var k=u.get(S);k?k.push(_):u.set(S,[_])}}return u}function ey(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 ty(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function $T(n,r,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=No(u.href),_=r.querySelector(ql(p));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=ah.bind(n),r.then(n,n)),o.state.loading|=4,o.instance=_,Yt(_);return}_=r.ownerDocument||r,u=Z1(u),(p=An.get(p))&&km(u,p),_=_.createElement("link"),Yt(_);var S=_;S._p=new Promise(function(k,L){S.onload=k,S.onerror=L}),ki(_,"link",u),o.instance=_}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=ah.bind(n),r.addEventListener("load",o),r.addEventListener("error",o))}}var Tm=0;function VT(n,r){return n.stylesheets&&n.count===0&&lh(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&lh(n,n.stylesheets),n.unsuspend){var _=n.unsuspend;n.unsuspend=null,_()}},6e4+r);0<n.imgBytes&&Tm===0&&(Tm=62500*ET());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&lh(n,n.stylesheets),n.unsuspend)){var _=n.unsuspend;n.unsuspend=null,_()}},(n.imgBytes>Tm?50:800)+r);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function ah(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lh(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var oh=null;function lh(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,oh=new Map,r.forEach(qT,n),oh=null,ah.call(n))}function qT(n,r){if(!(r.state.loading&4)){var o=oh.get(n);if(o)var u=o.get(null);else{o=new Map,oh.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<p.length;_++){var S=p[_];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),u=S)}u&&o.set(null,u)}p=r.instance,S=p.getAttribute("data-precedence"),_=o.get(S)||u,_===u&&o.set(null,p),o.set(S,p),this.count++,u=ah.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),_?_.parentNode.insertBefore(p,_.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Gl={$$typeof:M,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function KT(n,r,o,u,p,_,S,k,L){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=u,this.onUncaughtError=p,this.onCaughtError=_,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function iy(n,r,o,u,p,_,S,k,L,X,ne,ae){return n=new KT(n,r,o,S,L,X,ne,ae,k),r=1,_===!0&&(r|=24),_=cn(3,null,null,r),n.current=_,_.stateNode=n,r=of(),r.refCount++,n.pooledCache=r,r.refCount++,_.memoizedState={element:u,isDehydrated:o,cache:r},hf(_),n}function ny(n){return n?(n=so,n):so}function sy(n,r,o,u,p,_){p=ny(p),u.context===null?u.context=p:u.pendingContext=p,u=pr(r),u.payload={element:o},_=_===void 0?null:_,_!==null&&(u.callback=_),o=gr(n,u,r),o!==null&&(Ji(o,n,r),Cl(o,n,r))}function ry(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<r?o:r}}function Am(n,r){ry(n,r),(n=n.alternate)&&ry(n,r)}function ay(n){if(n.tag===13||n.tag===31){var r=la(n,67108864);r!==null&&Ji(r,n,67108864),Am(n,67108864)}}function oy(n){if(n.tag===13||n.tag===31){var r=mn();r=Mt(r);var o=la(n,r);o!==null&&Ji(o,n,r),Am(n,r)}}var ch=!0;function GT(n,r,o,u){var p=N.T;N.T=null;var _=F.p;try{F.p=2,Mm(n,r,o,u)}finally{F.p=_,N.T=p}}function WT(n,r,o,u){var p=N.T;N.T=null;var _=F.p;try{F.p=8,Mm(n,r,o,u)}finally{F.p=_,N.T=p}}function Mm(n,r,o,u){if(ch){var p=Rm(u);if(p===null)gm(n,r,u,uh,o),cy(n,u);else if(XT(p,n,r,o,u))u.stopPropagation();else if(cy(n,u),r&4&&-1<YT.indexOf(n)){for(;p!==null;){var _=Ts(p);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var S=Ri(_.pendingLanes);if(S!==0){var k=_;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var L=1<<31-xi(S);k.entanglements[1]|=L,S&=~L}es(_),(ct&6)===0&&(Ku=Ot()+500,Hl(0))}}break;case 31:case 13:k=la(_,2),k!==null&&Ji(k,_,2),Wu(),Am(_,2)}if(_=Rm(u),_===null&&gm(n,r,u,uh,o),_===p)break;p=_}p!==null&&u.stopPropagation()}else gm(n,r,u,null,o)}}function Rm(n){return n=He(n),Dm(n)}var uh=null;function Dm(n){if(uh=null,n=Ii(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=d(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 uh=n,null}function ly(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(ws()){case yi:return 2;case Es:return 8;case Cs:case Va:return 32;case nr:return 268435456;default:return 32}default:return 32}}var Om=!1,Nr=null,Tr=null,Ar=null,Wl=new Map,Yl=new Map,Mr=[],YT="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 cy(n,r){switch(n){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Wl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yl.delete(r.pointerId)}}function Xl(n,r,o,u,p,_){return n===null||n.nativeEvent!==_?(n={blockedOn:r,domEventName:o,eventSystemFlags:u,nativeEvent:_,targetContainers:[p]},r!==null&&(r=Ts(r),r!==null&&ay(r)),n):(n.eventSystemFlags|=u,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function XT(n,r,o,u,p){switch(r){case"focusin":return Nr=Xl(Nr,n,r,o,u,p),!0;case"dragenter":return Tr=Xl(Tr,n,r,o,u,p),!0;case"mouseover":return Ar=Xl(Ar,n,r,o,u,p),!0;case"pointerover":var _=p.pointerId;return Wl.set(_,Xl(Wl.get(_)||null,n,r,o,u,p)),!0;case"gotpointercapture":return _=p.pointerId,Yl.set(_,Xl(Yl.get(_)||null,n,r,o,u,p)),!0}return!1}function uy(n){var r=Ii(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,Wa(n.priority,function(){oy(o)});return}}else if(r===31){if(r=d(o),r!==null){n.blockedOn=r,Wa(n.priority,function(){oy(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 hh(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var o=Rm(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);Te=u,o.target.dispatchEvent(u),Te=null}else return r=Ts(o),r!==null&&ay(r),n.blockedOn=o,!1;r.shift()}return!0}function hy(n,r,o){hh(n)&&o.delete(r)}function ZT(){Om=!1,Nr!==null&&hh(Nr)&&(Nr=null),Tr!==null&&hh(Tr)&&(Tr=null),Ar!==null&&hh(Ar)&&(Ar=null),Wl.forEach(hy),Yl.forEach(hy)}function dh(n,r){n.blockedOn===r&&(n.blockedOn=null,Om||(Om=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ZT)))}var fh=null;function dy(n){fh!==n&&(fh=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fh===n&&(fh=null);for(var r=0;r<n.length;r+=3){var o=n[r],u=n[r+1],p=n[r+2];if(typeof u!="function"){if(Dm(u||o)===null)continue;break}var _=Ts(o);_!==null&&(n.splice(r,3),r-=3,Rf(_,{pending:!0,data:p,method:o.method,action:u},u,p))}}))}function Ao(n){function r(L){return dh(L,n)}Nr!==null&&dh(Nr,n),Tr!==null&&dh(Tr,n),Ar!==null&&dh(Ar,n),Wl.forEach(r),Yl.forEach(r);for(var o=0;o<Mr.length;o++){var u=Mr[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Mr.length&&(o=Mr[0],o.blockedOn===null);)uy(o),o.blockedOn===null&&Mr.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var p=o[u],_=o[u+1],S=p[Di]||null;if(typeof _=="function")S||dy(o);else if(S){var k=null;if(_&&_.hasAttribute("formAction")){if(p=_,S=_[Di]||null)k=S.formAction;else if(Dm(p)!==null)continue}else k=S.action;typeof k=="function"?o[u+1]=k:(o.splice(u,3),u-=3),dy(o)}}}function fy(){function n(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Lm(n){this._internalRoot=n}mh.prototype.render=Lm.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,u=mn();sy(o,u,n,r,null,null)},mh.prototype.unmount=Lm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;sy(n.current,2,null,n,null,null),Wu(),r[sr]=null}};function mh(n){this._internalRoot=n}mh.prototype.unstable_scheduleHydration=function(n){if(n){var r=Ga();n={blockedOn:null,target:n,priority:r};for(var o=0;o<Mr.length&&r!==0&&r<Mr[o].priority;o++);Mr.splice(o,0,n),o===0&&uy(n)}};var my=t.version;if(my!=="19.2.6")throw Error(s(527,my,"19.2.6"));F.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 QT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ph.isDisabled&&ph.supportsFiber)try{ks=ph.inject(QT),fi=ph}catch{}}return Ql.createRoot=function(n,r){if(!a(n))throw Error(s(299));var o=!1,u="",p=xv,_=Sv,S=wv;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=iy(n,1,!1,null,null,o,u,null,p,_,S,fy),n[sr]=r.current,pm(n),new Lm(r)},Ql.hydrateRoot=function(n,r,o){if(!a(n))throw Error(s(299));var u=!1,p="",_=xv,S=Sv,k=wv,L=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(_=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(L=o.formState)),r=iy(n,1,!0,r,o??null,u,p,L,_,S,k,fy),r.context=ny(null),o=r.current,u=mn(),u=Mt(u),p=pr(u),p.callback=null,gr(o,p,u),o=u,r.current.lanes=o,yt(r,o),es(r),n[sr]=r.current,pm(n),new mh(r)},Ql.version="19.2.6",Ql}var Ey;function l5(){if(Ey)return zm.exports;Ey=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(),zm.exports=o5(),zm.exports}var w2=l5();const E2=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();const c5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const u5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());const Cy=e=>{const t=u5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Hm={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 h5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},d5=C.createContext({}),f5=()=>C.useContext(d5),m5=C.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:s,className:a="",children:l,iconNode:c,...d},m)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:v="currentColor",className:y=""}=f5()??{},x=s??b?Number(i??g)*24/Number(t??f):i??g;return C.createElement("svg",{ref:m,...Hm,width:t??f??Hm.width,height:t??f??Hm.height,stroke:e??v,strokeWidth:x,className:E2("lucide",y,a),...!l&&!h5(d)&&{"aria-hidden":"true"},...d},[...c.map(([w,E])=>C.createElement(w,E)),...Array.isArray(l)?l:[l]])});const be=(e,t)=>{const i=C.forwardRef(({className:s,...a},l)=>C.createElement(m5,{ref:l,iconNode:t,className:E2(`lucide-${c5(Cy(e))}`,`lucide-${e}`,s),...a}));return i.displayName=Cy(e),i};const p5=[["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"}]],Vo=be("activity",p5);const g5=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_5=be("arrow-down",g5);const b5=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],v5=be("arrow-up",b5);const y5=[["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"}]],kc=be("bot",y5);const x5=[["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"}]],C2=be("box",x5);const S5=[["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"}]],ug=be("brain",S5);const w5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fc=be("check",w5);const E5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vs=be("chevron-down",E5);const C5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],k5=be("chevron-left",C5);const N5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yr=be("chevron-right",N5);const T5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],D0=be("chevron-up",T5);const A5=[["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"}]],M5=be("clipboard-copy",A5);const R5=[["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"}]],D5=be("code-xml",R5);const O5=[["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"}]],k2=be("copy",O5);const L5=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],j5=be("corner-down-left",L5);const B5=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],z5=be("corner-down-right",B5);const I5=[["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"}]],P5=be("cpu",I5);const U5=[["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"}]],$c=be("database",U5);const H5=[["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"}]],F5=be("download",H5);const $5=[["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"}]],V5=be("earth",$5);const q5=[["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"}]],N2=be("external-link",q5);const K5=[["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"}]],T2=be("eye-off",K5);const G5=[["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"}]],O0=be("eye",G5);const W5=[["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"}]],Y5=be("file-code-corner",W5);const X5=[["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"}]],Z5=be("file-exclamation-point",X5);const Q5=[["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"}]],J5=be("file-text",Q5);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"}]],A2=be("file",eA);const tA=[["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"}]],iA=be("flask-conical",tA);const nA=[["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"}]],bd=be("folder-open",nA);const sA=[["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"}]],rA=be("folder-plus",sA);const aA=[["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"}]],Ia=be("folder",aA);const oA=[["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"}]],lA=be("funnel",oA);const cA=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M2=be("gauge",cA);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"}]],Nc=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"}]],dA=be("git-pull-request-create",hA);const fA=[["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"}]],mA=be("heart",fA);const pA=[["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",pA);const _A=[["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"}]],hg=be("inbox",_A);const bA=[["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"}]],vA=be("key-round",bA);const yA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ds=be("loader-circle",yA);const xA=[["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"}]],SA=be("lock-keyhole",xA);const wA=[["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"}]],EA=be("maximize-2",wA);const CA=[["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"}]],kA=be("memory-stick",CA);const NA=[["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"}]],TA=be("minimize-2",NA);const AA=[["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"}]],MA=be("network",AA);const RA=[["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"}]],DA=be("package",RA);const OA=[["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"}]],LA=be("palette",OA);const jA=[["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"}]],BA=be("panel-left-close",jA);const zA=[["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"}]],IA=be("panel-left-open",zA);const PA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],UA=be("panel-left",PA);const HA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],FA=be("panel-top",HA);const $A=[["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"}]],VA=be("paperclip",$A);const qA=[["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"}]],dg=be("pencil",qA);const KA=[["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"}]],R2=be("play",KA);const GA=[["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"}]],fg=be("plug",GA);const WA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jn=be("plus",WA);const YA=[["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"}]],XA=be("radio",YA);const ZA=[["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"}]],D2=be("refresh-cw",ZA);const QA=[["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"}]],O2=be("rotate-ccw",QA);const JA=[["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"}]],L2=be("save",JA);const e4=[["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"}]],j2=be("scroll-text",e4);const t4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],i4=be("search",t4);const n4=[["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"}]],s4=be("server",n4);const r4=[["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"}]],a4=be("settings-2",r4);const o4=[["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"}]],l4=be("shield-alert",o4);const c4=[["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"}]],B2=be("sparkles",c4);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 d4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],vd=be("square",d4);const f4=[["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"}]],m4=be("table-2",f4);const p4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],z2=be("terminal",p4);const g4=[["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"}]],Vc=be("trash-2",g4);const _4=[["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"}]],b4=be("triangle-alert",_4);const v4=[["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"}]],y4=be("wand-sparkles",v4);const x4=[["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"}]],S4=be("wrench",x4);const w4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ys=be("x",w4);const E4=[["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"}]],C4=be("zap",E4),k4="/assets/nomoreide-logo-B2E14b65.png";class I2 extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function nt(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 I2(s?.error||"Port already in use",s.conflict):new Error(s?.error||i.statusText);return s}async function sn(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 nt(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function qc(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 nt(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function N4(){return(await nt("/api/agent")).agent}async function T4(){return(await nt("/api/agent/usage")).usage}async function A4(){const e=await nt("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function M4(e,t,i){await nt("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:i})})}async function R4(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 d="";for(;;){const{done:m,value:f}=await l.read();if(m)break;d+=c.decode(f,{stream:!0});let g=d.indexOf(`
10
+
11
+ `);for(;g!==-1;){const b=d.slice(0,g);d=d.slice(g+2);const v=b.split(`
12
+ `).find(y=>y.startsWith("data:"));if(v){const y=v.slice(5).trim();if(y)try{i(JSON.parse(y))}catch{}}g=d.indexOf(`
13
+
14
+ `)}}}async function D4(){return(await nt("/api/databases")).connections}async function O4(){return(await nt("/api/databases/detect")).detected}async function L4(e){await qc("/api/databases",e)}async function j4(e){return qc("/api/databases/test",e)}async function B4(e){await nt(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function z4(e){return(await nt(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function I4(e,t,i=100){return nt(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}`)}function P4(e,t,i,s,a){const l=s.map(c=>`- ${c.name}: ${c.dataType}${c.primaryKey?" (PK)":""}${c.nullable?"":" NOT NULL"}`).join(`
15
+ `);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(`
16
+ `)}async function U4(e=100){return(await nt(`/api/errors?limit=${e}`)).incidents}async function H4(e){return nt(`/api/errors/${e}/prompt`)}async function F4(e,t=!1){return nt(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function $4(e=200){return(await nt(`/api/git/graph?limit=${e}`)).commits}async function V4(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 q4(e){return(await nt(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function K4(){return(await nt("/api/git/files")).files}async function G4(e){const t=await nt(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function W4(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 Y4(e){await nt(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function X4(){return(await nt("/api/log-sources")).sources}async function Z4(e){return(await qc("/api/log-sources",e)).sources}async function P2(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 nt(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}async function Q4(){return nt("/api/dashboard")}async function J4(e){await nt(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function eM(e,t,i){t.includes(i)||await sn("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function tM(e,t,i){t.includes(i)&&await sn("/api/bundles",{name:e,originalName:e,services:t.filter(s=>s!==i).join(",")})}async function U2(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),nt(`/api/fs/directories?${i.toString()}`)}async function H2(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 nt(`/api/services/${encodeURIComponent(e)}/logs?${i.toString()}`);return{logs:s.logs,queryable:!!s.queryable}}async function iM(e,t){const i=t?`?path=${encodeURIComponent(t)}`:"";return nt(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function nM(e){const t=await nt(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function ky(e,t){return nt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function sM(e,t,i){return nt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:i})})}async function rM(e,t,i){return nt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:i})})}async function aM(e){return qc("/api/services/test",e)}async function oM(e,t){return qc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function lM(){return(await nt("/api/terminal/sessions")).sessions}async function Fm(){return(await nt("/api/terminal/sessions",{method:"POST"})).session}async function cM(e){await nt(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function F2(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=F2(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Tc(){for(var e,t,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(t=F2(e))&&(s&&(s+=" "),s+=t);return s}const Ny=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ty=Tc,$2=(e,t)=>i=>{var s;if(t?.variants==null)return Ty(e,i?.class,i?.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(f=>{const g=i?.[f],b=l?.[f];if(g===null)return null;const v=Ny(g)||Ny(b);return a[f][v]}),d=i&&Object.entries(i).reduce((f,g)=>{let[b,v]=g;return v===void 0||(f[b]=v),f},{}),m=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((f,g)=>{let{class:b,className:v,...y}=g;return Object.entries(y).every(x=>{let[w,E]=x;return Array.isArray(E)?E.includes({...l,...d}[w]):{...l,...d}[w]===E})?[...f,b,v]:f},[]);return Ty(e,c,m,i?.class,i?.className)},uM=(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},hM=(e,t)=>({classGroupId:e,validator:t}),V2=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),qh="-",Ay=[],dM="arbitrary..",fM=e=>{const t=pM(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return mM(c);const d=c.split(qh),m=d[0]===""&&d.length>1?1:0;return q2(d,m,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const m=s[c],f=i[c];return m?f?uM(f,m):m:f||Ay}return i[c]||Ay}}},q2=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],l=i.nextPart.get(a);if(l){const f=q2(e,t+1,l);if(f)return f}const c=i.validators;if(c===null)return;const d=t===0?e.join(qh):e.slice(t).join(qh),m=c.length;for(let f=0;f<m;f++){const g=c[f];if(g.validator(d))return g.classGroupId}},mM=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?dM+s:void 0})(),pM=e=>{const{theme:t,classGroups:i}=e;return gM(i,t)},gM=(e,t)=>{const i=V2();for(const s in e){const a=e[s];L0(a,i,s,t)}return i},L0=(e,t,i,s)=>{const a=e.length;for(let l=0;l<a;l++){const c=e[l];_M(c,t,i,s)}},_M=(e,t,i,s)=>{if(typeof e=="string"){bM(e,t,i);return}if(typeof e=="function"){vM(e,t,i,s);return}yM(e,t,i,s)},bM=(e,t,i)=>{const s=e===""?t:K2(t,e);s.classGroupId=i},vM=(e,t,i,s)=>{if(xM(e)){L0(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(hM(i,e))},yM=(e,t,i,s)=>{const a=Object.entries(e),l=a.length;for(let c=0;c<l;c++){const[d,m]=a[c];L0(m,K2(t,d),i,s)}},K2=(e,t)=>{let i=e;const s=t.split(qh),a=s.length;for(let l=0;l<a;l++){const c=s[l];let d=i.nextPart.get(c);d||(d=V2(),i.nextPart.set(c,d)),i=d}return i},xM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SM=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)}}},mg="!",My=":",wM=[],Ry=(e,t,i,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),EM=e=>{const{prefix:t,experimentalParseClassName:i}=e;let s=a=>{const l=[];let c=0,d=0,m=0,f;const g=a.length;for(let w=0;w<g;w++){const E=a[w];if(c===0&&d===0){if(E===My){l.push(a.slice(m,w)),m=w+1;continue}if(E==="/"){f=w;continue}}E==="["?c++:E==="]"?c--:E==="("?d++:E===")"&&d--}const b=l.length===0?a:a.slice(m);let v=b,y=!1;b.endsWith(mg)?(v=b.slice(0,-1),y=!0):b.startsWith(mg)&&(v=b.slice(1),y=!0);const x=f&&f>m?f-m:void 0;return Ry(l,y,v,x)};if(t){const a=t+My,l=s;s=c=>c.startsWith(a)?l(c.slice(a.length)):Ry(wM,!1,c,void 0,!0)}if(i){const a=s;s=l=>i({className:l,parseClassName:a})}return s},CM=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],d=c[0]==="[",m=t.has(c);d||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}},kM=e=>({cache:SM(e.cacheSize),parseClassName:EM(e),sortModifiers:CM(e),postfixLookupClassGroupIds:NM(e),...fM(e)}),NM=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},TM=/\s+/,AM=(e,t)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:l,postfixLookupClassGroupIds:c}=t,d=[],m=e.trim().split(TM);let f="";for(let g=m.length-1;g>=0;g-=1){const b=m[g],{isExternal:v,modifiers:y,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:E}=i(b);if(v){f=b+(f.length>0?" "+f:f);continue}let A=!!E,T;if(A){const j=w.substring(0,E);T=s(j);const O=T&&c[T]?s(w):void 0;O&&O!==T&&(T=O,A=!1)}else T=s(w);if(!T){if(!A){f=b+(f.length>0?" "+f:f);continue}if(T=s(w),!T){f=b+(f.length>0?" "+f:f);continue}A=!1}const M=y.length===0?"":y.length===1?y[0]:l(y).join(":"),R=x?M+mg:M,z=R+T;if(d.indexOf(z)>-1)continue;d.push(z);const U=a(T,A);for(let j=0;j<U.length;++j){const O=U[j];d.push(R+O)}f=b+(f.length>0?" "+f:f)}return f},MM=(...e)=>{let t=0,i,s,a="";for(;t<e.length;)(i=e[t++])&&(s=G2(i))&&(a&&(a+=" "),a+=s);return a},G2=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=G2(e[s]))&&(i&&(i+=" "),i+=t);return i},RM=(e,...t)=>{let i,s,a,l;const c=m=>{const f=t.reduce((g,b)=>b(g),e());return i=kM(f),s=i.cache.get,a=i.cache.set,l=d,d(m)},d=m=>{const f=s(m);if(f)return f;const g=AM(m,i);return a(m,g),g};return l=c,(...m)=>l(MM(...m))},DM=[],oi=e=>{const t=i=>i[e]||DM;return t.isThemeGetter=!0,t},W2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,OM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jM=/\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$/,BM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dr=e=>OM.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),ts=e=>!!e&&Number.isInteger(Number(e)),$m=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),Gs=e=>LM.test(e),X2=()=>!0,PM=e=>jM.test(e)&&!BM.test(e),j0=()=>!1,UM=e=>zM.test(e),HM=e=>IM.test(e),FM=e=>!xe(e)&&!we(e),$M=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)),VM=e=>Xr(e,J2,j0),xe=e=>W2.test(e),xa=e=>Xr(e,eE,PM),Dy=e=>Xr(e,QM,Ke),qM=e=>Xr(e,iE,X2),KM=e=>Xr(e,tE,j0),Oy=e=>Xr(e,Z2,j0),GM=e=>Xr(e,Q2,HM),gh=e=>Xr(e,nE,UM),we=e=>Y2.test(e),Jl=e=>Pa(e,eE),WM=e=>Pa(e,tE),Ly=e=>Pa(e,Z2),YM=e=>Pa(e,J2),XM=e=>Pa(e,Q2),_h=e=>Pa(e,nE,!0),ZM=e=>Pa(e,iE,!0),Xr=(e,t,i)=>{const s=W2.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},Pa=(e,t,i=!1)=>{const s=Y2.exec(e);return s?s[1]?t(s[1]):i:!1},Z2=e=>e==="position"||e==="percentage",Q2=e=>e==="image"||e==="url",J2=e=>e==="length"||e==="size"||e==="bg-size",eE=e=>e==="length",QM=e=>e==="number",tE=e=>e==="family-name",iE=e=>e==="number"||e==="weight",nE=e=>e==="shadow",JM=()=>{const e=oi("color"),t=oi("font"),i=oi("text"),s=oi("font-weight"),a=oi("tracking"),l=oi("leading"),c=oi("breakpoint"),d=oi("container"),m=oi("spacing"),f=oi("radius"),g=oi("shadow"),b=oi("inset-shadow"),v=oi("text-shadow"),y=oi("drop-shadow"),x=oi("blur"),w=oi("perspective"),E=oi("aspect"),A=oi("ease"),T=oi("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...R(),we,xe],U=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],O=()=>[we,xe,m],K=()=>[Dr,"full","auto",...O()],H=()=>[ts,"none","subgrid",we,xe],G=()=>["auto",{span:["full",ts,we,xe]},ts,we,xe],J=()=>[ts,"auto",we,xe],P=()=>["auto","min","max","fr",we,xe],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...O()],F=()=>[Dr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],$=()=>[Dr,"screen","full","dvw","lvw","svw","min","max","fit",...O()],Z=()=>[Dr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],W=()=>[e,we,xe],D=()=>[...R(),Ly,Oy,{position:[we,xe]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",YM,VM,{size:[we,xe]}],le=()=>[$m,Jl,xa],he=()=>["","none","full",f,we,xe],ge=()=>["",Ke,Jl,xa],Se=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[Ke,$m,Ly,Oy],st=()=>["","none",x,we,xe],ot=()=>["none",Ke,we,xe],lt=()=>["none",Ke,we,xe],Be=()=>[Ke,we,xe],Ft=()=>[Dr,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gs],breakpoint:[Gs],color:[X2],container:[Gs],"drop-shadow":[Gs],ease:["in","out","in-out"],font:[FM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gs],shadow:[Gs],spacing:["px",Ke],text:[Gs],"text-shadow":[Gs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dr,xe,we,E]}],container:["container"],"container-type":[{"@container":["","normal","size",we,xe]}],"container-named":[$M],columns:[{columns:[Ke,xe,we,d]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:z()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[ts,"auto",we,xe]}],basis:[{basis:[Dr,"full","auto",d,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Dr,"auto","initial","none",xe]}],grow:[{grow:["",Ke,we,xe]}],shrink:[{shrink:["",Ke,we,xe]}],order:[{order:[ts,"first","last","none",we,xe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[d,"screen",...F()]}],"min-w":[{"min-w":[d,"screen","none",...F()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,Jl,xa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,ZM,qM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$m,xe]}],"font-family":[{font:[WM,KM,t]}],"font-features":[{"font-features":[xe]}],"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,we,xe]}],"line-clamp":[{"line-clamp":[Ke,"none",we,Dy]}],leading:[{leading:[l,...O()]}],"list-image":[{"list-image":["none",we,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",we,xa]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Ke,"auto",we,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[ts,we,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,xe]}],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",we,xe]}],"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:ie()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ts,we,xe],radial:["",we,xe],conic:[ts,we,xe]},XM,GM]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:ge()}],"border-w-x":[{"border-x":ge()}],"border-w-y":[{"border-y":ge()}],"border-w-s":[{"border-s":ge()}],"border-w-e":[{"border-e":ge()}],"border-w-bs":[{"border-bs":ge()}],"border-w-be":[{"border-be":ge()}],"border-w-t":[{"border-t":ge()}],"border-w-r":[{"border-r":ge()}],"border-w-b":[{"border-b":ge()}],"border-w-l":[{"border-l":ge()}],"divide-x":[{"divide-x":ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,we,xe]}],"outline-w":[{outline:["",Ke,Jl,xa]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",g,_h,gh]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",b,_h,gh]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Ke,xa]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ge()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",v,_h,gh]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Ke,we,xe]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"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":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[we,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,xe]}],filter:[{filter:["","none",we,xe]}],blur:[{blur:st()}],brightness:[{brightness:[Ke,we,xe]}],contrast:[{contrast:[Ke,we,xe]}],"drop-shadow":[{"drop-shadow":["","none",y,_h,gh]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Ke,we,xe]}],"hue-rotate":[{"hue-rotate":[Ke,we,xe]}],invert:[{invert:["",Ke,we,xe]}],saturate:[{saturate:[Ke,we,xe]}],sepia:[{sepia:["",Ke,we,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",we,xe]}],"backdrop-blur":[{"backdrop-blur":st()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,we,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,we,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,we,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,we,xe]}],"backdrop-invert":[{"backdrop-invert":["",Ke,we,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,we,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,we,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,we,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",we,xe]}],ease:[{ease:["linear","initial",A,we,xe]}],delay:[{delay:[Ke,we,xe]}],animate:[{animate:["none",T,we,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,we,xe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:ot()}],"rotate-x":[{"rotate-x":ot()}],"rotate-y":[{"rotate-y":ot()}],"rotate-z":[{"rotate-z":ot()}],scale:[{scale:lt()}],"scale-x":[{"scale-x":lt()}],"scale-y":[{"scale-y":lt()}],"scale-z":[{"scale-z":lt()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[we,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"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:[ts,we,xe]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",we,xe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Ke,Jl,xa,Dy]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},e6=RM(JM);function me(...e){return e6(Tc(e))}const t6=$2("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 fe({className:e,variant:t,size:i,...s}){return h.jsx("button",{className:me(t6({variant:t,size:i,className:e})),...s})}const sE=C.createContext({});function i6(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const n6=typeof window<"u",s6=n6?C.useLayoutEffect:C.useEffect,B0=C.createContext(null);function z0(e,t){e.indexOf(t)===-1&&e.push(t)}function Kh(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const fs=(e,t,i)=>i>t?t:i<e?e:i;let I0=()=>{};const qr={},rE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function aE(e){return typeof e=="object"&&e!==null}const oE=e=>/^0[^.\s]+$/u.test(e);function lE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,r6=(e,t)=>i=>t(e(i)),Kc=(...e)=>e.reduce(r6),Ac=(e,t,i)=>{const s=t-e;return s===0?1:(i-e)/s};class P0{constructor(){this.subscriptions=[]}add(t){return z0(this.subscriptions,t),()=>Kh(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 bn=e=>e*1e3,Ln=e=>e/1e3;function cE(e,t){return t?e*(1e3/t):0}const uE=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,a6=1e-7,o6=12;function l6(e,t,i,s,a){let l,c,d=0;do c=t+(i-t)/2,l=uE(c,s,a)-e,l>0?i=c:t=c;while(Math.abs(l)>a6&&++d<o6);return c}function Gc(e,t,i,s){if(e===t&&i===s)return Bn;const a=l=>l6(l,0,1,e,i);return l=>l===0||l===1?l:uE(a(l),t,s)}const hE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,dE=e=>t=>1-e(1-t),fE=Gc(.33,1.53,.69,.99),U0=dE(fE),mE=hE(U0),pE=e=>e>=1?1:(e*=2)<1?.5*U0(e):.5*(2-Math.pow(2,-10*(e-1))),H0=e=>1-Math.sin(Math.acos(e)),gE=dE(H0),_E=hE(H0),c6=Gc(.42,0,1,1),u6=Gc(0,0,.58,1),bE=Gc(.42,0,.58,1),h6=e=>Array.isArray(e)&&typeof e[0]!="number",vE=e=>Array.isArray(e)&&typeof e[0]=="number",d6={linear:Bn,easeIn:c6,easeInOut:bE,easeOut:u6,circIn:H0,circInOut:_E,circOut:gE,backIn:U0,backInOut:mE,backOut:fE,anticipate:pE},f6=e=>typeof e=="string",jy=e=>{if(vE(e)){I0(e.length===4);const[t,i,s,a]=e;return Gc(t,i,s,a)}else if(f6(e))return d6[e];return e},bh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m6(e,t){let i=new Set,s=new Set,a=!1,l=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function m(g){c.has(g)&&(f.schedule(g),e()),g(d)}const f={schedule:(g,b=!1,v=!1)=>{const x=v&&a?i:s;return b&&c.add(g),x.add(g),g},cancel:g=>{s.delete(g),c.delete(g)},process:g=>{if(d=g,a){l=!0;return}a=!0;const b=i;i=s,s=b,i.forEach(m),i.clear(),a=!1,l&&(l=!1,f.process(g))}};return f}const p6=40;function yE(e,t){let i=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>i=!0,c=bh.reduce((M,R)=>(M[R]=m6(l),M),{}),{setup:d,read:m,resolveKeyframes:f,preUpdate:g,update:b,preRender:v,render:y,postRender:x}=c,w=()=>{const M=qr.useManualTiming,R=M?a.timestamp:performance.now();i=!1,M||(a.delta=s?1e3/60:Math.max(Math.min(R-a.timestamp,p6),1)),a.timestamp=R,a.isProcessing=!0,d.process(a),m.process(a),f.process(a),g.process(a),b.process(a),v.process(a),y.process(a),x.process(a),a.isProcessing=!1,i&&t&&(s=!1,e(w))},E=()=>{i=!0,s=!0,a.isProcessing||e(w)};return{schedule:bh.reduce((M,R)=>{const z=c[R];return M[R]=(U,j=!1,O=!1)=>(i||E(),z.schedule(U,j,O)),M},{}),cancel:M=>{for(let R=0;R<bh.length;R++)c[bh[R]].cancel(M)},state:a,steps:c}}const{schedule:wt,cancel:Kr,state:Ni,steps:Vm}=yE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let Rh;function g6(){Rh=void 0}const Fi={now:()=>(Rh===void 0&&Fi.set(Ni.isProcessing||qr.useManualTiming?Ni.timestamp:performance.now()),Rh),set:e=>{Rh=e,queueMicrotask(g6)}},xE=e=>t=>typeof t=="string"&&t.startsWith(e),SE=xE("--"),_6=xE("var(--"),F0=e=>_6(e)?b6.test(e.split("/*")[0].trim()):!1,b6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function By(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Yo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Mc={...Yo,transform:e=>fs(0,1,e)},vh={...Yo,default:1},xc=e=>Math.round(e*1e5)/1e5,$0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function v6(e){return e==null}const y6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,V0=(e,t)=>i=>!!(typeof i=="string"&&y6.test(i)&&i.startsWith(e)||t&&!v6(i)&&Object.prototype.hasOwnProperty.call(i,t)),wE=(e,t,i)=>s=>{if(typeof s!="string")return s;const[a,l,c,d]=s.match($0);return{[e]:parseFloat(a),[t]:parseFloat(l),[i]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},x6=e=>fs(0,255,e),qm={...Yo,transform:e=>Math.round(x6(e))},Ta={test:V0("rgb","red"),parse:wE("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:s=1})=>"rgba("+qm.transform(e)+", "+qm.transform(t)+", "+qm.transform(i)+", "+xc(Mc.transform(s))+")"};function S6(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 pg={test:V0("#"),parse:S6,transform:Ta.transform},Wc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ir=Wc("deg"),cs=Wc("%"),ke=Wc("px"),w6=Wc("vh"),E6=Wc("vw"),zy={...cs,parse:e=>cs.parse(e)/100,transform:e=>cs.transform(e*100)},zo={test:V0("hsl","hue"),parse:wE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(e)+", "+cs.transform(xc(t))+", "+cs.transform(xc(i))+", "+xc(Mc.transform(s))+")"},ii={test:e=>Ta.test(e)||pg.test(e)||zo.test(e),parse:e=>Ta.test(e)?Ta.parse(e):zo.test(e)?zo.parse(e):pg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ta.transform(e):zo.transform(e),getAnimatableNone:e=>{const t=ii.parse(e);return t.alpha=0,ii.transform(t)}},C6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k6(e){return isNaN(e)&&typeof e=="string"&&(e.match($0)?.length||0)+(e.match(C6)?.length||0)>0}const EE="number",CE="color",N6="var",T6="var(",Iy="${}",A6=/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 qo(e){const t=e.toString(),i=[],s={color:[],number:[],var:[]},a=[];let l=0;const d=t.replace(A6,m=>(ii.test(m)?(s.color.push(l),a.push(CE),i.push(ii.parse(m))):m.startsWith(T6)?(s.var.push(l),a.push(N6),i.push(m)):(s.number.push(l),a.push(EE),i.push(parseFloat(m))),++l,Iy)).split(Iy);return{values:i,split:d,indexes:s,types:a}}function M6(e){return qo(e).values}function kE({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===EE?a+=xc(s[l]):c===CE?a+=ii.transform(s[l]):a+=s[l]}return a}}function R6(e){return kE(qo(e))}const D6=e=>typeof e=="number"?0:ii.test(e)?ii.getAnimatableNone(e):e,O6=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:D6(e);function L6(e){const t=qo(e);return kE(t)(t.values.map((s,a)=>O6(s,t.split[a])))}const Yn={test:k6,parse:M6,createTransformer:R6,getAnimatableNone:L6};function Km(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 j6({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 d=i<.5?i*(1+t):i+t-i*t,m=2*i-d;a=Km(m,d,e+1/3),l=Km(m,d,e),c=Km(m,d,e-1/3)}return{red:Math.round(a*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:s}}function Gh(e,t){return i=>i>0?t:e}const At=(e,t,i)=>e+(t-e)*i,Gm=(e,t,i)=>{const s=e*e,a=i*(t*t-s)+s;return a<0?0:Math.sqrt(a)},B6=[pg,Ta,zo],z6=e=>B6.find(t=>t.test(e));function Py(e){const t=z6(e);if(!t)return!1;let i=t.parse(e);return t===zo&&(i=j6(i)),i}const Uy=(e,t)=>{const i=Py(e),s=Py(t);if(!i||!s)return Gh(e,t);const a={...i};return l=>(a.red=Gm(i.red,s.red,l),a.green=Gm(i.green,s.green,l),a.blue=Gm(i.blue,s.blue,l),a.alpha=At(i.alpha,s.alpha,l),Ta.transform(a))},gg=new Set(["none","hidden"]);function I6(e,t){return gg.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function P6(e,t){return i=>At(e,t,i)}function q0(e){return typeof e=="number"?P6:typeof e=="string"?F0(e)?Gh:ii.test(e)?Uy:F6:Array.isArray(e)?NE:typeof e=="object"?ii.test(e)?Uy:U6:Gh}function NE(e,t){const i=[...e],s=i.length,a=e.map((l,c)=>q0(l)(l,t[c]));return l=>{for(let c=0;c<s;c++)i[c]=a[c](l);return i}}function U6(e,t){const i={...e,...t},s={};for(const a in i)e[a]!==void 0&&t[a]!==void 0&&(s[a]=q0(e[a])(e[a],t[a]));return a=>{for(const l in s)i[l]=s[l](a);return i}}function H6(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]],d=e.values[c]??0;i[a]=d,s[l]++}return i}const F6=(e,t)=>{const i=Yn.createTransformer(t),s=qo(e),a=qo(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?gg.has(e)&&!a.values.length||gg.has(t)&&!s.values.length?I6(e,t):Kc(NE(H6(s,a),a.values),i):Gh(e,t)};function TE(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?At(e,t,i):q0(e)(e,t)}const $6=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>wt.update(t,i),stop:()=>Kr(t),now:()=>Ni.isProcessing?Ni.timestamp:Fi.now()}},AE=(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)})`},Wh=2e4;function K0(e){let t=0;const i=50;let s=e.next(t);for(;!s.done&&t<Wh;)t+=i,s=e.next(t);return t>=Wh?1/0:t}function V6(e,t=100,i){const s=i({...e,keyframes:[0,t]}),a=Math.min(K0(s),Wh);return{type:"keyframes",ease:l=>s.next(a*l).value/t,duration:Ln(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 _g(e,t){return e*Math.sqrt(1-t*t)}const q6=12;function K6(e,t,i){let s=i;for(let a=1;a<q6;a++)s=s-e(s)/t(s);return s}const Wm=.001;function G6({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:i=Pt.velocity,mass:s=Pt.mass}){let a,l,c=1-t;c=fs(Pt.minDamping,Pt.maxDamping,c),e=fs(Pt.minDuration,Pt.maxDuration,Ln(e)),c<1?(a=f=>{const g=f*c,b=g*e,v=g-i,y=_g(f,c),x=Math.exp(-b);return Wm-v/y*x},l=f=>{const b=f*c*e,v=b*i+i,y=Math.pow(c,2)*Math.pow(f,2)*e,x=Math.exp(-b),w=_g(Math.pow(f,2),c);return(-a(f)+Wm>0?-1:1)*((v-y)*x)/w}):(a=f=>{const g=Math.exp(-f*e),b=(f-i)*e+1;return-Wm+g*b},l=f=>{const g=Math.exp(-f*e),b=(i-f)*(e*e);return g*b});const d=5/e,m=K6(a,l,d);if(e=bn(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 W6=["duration","bounce"],Y6=["stiffness","damping","mass"];function Hy(e,t){return t.some(i=>e[i]!==void 0)}function X6(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Hy(e,Y6)&&Hy(e,W6))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,s=2*Math.PI/(i*1.2),a=s*s,l=2*fs(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Pt.mass,stiffness:a,damping:l}}else{const i=G6({...e,velocity:0});t={...t,...i,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function Yh(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],d={done:!1,value:l},{stiffness:m,damping:f,mass:g,duration:b,velocity:v,isResolvedFromDuration:y}=X6({...i,velocity:-Ln(i.velocity||0)}),x=v||0,w=f/(2*Math.sqrt(m*g)),E=c-l,A=Ln(Math.sqrt(m/g)),T=Math.abs(E)<5;s||(s=T?Pt.restSpeed.granular:Pt.restSpeed.default),a||(a=T?Pt.restDelta.granular:Pt.restDelta.default);let M,R,z,U,j,O;if(w<1)z=_g(A,w),U=(x+w*A*E)/z,M=H=>{const G=Math.exp(-w*A*H);return c-G*(U*Math.sin(z*H)+E*Math.cos(z*H))},j=w*A*U+E*z,O=w*A*E-U*z,R=H=>Math.exp(-w*A*H)*(j*Math.sin(z*H)+O*Math.cos(z*H));else if(w===1){M=G=>c-Math.exp(-A*G)*(E+(x+A*E)*G);const H=x+A*E;R=G=>Math.exp(-A*G)*(A*H*G-x)}else{const H=A*Math.sqrt(w*w-1);M=ee=>{const q=Math.exp(-w*A*ee),N=Math.min(H*ee,300);return c-q*((x+w*A*E)*Math.sinh(N)+H*E*Math.cosh(N))/H};const G=(x+w*A*E)/H,J=w*A*G-E*H,P=w*A*E-G*H;R=ee=>{const q=Math.exp(-w*A*ee),N=Math.min(H*ee,300);return q*(J*Math.sinh(N)+P*Math.cosh(N))}}const K={calculatedDuration:y&&b||null,velocity:H=>bn(R(H)),next:H=>{if(!y&&w<1){const J=Math.exp(-w*A*H),P=Math.sin(z*H),ee=Math.cos(z*H),q=c-J*(U*P+E*ee),N=bn(J*(j*P+O*ee));return d.done=Math.abs(N)<=s&&Math.abs(c-q)<=a,d.value=d.done?c:q,d}const G=M(H);if(y)d.done=H>=b;else{const J=bn(R(H));d.done=Math.abs(J)<=s&&Math.abs(c-G)<=a}return d.value=d.done?c:G,d},toString:()=>{const H=Math.min(K0(K),Wh),G=AE(J=>K.next(H*J).value,H,30);return H+"ms "+G},toTransition:()=>{}};return K}Yh.applyToOptions=e=>{const t=V6(e,100,Yh);return e.ease=t.ease,e.duration=bn(t.duration),e.type="keyframes",e};const Z6=5;function ME(e,t,i){const s=Math.max(t-Z6,0);return cE(i-e(s),t-s)}function bg({keyframes:e,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:l=500,modifyTarget:c,min:d,max:m,restDelta:f=.5,restSpeed:g}){const b=e[0],v={done:!1,value:b},y=O=>d!==void 0&&O<d||m!==void 0&&O>m,x=O=>d===void 0?m:m===void 0||Math.abs(d-O)<Math.abs(m-O)?d:m;let w=i*t;const E=b+w,A=c===void 0?E:c(E);A!==E&&(w=A-b);const T=O=>-w*Math.exp(-O/s),M=O=>A+T(O),R=O=>{const K=T(O),H=M(O);v.done=Math.abs(K)<=f,v.value=v.done?A:H};let z,U;const j=O=>{y(v.value)&&(z=O,U=Yh({keyframes:[v.value,x(v.value)],velocity:ME(M,O,v.value),damping:a,stiffness:l,restDelta:f,restSpeed:g}))};return j(0),{calculatedDuration:null,next:O=>{let K=!1;return!U&&z===void 0&&(K=!0,R(O),j(O)),z!==void 0&&O>=z?U.next(O-z):(!K&&R(O),v)}}}function Q6(e,t,i){const s=[],a=i||qr.mix||TE,l=e.length-1;for(let c=0;c<l;c++){let d=a(e[c],e[c+1]);if(t){const m=Array.isArray(t)?t[c]||Bn:t;d=Kc(m,d)}s.push(d)}return s}function J6(e,t,{clamp:i=!0,ease:s,mixer:a}={}){const l=e.length;if(I0(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 d=Q6(t,s,a),m=d.length,f=g=>{if(c&&g<e[0])return t[0];let b=0;if(m>1)for(;b<e.length-2&&!(g<e[b+1]);b++);const v=Ac(e[b],e[b+1],g);return d[b](v)};return i?g=>f(fs(e[0],e[l-1],g)):f}function eR(e,t){const i=e[e.length-1];for(let s=1;s<=t;s++){const a=Ac(0,t,s);e.push(At(i,1,a))}}function tR(e){const t=[0];return eR(t,e.length-1),t}function iR(e,t){return e.map(i=>i*t)}function nR(e,t){return e.map(()=>t||bE).splice(0,e.length-1)}function Sc({duration:e=300,keyframes:t,times:i,ease:s="easeInOut"}){const a=h6(s)?s.map(jy):jy(s),l={done:!1,value:t[0]},c=iR(i&&i.length===t.length?i:tR(t),e),d=J6(c,t,{ease:Array.isArray(a)?a:nR(t,a)});return{calculatedDuration:e,next:m=>(l.value=d(m),l.done=m>=e,l)}}const sR=e=>e!==null;function yd(e,{repeat:t,repeatType:i="loop"},s,a=1){const l=e.filter(sR),d=a<0||t&&i!=="loop"&&t%2===1?0:l.length-1;return!d||s===void 0?l[d]:s}const rR={decay:bg,inertia:bg,tween:Sc,keyframes:Sc,spring:Yh};function RE(e){typeof e.type=="string"&&(e.type=rR[e.type])}class G0{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 aR=e=>e/100;class Xh extends G0{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!==Fi.now()&&this.tick(Fi.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;RE(t);const{type:i=Sc,repeat:s=0,repeatDelay:a=0,repeatType:l,velocity:c=0}=t;let{keyframes:d}=t;const m=i||Sc;m!==Sc&&typeof d[0]!="number"&&(this.mixKeyframes=Kc(aR,TE(d[0],d[1])),d=[0,100]);const f=m({...t,keyframes:d});l==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...d].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=K0(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:d,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:f=0,keyframes:g,repeat:b,repeatType:v,repeatDelay:y,type:x,onUpdate:w,finalKeyframe:E}=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 A=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?A<0:A>a;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let M=this.currentTime,R=s;if(b){const O=Math.min(this.currentTime,a)/d;let K=Math.floor(O),H=O%1;!H&&O>=1&&(H=1),H===1&&K--,K=Math.min(K,b+1),K%2&&(v==="reverse"?(H=1-H,y&&(H-=y/d)):v==="mirror"&&(R=c)),M=fs(0,1,H)*d}let z;T?(this.delayState.value=g[0],z=this.delayState):z=R.next(M),l&&!T&&(z.value=l(z.value));let{done:U}=z;!T&&m!==null&&(U=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return j&&x!==bg&&(z.value=yd(g,this.options,E,this.speed)),w&&w(z.value),j&&this.finish(),z}then(t,i){return this.finished.then(t,i)}get duration(){return Ln(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ln(t)}get time(){return Ln(this.currentTime)}set time(t){t=bn(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 ME(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(Fi.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=Ln(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=$6,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(Fi.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 oR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Aa=e=>e*180/Math.PI,vg=e=>{const t=Aa(Math.atan2(e[1],e[0]));return yg(t)},lR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:vg,rotateZ:vg,skewX:e=>Aa(Math.atan(e[1])),skewY:e=>Aa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yg=e=>(e=e%360,e<0&&(e+=360),e),Fy=vg,$y=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Vy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),cR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$y,scaleY:Vy,scale:e=>($y(e)+Vy(e))/2,rotateX:e=>yg(Aa(Math.atan2(e[6],e[5]))),rotateY:e=>yg(Aa(Math.atan2(-e[2],e[0]))),rotateZ:Fy,rotate:Fy,skewX:e=>Aa(Math.atan(e[4])),skewY:e=>Aa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function xg(e){return e.includes("scale")?1:0}function Sg(e,t){if(!e||e==="none")return xg(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(i)s=cR,a=i;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=lR,a=d}if(!a)return xg(t);const l=s[t],c=a[1].split(",").map(hR);return typeof l=="function"?l(c):c[l]}const uR=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Sg(i,t)};function hR(e){return parseFloat(e.trim())}const Xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zo=new Set(Xo),qy=e=>e===Yo||e===ke,dR=new Set(["x","y","z"]),fR=Xo.filter(e=>!dR.has(e));function mR(e){const t=[];return fR.forEach(i=>{const s=e.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Hr={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})=>Sg(t,"x"),y:(e,{transform:t})=>Sg(t,"y")};Hr.translateX=Hr.x;Hr.translateY=Hr.y;const Ra=new Set;let wg=!1,Eg=!1,Cg=!1;function DE(){if(Eg){const e=Array.from(Ra).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),i=new Map;t.forEach(s=>{const a=mR(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)})}Eg=!1,wg=!1,Ra.forEach(e=>e.complete(Cg)),Ra.clear()}function OE(){Ra.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Eg=!0)})}function pR(){Cg=!0,OE(),DE(),Cg=!1}class W0{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?(Ra.add(this),wg||(wg=!0,wt.read(OE),wt.resolveKeyframes(DE))):(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 d=s.readValue(i,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),a&&l===void 0&&a.set(t[0])}oR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ra.delete(this)}cancel(){this.state==="scheduled"&&(Ra.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const gR=e=>e.startsWith("--");function LE(e,t,i){gR(t)?e.style.setProperty(t,i):e.style[t]=i}const _R={};function jE(e,t){const i=lE(e);return()=>_R[t]??i()}const bR=jE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),BE=jE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dc=([e,t,i,s])=>`cubic-bezier(${e}, ${t}, ${i}, ${s})`,Ky={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dc([0,.65,.55,1]),circOut:dc([.55,0,1,.45]),backIn:dc([.31,.01,.66,-.59]),backOut:dc([.33,1.53,.69,.99])};function zE(e,t){if(e)return typeof e=="function"?BE()?AE(e,t):"ease-out":vE(e)?dc(e):Array.isArray(e)?e.map(i=>zE(i,t)||Ky.easeOut):Ky[e]}function vR(e,t,i,{delay:s=0,duration:a=300,repeat:l=0,repeatType:c="loop",ease:d="easeOut",times:m}={},f=void 0){const g={[t]:i};m&&(g.offset=m);const b=zE(d,a);Array.isArray(b)&&(g.easing=b);const v={delay:s,duration:a,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),e.animate(g,v)}function IE(e){return typeof e=="function"&&"applyToOptions"in e}function yR({type:e,...t}){return IE(e)&&BE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class PE extends G0{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:d,onComplete:m}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,I0(typeof t.type!="string");const f=yR(t);this.animation=vR(i,s,a,f,l),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const g=yd(a,this.options,d,this.speed);this.updateMotionValue&&this.updateMotionValue(g),LE(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 Ln(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ln(t)}get time(){return Ln(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=bn(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&&bR()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),s&&(this.animation.rangeEnd=s),Bn):a(this)}}const UE={anticipate:pE,backInOut:mE,circInOut:_E};function xR(e){return e in UE}function SR(e){typeof e.ease=="string"&&xR(e.ease)&&(e.ease=UE[e.ease])}const Ym=10;class wR extends PE{constructor(t){SR(t),RE(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 d=new Xh({...c,autoplay:!1}),m=Math.max(Ym,Fi.now()-this.startTime),f=fs(0,Ym,m-Ym),g=d.sample(m).value,{name:b}=this.options;l&&b&&LE(l,b,g),i.setWithVelocity(d.sample(Math.max(0,m-f)).value,g,f),d.stop()}}const Gy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Yn.test(e)||e==="0")&&!e.startsWith("url("));function ER(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 CR(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=Gy(a,t),d=Gy(l,t);return!c||!d?!1:ER(e)||(i==="spring"||IE(i))&&s}function kg(e){e.duration=0,e.type="keyframes"}const HE=new Set(["opacity","clipPath","filter","transform"]),kR=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function NR(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&kR.test(e[t]))return!0;return!1}const TR=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),AR=lE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function MR(e){const{motionValue:t,name:i,repeatDelay:s,repeatType:a,damping:l,type:c,keyframes:d}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:g}=t.owner.getProps();return AR()&&i&&(HE.has(i)||TR.has(i)&&NR(d))&&(i!=="transform"||!g)&&!f&&!s&&a!=="mirror"&&l!==0&&c!=="inertia"}const RR=40;class DR extends G0{constructor({autoplay:t=!0,delay:i=0,type:s="keyframes",repeat:a=0,repeatDelay:l=0,repeatType:c="loop",keyframes:d,name:m,motionValue:f,element:g,...b}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Fi.now();const v={autoplay:t,delay:i,type:s,repeat:a,repeatDelay:l,repeatType:c,name:m,motionValue:f,element:g,...b},y=g?.KeyframeResolver||W0;this.keyframeResolver=new y(d,(x,w,E)=>this.onKeyframesResolved(x,w,v,!E),m,f,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,a){this.keyframeResolver=void 0;const{name:l,type:c,velocity:d,delay:m,isHandoff:f,onUpdate:g}=s;this.resolvedAt=Fi.now();let b=!0;CR(t,l,c,d)||(b=!1,(qr.instantAnimations||!m)&&g?.(yd(t,s,i)),t[0]=t[t.length-1],kg(s),s.repeat=0);const y={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>RR?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},x=b&&!f&&MR(y),w=y.motionValue?.owner?.current;let E;if(x)try{E=new wR({...y,element:w})}catch{E=new Xh(y)}else E=new Xh(y);E.finished.then(()=>{this.notifyFinished()}).catch(Bn),this.pendingTimeline&&(this.stopTimeline=E.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=E}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(),pR()),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 FE(e,t,i,s=0,a=1){const l=Array.from(e).sort((f,g)=>f.sortNodePosition(g)).indexOf(t),c=e.size,d=(c-1)*s;return typeof i=="function"?i(l,c):a===1?l*s:d-l*s}const OR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function LR(e){const t=OR.exec(e);if(!t)return[,];const[,i,s,a]=t;return[`--${i??s}`,a]}function $E(e,t,i=1){const[s,a]=LR(e);if(!s)return;const l=window.getComputedStyle(t).getPropertyValue(s);if(l){const c=l.trim();return rE(c)?parseFloat(c):c}return F0(a)?$E(a,t,i+1):a}const jR={type:"spring",stiffness:500,damping:25,restSpeed:10},BR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),zR={type:"keyframes",duration:.8},IR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PR=(e,{keyframes:t})=>t.length>2?zR:Zo.has(e)?e.startsWith("scale")?BR(t[1]):jR:IR;function VE(e,t){if(e?.inherit&&t){const{inherit:i,...s}=e;return{...t,...s}}return e}function Y0(e,t){const i=e?.[t]??e?.default??e;return i!==e?VE(i,e):i}const UR=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function HR(e){for(const t in e)if(!UR.has(t))return!0;return!1}const X0=(e,t,i,s={},a,l)=>c=>{const d=Y0(s,e)||{},m=d.delay||s.delay||0;let{elapsed:f=0}=s;f=f-bn(m);const g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-f,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:l?void 0:a};HR(d)||Object.assign(g,PR(e,g)),g.duration&&(g.duration=bn(g.duration)),g.repeatDelay&&(g.repeatDelay=bn(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let b=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(kg(g),g.delay===0&&(b=!0)),(qr.instantAnimations||qr.skipAnimations||a?.shouldSkipAnimations)&&(b=!0,kg(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,b&&!l&&t.get()!==void 0){const v=yd(g.keyframes,d);if(v!==void 0){wt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return d.isSync?new Xh(g):new DR(g)};function Wy(e){const t=[{},{}];return e?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function Z0(e,t,i,s){if(typeof t=="function"){const[a,l]=Wy(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]=Wy(s);t=t(i!==void 0?i:e.custom,a,l)}return t}function Da(e,t,i){const s=e.getProps();return Z0(s,t,i!==void 0?i:s.custom,e)}const qE=new Set(["width","height","top","left","right","bottom",...Xo]),Yy=30,FR=e=>!isNaN(parseFloat(e));class $R{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const a=Fi.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=Fi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FR(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 P0);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=Fi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Yy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Yy);return cE(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 Ko(e,t){return new $R(e,t)}const Ng=e=>Array.isArray(e);function VR(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,Ko(i))}function qR(e){return Ng(e)?e[e.length-1]||0:e}function KR(e,t){const i=Da(e,t);let{transitionEnd:s={},transition:a={},...l}=i||{};l={...l,...s};for(const c in l){const d=qR(l[c]);VR(e,c,d)}}const Ai=e=>!!(e&&e.getVelocity);function GR(e){return!!(Ai(e)&&e.add)}function Tg(e,t){const i=e.getValue("willChange");if(GR(i))return i.add(t);if(!i&&qr.WillChange){const s=new qr.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Q0(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const WR="framerAppearId",KE="data-"+Q0(WR);function GE(e){return e.props[KE]}function YR({protectedKeys:e,needsAnimating:t},i){const s=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function WE(e,t,{delay:i=0,transitionOverride:s,type:a}={}){let{transition:l,transitionEnd:c,...d}=t;const m=e.getDefaultTransition();l=l?VE(l,m):m;const f=l?.reduceMotion;s&&(l=s);const g=[],b=a&&e.animationState&&e.animationState.getState()[a];for(const v in d){const y=e.getValue(v,e.latestValues[v]??null),x=d[v];if(x===void 0||b&&YR(b,v))continue;const w={delay:i,...Y0(l||{},v)},E=y.get();if(E!==void 0&&!y.isAnimating()&&!Array.isArray(x)&&x===E&&!w.velocity){wt.update(()=>y.set(x));continue}let A=!1;if(window.MotionHandoffAnimation){const R=GE(e);if(R){const z=window.MotionHandoffAnimation(R,v,wt);z!==null&&(w.startTime=z,A=!0)}}Tg(e,v);const T=f??e.shouldReduceMotion;y.start(X0(v,y,x,T&&qE.has(v)?{type:!1}:w,e,A));const M=y.animation;M&&g.push(M)}if(c){const v=()=>wt.update(()=>{c&&KR(e,c)});g.length?Promise.all(g).then(v):v()}return g}function Ag(e,t,i={}){const s=Da(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(WE(e,s,i)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:g,staggerDirection:b}=a;return XR(e,t,m,f,g,b,i)}:()=>Promise.resolve(),{when:d}=a;if(d){const[m,f]=d==="beforeChildren"?[l,c]:[c,l];return m().then(()=>f())}else return Promise.all([l(),c(i.delay)])}function XR(e,t,i=0,s=0,a=0,l=1,c){const d=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),d.push(Ag(m,t,{...c,delay:i+(typeof s=="function"?0:s)+FE(e.variantChildren,m,s,a,l)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(d)}function ZR(e,t,i={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(l=>Ag(e,l,i));s=Promise.all(a)}else if(typeof t=="string")s=Ag(e,t,i);else{const a=typeof t=="function"?Da(e,t,i.custom):t;s=Promise.all(WE(e,a,i))}return s.then(()=>{e.notify("AnimationComplete",t)})}const QR={test:e=>e==="auto",parse:e=>e},YE=e=>t=>t.test(e),XE=[Yo,ke,cs,Ir,E6,w6,QR],Xy=e=>XE.find(YE(e));function JR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oE(e):!0}const e8=new Set(["brightness","contrast","saturate","opacity"]);function t8(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=i.match($0)||[];if(!s)return e;const a=i.replace(s,"");let l=e8.has(t)?1:0;return s!==i&&(l*=100),t+"("+l+a+")"}const i8=/\b([a-z-]*)\(.*?\)/gu,Mg={...Yn,getAnimatableNone:e=>{const t=e.match(i8);return t?t.map(t8).join(" "):e}},Rg={...Yn,getAnimatableNone:e=>{const t=Yn.parse(e);return Yn.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Zy={...Yo,transform:Math.round},n8={rotate:Ir,rotateX:Ir,rotateY:Ir,rotateZ:Ir,scale:vh,scaleX:vh,scaleY:vh,scaleZ:vh,skew:Ir,skewX:Ir,skewY:Ir,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Mc,originX:zy,originY:zy,originZ:ke},J0={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...n8,zIndex:Zy,fillOpacity:Mc,strokeOpacity:Mc,numOctaves:Zy},s8={...J0,color:ii,backgroundColor:ii,outlineColor:ii,fill:ii,stroke:ii,borderColor:ii,borderTopColor:ii,borderRightColor:ii,borderBottomColor:ii,borderLeftColor:ii,filter:Mg,WebkitFilter:Mg,mask:Rg,WebkitMask:Rg},ZE=e=>s8[e],r8=new Set([Mg,Rg]);function QE(e,t){let i=ZE(e);return r8.has(i)||(i=Yn),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const a8=new Set(["auto","none","0"]);function o8(e,t,i){let s=0,a;for(;s<e.length&&!a;){const l=e[s];typeof l=="string"&&!a8.has(l)&&qo(l).values.length&&(a=e[s]),s++}if(a&&i)for(const l of t)e[l]=QE(i,a)}class l8 extends W0{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 b=t[g];if(typeof b=="string"&&(b=b.trim(),F0(b))){const v=$E(b,i.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!qE.has(s)||t.length!==2)return;const[a,l]=t,c=Xy(a),d=Xy(l),m=By(a),f=By(l);if(m!==f&&Hr[s]){this.needsMeasurement=!0;return}if(c!==d)if(qy(c)&&qy(d))for(let g=0;g<t.length;g++){const b=t[g];typeof b=="string"&&(t[g]=parseFloat(b))}else Hr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||JR(t[a]))&&s.push(a);s.length&&o8(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=Hr[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]=Hr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,m])=>{t.getValue(d).set(m)}),this.resolveNoneKeyframes()}}function JE(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 eC=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function c8(e){return aE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:e_}=yE(queueMicrotask,!1),Kn={x:!1,y:!1};function tC(){return Kn.x||Kn.y}function u8(e){return e==="x"||e==="y"?Kn[e]?null:(Kn[e]=!0,()=>{Kn[e]=!1}):Kn.x||Kn.y?null:(Kn.x=Kn.y=!0,()=>{Kn.x=Kn.y=!1})}function iC(e,t){const i=JE(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[i,a,()=>s.abort()]}function h8(e){return!(e.pointerType==="touch"||tC())}function d8(e,t,i={}){const[s,a,l]=iC(e,i);return s.forEach(c=>{let d=!1,m=!1,f;const g=()=>{c.removeEventListener("pointerleave",x)},b=E=>{f&&(f(E),f=void 0),g()},v=E=>{d=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),m&&(m=!1,b(E))},y=()=>{d=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},x=E=>{if(E.pointerType!=="touch"){if(d){m=!0;return}b(E)}},w=E=>{if(!h8(E))return;m=!1;const A=t(c,E);typeof A=="function"&&(f=A,c.addEventListener("pointerleave",x,a))};c.addEventListener("pointerenter",w,a),c.addEventListener("pointerdown",y,a)}),l}const nC=(e,t)=>t?e===t?!0:nC(e,t.parentElement):!1,t_=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,f8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function m8(e){return f8.has(e.tagName)||e.isContentEditable===!0}const p8=new Set(["INPUT","SELECT","TEXTAREA"]);function g8(e){return p8.has(e.tagName)||e.isContentEditable===!0}const Dh=new WeakSet;function Qy(e){return t=>{t.key==="Enter"&&e(t)}}function Xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const _8=(e,t)=>{const i=e.currentTarget;if(!i)return;const s=Qy(()=>{if(Dh.has(i))return;Xm(i,"down");const a=Qy(()=>{Xm(i,"up")}),l=()=>Xm(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 Jy(e){return t_(e)&&!tC()}const ex=new WeakSet;function b8(e,t,i={}){const[s,a,l]=iC(e,i),c=d=>{const m=d.currentTarget;if(!Jy(d)||ex.has(d))return;Dh.add(m),i.stopPropagation&&ex.add(d);const f=t(m,d),g=(y,x)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",v),Dh.has(m)&&Dh.delete(m),Jy(y)&&typeof f=="function"&&f(y,{success:x})},b=y=>{g(y,m===window||m===document||i.useGlobalTarget||nC(m,y.target))},v=y=>{g(y,!1)};window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",v,a)};return s.forEach(d=>{(i.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),c8(d)&&(d.addEventListener("focus",f=>_8(f,a)),!m8(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),l}function i_(e){return aE(e)&&"ownerSVGElement"in e}const Oh=new WeakMap;let Lh;const sC=(e,t,i)=>(s,a)=>a&&a[0]?a[0][e+"Size"]:i_(s)&&"getBBox"in s?s.getBBox()[t]:s[i],v8=sC("inline","width","offsetWidth"),y8=sC("block","height","offsetHeight");function x8({target:e,borderBoxSize:t}){Oh.get(e)?.forEach(i=>{i(e,{get width(){return v8(e,t)},get height(){return y8(e,t)}})})}function S8(e){e.forEach(x8)}function w8(){typeof ResizeObserver>"u"||(Lh=new ResizeObserver(S8))}function E8(e,t){Lh||w8();const i=JE(e);return i.forEach(s=>{let a=Oh.get(s);a||(a=new Set,Oh.set(s,a)),a.add(t),Lh?.observe(s)}),()=>{i.forEach(s=>{const a=Oh.get(s);a?.delete(t),a?.size||Lh?.unobserve(s)})}}const jh=new Set;let Io;function C8(){Io=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jh.forEach(t=>t(e))},window.addEventListener("resize",Io)}function k8(e){return jh.add(e),Io||C8(),()=>{jh.delete(e),!jh.size&&typeof Io=="function"&&(window.removeEventListener("resize",Io),Io=void 0)}}function tx(e,t){return typeof e=="function"?k8(e):E8(e,t)}function N8(e){return i_(e)&&e.tagName==="svg"}const T8=[...XE,ii,Yn],A8=e=>T8.find(YE(e)),ix=()=>({translate:0,scale:1,origin:0,originPoint:0}),Po=()=>({x:ix(),y:ix()}),nx=()=>({min:0,max:0}),ui=()=>({x:nx(),y:nx()}),M8=new WeakMap;function xd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Rc(e){return typeof e=="string"||Array.isArray(e)}const n_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],s_=["initial",...n_];function Sd(e){return xd(e.animate)||s_.some(t=>Rc(e[t]))}function rC(e){return!!(Sd(e)||e.variants)}function R8(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,Ko(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,Ko(c!==void 0?c:a,{owner:e}))}}for(const s in i)t[s]===void 0&&e.removeValue(s);return t}const Dg={current:null},aC={current:!1},D8=typeof window<"u";function O8(){if(aC.current=!0,!!D8)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Dg.current=e.matches;e.addEventListener("change",t),t()}else Dg.current=!1}const sx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zh={};function oC(e){Zh=e}function L8(){return Zh}class j8{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,reducedMotionConfig:a,skipAnimations:l,blockInitialAnimation:c,visualState:d},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=W0,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 y=Fi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,wt.render(this.render,!1,!0))};const{latestValues:f,renderState:g}=d;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=Sd(i),this.isVariantNode=rC(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,...v}=this.scrapeMotionValuesFromProps(i,{},this);for(const y in v){const x=v[y];f[y]!==void 0&&Ai(x)&&x.set(f[y])}}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,M8.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||O8(),this.shouldReduceMotion=Dg.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(),Kr(this.notifyUpdate),Kr(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&&HE.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:d,times:m,ease:f,duration:g}=i.accelerate,b=new PE({element:this.current,name:t,keyframes:d,times:m,ease:f,duration:bn(g)}),v=c(b);this.valueSubscriptions.set(t,()=>{v(),b.cancel()});return}const s=Zo.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 Zh){const i=Zh[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<sx.length;s++){const a=sx[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=R8(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=Ko(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"&&(rE(s)||oE(s))?s=parseFloat(s):!A8(s)&&Yn.test(i)&&(s=QE(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=Z0(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 P0),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){e_.render(this.render)}}class lC extends j8{constructor(){super(...arguments),this.KeyframeResolver=l8}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 Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cC({top:e,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:e,max:s}}}function B8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function z8(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 Zm(e){return e===void 0||e===1}function Og({scale:e,scaleX:t,scaleY:i}){return!Zm(e)||!Zm(t)||!Zm(i)}function Ea(e){return Og(e)||uC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function uC(e){return rx(e.x)||rx(e.y)}function rx(e){return e&&e!=="0%"}function Qh(e,t,i){const s=e-i,a=t*s;return i+a}function ax(e,t,i,s,a){return a!==void 0&&(e=Qh(e,a,s)),Qh(e,i,s)+t}function Lg(e,t=0,i=1,s,a){e.min=ax(e.min,t,i,s,a),e.max=ax(e.max,t,i,s,a)}function hC(e,{x:t,y:i}){Lg(e.x,t.translate,t.scale,t.originPoint),Lg(e.y,i.translate,i.scale,i.originPoint)}const ox=.999999999999,lx=1.0000000000001;function I8(e,t,i,s=!1){const a=i.length;if(!a)return;t.x=t.y=1;let l,c;for(let d=0;d<a;d++){l=i[d],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&&(os(e.x,-l.scroll.offset.x),os(e.y,-l.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,hC(e,c)),s&&Ea(l.latestValues)&&Bh(e,l.latestValues,l.layout?.layoutBox))}t.x<lx&&t.x>ox&&(t.x=1),t.y<lx&&t.y>ox&&(t.y=1)}function os(e,t){e.min+=t,e.max+=t}function cx(e,t,i,s,a=.5){const l=At(e.min,e.max,a);Lg(e,t,i,l,s)}function ux(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Bh(e,t,i){const s=i??e;cx(e.x,ux(t.x,s.x),t.scaleX,t.scale,t.originX),cx(e.y,ux(t.y,s.y),t.scaleY,t.scale,t.originY)}function dC(e,t){return cC(z8(e.getBoundingClientRect(),t))}function P8(e,t,i){const s=dC(e,i),{scroll:a}=t;return a&&(os(s.x,a.offset.x),os(s.y,a.offset.y)),s}const U8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H8=Xo.length;function F8(e,t,i){let s="",a=!0;for(let l=0;l<H8;l++){const c=Xo[l],d=e[c];if(d===void 0)continue;let m=!0;if(typeof d=="number")m=d===(c.startsWith("scale")?1:0);else{const f=parseFloat(d);m=c.startsWith("scale")?f===1:f===0}if(!m||i){const f=eC(d,J0[c]);if(!m){a=!1;const g=U8[c]||c;s+=`${g}(${f}) `}i&&(t[c]=f)}}return s=s.trim(),i?s=i(t,a?"":s):a&&(s="none"),s}function r_(e,t,i){const{style:s,vars:a,transformOrigin:l}=e;let c=!1,d=!1;for(const m in t){const f=t[m];if(Zo.has(m)){c=!0;continue}else if(SE(m)){a[m]=f;continue}else{const g=eC(f,J0[m]);m.startsWith("origin")?(d=!0,l[m]=g):s[m]=g}}if(t.transform||(c||i?s.transform=F8(t,e.transform,i):s.transform&&(s.transform="none")),d){const{originX:m="50%",originY:f="50%",originZ:g=0}=l;s.transformOrigin=`${m} ${f} ${g}`}}function fC(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 hx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ec={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const i=hx(e,t.target.x),s=hx(e,t.target.y);return`${i}% ${s}%`}},$8={correct:(e,{treeScale:t,projectionDelta:i})=>{const s=e,a=Yn.parse(e);if(a.length>5)return s;const l=Yn.createTransformer(e),c=typeof a[0]!="number"?1:0,d=i.x.scale*t.x,m=i.y.scale*t.y;a[0+c]/=d,a[1+c]/=m;const f=At(d,m,.5);return typeof a[2+c]=="number"&&(a[2+c]/=f),typeof a[3+c]=="number"&&(a[3+c]/=f),l(a)}},jg={borderRadius:{...ec,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ec,borderTopRightRadius:ec,borderBottomLeftRadius:ec,borderBottomRightRadius:ec,boxShadow:$8};function mC(e,{layout:t,layoutId:i}){return Zo.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!jg[e]||e==="opacity")}function a_(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])||mC(c,e)||i?.getValue(c)?.liveStyle!==void 0)&&(l[c]=s[c]);return l}function V8(e){return window.getComputedStyle(e)}class q8 extends lC{constructor(){super(...arguments),this.type="html",this.renderInstance=fC}readValueFromInstance(t,i){if(Zo.has(i))return this.projection?.isProjecting?xg(i):uR(t,i);{const s=V8(t),a=(SE(i)?s.getPropertyValue(i):s[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return dC(t,i)}build(t,i,s){r_(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return a_(t,i,s)}}const K8={offset:"stroke-dashoffset",array:"stroke-dasharray"},G8={offset:"strokeDashoffset",array:"strokeDasharray"};function W8(e,t,i=1,s=0,a=!0){e.pathLength=1;const l=a?K8:G8;e[l.offset]=`${-s}`,e[l.array]=`${t} ${i}`}const Y8=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pC(e,{attrX:t,attrY:i,attrScale:s,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...d},m,f,g){if(r_(e,d,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:b,style:v}=e;b.transform&&(v.transform=b.transform,delete b.transform),(v.transform||b.transformOrigin)&&(v.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete b.transformBox);for(const y of Y8)b[y]!==void 0&&(v[y]=b[y],delete b[y]);t!==void 0&&(b.x=t),i!==void 0&&(b.y=i),s!==void 0&&(b.scale=s),a!==void 0&&W8(b,a,l,c,!1)}const gC=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"]),_C=e=>typeof e=="string"&&e.toLowerCase()==="svg";function X8(e,t,i,s){fC(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(gC.has(a)?a:Q0(a),t.attrs[a])}function bC(e,t,i){const s=a_(e,t,i);for(const a in e)if(Ai(e[a])||Ai(t[a])){const l=Xo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[l]=e[a]}return s}class Z8 extends lC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ui}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(Zo.has(i)){const s=ZE(i);return s&&s.default||0}return i=gC.has(i)?i:Q0(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return bC(t,i,s)}build(t,i,s){pC(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,a){X8(t,i,s,a)}mount(t){this.isSVGTag=_C(t.tagName),super.mount(t)}}const Q8=s_.length;function vC(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?vC(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;i<Q8;i++){const s=s_[i],a=e.props[s];(Rc(a)||a===!1)&&(t[s]=a)}return t}function yC(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 J8=[...n_].reverse(),eD=n_.length;function tD(e){return t=>Promise.all(t.map(({animation:i,options:s})=>ZR(e,i,s)))}function iD(e){let t=tD(e),i=dx(),s=!0,a=!1;const l=f=>(g,b)=>{const v=Da(e,b,f==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:y,transitionEnd:x,...w}=v;g={...g,...w,...x}}return g};function c(f){t=f(e)}function d(f){const{props:g}=e,b=vC(e.parent)||{},v=[],y=new Set;let x={},w=1/0;for(let A=0;A<eD;A++){const T=J8[A],M=i[T],R=g[T]!==void 0?g[T]:b[T],z=Rc(R),U=T===f?M.isActive:null;U===!1&&(w=A);let j=R===b[T]&&R!==g[T]&&z;if(j&&(s||a)&&e.manuallyAnimateOnMount&&(j=!1),M.protectedKeys={...x},!M.isActive&&U===null||!R&&!M.prevProp||xd(R)||typeof R=="boolean")continue;if(T==="exit"&&M.isActive&&U!==!0){M.prevResolvedValues&&(x={...x,...M.prevResolvedValues});continue}const O=nD(M.prevProp,R);let K=O||T===f&&M.isActive&&!j&&z||A>w&&z,H=!1;const G=Array.isArray(R)?R:[R];let J=G.reduce(l(T),{});U===!1&&(J={});const{prevResolvedValues:P={}}=M,ee={...P,...J},q=$=>{K=!0,y.has($)&&(H=!0,y.delete($)),M.needsAnimating[$]=!0;const Z=e.getValue($);Z&&(Z.liveStyle=!1)};for(const $ in ee){const Z=J[$],W=P[$];if(x.hasOwnProperty($))continue;let D=!1;Ng(Z)&&Ng(W)?D=!yC(Z,W):D=Z!==W,D?Z!=null?q($):y.add($):Z!==void 0&&y.has($)?q($):M.protectedKeys[$]=!0}M.prevProp=R,M.prevResolvedValues=J,M.isActive&&(x={...x,...J}),(s||a)&&e.blockInitialAnimation&&(K=!1);const N=j&&O;K&&(!N||H)&&v.push(...G.map($=>{const Z={type:T};if(typeof $=="string"&&(s||a)&&!N&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,D=Da(W,$);if(W.enteringChildren&&D){const{delayChildren:ie}=D.transition||{};Z.delay=FE(W.enteringChildren,e,ie)}}return{animation:$,options:Z}}))}if(y.size){const A={};if(typeof g.initial!="boolean"){const T=Da(e,Array.isArray(g.initial)?g.initial[0]:g.initial);T&&T.transition&&(A.transition=T.transition)}y.forEach(T=>{const M=e.getBaseTarget(T),R=e.getValue(T);R&&(R.liveStyle=!0),A[T]=M??null}),v.push({animation:A})}let E=!!v.length;return s&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(E=!1),s=!1,a=!1,E?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 b=d(f);for(const v in i)i[v].protectedKeys={};return b}return{animateChanges:d,setActive:m,setAnimateFunction:c,getState:()=>i,reset:()=>{i=dx(),a=!0}}}function nD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!yC(t,e):!1}function Sa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dx(){return{animate:Sa(!0),whileInView:Sa(),whileHover:Sa(),whileTap:Sa(),whileDrag:Sa(),whileFocus:Sa(),exit:Sa()}}function Bg(e,t){e.min=t.min,e.max=t.max}function qn(e,t){Bg(e.x,t.x),Bg(e.y,t.y)}function fx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xC=1e-4,sD=1-xC,rD=1+xC,SC=.01,aD=0-SC,oD=0+SC;function $i(e){return e.max-e.min}function lD(e,t,i){return Math.abs(e-t)<=i}function mx(e,t,i,s=.5){e.origin=s,e.originPoint=At(t.min,t.max,e.origin),e.scale=$i(i)/$i(t),e.translate=At(i.min,i.max,e.origin)-e.originPoint,(e.scale>=sD&&e.scale<=rD||isNaN(e.scale))&&(e.scale=1),(e.translate>=aD&&e.translate<=oD||isNaN(e.translate))&&(e.translate=0)}function wc(e,t,i,s){mx(e.x,t.x,i.x,s?s.originX:void 0),mx(e.y,t.y,i.y,s?s.originY:void 0)}function px(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+$i(t)}function cD(e,t,i,s){px(e.x,t.x,i.x,s?.x),px(e.y,t.y,i.y,s?.y)}function gx(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+$i(t)}function Jh(e,t,i,s){gx(e.x,t.x,i.x,s?.x),gx(e.y,t.y,i.y,s?.y)}function _x(e,t,i,s,a){return e-=t,e=Qh(e,1/i,s),a!==void 0&&(e=Qh(e,1/a,s)),e}function uD(e,t=0,i=1,s=.5,a,l=e,c=e){if(cs.test(t)&&(t=parseFloat(t),t=At(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=At(l.min,l.max,s);e===l&&(d-=t),e.min=_x(e.min,t,i,d,a),e.max=_x(e.max,t,i,d,a)}function bx(e,t,[i,s,a],l,c){uD(e,t[i],t[s],t[a],t.scale,l,c)}const hD=["x","scaleX","originX"],dD=["y","scaleY","originY"];function vx(e,t,i,s){bx(e.x,t,hD,i?i.x:void 0,s?s.x:void 0),bx(e.y,t,dD,i?i.y:void 0,s?s.y:void 0)}function yx(e){return e.translate===0&&e.scale===1}function wC(e){return yx(e.x)&&yx(e.y)}function xx(e,t){return e.min===t.min&&e.max===t.max}function fD(e,t){return xx(e.x,t.x)&&xx(e.y,t.y)}function Sx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EC(e,t){return Sx(e.x,t.x)&&Sx(e.y,t.y)}function wx(e){return $i(e.x)/$i(e.y)}function Ex(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function as(e){return[e("x"),e("y")]}function mD(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:b,rotateY:v,skewX:y,skewY:x}=i;f&&(s=`perspective(${f}px) ${s}`),g&&(s+=`rotate(${g}deg) `),b&&(s+=`rotateX(${b}deg) `),v&&(s+=`rotateY(${v}deg) `),y&&(s+=`skewX(${y}deg) `),x&&(s+=`skewY(${x}deg) `)}const d=e.x.scale*t.x,m=e.y.scale*t.y;return(d!==1||m!==1)&&(s+=`scale(${d}, ${m})`),s||"none"}const CC=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],pD=CC.length,Cx=e=>typeof e=="string"?parseFloat(e):e,kx=e=>typeof e=="number"||ke.test(e);function gD(e,t,i,s,a,l){a?(e.opacity=At(0,i.opacity??1,_D(s)),e.opacityExit=At(t.opacity??1,0,bD(s))):l&&(e.opacity=At(t.opacity??1,i.opacity??1,s));for(let c=0;c<pD;c++){const d=CC[c];let m=Nx(t,d),f=Nx(i,d);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||kx(m)===kx(f)?(e[d]=Math.max(At(Cx(m),Cx(f),s),0),(cs.test(f)||cs.test(m))&&(e[d]+="%")):e[d]=f}(t.rotate||i.rotate)&&(e.rotate=At(t.rotate||0,i.rotate||0,s))}function Nx(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _D=kC(0,.5,gE),bD=kC(.5,.95,Bn);function kC(e,t,i){return s=>s<e?0:s>t?1:i(Ac(e,t,s))}function vD(e,t,i){const s=Ai(e)?e:Ko(e);return s.start(X0("",s,t,i)),s.animation}function Dc(e,t,i,s={passive:!0}){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i)}const yD=(e,t)=>e.depth-t.depth;class xD{constructor(){this.children=[],this.isDirty=!1}add(t){z0(this.children,t),this.isDirty=!0}remove(t){Kh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(yD),this.isDirty=!1,this.children.forEach(t)}}function SD(e,t){const i=Fi.now(),s=({timestamp:a})=>{const l=a-i;l>=t&&(Kr(s),e(l-t))};return wt.setup(s,!0),()=>Kr(s)}function zh(e){return Ai(e)?e.get():e}class wD{constructor(){this.members=[]}add(t){z0(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&&(Kh(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(Kh(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 Ih={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qm=["","X","Y","Z"],ED=1e3;let CD=0;function Jm(e,t,i,s){const{latestValues:a}=t;a[e]&&(i[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function NC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=GE(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&&NC(s)}function TC({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(c={},d=t?.()){this.id=CD++,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(TD),this.nodes.forEach(LD),this.nodes.forEach(jD),this.nodes.forEach(AD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new xD)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new P0),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const m=this.eventHandlers.get(c);m&&m.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=i_(c)&&!N8(c),this.instance=c;const{layoutId:d,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||d)&&(this.isLayoutDirty=!0),e){let g,b=0;const v=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{b=window.innerWidth}),e(c,()=>{const y=window.innerWidth;y!==b&&(b=y,this.root.updateBlockedByResize=!0,g&&g(),g=SD(v,250),Ih.hasAnimatedSinceResize&&(Ih.hasAnimatedSinceResize=!1,this.nodes.forEach(Mx)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&f&&(d||m)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:b,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||UD,{onLayoutAnimationStart:w,onLayoutAnimationComplete:E}=f.getProps(),A=!this.targetLayout||!EC(this.targetLayout,y),T=!b&&v;if(this.options.layoutRoot||this.resumeFrom||T||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...Y0(x,"layout"),onPlay:w,onComplete:E};(f.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(g,T)}else b||Mx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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(),Kr(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(BD),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&&NC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const b=this.path[g];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:d,layout:m}=this.options;if(d===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(RD),this.nodes.forEach(Tx);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ax);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(DD),this.nodes.forEach(OD),this.nodes.forEach(kD),this.nodes.forEach(ND)):this.nodes.forEach(Ax),this.clearAllSnapshots();const d=Fi.now();Ni.delta=fs(0,1e3/60,d-Ni.timestamp),Ni.timestamp=d,Ni.isProcessing=!0,Vm.update.process(Ni),Vm.preRender.process(Ni),Vm.render.process(Ni),Ni.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,e_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(MD),this.sharedNodes.forEach(zD)}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&&!$i(this.snapshot.measuredBox.x)&&!$i(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:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&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,d=this.projectionDelta&&!wC(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,g=f!==this.prevTransformTemplateValue;c&&this.instance&&(d||Ea(this.latestValues)||g)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let m=this.removeElementScroll(d);return c&&(m=this.removeTransform(m)),HD(m),{animationId:this.root.animationId,measuredBox:d,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return ui();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(FD))){const{scroll:f}=this.root;f&&(os(d.x,f.offset.x),os(d.y,f.offset.y))}return d}removeElementScroll(c){const d=ui();if(qn(d,c),this.scroll?.wasRoot)return d;for(let m=0;m<this.path.length;m++){const f=this.path[m],{scroll:g,options:b}=f;f!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&qn(d,c),os(d.x,g.offset.x),os(d.y,g.offset.y))}return d}applyTransform(c,d=!1,m){const f=m||ui();qn(f,c);for(let g=0;g<this.path.length;g++){const b=this.path[g];!d&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(os(f.x,-b.scroll.offset.x),os(f.y,-b.scroll.offset.y)),Ea(b.latestValues)&&Bh(f,b.latestValues,b.layout?.layoutBox)}return Ea(this.latestValues)&&Bh(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const d=ui();qn(d,c);for(let m=0;m<this.path.length;m++){const f=this.path[m];if(!Ea(f.latestValues))continue;let g;f.instance&&(Og(f.latestValues)&&f.updateSnapshot(),g=ui(),qn(g,f.measurePageBox())),vx(d,f.latestValues,f.snapshot?.layoutBox,g)}return Ea(this.latestValues)&&vx(d,this.latestValues),d}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 d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==d;if(!(c||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:b}=this.options;if(!this.layout||!(g||b))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(),cD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):qn(this.target,this.layout.layoutBox),hC(this.target,this.targetDelta)):qn(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||Og(this.parent.latestValues)||uC(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,d,m){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ui(),this.relativeTargetOrigin=ui(),Jh(this.relativeTargetOrigin,d,m,this.options.layoutAnchor||void 0),qn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),d&&(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;qn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,v=this.treeScale.y;I8(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ui());const{target:y}=c;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fx(this.prevProjectionDelta.x,this.projectionDelta.x),fx(this.prevProjectionDelta.y,this.projectionDelta.y)),wc(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==v||!Ex(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ex(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Po(),this.projectionDelta=Po(),this.projectionDeltaWithTransform=Po()}setAnimationOrigin(c,d=!1){const m=this.snapshot,f=m?m.latestValues:{},g={...this.latestValues},b=Po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ui(),y=m?m.source:void 0,x=this.layout?this.layout.source:void 0,w=y!==x,E=this.getStack(),A=!E||E.members.length<=1,T=!!(w&&!A&&this.options.crossfade===!0&&!this.path.some(PD));this.animationProgress=0;let M;this.mixTargetDelta=R=>{const z=R/1e3;Rx(b.x,c.x,z),Rx(b.y,c.y,z),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jh(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ID(this.relativeTarget,this.relativeTargetOrigin,v,z),M&&fD(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ui()),qn(M,this.relativeTarget)),w&&(this.animationValues=g,gD(g,f,this.latestValues,z,T,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Kr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{Ih.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ko(0)),this.motionValue.jump(0,!1),this.currentAnimation=vD(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},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(ED),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:m,layout:f,latestValues:g}=c;if(!(!d||!m||!f)){if(this!==c&&this.layout&&f&&AC(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||ui();const b=$i(this.layout.layoutBox.x);m.x.min=c.target.x.min,m.x.max=m.x.min+b;const v=$i(this.layout.layoutBox.y);m.y.min=c.target.y.min,m.y.max=m.y.min+v}qn(d,m),Bh(d,g),wc(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new wD),this.sharedNodes.get(c).add(d);const f=d.options.initialPromotionConfig;d.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(d):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:d,preserveFollowOpacity:m}={}){const f=this.getStack();f&&f.promote(this,m),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:m}=c;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(d=!0),!d)return;const f={};m.z&&Jm("z",c,f,this.animationValues);for(let g=0;g<Qm.length;g++)Jm(`rotate${Qm[g]}`,c,f,this.animationValues),Jm(`skew${Qm[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,d){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=zh(d?.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=zh(d?.pointerEvents)||""),this.hasProjected&&!Ea(this.latestValues)&&(c.transform=m?m({},""):"none",this.hasProjected=!1);return}c.visibility="";const g=f.animationValues||f.latestValues;this.applyTransformsToTarget();let b=mD(this.projectionDeltaWithTransform,this.treeScale,g);m&&(b=m(g,b)),c.transform=b;const{x:v,y}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${y.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 x in jg){if(g[x]===void 0)continue;const{correct:w,applyTo:E,isCSSVariable:A}=jg[x],T=b==="none"?g[x]:w(g[x],f);if(E){const M=E.length;for(let R=0;R<M;R++)c[E[R]]=T}else A?this.options.visualElement.renderState.vars[x]=T:c[x]=T}this.options.layoutId&&(c.pointerEvents=f===this?zh(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Tx),this.root.sharedNodes.clear()}}}function kD(e){e.updateLayout()}function ND(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")as(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],v=$i(b);b.min=i[g].min,b.max=b.min+v});else if(a==="x"||a==="y"){const g=a==="x"?"y":"x";Bg(l?t.measuredBox[g]:t.layoutBox[g],i[g])}else AC(a,t.layoutBox,i)&&as(g=>{const b=l?t.measuredBox[g]:t.layoutBox[g],v=$i(i[g]);b.max=b.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const c=Po();wc(c,i,t.layoutBox);const d=Po();l?wc(d,e.applyTransform(s,!0),t.measuredBox):wc(d,i,t.layoutBox);const m=!wC(c);let f=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:v}=g;if(b&&v){const y=e.options.layoutAnchor||void 0,x=ui();Jh(x,t.layoutBox,b.layoutBox,y);const w=ui();Jh(w,i,v.layoutBox,y),EC(x,w)||(f=!0),g.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function TD(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 AD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function MD(e){e.clearSnapshot()}function Tx(e){e.clearMeasurements()}function RD(e){e.isLayoutDirty=!0,e.updateLayout()}function Ax(e){e.isLayoutDirty=!1}function DD(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function OD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function LD(e){e.resolveTargetDelta()}function jD(e){e.calcProjection()}function BD(e){e.resetSkewAndRotation()}function zD(e){e.removeLeadSnapshot()}function Rx(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 Dx(e,t,i,s){e.min=At(t.min,i.min,s),e.max=At(t.max,i.max,s)}function ID(e,t,i,s){Dx(e.x,t.x,i.x,s),Dx(e.y,t.y,i.y,s)}function PD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const UD={duration:.45,ease:[.4,0,.1,1]},Ox=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Lx=Ox("applewebkit/")&&!Ox("chrome/")?Math.round:Bn;function jx(e){e.min=Lx(e.min),e.max=Lx(e.max)}function HD(e){jx(e.x),jx(e.y)}function AC(e,t,i){return e==="position"||e==="preserve-aspect"&&!lD(wx(t),wx(i),.2)}function FD(e){return e!==e.root&&e.scroll?.wasRoot}const $D=TC({attachResizeListener:(e,t)=>Dc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ep={current:void 0},MC=TC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ep.current){const e=new $D({});e.mount(window),e.setOptions({layoutScroll:!0}),ep.current=e}return ep.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),RC=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function VD(e=!0){const t=C.useContext(B0);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:a}=t,l=C.useId();C.useEffect(()=>{if(e)return a(l)},[e]);const c=C.useCallback(()=>e&&s&&s(l),[l,s,e]);return!i&&s?[!1,c]:[!0]}const DC=C.createContext({strict:!1}),Bx={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 zx=!1;function qD(){if(zx)return;const e={};for(const t in Bx)e[t]={isEnabled:i=>Bx[t].some(s=>!!i[s])};oC(e),zx=!0}function OC(){return qD(),L8()}function KD(e){const t=OC();for(const i in e)t[i]={...t[i],...e[i]};oC(t)}const GD=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 ed(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||GD.has(e)}let LC=e=>!ed(e);function WD(e){typeof e=="function"&&(LC=t=>t.startsWith("on")?!ed(t):e(t))}try{WD(require("@emotion/is-prop-valid").default)}catch{}function YD(e,t,i){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||Ai(e[a])||(LC(a)||i===!0&&ed(a)||!t&&!ed(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const wd=C.createContext({});function XD(e,t){if(Sd(e)){const{initial:i,animate:s}=e;return{initial:i===!1||Rc(i)?i:void 0,animate:Rc(s)?s:void 0}}return e.inherit!==!1?t:{}}function ZD(e){const{initial:t,animate:i}=XD(e,C.useContext(wd));return C.useMemo(()=>({initial:t,animate:i}),[Ix(t),Ix(i)])}function Ix(e){return Array.isArray(e)?e.join(" "):e}const o_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jC(e,t,i){for(const s in t)!Ai(t[s])&&!mC(s,i)&&(e[s]=t[s])}function QD({transformTemplate:e},t){return C.useMemo(()=>{const i=o_();return r_(i,t,e),Object.assign({},i.vars,i.style)},[t])}function JD(e,t){const i=e.style||{},s={};return jC(s,i,e),Object.assign(s,QD(e,t)),s}function eO(e,t){const i={},s=JD(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 BC=()=>({...o_(),attrs:{}});function tO(e,t,i,s){const a=C.useMemo(()=>{const l=BC();return pC(l,t,_C(s),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};jC(l,e.style,e),a.style={...l,...a.style}}return a}const iO=["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 l_(e){return typeof e!="string"||e.includes("-")?!1:!!(iO.indexOf(e)>-1||/[A-Z]/u.test(e))}function nO(e,t,i,{latestValues:s},a,l=!1,c){const m=(c??l_(e)?tO:eO)(t,s,a,e),f=YD(t,typeof e=="string",l),g=e!==C.Fragment?{...f,...m,ref:i}:{},{children:b}=t,v=C.useMemo(()=>Ai(b)?b.get():b,[b]);return C.createElement(e,{...g,children:v})}function sO({scrapeMotionValuesFromProps:e,createRenderState:t},i,s,a){return{latestValues:rO(i,s,a,e),renderState:t()}}function rO(e,t,i,s){const a={},l=s(e,{});for(const v in l)a[v]=zh(l[v]);let{initial:c,animate:d}=e;const m=Sd(e),f=rC(e);t&&f&&!m&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let g=i?i.initial===!1:!1;g=g||c===!1;const b=g?d:c;if(b&&typeof b!="boolean"&&!xd(b)){const v=Array.isArray(b)?b:[b];for(let y=0;y<v.length;y++){const x=Z0(e,v[y]);if(x){const{transitionEnd:w,transition:E,...A}=x;for(const T in A){let M=A[T];if(Array.isArray(M)){const R=g?M.length-1:0;M=M[R]}M!==null&&(a[T]=M)}for(const T in w)a[T]=w[T]}}}return a}const zC=e=>(t,i)=>{const s=C.useContext(wd),a=C.useContext(B0),l=()=>sO(e,t,s,a);return i?l():i6(l)},aO=zC({scrapeMotionValuesFromProps:a_,createRenderState:o_}),oO=zC({scrapeMotionValuesFromProps:bC,createRenderState:BC}),lO=Symbol.for("motionComponentSymbol");function cO(e,t,i){const s=C.useRef(i);C.useInsertionEffect(()=>{s.current=i});const a=C.useRef(null);return C.useCallback(l=>{l&&e.onMount?.(l);const c=s.current;if(typeof c=="function")if(l){const d=c(l);typeof d=="function"&&(a.current=d)}else a.current?(a.current(),a.current=null):c(l);else c&&(c.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const IC=C.createContext({});function jo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function uO(e,t,i,s,a,l){const{visualElement:c}=C.useContext(wd),d=C.useContext(DC),m=C.useContext(B0),f=C.useContext(RC),g=f.reducedMotion,b=f.skipAnimations,v=C.useRef(null),y=C.useRef(!1);s=s||d.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:b,isSVG:l}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,w=C.useContext(IC);x&&!x.projection&&a&&(x.type==="html"||x.type==="svg")&&hO(v.current,i,a,w);const E=C.useRef(!1);C.useInsertionEffect(()=>{x&&E.current&&x.update(i,m)});const A=i[KE],T=C.useRef(!!A&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return s6(()=>{y.current=!0,x&&(E.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),T.current&&x.animationState&&x.animationState.animateChanges())}),C.useEffect(()=>{x&&(!T.current&&x.animationState&&x.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),T.current=!1),x.enteringChildren=void 0)}),x}function hO(e,t,i,s){const{layoutId:a,layout:l,drag:c,dragConstraints:d,layoutScroll:m,layoutRoot:f,layoutAnchor:g,layoutCrossfade:b}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:PC(e.parent)),e.projection.setOptions({layoutId:a,layout:l,alwaysMeasureLayout:!!c||d&&jo(d),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:s,crossfade:b,layoutScroll:m,layoutRoot:f,layoutAnchor:g})}function PC(e){if(e)return e.options.allowProjection!==!1?e.projection:PC(e.parent)}function tp(e,{forwardMotionProps:t=!1,type:i}={},s,a){s&&KD(s);const l=i?i==="svg":l_(e),c=l?oO:aO;function d(f,g){let b;const v={...C.useContext(RC),...f,layoutId:dO(f)},{isStatic:y}=v,x=ZD(f),w=c(f,y);if(!y&&typeof window<"u"){fO();const E=mO(v);b=E.MeasureLayout,x.visualElement=uO(e,w,v,a,E.ProjectionNode,l)}return h.jsxs(wd.Provider,{value:x,children:[b&&x.visualElement?h.jsx(b,{visualElement:x.visualElement,...v}):null,nO(e,f,cO(w,x.visualElement,g),w,y,t,l)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=C.forwardRef(d);return m[lO]=e,m}function dO({layoutId:e}){const t=C.useContext(sE).id;return t&&e!==void 0?t+"-"+e:e}function fO(e,t){C.useContext(DC).strict}function mO(e){const t=OC(),{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 pO(e,t){if(typeof Proxy>"u")return tp;const i=new Map,s=(l,c)=>tp(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,tp(c,void 0,e,t)),i.get(c))})}const gO=(e,t)=>t.isSVG??l_(e)?new Z8(t):new q8(t,{allowProjection:e!==C.Fragment});class _O extends Zr{constructor(t){super(t),t.animationState||(t.animationState=iD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xd(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 bO=0;class vO extends Zr{constructor(){super(...arguments),this.id=bO++,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 d=Da(this.node,l,c);if(d){const{transition:m,transitionEnd:f,...g}=d;for(const b in g)this.node.getValue(b)?.jump(g[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);i&&!t&&a.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const yO={animation:{Feature:_O},exit:{Feature:vO}};function Yc(e){return{point:{x:e.pageX,y:e.pageY}}}const xO=e=>t=>t_(t)&&e(t,Yc(t));function Ec(e,t,i,s){return Dc(e,t,xO(i),s)}const UC=({current:e})=>e?e.ownerDocument.defaultView:null,Px=(e,t)=>Math.abs(e-t);function SO(e,t){const i=Px(e.x,t.x),s=Px(e.y,t.y);return Math.sqrt(i**2+s**2)}const Ux=new Set(["auto","scroll"]);class HC{constructor(t,i,{transformPagePoint:s,contextWindow:a=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3,element:d}={}){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=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=yh(this.lastRawMoveEventInfo,this.transformPagePoint));const y=ip(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=SO(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:E}=y,{timestamp:A}=Ni;this.history.push({...E,timestamp:A});const{onStart:T,onMove:M}=this.handlers;x||(T&&T(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=yh(x,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:w,onSessionEnd:E,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ip(y.type==="pointercancel"?this.lastMoveEventInfo:yh(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(y,T),E&&E(y,T)},!t_(t))return;this.dragSnapToOrigin=l,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=c,this.contextWindow=a||window;const m=Yc(t),f=yh(m,this.transformPagePoint),{point:g}=f,{timestamp:b}=Ni;this.history=[{...g,timestamp:b}];const{onSessionStart:v}=i;v&&v(t,ip(f,this.history)),this.removeListeners=Kc(Ec(this.contextWindow,"pointermove",this.handlePointerMove),Ec(this.contextWindow,"pointerup",this.handlePointerUp),Ec(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let i=t.parentElement;for(;i;){const s=getComputedStyle(i);(Ux.has(s.overflowX)||Ux.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(),Kr(this.updatePoint)}}function yh(e,t){return t?{point:t(e.point)}:e}function Hx(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ip({point:e},t){return{point:e,delta:Hx(e,FC(t)),offset:Hx(e,wO(t)),velocity:EO(t,.1)}}function wO(e){return e[0]}function FC(e){return e[e.length-1]}function EO(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,s=null;const a=FC(e);for(;i>=0&&(s=e[i],!(a.timestamp-s.timestamp>bn(t)));)i--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&a.timestamp-s.timestamp>bn(t)*2&&(s=e[1]);const l=Ln(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 CO(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 Fx(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 kO(e,{top:t,left:i,bottom:s,right:a}){return{x:Fx(e.x,i,a),y:Fx(e.y,t,s)}}function $x(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 NO(e,t){return{x:$x(e.x,t.x),y:$x(e.y,t.y)}}function TO(e,t){let i=.5;const s=$i(e),a=$i(t);return a>s?i=Ac(t.min,t.max-s,e.min):s>a&&(i=Ac(e.min,e.max-a,t.min)),fs(0,1,i)}function AO(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 zg=.35;function MO(e=zg){return e===!1?e=0:e===!0&&(e=zg),{x:Vx(e,"left","right"),y:Vx(e,"top","bottom")}}function Vx(e,t,i){return{min:qx(e,t),max:qx(e,i)}}function qx(e,t){return typeof e=="number"?e:e[t]||0}const RO=new WeakMap;class DO{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=b=>{i&&this.snapToCursor(Yc(b).point),this.stopAnimation()},c=(b,v)=>{const{drag:y,dragPropagation:x,onDragStart:w}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=u8(y),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),as(A=>{let T=this.getAxisMotionValue(A).get()||0;if(cs.test(T)){const{projection:M}=this.visualElement;if(M&&M.layout){const R=M.layout.layoutBox[A];R&&(T=$i(R)*(parseFloat(T)/100))}}this.originPoint[A]=T}),w&&wt.update(()=>w(b,v),!1,!0),Tg(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:w,onDrag:E}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:A}=v;if(x&&this.currentDirection===null){this.currentDirection=LO(A),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,A),this.updateAxis("y",v.point,A),this.visualElement.render(),E&&wt.update(()=>E(b,v),!1,!0)},m=(b,v)=>{this.latestPointerEvent=b,this.latestPanInfo=v,this.stop(b,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new HC(t,{onSessionStart:l,onStart:c,onMove:d,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:s,contextWindow:UC(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:d}=this.getProps();d&&wt.postRender(()=>d(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||!xh(t,a,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(c=CO(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&&jo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=kO(s.layoutBox,t):this.constraints=!1,this.elastic=MO(i),a!==this.constraints&&!jo(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&as(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=AO(s.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!jo(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const l=P8(s,a.root,this.visualElement.getTransformPagePoint());let c=NO(a.layout.layoutBox,l);if(i){const d=i(B8(c));this.hasMutatedConstraints=!!d,d&&(c=cC(d))}return c}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:a,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),m=this.constraints||{},f=as(g=>{if(!xh(g,i,this.currentDirection))return;let b=m&&m[g]||{};(c===!0||c===g)&&(b={min:0,max:0});const v=a?200:1e6,y=a?40:1e7,x={type:"inertia",velocity:s?t[g]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...l,...b};return this.startAxisValueAnimation(g,x)});return Promise.all(f).then(d)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return Tg(this.visualElement,t),s.start(X0(t,s,0,i,this.visualElement,!1))}stopAnimation(){as(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){as(i=>{const{drag:s}=this.getProps();if(!xh(i,s,this.currentDirection))return;const{projection:a}=this.visualElement,l=this.getAxisMotionValue(i);if(a&&a.layout){const{min:c,max:d}=a.layout.layoutBox[i],m=l.get()||0;l.set(t[i]-At(c,d,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!jo(i)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};as(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const m=d.get();a[c]=TO({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(),as(c=>{if(!xh(c,t,null))return;const d=this.getAxisMotionValue(c),{min:m,max:f}=this.constraints[c];d.set(At(m,f,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RO.set(this.visualElement,this);const t=this.visualElement.current,i=Ec(t,"pointerdown",f=>{const{drag:g,dragListener:b=!0}=this.getProps(),v=f.target,y=v!==t&&g8(v);g&&b&&!y&&this.start(f)});let s;const a=()=>{const{dragConstraints:f}=this.getProps();jo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),s||(s=OO(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 d=Dc(window,"resize",()=>this.scalePositionWithinConstraints()),m=l.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:g})=>{this.isDragging&&g&&(as(b=>{const v=this.getAxisMotionValue(b);v&&(this.originPoint[b]+=f[b].translate,v.set(v.get()+f[b].translate))}),this.visualElement.render())}));return()=>{d(),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=zg,dragMomentum:d=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:d}}}function Kx(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function OO(e,t,i){const s=tx(e,Kx(i)),a=tx(t,Kx(i));return()=>{s(),a()}}function xh(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function LO(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class jO extends Zr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new DO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}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 np=e=>(t,i)=>{e&&wt.update(()=>e(t,i),!1,!0)};class BO extends Zr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:UC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:np(t),onStart:np(i),onMove:np(s),onEnd:(l,c)=>{delete this.session,a&&wt.postRender(()=>a(l,c))}}}mount(){this.removePointerDownListener=Ec(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 sp=!1;class zO extends C.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),sp&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ih.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}),sp=!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 d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=i,s.root.didUpdate(),e_.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:a}=t;sp=!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 $C(e){const[t,i]=VD(),s=C.useContext(sE);return h.jsx(zO,{...e,layoutGroup:s,switchLayoutGroup:C.useContext(IC),isPresent:t,safeToRemove:i})}const IO={pan:{Feature:BO},drag:{Feature:jO,ProjectionNode:MC,MeasureLayout:$C}};function Gx(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,Yc(t)))}class PO extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=d8(t,(i,s)=>(Gx(this.node,s,"Start"),a=>Gx(this.node,a,"End"))))}unmount(){}}class UO extends Zr{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=Kc(Dc(this.node.current,"focus",()=>this.onFocus()),Dc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wx(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,Yc(t)))}class HO extends Zr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=b8(t,(a,l)=>(Wx(this.node,l,"Start"),(c,{success:d})=>Wx(this.node,c,d?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:s?.tap===!1})}unmount(){}}const Ig=new WeakMap,rp=new WeakMap,FO=e=>{const t=Ig.get(e.target);t&&t(e)},$O=e=>{e.forEach(FO)};function VO({root:e,...t}){const i=e||document;rp.has(i)||rp.set(i,{});const s=rp.get(i),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver($O,{root:e,...t})),s[a]}function qO(e,t,i){const s=VO(t);return Ig.set(e,i),s.observe(e),()=>{Ig.delete(e),s.unobserve(e)}}const KO={some:0,all:1};class GO extends Zr{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:KO[a]},d=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:b}=this.node.getProps(),v=f?g:b;v&&v(m)};this.stopObserver=qO(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(WO(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function WO({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const YO={inView:{Feature:GO},tap:{Feature:HO},focus:{Feature:UO},hover:{Feature:PO}},XO={layout:{ProjectionNode:MC,MeasureLayout:$C}},ZO={...yO,...YO,...IO,...XO},ap=pO(ZO,gO),Ve=({label:e,children:t,variant:i="primary",size:s="medium",icon:a,onClick:l,removable:c=!1,className:d,maxWidth:m,appearance:f,onRemove:g,isLoading:b=!1})=>{const v=QO(i),y=f??(i==="outline"?"outline":"solid"),x=e??t,w=!!l,E={primary:{solid:"bg-[#11111198] text-white border border-transparent",outline:"border-2 border-[#11111198] text-[#11111198]",subtle:"bg-[#11111140] text-[#11111198] border border-transparent"},secondary:{solid:"bg-zinc-700 text-white border border-transparent",outline:"border-2 border-zinc-400 text-zinc-800 bg-white",subtle:"bg-zinc-100 text-zinc-800 border border-zinc-300"},success:{solid:"bg-emerald-600 text-white border border-transparent",outline:"border-2 border-emerald-600 text-emerald-700",subtle:"bg-emerald-100 text-emerald-700 border border-transparent"},warning:{solid:"bg-amber-500 text-white border border-transparent",outline:"border-2 border-amber-500 text-amber-700",subtle:"bg-amber-100 text-amber-700 border border-transparent"},error:{solid:"bg-destructive text-destructive-foreground border border-transparent",outline:"border-2 border-destructive text-destructive",subtle:"bg-destructive/20 text-destructive border border-transparent"}},A={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},T=R=>{R.stopPropagation(),l?.()},M=R=>{R.stopPropagation(),g?.()};return h.jsxs(ap.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,backgroundColor:w&&v==="primary"?"#111111d1":void 0,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:T,style:{maxWidth:m},className:me("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",E[v][y],A[s],w&&"cursor-pointer",d),children:[b?h.jsx(ap.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:h.jsx(ds,{className:"size-3.5"})}):a&&h.jsx("span",{className:"flex-shrink-0",children:a}),h.jsx("span",{className:"min-w-0 truncate",children:x}),c&&h.jsx(ap.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-[#11111198] p-1 opacity-70 hover:opacity-100",onClick:M,type:"button",children:h.jsx(ys,{className:"size-3.5"})})]})};function QO(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const JO=$2("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-red-200 bg-red-50 text-red-700"}},defaultVariants:{variant:"default"}});function ut({className:e,variant:t,...i}){return h.jsx("div",{className:me(JO({variant:t,className:e})),...i})}function ms({className:e,...t}){return h.jsx("div",{className:me("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function ps({className:e,...t}){return h.jsx("div",{className:me("grid gap-1.5 p-4",e),...t})}function gs({className:e,...t}){return h.jsx("h3",{className:me("text-sm font-semibold tracking-tight",e),...t})}function Gr({className:e,...t}){return h.jsx("p",{className:me("text-sm text-muted-foreground",e),...t})}function _s({className:e,...t}){return h.jsx("div",{className:me("p-4 pt-0",e),...t})}const Yx=100;function e7(){const[e,t]=C.useState([]),[i,s]=C.useState(!1),a=C.useRef(new Set);C.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",d=>{try{const m=JSON.parse(d.data);t(f=>{if(a.current.has(m.id))return f;a.current.add(m.id);const g=[...f,m];return g.length>Yx&&g.splice(0,g.length-Yx),g})}catch{}}),()=>{c.close()}},[]);const l=[...e].reverse();return h.jsxs(ms,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Vo,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:"Live MCP Tool Calls"}),h.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),h.jsx(Ve,{variant:"outline",size:"small",icon:h.jsx("span",{className:me("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),h.jsx(Gr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),h.jsx(_s,{className:"p-0",children:l.length?h.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:l.map(c=>h.jsxs("li",{className:"px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:c.tool}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[h.jsxs("span",{children:[c.durationMs," ms"]}),h.jsx(Ve,{variant:c.status==="ok"?"success":"error",appearance:"outline",size:"small",children:c.status})]})]}),c.args?h.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:c.args}):null,c.error?h.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:c.error}):null,h.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(c.startedAt).toLocaleTimeString()})]},c.id))}):h.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 t7({agent:e,agentId:t}){return h.jsxs(h.Fragment,{children:[h.jsx(e7,{}),t!=="claude-code"?null:h.jsxs(ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(bd,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:"Recent Projects"})]}),h.jsx(Ve,{variant:"outline",size:"small",children:e.projects.length})]}),h.jsx(Gr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),h.jsx(_s,{className:"p-0",children:e.projects.length?h.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(i=>h.jsxs("li",{className:me("flex items-start justify-between gap-3 px-3 py-2",i.current&&"bg-primary/5"),children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.path}),i.current?h.jsx(Ve,{variant:"outline",size:"small",children:"current"}):null]}),i.lastSessionFirstPrompt?h.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:i.lastSessionFirstPrompt}):null]}),h.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[i.mcpServerCount?h.jsxs("div",{children:[i.mcpServerCount," mcp"]}):null,i.lastSessionModified?h.jsx("div",{children:i7(i.lastSessionModified)}):null]})]},i.path))}):h.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function i7(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function Ed({className:e}){return h.jsx("svg",{className:me("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:h.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 Cd({className:e}){return h.jsx("svg",{className:me("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:h.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 VC({icon:e,title:t,children:i}){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-16 text-center",children:[h.jsx("div",{className:"text-muted-foreground/70",children:e}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:t}),i?h.jsx("p",{className:"max-w-sm text-xs text-muted-foreground",children:i}):null]})}function n7({agent:e,agentId:t}){return t==="codex"?h.jsxs(VC,{icon:h.jsx(ug,{className:"size-8"}),title:"No memory introspection for Codex yet",children:["Project memory and ",h.jsx("code",{className:"font-mono",children:"CLAUDE.md"})," reading are Claude-specific. Codex memory support isn't wired up."]}):h.jsxs(ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ug,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:"Project Memory"})]}),h.jsx(Ve,{variant:"outline",size:"small",children:e.project.memoryFiles.length+(e.project.claudeMdPath?1:0)})]}),h.jsx(Gr,{className:"truncate text-xs",children:e.project.memoryDir??"No memory directory found for this project."})]}),h.jsxs(_s,{className:"space-y-2 p-3",children:[e.project.claudeMdPath?h.jsx(Xx,{title:"CLAUDE.md",preview:e.project.claudeMdPreview,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(i=>h.jsx(Xx,{title:i.name,subtitle:`${i.size} B`,preview:i.preview,defaultOpen:i.name==="MEMORY.md"},i.path)):e.project.claudeMdPath?null:h.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function Xx({title:e,subtitle:t,preview:i,defaultOpen:s=!1}){const[a,l]=C.useState(s);return h.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[h.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:[h.jsx(Yr,{className:me("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),h.jsx("span",{children:e}),t?h.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&i?h.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]})}function s7({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,i=t>0?e.cacheReadInputTokens/t*100:0;return h.jsxs("div",{className:"rounded-md border border-border",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ed,{className:"size-3.5 text-amber-700"}),h.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?h.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),h.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),h.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:[h.jsx(Or,{label:"Input",value:tc(e.inputTokens)}),h.jsx(Or,{label:"Output",value:tc(e.outputTokens)}),h.jsx(Or,{label:"Cache read",value:tc(e.cacheReadInputTokens)}),h.jsx(Or,{label:"Cache create",value:tc(e.cacheCreationInputTokens)}),h.jsx(Or,{label:"Lines +",value:String(e.linesAdded)}),h.jsx(Or,{label:"Lines −",value:String(e.linesRemoved)}),h.jsx(Or,{label:"Wall",value:Zx(e.durationMs)}),h.jsx(Or,{label:"API",value:Zx(e.apiDurationMs)})]}),h.jsxs("div",{className:"border-t border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[h.jsx("span",{children:"Cache read share of input"}),h.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),h.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:h.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,i).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?h.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[h.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?h.jsx(td,{label:"5h block",window:e.fiveHour}):null,e.weekly?h.jsx(td,{label:"This week",window:e.weekly}):null]}):null,e.models.length?h.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[h.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(s=>h.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[h.jsx("span",{className:"truncate",children:s.model}),h.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[tc(s.inputTokens+s.outputTokens)," tok ·"," ",h.jsxs("span",{className:"text-emerald-700",children:["$",s.costUSD.toFixed(4)]})]})]},s.model))]}):null]})}function r7({usage:e}){return h.jsxs("div",{className:"rounded-md border border-border",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Cd,{className:"size-3.5 text-foreground"}),h.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · rate limits"})]}),e.timestamp?h.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),h.jsxs("div",{className:"space-y-2 px-3 py-2",children:[e.primary?h.jsx(td,{label:"5h window",window:e.primary}):null,e.secondary?h.jsx(td,{label:"Weekly window",window:e.secondary}):null]})]})}function td({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 h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[h.jsx("span",{className:"text-muted-foreground",children:e}),h.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),h.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:h.jsx("div",{className:me("h-full",a),style:{width:`${i.toFixed(2)}%`}})}),s?h.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",s]}):null]})}function Or({label:e,value:t}){return h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),h.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function tc(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Zx(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 a7(e=1e4){const[t,i]=C.useState(null),[s,a]=C.useState(null);return C.useEffect(()=>{let l=!0;const c=()=>{T4().then(m=>{l&&(i(m),a(null))}).catch(m=>{l&&a(m instanceof Error?m.message:String(m))})};c();const d=window.setInterval(c,e);return()=>{l=!1,window.clearInterval(d)}},[e]),{usage:t,error:s}}const o7={"claude-code":{label:"Claude Code",icon:h.jsx(Ed,{})},codex:{label:"Codex",icon:h.jsx(Cd,{})}};function l7({agent:e,agentId:t}){const{usage:i,error:s}=a7(),a=e.detected.name===t,l=o7[t],c=t==="codex";return h.jsxs(ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(M2,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:c?"Rate Limits":"Token & Cost Usage"}),h.jsx(Ve,{variant:"outline",size:"small",icon:l.icon,children:l.label}),a?h.jsx(Ve,{variant:"outline",size:"small",children:"active session"}):h.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"})]}),h.jsxs(Gr,{className:"truncate text-xs",children:[c?h.jsxs(h.Fragment,{children:["Rate-limit windows from ",h.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):h.jsxs(h.Fragment,{children:["Last-session metrics from ",h.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",h.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),h.jsxs(_s,{className:"p-3",children:[s?h.jsx("p",{className:"text-xs text-destructive",children:s}):null,c?i?.codex?h.jsx(r7,{usage:i.codex}):s?null:h.jsx(Qx,{agent:"Codex CLI"}):i?.claude?h.jsx(s7,{usage:i.claude}):s?null:h.jsx(Qx,{agent:"Claude Code"})]})]})}function Qx({agent:e}){return h.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function c7({agent:e,agentId:t}){return t==="codex"?h.jsxs(VC,{icon:h.jsx(fg,{className:"size-8"}),title:"No skill/MCP discovery for Codex yet",children:["Skills and MCP servers are read from ",h.jsx("code",{className:"font-mono",children:"~/.claude.json"}),". Codex config introspection isn't wired up."]}):h.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[h.jsxs(ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(B2,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:"Skills"})]}),h.jsx(Ve,{variant:"outline",size:"small",children:e.skills.length})]}),h.jsx(Gr,{className:"text-xs",children:"User, project, and plugin skills discovered for the active agent."})]}),h.jsx(_s,{className:"p-0",children:e.skills.length?h.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(i=>h.jsxs("li",{className:"px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.name}),h.jsx(Ve,{variant:"outline",size:"small",children:i.scope})]}),i.description?h.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:i.description}):null]},`${i.scope}:${i.name}`))}):h.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),h.jsxs(ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(fg,{className:"size-4 text-muted-foreground"}),h.jsx(gs,{children:"MCP Servers"})]}),h.jsx(Ve,{variant:"outline",size:"small",children:e.mcpServers.length})]}),h.jsxs(Gr,{className:"text-xs",children:["From ",h.jsx("code",{className:"font-mono",children:"~/.claude.json"})," (user + project scopes)."]})]}),h.jsx(_s,{className:"p-0",children:e.mcpServers.length?h.jsx("ul",{className:"divide-y divide-border",children:e.mcpServers.map(i=>h.jsxs("li",{className:"px-3 py-2",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i.name}),h.jsx(Ve,{variant:"outline",size:"small",children:i.scope})]}),h.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:i.command??i.url??i.type??"—"})]},`${i.scope}:${i.name}`))}):h.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})]})}const u7=[{id:"claude-code",label:"Claude Code",icon:h.jsx(Ed,{className:"size-4"})},{id:"codex",label:"Codex",icon:h.jsx(Cd,{className:"size-4"})}],h7=[{id:"overview",label:"Overview",icon:h.jsx(M2,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:h.jsx(ug,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:h.jsx(fg,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:h.jsx(Vo,{className:"size-3.5"})}];function d7(){const[e,t]=C.useState(null),[i,s]=C.useState(null),[a,l]=C.useState("claude-code"),[c,d]=C.useState("overview");return C.useEffect(()=>{let m=!0;return N4().then(f=>{m&&(t(f),f.detected.name==="codex"&&l("codex"))}).catch(f=>{m&&s(f instanceof Error?f.message:String(f))}),()=>{m=!1}},[]),i?h.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:h.jsxs(ut,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",i]})}):e?h.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:u7.map(m=>{const f=a===m.id,g=e.detected.name===m.id;return h.jsxs("button",{type:"button",onClick:()=>l(m.id),className:me("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",f?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.icon,m.label,g?h.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},m.id)})}),h.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:h7.map(m=>h.jsxs("button",{type:"button",onClick:()=>d(m.id),className:me("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",c===m.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[m.icon,m.label,c===m.id?h.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},m.id))}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[c==="overview"?h.jsx(l7,{agent:e,agentId:a}):null,c==="memory"?h.jsx(n7,{agent:e,agentId:a}):null,c==="tools"?h.jsx(c7,{agent:e,agentId:a}):null,c==="activity"?h.jsx(t7,{agent:e,agentId:a}):null]})]}):h.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:h.jsx(ut,{variant:"muted",children:"Loading agent info…"})})}const c_="application/x-nomoreide-path";function qC(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function KC(e,t){e.setData(c_,t)}function Jx(e){return e.types.includes(c_)}function f7(e){return e.getData(c_)||null}function GC(e){return{draggable:!0,onDragStart:t=>{KC(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const m7=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),p7=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),g7=new Set(["conf","config","ini","toml","yaml","yml"]),_7=new Set(["csv","json","sql","xml"]),b7=new Set(["md","mdx","rst","txt"]),v7=new Set(["gif","jpeg","jpg","png","svg","webp"]),y7=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),x7=new Set(["css","less","sass","scss"]);function S7(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return y7.has(t)||t.endsWith(".lock")?"lock":w7(t)?"test":p7.has(t)||g7.has(i)?"config":x7.has(i)?"style":v7.has(i)?"image":b7.has(i)?"document":_7.has(i)?"data":m7.has(i)?"code":"generic"}function w7(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function u_({path:e,className:t}){const i=S7(e),s=E7[i];return h.jsx(s,{"aria-label":`${i} file`,className:me("size-3.5 shrink-0",C7[i],t)})}const E7={code:Y5,config:a4,data:$c,document:J5,generic:A2,image:gA,lock:SA,style:LA,test:iA},C7={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 k7(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function N7({onPick:e,onClose:t}){const[i,s]=C.useState(""),[a,l]=C.useState(null),[c,d]=C.useState(null),[m,f]=C.useState(!1),g=C.useRef(null),b=a?a.parent!==a.path:!1;return C.useEffect(()=>{function v(y){g.current&&!g.current.contains(y.target)&&t()}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[t]),C.useEffect(()=>{let v=!0;return f(!0),d(null),U2(i,{files:!0}).then(y=>v&&l(y)).catch(y=>v&&d(y instanceof Error?y.message:String(y))).finally(()=>v&&f(!1)),()=>{v=!1}},[i]),h.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:[h.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[h.jsx(fe,{"aria-label":"Parent folder",className:"size-7",disabled:!b,onClick:()=>a&&s(a.parent),size:"icon",type:"button",variant:"ghost",children:h.jsx(D0,{})}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?h.jsx(ds,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?h.jsxs(fe,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[h.jsx(z5,{})," This folder"]}):null,h.jsx(fe,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:h.jsx(ys,{})})]}),h.jsx("div",{className:"max-h-64 overflow-auto p-1",children:c?h.jsx(ut,{variant:"destructive",className:"m-1",children:c}):a&&a.entries.length===0?h.jsx(ut,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(v=>{const y=v.isDir?"":k7(v.name);return h.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?h.jsx(Ia,{className:"size-3.5 shrink-0 text-amber-600"}):h.jsx(u_,{path:v.path}),h.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.name}),y?h.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:y}):null]},v.path)})})]})}let eS=0;const tS=()=>(eS+=1,`t${Date.now()}-${eS}`);function T7(){const[e,t]=C.useState([]),[i,s]=C.useState(!1),[a,l]=C.useState(null),[c,d]=C.useState(null),[m,f]=C.useState(null),[g,b]=C.useState([]),v=C.useRef(null),y=C.useRef(void 0);C.useEffect(()=>{A4().then(T=>{d(T.configured),f(T.provider)}).catch(()=>d(!1))},[]);const x=C.useCallback(async(T,M)=>{b(z=>z.filter(U=>U.requestId!==T));const R=y.current;if(R)try{await M4(R,T,M)}catch{}},[]),w=C.useCallback(()=>{v.current?.abort(),v.current=null,s(!1)},[]),E=C.useCallback(async T=>{const M=T.trim();if(!M||i)return;l(null);const R={id:tS(),role:"user",text:M,tools:[]},z=tS(),U={id:z,role:"assistant",text:"",tools:[]};t(K=>[...K,R,U]);const j=K=>t(H=>H.map(G=>G.id===z?K(G):G)),O=new AbortController;v.current=O,s(!0);try{await R4(M,y.current,K=>{switch(K.type){case"session":y.current=K.sessionId;break;case"text":j(H=>({...H,text:H.text+K.text}));break;case"tool_use":j(H=>({...H,tools:[...H.tools,{id:K.id,name:K.name,input:K.input,status:"running"}]}));break;case"tool_result":j(H=>({...H,tools:H.tools.map(G=>G.id===K.id?{...G,preview:K.preview,isError:K.isError,status:"done"}:G)}));break;case"approval_request":b(H=>[...H,{requestId:K.requestId,name:K.name,input:K.input}]);break;case"error":l(K.message);break;case"done":break}},O.signal)}catch(K){O.signal.aborted||l(K instanceof Error?K.message:String(K))}finally{v.current=null,s(!1)}},[i]),A=C.useCallback(()=>{w(),y.current=void 0,t([]),b([]),l(null)},[w]);return{turns:e,streaming:i,error:a,configured:c,provider:m,approvals:g,send:E,stop:w,clear:A,respond:x}}function A7({onOpenAgentPage:e}){const[t,i]=C.useState(!1),{turns:s,streaming:a,error:l,configured:c,provider:d,approvals:m,send:f,stop:g,clear:b,respond:v}=T7(),[y,x]=C.useState(""),[w,E]=C.useState(!1),[A,T]=C.useState(!1),[M,R]=C.useState(!1),z=C.useRef(null),U=C.useRef(null);function j(P){i(!0),x(ee=>ee.trim()?`${ee.replace(/\s*$/,"")} ${P} `:`${P} `),requestAnimationFrame(()=>U.current?.focus())}C.useEffect(()=>{t&&U.current?.focus()},[t]),C.useEffect(()=>{const P=q=>{q.dataTransfer&&Jx(q.dataTransfer)&&E(!0)},ee=()=>{E(!1),T(!1)};return document.addEventListener("dragstart",P),document.addEventListener("dragend",ee),document.addEventListener("drop",ee),()=>{document.removeEventListener("dragstart",P),document.removeEventListener("dragend",ee),document.removeEventListener("drop",ee)}},[]),C.useEffect(()=>{const P=z.current;P&&(P.scrollTop=P.scrollHeight)},[s,t]);async function O(){const P=y;x(""),await f(P)}function K(P){P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),O())}function H(P){Jx(P.dataTransfer)&&(P.preventDefault(),P.dataTransfer.dropEffect="copy",t||i(!0),T(!0))}function G(P){P.currentTarget.contains(P.relatedTarget)||T(!1)}function J(P){T(!1);const ee=f7(P.dataTransfer);ee&&(P.preventDefault(),j(ee))}return h.jsx("div",{className:me("fixed inset-x-0 bottom-0 z-50 flex flex-col border-t border-border bg-card/95 shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.25)] backdrop-blur transition-[height] duration-200",t?"h-[50vh]":w?"h-12":"h-9",w&&!A&&"border-primary/60 bg-primary/5",A&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),onDragOver:H,onDragLeave:G,onDrop:J,children:t?h.jsxs(h.Fragment,{children:[h.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-2 border-b border-border px-3",children:[h.jsx(iS,{provider:d,className:"size-4 text-primary"}),h.jsx("span",{className:"text-sm font-medium",children:d?.label??"Agent"}),a?h.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx(ds,{className:"size-3 animate-spin"})," thinking…"]}):null,h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e?h.jsx(fe,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:h.jsx(FA,{})}):null,h.jsx(fe,{"aria-label":"Clear conversation",className:"size-7",disabled:s.length===0,onClick:b,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:h.jsx(Vc,{})}),h.jsx(fe,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>i(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:h.jsx(vs,{})})]})]}),h.jsxs("div",{ref:z,className:"min-h-0 flex-1 space-y-3 overflow-auto px-3 py-3",children:[s.length===0?h.jsx(M7,{configured:c,provider:d}):s.map(P=>h.jsx(R7,{turn:P},P.id)),l?h.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:[h.jsx(b4,{className:"mt-px size-3.5 shrink-0"}),h.jsx("span",{className:"min-w-0 break-words",children:l})]}):null]}),m.length>0?h.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-400/40 bg-amber-50/60 px-3 py-2",children:m.map(P=>h.jsx(O7,{prompt:P,onRespond:v},P.requestId))}):null,h.jsxs("div",{className:me("relative shrink-0 border-t border-border p-2 transition-colors",w&&"bg-primary/5"),children:[M?h.jsx(N7,{onClose:()=>R(!1),onPick:P=>{R(!1),j(P)}}):null,h.jsxs("div",{className:"flex items-end gap-2",children:[h.jsx(fe,{"aria-label":"Attach a file or folder",className:"size-9 shrink-0",disabled:c===!1,onClick:()=>R(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:M?"secondary":"outline",children:h.jsx(VA,{})}),h.jsx("textarea",{ref:U,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:c===!1,onChange:P=>x(P.target.value),onKeyDown:K,placeholder:c===!1?`${d?.label??"Agent"} (\`${d?.commandName??"agent"}\`) is not installed`:`Ask ${d?.label??"the agent"} anything about this project...`,rows:1,value:y}),a?h.jsxs(fe,{onClick:g,size:"sm",type:"button",variant:"outline",children:[h.jsx(vd,{})," Stop"]}):h.jsxs(fe,{disabled:!y.trim()||c===!1,onClick:()=>{O()},size:"sm",type:"button",children:["Send ",h.jsx(j5,{})]})]})]})]}):h.jsx("button",{className:me("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",w?"font-medium text-primary":"text-muted-foreground"),onClick:()=>i(!0),type:"button",children:w?h.jsxs(h.Fragment,{children:[h.jsx(F5,{className:"size-4 animate-bounce text-primary"}),h.jsx("span",{children:"Drop here to add it to your message"})]}):h.jsxs(h.Fragment,{children:[h.jsx(iS,{provider:d,className:"size-4 text-primary"}),h.jsxs("span",{children:["Ask ",d?.label??"the agent","..."]}),a?h.jsx(ds,{className:"size-3.5 animate-spin"}):null,h.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function iS({provider:e,className:t}){return e?.id==="claude"?h.jsx(Ed,{className:t}):e?.id==="codex"?h.jsx(Cd,{className:t}):h.jsx(B2,{className:t})}function M7({configured:e,provider:t}){return e===!1?h.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 ",h.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):h.jsx("div",{className:"text-xs text-muted-foreground",children:t?.intro??'This is the active agent, running in your workspace with full tools - e.g. "restart the api and tail its logs", "what changed in git and why?", "fix the failing test".'})}function R7({turn:e}){return e.role==="user"?h.jsx("div",{className:"flex justify-end",children:h.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})}):h.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(t=>h.jsx(D7,{tool:t},t.id)),e.text?h.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:e.text}):null]})}function D7({tool:e}){const t=WC(e.input);return h.jsxs("div",{className:me("inline-flex max-w-[85%] items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-[11px]",e.isError?"border-destructive/40 bg-destructive/5 text-destructive":"border-border bg-background text-muted-foreground"),children:[e.status==="running"?h.jsx(ds,{className:"size-3 animate-spin"}):h.jsx(S4,{className:"size-3"}),h.jsx("span",{className:"font-semibold",children:e.name}),t?h.jsx("span",{className:"truncate",children:t}):null]})}function O7({prompt:e,onRespond:t}){const i=WC(e.input).slice(0,140);return h.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:[h.jsx(l4,{className:"size-4 shrink-0 text-amber-600"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"font-mono font-semibold",children:e.name}),i?h.jsx("span",{className:"ml-1 truncate font-mono text-muted-foreground",children:i}):null]}),h.jsxs(fe,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[h.jsx(ys,{})," Deny"]}),h.jsxs(fe,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[h.jsx(Fc,{})," Allow"]})]})}function WC(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}const L7=[{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%)"}],j7=({size:e=20,color:t="#8f8f8f"})=>h.jsx("div",{style:{width:e,height:e},children:h.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:L7.map(i=>h.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...i}},i.transform))})}),B7=[{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"}],z7={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"},I7={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]"}},Sh=({size:e="medium",type:t="primary",variant:i="styled",shape:s="square",svgOnly:a=!1,children:l,prefix:c,suffix:d,shadow:m=!1,loading:f=!1,disabled:g=!1,fullWidth:b=!1,className:v,...y})=>h.jsxs("button",{disabled:g,tabIndex:0,className:Tc("flex items-center justify-center gap-0.5 duration-150",B7[+a][e],g||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":z7[t],I7[s][e],m&&"shadow-border-small border-none",b&&"w-full",i==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",v),type:"button",...y,children:[f?h.jsx(j7,{size:e==="large"?24:16}):c,h.jsx("span",{className:Tc("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&i!=="unstyled"&&"px-1.5"),children:l}),!f&&d]}),P7=({className:e})=>h.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z"})}),U7=()=>h.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:h.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 op=null,H7=0;const ni={toasts:[],listeners:new Set,add(e,t,i,s,a,l){const c=H7++,d={id:c,text:e,preserve:i,action:s,onAction:a,onUndoAction:l,type:t};if(!d.preserve){d.remaining=3e3,d.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(f=>f.id!==c),this.notify()};d.timeout=setTimeout(m,d.remaining),d.pause=()=>{d.timeout&&(clearTimeout(d.timeout),d.timeout=void 0,d.remaining-=Date.now()-d.start)},d.resume=()=>{d.timeout||(d.start=Date.now(),d.timeout=setTimeout(m,d.remaining))}}this.toasts.push(d),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()})}},F7=()=>{const[e,t]=C.useState([]),[i,s]=C.useState([]),[a,l]=C.useState(!1),c=x=>w=>{w&&x.measuredHeight==null&&(x.measuredHeight=w.getBoundingClientRect().height,ni.notify())};C.useEffect(()=>(t([...ni.toasts]),ni.subscribe(()=>{t([...ni.toasts])})),[]),C.useEffect(()=>{const x=e.filter(w=>!i.includes(w.id)).map(w=>w.id);x.length>0&&requestAnimationFrame(()=>{s(w=>[...w,...x])})},[i,e]);const m=Math.max(0,e.length-3),f=(x,w)=>{if(x===w-1)return"none";const E=w-1-x;let A=e[w-1]?.measuredHeight||63;for(let R=w-1;R>x;R--)a?A+=(e[R-1]?.measuredHeight||63)+10:A+=20;const T=-E,M=a?1:1-.05*E;return`translate3d(0, calc(100% - ${A}px), ${T}px) scale(${M})`},g=()=>{l(!0),ni.toasts.forEach(x=>{x.pause?.()})},b=()=>{l(!1),ni.toasts.forEach(x=>{x.resume?.()})},y=e.slice(m).reduce((x,w)=>x+(w.measuredHeight??63),0);return h.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:y},children:h.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:y},onMouseEnter:g,onMouseLeave:b,children:e.map((x,w)=>{const E=w>=m;return h.jsx("div",{ref:c(x),className:Tc("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"}[x.type],E?"opacity-100":"opacity-0",w<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:i.includes(x.id)?f(w,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:h.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[h.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[h.jsx("span",{children:x.text}),!x.action&&h.jsxs("div",{className:"flex gap-1",children:[x.onUndoAction&&h.jsx(Sh,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{x.onUndoAction?.(),ni.remove(x.id)},children:h.jsx(U7,{})}),h.jsx(Sh,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ni.remove(x.id),children:h.jsx(P7,{className:{message:"fill-gray-1000",success:"fill-contrast-fg",warning:"fill-gray-1000 dark:fill-gray-100",error:"fill-contrast-fg"}[x.type]})})]})]}),x.action&&h.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[h.jsx(Sh,{type:"tertiary",size:"small",onClick:()=>ni.remove(x.id),children:"Dismiss"}),h.jsx(Sh,{type:"primary",size:"small",onClick:()=>{x.onAction?.(),ni.remove(x.id)},children:x.action})]})]})},x.id)})})})},wh=()=>{if(op)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),op=w2.createRoot(e),op.render(h.jsx(F7,{}))},vn=()=>({message:C.useCallback(({text:e,preserve:t,action:i,onAction:s,onUndoAction:a})=>{wh(),ni.add(e,"message",t,i,s,a)},[]),success:C.useCallback(e=>{wh(),ni.add(e,"success")},[]),warning:C.useCallback(e=>{wh(),ni.add(e,"warning")},[]),error:C.useCallback(e=>{wh(),ni.add(e,"error")},[])});function St({className:e,type:t,...i}){return h.jsx("input",{type:t,className:me("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...i})}var h_=S2();function Qs({children:e,icon:t,onClose:i,title:s,size:a="md"}){return C.useEffect(()=>{function l(c){c.key==="Escape"&&i()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),h_.createPortal(h.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:i,children:h.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:[h.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[h.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),h.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),h.jsx(fe,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:h.jsx(ys,{})})]}),h.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const $7=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function V7({onClose:e,onSaved:t}){const{error:i,success:s}=vn(),[a,l]=C.useState("postgres"),[c,d]=C.useState(""),[m,f]=C.useState(""),[g,b]=C.useState([]),[v,y]=C.useState({status:"idle"}),[x,w]=C.useState(!1),[E,A]=C.useState(!1);C.useEffect(()=>{O4().then(b).catch(()=>b([]))},[]);function T(U){l(U.engine),f(U.url),y({status:"idle"}),c.trim()||d(q7(U))}async function M(){if(m.trim()){w(!0),y({status:"idle"});try{const U=await j4({engine:a,url:m.trim()});y(U.ok?{status:"ok",message:"Connected"}:{status:"fail",message:U.error??"Connection failed"})}catch(U){y({status:"fail",message:U instanceof Error?U.message:String(U)})}finally{w(!1)}}}async function R(){if(!c.trim()||!m.trim()){i("Name and connection are both required.");return}A(!0);try{await L4({name:c.trim(),engine:a,url:m.trim()}),s(`Saved connection "${c.trim()}".`),t(),e()}catch(U){i(U instanceof Error?U.message:String(U))}finally{A(!1)}}const z=a==="sqlite";return h.jsx(Qs,{icon:h.jsx($c,{}),onClose:e,title:"Add database connection",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[g.length>0?h.jsxs("section",{children:[h.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[h.jsx(y4,{className:"size-3.5"}),"Found in your services"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(U=>h.jsxs("button",{type:"button",onClick:()=>T(U),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:U.maskedUrl,children:[h.jsx(Ve,{variant:"outline",size:"small",children:U.engine}),h.jsx("span",{className:"font-mono",children:U.service}),h.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",U.key]})]},`${U.service}:${U.key}`))})]}):null,h.jsxs("section",{children:[h.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),h.jsx("div",{className:"flex gap-1.5",children:$7.map(U=>h.jsx(fe,{size:"sm",variant:a===U.value?"default":"outline",onClick:()=>{l(U.value),y({status:"idle"})},type:"button",children:U.label},U.value))})]}),h.jsxs("label",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),h.jsx(St,{value:c,onChange:U=>d(U.target.value),placeholder:"e.g. shop-db"})]}),h.jsxs("label",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z?"Database file path":"Connection URL"}),h.jsx(St,{value:m,onChange:U=>{f(U.target.value),y({status:"idle"})},placeholder:z?"/abs/path/to/app.db":a==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Read-only. The connection string is stored like a secret and masked in the UI and API."})]}),v.status!=="idle"?h.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${v.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[v.status==="ok"?h.jsx(Fc,{className:"size-3.5"}):h.jsx(ys,{className:"size-3.5"}),h.jsx("span",{className:"break-all font-mono",children:v.message})]}):null,h.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[h.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>{M()},disabled:x||!m.trim(),type:"button",children:[x?h.jsx(ds,{className:"animate-spin"}):null,"Test connection"]}),h.jsxs(fe,{size:"sm",onClick:()=>{R()},disabled:E,type:"button",children:[E?h.jsx(ds,{className:"animate-spin"}):null,"Save"]})]})]})})}function q7(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function K7({connection:e,sample:t}){const{success:i,error:s}=vn();async function a(l){try{const c=P4(e,t.engine,t.table,t.columns,l);await navigator.clipboard.writeText(c),i("Copied row + schema prompt to clipboard.")}catch(c){s(c instanceof Error?c.message:String(c))}}return t.columns.length===0?h.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):h.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:h.jsxs("table",{className:"w-full border-collapse text-left font-mono text-[11px]",children:[h.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:h.jsxs("tr",{className:"border-b border-border",children:[h.jsx("th",{className:"w-10 px-2 py-2"}),t.columns.map(l=>h.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[l.primaryKey?h.jsx(vA,{className:"size-3 text-amber-500"}):null,l.name]}),h.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:l.dataType})]},l.name))]})}),h.jsxs("tbody",{children:[t.rows.map((l,c)=>h.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[h.jsx("td",{className:"px-2 py-1 align-top",children:h.jsx(fe,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:"Explain this row to the agent",onClick:()=>{a(l)},type:"button",children:h.jsx(kc,{className:"size-3.5"})})}),t.columns.map(d=>h.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:nS(l[d.name]),children:nS(l[d.name])},d.name))]},c)),t.rows.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function nS(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function G7(){const[e,t]=C.useState([]),[i,s]=C.useState(!0),[a,l]=C.useState(null),c=C.useCallback(async()=>{s(!0),l(null);try{t(await D4())}catch(d){l(d instanceof Error?d.message:String(d))}finally{s(!1)}},[]);return C.useEffect(()=>{c()},[c]),{connections:e,loading:i,error:a,refresh:c}}function W7(e){const[t,i]=C.useState([]),[s,a]=C.useState(null),[l,c]=C.useState(null),[d,m]=C.useState(null),[f,g]=C.useState(null),[b,v]=C.useState(!1),[y,x]=C.useState(!1);return C.useEffect(()=>{if(i([]),a(null),c(null),m(null),g(null),!e)return;let w=!1;return v(!0),z4(e).then(E=>{w||(i(E),a(E[0]?.qualifiedName??null))}).catch(E=>{w||m(E instanceof Error?E.message:String(E))}).finally(()=>{w||v(!1)}),()=>{w=!0}},[e]),C.useEffect(()=>{if(c(null),g(null),!e||!s)return;let w=!1;return x(!0),I4(e,s,100).then(E=>{w||c(E)}).catch(E=>{w||g(E instanceof Error?E.message:String(E))}).finally(()=>{w||x(!1)}),()=>{w=!0}},[e,s]),{tables:t,selectedTable:s,setSelectedTable:a,sample:l,tablesError:d,rowsError:f,loadingTables:b,loadingRows:y}}function Y7(){const{connections:e,loading:t,error:i,refresh:s}=G7(),{error:a,success:l}=vn(),[c,d]=C.useState(null),[m,f]=C.useState(!1);C.useEffect(()=>{if(e.length===0){d(null);return}d(b=>b&&e.some(v=>v.name===b)?b:e[0].name)},[e]);async function g(b){try{await B4(b),l(`Removed connection "${b}".`),await s()}catch(v){a(v instanceof Error?v.message:String(v))}}return h.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[h.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($c,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-semibold",children:"Connections"}),h.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),h.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>f(!0),type:"button",children:[h.jsx(jn,{}),"Add"]})]}),h.jsx("ul",{className:"min-h-0 flex-1 overflow-auto",children:e.map(b=>h.jsx("li",{children:h.jsxs("div",{className:me("group flex w-full items-center gap-2 px-3 py-2 transition-colors hover:bg-muted/50",b.name===c&&"bg-muted/70"),children:[h.jsxs("button",{type:"button",onClick:()=>d(b.name),className:"flex min-w-0 flex-1 flex-col text-left",children:[h.jsx("span",{className:"truncate text-xs font-semibold",children:b.name}),h.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:b.url})]}),h.jsx(Ve,{variant:"outline",size:"small",children:b.engine}),h.jsx(fe,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:`Remove ${b.name}`,onClick:()=>{g(b.name)},type:"button",children:h.jsx(Vc,{className:"size-3.5 text-destructive"})})]})},b.name))}),t&&e.length===0?h.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading…"}):null]}),h.jsx("div",{className:"min-h-0 flex-1",children:i?h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"muted",className:"border-destructive/40 text-destructive",children:i})}):c?h.jsx(X7,{connection:c}):h.jsx(Z7,{onAdd:()=>f(!0)})}),m?h.jsx(V7,{onClose:()=>f(!1),onSaved:s}):null]})}function X7({connection:e}){const{tables:t,selectedTable:i,setSelectedTable:s,sample:a,tablesError:l,rowsError:c,loadingTables:d,loadingRows:m}=W7(e);return h.jsxs("div",{className:"flex h-full min-h-0",children:[h.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[h.jsx(m4,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),h.jsx(Ve,{variant:"outline",size:"small",children:t.length}),d?h.jsx(ds,{className:"size-3.5 animate-spin"}):null]}),l?h.jsx("div",{className:"p-3",children:h.jsx(ut,{variant:"muted",className:"border-destructive/40 text-destructive",children:l})}):h.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(f=>h.jsx("li",{children:h.jsx("button",{type:"button",onClick:()=>s(f.qualifiedName),className:me("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",f.qualifiedName===i&&"bg-muted/70 font-semibold"),children:f.qualifiedName})},f.qualifiedName)),!d&&t.length===0?h.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:i??"Select a table"}),a?h.jsxs(Ve,{variant:"outline",size:"small",children:[a.rowCount," rows"]}):null]}),c?h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"muted",className:"border-destructive/40 text-destructive",children:c})}):m?h.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[h.jsx(ds,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):a?h.jsx(K7,{connection:e,sample:a}):h.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function Z7({onAdd:e}){return h.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:h.jsxs("div",{className:"max-w-sm",children:[h.jsx($c,{className:"mx-auto size-8 text-muted-foreground/50"}),h.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),h.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' ",h.jsx("code",{children:".env"})," files."]}),h.jsxs(fe,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[h.jsx(jn,{}),"Add connection"]})]})})}function Q7({incident:e}){const{error:t,success:i}=vn(),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[d,m]=C.useState(!1);async function f(){a(!0);try{const{prompt:b}=await H4(e.id);await navigator.clipboard.writeText(b),c(!0),i("Copied debugging prompt to clipboard."),window.setTimeout(()=>c(!1),2e3)}catch(b){t(b instanceof Error?b.message:String(b))}finally{a(!1)}}async function g(){m(!0);try{const{markdown:b}=await F4(e.id);await navigator.clipboard.writeText(b),i("Copied repro bundle to clipboard.")}catch(b){t(b instanceof Error?b.message:String(b))}finally{m(!1)}}return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx(Ve,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),h.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?h.jsxs(Ve,{variant:"outline",size:"small",children:["×",e.count]}):null]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(fe,{onClick:()=>{g()},disabled:d,size:"sm",variant:"outline",children:[h.jsx(DA,{}),d?"Bundling…":"Copy repro bundle"]}),h.jsxs(fe,{onClick:()=>{f()},disabled:s,size:"sm",children:[l?h.jsx(Fc,{}):h.jsx(M5,{}),l?"Copied":"Copy to agent"]})]})]}),h.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?h.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[h.jsx(Z5,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,h.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()]})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[h.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),h.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(`
17
+ `)}),h.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 sS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function J7(){const[e,t]=C.useState([]),[i,s]=C.useState(!1),[a,l]=C.useState(null),c=C.useCallback(d=>{t(m=>sS([...m.filter(f=>f.id!==d.id),d]))},[]);return C.useEffect(()=>{let d=!0;U4().then(f=>{d&&t(sS(f))}).catch(f=>{d&&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{}}),()=>{d=!1,m.close()}},[c]),{incidents:e,connected:i,error:a}}function eL(){const{incidents:e,connected:t,error:i}=J7(),[s,a]=C.useState(null);C.useEffect(()=>{if(e.length===0){a(null);return}a(c=>c!==null&&e.some(d=>d.id===c)?c:e[0].id)},[e]);const l=C.useMemo(()=>e.find(c=>c.id===s)??null,[e,s]);return h.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[h.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(hg,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),h.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),h.jsx(Ve,{variant:"outline",size:"small",icon:h.jsx("span",{className:me("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),h.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(c=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>a(c.id),className:me("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:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:c.service}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.count>1?h.jsxs(Ve,{variant:"outline",size:"small",children:["×",c.count]}):null,h.jsx(Ve,{variant:c.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:c.level})]})]}),h.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:c.title}),h.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(c.lastSeen).toLocaleTimeString()})]})},c.id))})]}),h.jsx("div",{className:"min-h-0 flex-1",children:i?h.jsx("div",{className:"p-4",children:h.jsxs(ut,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",i]})}):l?h.jsx(Q7,{incident:l}):h.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:h.jsxs("div",{className:"max-w-sm",children:[h.jsx(hg,{className:"mx-auto size-8 text-muted-foreground/50"}),h.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),h.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 tL={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 Ur({label:e,children:t,side:i="bottom",className:s}){return h.jsxs("span",{className:me("group/tt relative inline-flex",s),children:[t,h.jsx("span",{role:"tooltip",className:me("pointer-events-none absolute z-[1100] whitespace-nowrap rounded-md bg-foreground px-2 py-1 text-xs font-medium text-background shadow-md","opacity-0 transition-opacity duration-150 group-hover/tt:opacity-100",tL[i]),children:e})]})}function iL({context:e}){const[t,i]=C.useState(!1);if(!e)return h.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 h.jsxs("section",{"aria-label":"Agent context",className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"agent-context-panel",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-medium",children:[h.jsx(kc,{className:"size-3.5"}),"Agent context"]}),h.jsxs(fe,{onClick:s,size:"sm",type:"button",variant:"outline",children:[t?h.jsx(Fc,{className:"size-3.5"}):h.jsx(k2,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),h.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 Rn({className:e,...t}){return h.jsx("label",{className:me("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const In='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Pn='</title><path d="',Un='"/></svg>',nL={title:".NET",slug:"dotnet",get svg(){return In+".NET"+Pn+this.path+Un},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"}},sL={title:"Bun",slug:"bun",get svg(){return In+"Bun"+Pn+this.path+Un},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"},rL={title:"Deno",slug:"deno",get svg(){return In+"Deno"+Pn+this.path+Un},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"}},aL={title:"Docker",slug:"docker",get svg(){return In+"Docker"+Pn+this.path+Un},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"},oL={title:"Go",slug:"go",get svg(){return In+"Go"+Pn+this.path+Un},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"},lL={title:"Node.js",slug:"nodedotjs",get svg(){return In+"Node.js"+Pn+this.path+Un},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"},cL={title:"npm",slug:"npm",get svg(){return In+"npm"+Pn+this.path+Un},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"},uL={title:"pnpm",slug:"pnpm",get svg(){return In+"pnpm"+Pn+this.path+Un},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"},hL={title:"Python",slug:"python",get svg(){return In+"Python"+Pn+this.path+Un},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/"},rS={title:"Rust",slug:"rust",get svg(){return In+"Rust"+Pn+this.path+Un},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"}},dL={title:"Vite",slug:"vite",get svg(){return In+"Vite"+Pn+this.path+Un},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"},fL={title:"Yarn",slug:"yarn",get svg(){return In+"Yarn"+Pn+this.path+Un},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 mL(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?en.vite:/\bcargo\s+/.test(t)?en.cargo:/\brustc\b/.test(t)?en.rust:/\bdotnet\b/.test(t)?en.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?en.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?en.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?en.go:/\bbun\b/.test(t)?en.bun:/\bdeno\b/.test(t)?en.deno:/\bpnpm\b/.test(t)?en.pnpm:/\byarn\b/.test(t)?en.yarn:/\bnpm\b/.test(t)?en.npm:/\bnode\b/.test(t)?en.node:en.generic}const en={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 d_({command:e,compact:t}){const i=mL(e),s=pL[i.kind];return h.jsx("span",{"aria-label":`${i.label} process`,className:me("inline-flex shrink-0 items-center justify-center rounded-md border bg-white shadow-sm",t?"size-6":"size-7",s?"border-zinc-200":"border-zinc-300 bg-zinc-100 text-zinc-700"),style:s?{color:`#${s.hex}`}:void 0,title:i.label,children:s?h.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:h.jsx("path",{d:s.path})}):h.jsx(z2,{className:t?"size-3.5":"size-4"})})}const pL={bun:sL,cargo:rS,deno:rL,dotnet:nL,docker:aL,generic:null,go:oL,node:lL,npm:cL,pnpm:uL,python:hL,rust:rS,vite:dL,yarn:fL},gL=[{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"}],aS=[{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 _L({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return h.jsxs(ut,{variant:e.ok?"default":"destructive",children:[h.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),h.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?h.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(`
18
+ `)}):null]})}function f_({active:e,baseUrl:t,compact:i=!1,onRefresh:s,onStarted:a,restartAction:l,solidStart:c=!1,targetLabel:d}){return e?h.jsxs(h.Fragment,{children:[h.jsx(lp,{compact:i,intent:"restart",icon:h.jsx(O2,{}),label:"Restart",action:l,targetLabel:d,url:`${t}/restart`,onRefresh:s}),h.jsx(lp,{compact:i,intent:"stop",icon:h.jsx(vd,{}),label:"Stop",targetLabel:d,url:`${t}/stop`,onRefresh:s})]}):h.jsx(lp,{compact:i,intent:c?"startSolid":"start",icon:h.jsx(R2,{}),label:"Start",targetLabel:d,url:`${t}/start`,onRefresh:s,onSuccess:a})}function Oc(e,t,i){const s=i instanceof Error?i.message:String(i);return`${e} failed for ${t}: ${s}`}function lp({action:e,compact:t=!1,intent:i="neutral",icon:s,label:a,targetLabel:l,url:c,onRefresh:d,onSuccess:m}){const[f,g]=C.useState(!1),[b,v]=C.useState(null),{error:y,success:x}=vn();async function w(A={}){g(!0);try{e?await e():await sn(c,A),x(`${a} requested for ${l}.`),await d(),v(null),m?.()}catch(T){T instanceof I2?v(T.conflict):y(Oc(a,l,T))}finally{g(!1)}}const E=h.jsxs(fe,{"aria-label":a,className:`${vL[i]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>w(),size:t?"icon":"sm",variant:"outline",children:[s,t?null:a]});return h.jsxs(h.Fragment,{children:[t?h.jsx(Ur,{label:a,children:E}):E,b?h.jsx(bL,{busy:f,conflict:b,onCancel:()=>v(null),onKillAndStart:()=>w({strategy:"killHolder"}),targetLabel:l}):null]})}function bL({busy:e,conflict:t,onCancel:i,onKillAndStart:s,targetLabel:a}){const l=t.holder,c=`http://localhost:${t.port}/`;return h.jsx(Qs,{icon:h.jsx(C4,{}),onClose:e?()=>{}:i,title:`Port ${t.port} is already in use`,children:h.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[h.jsxs("p",{children:[h.jsx("span",{className:"font-medium",children:a})," wants port"," ",h.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),h.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})`:""}
19
+ ${l.command}`:"unknown process"}),h.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[h.jsx(fe,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),h.jsxs(fe,{onClick:()=>window.open(c,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[h.jsx(N2,{}),"Open in browser"]}),h.jsx(fe,{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 vL={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 yL({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{error:a,success:l}=vn(),c=!!s,[d,m]=C.useState(s?.kind??"local"),[f,g]=C.useState(s?.name??""),[b,v]=C.useState(s?.command??""),[y,x]=C.useState(s?.cwd??e),[w,E]=C.useState(s?.port?String(s.port):""),[A,T]=C.useState(s?.description??""),[M,R]=C.useState(s?.composeFile??""),[z,U]=C.useState(s?.composeService??""),[j,O]=C.useState(s?.host??""),[K,H]=C.useState(null),[G,J]=C.useState(!1);C.useEffect(()=>{H(null)},[b,y,w,d]);function P(){g(""),v(""),x(e),E(""),T(""),R(""),U(""),O(""),H(null)}async function ee(N){N.preventDefault();try{const F={name:f,kind:d,cwd:y,port:w,description:A};(d==="local"||d==="ssh")&&(F.command=b),d==="docker-compose"&&(F.composeFile=M,F.composeService=z),d==="ssh"&&(F.host=j),await sn("/api/services",F),c||P(),l(c?`${f} updated.`:`${f} added.`),await t(),i?.()}catch(F){a(Oc(c?"Update service":"Add service",f||"service",F))}}async function q(){if(!b.trim()){a("Test command failed for service: command is required.");return}J(!0);try{H(await aM({command:b,cwd:y,port:w}))}catch(N){a(Oc("Test command",f||"service",N))}finally{J(!1)}}return{editing:c,kind:d,setKind:m,name:f,setName:g,command:b,setCommand:v,formCwd:y,setFormCwd:x,port:w,setPort:E,description:A,setDescription:T,composeFile:M,setComposeFile:R,composeService:z,setComposeService:U,host:j,setHost:O,testResult:K,testing:G,submit:ee,testCommand:q}}function oS({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{editing:a,kind:l,setKind:c,name:d,setName:m,command:f,setCommand:g,formCwd:b,setFormCwd:v,port:y,setPort:x,description:w,setDescription:E,composeFile:A,setComposeFile:T,composeService:M,setComposeService:R,host:z,setHost:U,testResult:j,testing:O,submit:K,testCommand:H}=yL({cwd:e,onRefresh:t,onSaved:i,initialService:s}),G=aS.find(q=>q.value===l),J=l==="local"&&f.trim().length>0&&b.trim().length>0,P="grid gap-2 rounded-md border border-border bg-muted/30 p-3",ee="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return h.jsxs("form",{className:"grid gap-3",onSubmit:K,children:[h.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[h.jsxs("fieldset",{className:`${P} sm:col-span-2`,children:[h.jsx("legend",{className:ee,children:"Step 1 · Service kind"}),h.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:aS.map(q=>h.jsx(fe,{className:"justify-center",disabled:a,onClick:()=>c(q.value),size:"sm",type:"button",variant:l===q.value?"default":"outline",children:q.label},q.value))}),h.jsx("p",{className:"text-[11px] text-muted-foreground",children:G.hint})]}),h.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[h.jsxs("fieldset",{className:P,children:[h.jsx("legend",{className:ee,children:"Step 2 · Identity"}),h.jsxs(Rn,{children:["Name",h.jsx(St,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.target.value),placeholder:"backend",readOnly:a,required:!0,value:d}),a?h.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),h.jsxs(Rn,{children:["Description",h.jsx(St,{className:"h-8 text-sm",name:"description",onChange:q=>E(q.target.value),placeholder:"API server",value:w})]})]}),h.jsxs("fieldset",{className:P,children:[h.jsx("legend",{className:ee,children:"Step 4 · Networking (optional)"}),h.jsxs(Rn,{children:["Port",h.jsx(St,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>x(q.target.value),placeholder:"3001",value:y})]})]})]}),l==="local"?h.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[h.jsx("legend",{className:ee,children:"Step 3 · Local command"}),h.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:gL.map(q=>h.jsxs(fe,{className:"justify-start gap-1.5",onClick:()=>{g(q.command),E(q.description)},size:"sm",type:"button",variant:"outline",children:[h.jsx(d_,{command:q.badgeCommand??q.command,compact:!0}),h.jsx("span",{className:"truncate",children:q.label})]},q.label))}),h.jsxs(Rn,{children:["Command",h.jsx(St,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>g(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),h.jsxs(Rn,{children:["Working Directory",h.jsx(St,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:b})]})]}):null,l==="docker-compose"?h.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[h.jsx("legend",{className:ee,children:"Step 3 · Docker Compose target"}),h.jsxs(Rn,{children:["Compose Service",h.jsx(St,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>R(q.target.value),placeholder:"api",required:!0,value:M})]}),h.jsxs(Rn,{children:["Compose File (optional)",h.jsx(St,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>T(q.target.value),placeholder:"docker-compose.yml",value:A})]}),h.jsxs(Rn,{children:["Working Directory (where compose file lives)",h.jsx(St,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),required:!0,value:b})]})]}):null,l==="ssh"?h.jsxs("fieldset",{className:`${P} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[h.jsx("legend",{className:ee,children:"Step 3 · SSH connection"}),h.jsxs(Rn,{children:["SSH Host (alias from ~/.ssh/config)",h.jsx(St,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>U(q.target.value),placeholder:"devbox",required:!0,value:z})]}),h.jsxs(Rn,{children:["Remote Command",h.jsx(St,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>g(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),h.jsxs(Rn,{children:["Remote Working Directory",h.jsx(St,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>v(q.target.value),placeholder:"/srv/app",required:!0,value:b})]}),h.jsxs(ut,{variant:"muted",children:[h.jsx("div",{className:"font-medium",children:"SSH key handling"}),h.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",h.jsxs("code",{children:["Host ",z||"&lt;alias&gt;"]})," entry to",h.jsx("code",{children:" ~/.ssh/config"})," with ",h.jsx("code",{children:"HostName"}),", ",h.jsx("code",{children:"User"}),", and"," ",h.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",h.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",h.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",h.jsxs("code",{children:["ssh ",z||"&lt;alias&gt;"]})," using that config."]})]})]}):null]}),j?h.jsx(_L,{result:j}):null,h.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[l==="local"?h.jsxs(fe,{disabled:O||!J,onClick:H,type:"button",variant:"outline",children:[h.jsx(z2,{}),O?"Testing...":"Test Command"]}):null,h.jsx(fe,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function YC({initialName:e="",initialServices:t=[],onSaved:i,onRefresh:s,originalName:a,services:l,submitLabel:c="Save Group"}){const{error:d,success:m}=vn();async function f(g){g.preventDefault();const b=g.currentTarget,v=new FormData(b),y=String(v.get("name")??""),x=v.getAll("services").map(w=>String(w)).filter(Boolean);try{await sn("/api/bundles",{name:y,originalName:a,services:x.join(",")}),b.reset(),m(`${y} group saved.`),await s(),i?.()}catch(w){d(Oc("Save group",y||"group",w))}}return h.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[h.jsxs(Rn,{children:["Group name",h.jsx(St,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),h.jsxs("fieldset",{className:"grid gap-1.5",children:[h.jsx("legend",{className:"text-xs font-medium",children:"Services"}),l.length?l.map(g=>h.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[h.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(g.name),name:"services",type:"checkbox",value:g.name}),h.jsx(d_,{command:g.command??"",compact:!0}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-sm font-medium",children:g.name}),h.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:g.command??g.kind??""})]})]},g.name)):h.jsx(ut,{variant:"muted",children:"All services are already grouped, or none registered."})]}),h.jsx(fe,{className:"h-8",disabled:!l.length,type:"submit",children:c})]})}function id({label:e}){return h.jsx(ut,{variant:"muted",className:"m-4 text-center",children:e})}const xL=900*1e3,fc=12,cp=200;function SL({events:e}){const[t,i]=C.useState(null),[s,a]=C.useState(null),{rows:l,windowStart:c,windowEnd:d}=C.useMemo(()=>wL(e),[e]),m=t?l.find(f=>f.service===t)??null:null;return h.jsxs(h.Fragment,{children:[h.jsxs(ms,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs(gs,{className:"flex items-center gap-2",children:[h.jsx(Vo,{className:"size-3.5"}),"Runtime Monitor"]}),h.jsx(Gr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),h.jsx(_s,{className:"p-0",children:l.length===0?h.jsx(id,{label:"No runtime timeline events yet."}):h.jsxs("div",{className:"divide-y divide-border",children:[l.map(f=>h.jsx(CL,{onClick:()=>i(f.service),row:f,windowEnd:d,windowStart:c},f.service)),h.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[h.jsx("span",{children:nd(c)}),h.jsx("span",{children:"now"})]})]})})]}),m?h.jsx(Qs,{icon:h.jsx(Vo,{}),onClose:()=>i(null),title:m.service,children:h.jsx(NL,{onSelect:a,row:m})}):null,s?h.jsx(Qs,{icon:h.jsx(Vo,{}),onClose:()=>a(null),title:s.title,children:h.jsx(TL,{event:s})}):null]})}function wL(e){const t=Date.now(),i=t,s=t-xL;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(-cp):a.length>cp&&(a=a.slice(-cp));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,M)=>T.timestamp.localeCompare(M.timestamp)),b=new Array(fc).fill(0),v=new Array(fc).fill(null);for(const T of g){const M=new Date(T.timestamp).getTime(),R=Math.max(s,Math.min(i,M)),z=Math.min(fc-1,Math.floor((R-s)/c*fc));b[z]+=1;const U=v[z];v[z]=EL(U,T.severity)}const y=g.filter(T=>T.severity==="error").length,x=g.filter(T=>T.severity==="warning").length,w=g.length-y-x,E=[...g].reverse().find(T=>T.severity!=="info")??null,A=y>0?"error":x>0?"warning":"info";return{service:m,events:g,errors:y,warnings:x,infos:w,buckets:b,bucketSeverity:v,lastNotable:E,worstSeverity:A}}).sort((m,f)=>{const g=v=>v.errors*1e3+v.warnings,b=g(f)-g(m);return b!==0?b:m.service.localeCompare(f.service)}),windowStart:s,windowEnd:i}}function EL(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function CL({onClick:e,row:t,windowEnd:i,windowStart:s}){const a=Math.max(1,...t.buckets);return h.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:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:me("size-2 shrink-0 rounded-full",XC(t.worstSeverity))}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:h.jsx("bdi",{children:t.service})}),t.errors>0?h.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?h.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,h.jsx(Yr,{className:"size-3 text-muted-foreground"})]}),h.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${fc}, minmax(0, 1fr))`},children:t.buckets.map((l,c)=>h.jsx(kL,{count:l,max:a,severity:t.bucketSeverity[c]},c))}),t.lastNotable?h.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):h.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),h.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[h.jsx("span",{children:nd(s)}),h.jsx("span",{children:nd(i)})]})]})}function kL({count:e,max:t,severity:i}){if(e===0)return h.jsx("span",{className:"rounded-sm bg-border/60"});const s=Math.min(1,.35+e/t*.65);return h.jsx("span",{className:me("rounded-sm",AL(i)),style:{opacity:s},title:`${e} event${e===1?"":"s"}`})}function NL({onSelect:e,row:t}){const i=[...t.events].sort((s,a)=>a.timestamp.localeCompare(s.timestamp));return h.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[h.jsxs("span",{children:[t.events.length," events"]}),h.jsx("span",{children:"·"}),h.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),h.jsx("span",{children:"·"}),h.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),h.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:i.map(s=>h.jsx("li",{children:h.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:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:me("size-2 shrink-0 rounded-full",XC(s.severity))}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:s.title}),h.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:nd(s.timestamp)})]}),s.detail?h.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s.detail}):null]})},s.id))})]})}function TL({event:e}){const t=new Date(e.timestamp);return h.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:me("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",ML(e.severity)),children:e.severity}),h.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?h.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]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),h.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?h.jsxs("div",{children:[h.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),h.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 XC(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function AL(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function ML(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function nd(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 RL({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:jL(e.summary);return h.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:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsxs("span",{className:me("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",DL(e.status)),children:[h.jsx("span",{className:"inline-flex shrink-0",children:h.jsx(Vo,{className:"size-3"})}),h.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),i?h.jsx("span",{className:"min-w-0 truncate",children:i}):null]}),t?h.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[h.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[h.jsx(P5,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),h.jsxs("span",{children:[LL(t.cpuPercent)," CPU"]}),h.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[h.jsx(kA,{className:"size-3"}),OL(t.rssMb)," RAM"]})]}):null]})}function DL(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 OL(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function LL(e){return`${e.toFixed(1)}%`}function jL(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function BL({ports:e}){const t=e.filter(s=>s.state==="occupied").length,i=e.filter(s=>s.state==="managed").length;return h.jsxs(ms,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[h.jsxs(ps,{className:"border-b border-border px-3 py-2",children:[h.jsxs(gs,{className:"flex items-center gap-2",children:[h.jsx(MA,{className:"size-3.5"}),"Ports"]}),h.jsxs(Gr,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),h.jsx(_s,{className:"p-0",children:e.length?h.jsx("div",{className:"divide-y divide-border",children:e.map(s=>h.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"font-mono text-xs",children:[":",s.port]}),h.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:s.services.join(", ")||"Unassigned"}),s.urls[0]?h.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:s.urls[0]}):null]}),h.jsx(zL,{port:s})]},s.port))}):h.jsx(id,{label:"No configured ports yet."})})]})}function zL({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 h.jsx(Ve,{className:me(e&&"max-w-36 truncate"),variant:s,children:i})}function IL({onChange:e,value:t}){return h.jsxs("label",{className:"relative block",children:[h.jsx(i4,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),h.jsx(St,{"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 PL({className:e,containerRef:t,emptyText:i,logs:s,query:a}){return h.jsx("div",{className:me("h-full max-w-full overflow-auto font-mono text-[11px] leading-5",e),ref:t,role:"log",children:s.length?s.map((l,c)=>h.jsxs("div",{className:me("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5",l.stream==="stderr"?"bg-red-50/70 text-red-800":"bg-emerald-50/35 text-zinc-800"),children:[h.jsx("span",{className:"text-muted-foreground",children:l.timestamp}),h.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[l.stream==="stderr"?h.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700",children:"stderr"}):null,HL(l.text,a)]})]},`${l.timestamp}-${l.stream}-${c}`)):h.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function UL(e){return`${e.timestamp} ${e.stream} ${e.text}`}function HL(e,t){const i=t.trim();if(!i)return e;const s=e.toLowerCase(),a=i.toLowerCase(),l=[];let c=0,d=s.indexOf(a);for(;d!==-1;){d>c&&l.push(e.slice(c,d));const m=d+i.length;l.push(h.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950",children:e.slice(d,m)},`${d}-${m}`)),c=m,d=s.indexOf(a,c)}return c<e.length&&l.push(e.slice(c)),l}function lS(e){return`${e.kind}:${e.name}`}function FL(e,t=!1,i={}){const[s,a]=C.useState(),[l,c]=C.useState(),[d,m]=C.useState(e.kind==="source"),f=JSON.stringify(i);return C.useEffect(()=>{a(void 0),c(void 0);let g=!1;const b=async()=>{try{if(e.kind==="service"){const y=await H2(e.name,i);g||(a(y.logs),m(y.queryable),c(void 0))}else{const y=await P2(e.name,i);g||(a(y),m(!0),c(void 0))}}catch(y){g||c(y instanceof Error?y.message:String(y))}};b();const v=window.setInterval(b,t?1e3:2e3);return()=>{g=!0,window.clearInterval(v)}},[e.kind,e.name,t,f]),{logs:s,error:l,queryable:d}}const $L=[{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 ZC({target:e,query:t,setQuery:i,streaming:s,setStreaming:a,hideStdout:l,setHideStdout:c,fill:d=!1,leading:m,trailing:f}){const g=e.kind==="source",[b,v]=C.useState(""),[y,x]=C.useState(""),[w,E]=C.useState(t);C.useEffect(()=>{const Z=window.setTimeout(()=>E(t),300);return()=>window.clearTimeout(Z)},[t]);const A=C.useMemo(()=>{const Z={};b&&(Z.since=b),y&&(Z.level=y);const W=w.trim();return W&&(Z.grep=W),Z},[b,y,w]),{logs:T,error:M,queryable:R}=FL(e,s,A),z=g||R,U=C.useRef(null),j=C.useRef(!0),[O,K]=C.useState([]),[H,G]=C.useState(!1),J=JSON.stringify(A);C.useEffect(()=>{K([])},[J,e.kind,e.name]);const P=C.useMemo(()=>{const Z=T??[];if(O.length===0)return Z;const W=new Set(O.map(D=>D.cursor).filter(Boolean));return[...O,...Z.filter(D=>!D.cursor||!W.has(D.cursor))]},[T,O]),ee=(O[0]??(T??[])[0])?.cursor;async function q(){if(!(!z||!ee||H)){G(!0),j.current=!1;try{const Z={...A,before:ee,lines:200},W=e.kind==="source"?await P2(e.name,Z):(await H2(e.name,Z)).logs;W.length&&K(D=>{const ie=new Set(D.map(le=>le.cursor).filter(Boolean));return[...W.filter(le=>!le.cursor||!ie.has(le.cursor)),...D]})}finally{G(!1)}}}const N=t.trim().toLowerCase(),F=C.useMemo(()=>{let Z=P;return l&&(Z=Z.filter(W=>W.stream==="stderr")),N&&(Z=Z.filter(W=>UL(W).toLowerCase().includes(N))),Z},[P,l,N]);C.useEffect(()=>{const Z=U.current;if(!Z)return;const W=()=>{const D=Z.scrollHeight-Z.scrollTop-Z.clientHeight;j.current=D<40};return W(),Z.addEventListener("scroll",W,{passive:!0}),()=>Z.removeEventListener("scroll",W)},[]),C.useEffect(()=>{if(!s||!j.current||F.length===0)return;const Z=U.current;Z&&(Z.scrollTop=Z.scrollHeight)},[s,F]);const $=T?N?`No log lines match "${t.trim()}".`:l?"No stderr output captured.":"No log entries.":"Loading…";return h.jsxs("div",{className:d?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,h.jsx(IL,{onChange:i,value:t}),z?h.jsxs(h.Fragment,{children:[h.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:Z=>v(Z.target.value),value:b,children:$L.map(Z=>h.jsx("option",{value:Z.value,children:Z.label},Z.label))}),h.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:Z=>x(Z.target.value),value:y,children:[h.jsx("option",{value:"",children:"All levels"}),h.jsx("option",{value:"warn",children:"Warnings+"}),h.jsx("option",{value:"error",children:"Errors"})]})]}):h.jsxs(cS,{active:l,activeClassName:"border-amber-600 bg-amber-50 text-amber-700",onClick:()=>c(!l),children:[h.jsx(lA,{}),"Errors only"]}),h.jsxs(cS,{active:s,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700",onClick:()=>a(!s),children:[h.jsx(XA,{}),s?"Streaming":"Stream"]}),z&&ee?h.jsxs(fe,{disabled:H,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[h.jsx(D0,{}),H?"Loading…":"Load older"]}):null,f?h.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),M?h.jsx("div",{className:"text-red-600",children:M}):null,h.jsx(PL,{className:me("rounded border border-border/60",d?"min-h-0 flex-1":"max-h-80"),containerRef:U,emptyText:$,logs:F,query:t})]})}function cS({active:e,activeClassName:t,children:i,onClick:s}){return h.jsx(fe,{"aria-pressed":e,className:e?t:void 0,onClick:s,size:"sm",type:"button",variant:"outline",children:i})}function VL(e,t){return e.kind===t.kind&&e.name===t.name}function qL({options:e,target:t,onChange:i,className:s}){const a=e.findIndex(c=>VL(c.target,t)),l=[...new Set(e.map(c=>c.group))];return h.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=>h.jsx("optgroup",{label:c,children:e.map((d,m)=>d.group===c?h.jsx("option",{value:String(m),children:d.label},`${d.group}:${d.label}`):null)},c))})}function KL({serviceName:e}){const[t,i]=C.useState(""),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[d,m]=C.useState(!1),f=h.jsx(ZC,{fill:!0,hideStdout:l,query:t,setHideStdout:c,setQuery:i,setStreaming:a,streaming:s,target:{kind:"service",name:e},trailing:h.jsxs(fe,{onClick:()=>m(g=>!g),size:"sm",type:"button",variant:"outline",children:[d?h.jsx(TA,{}):h.jsx(EA,{}),d?"Exit":"Expand"]})});return d?h.jsx(QC,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):h.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function QC({title:e,onClose:t,children:i,maxWidthClass:s="max-w-6xl"}){return C.useEffect(()=>{function a(l){l.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),h_.createPortal(h.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:h.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:[h.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[h.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),h.jsx(fe,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:h.jsx(ys,{})})]}),h.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const GL={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 WL({onClose:e,onAdded:t}){const[i,s]=C.useState(""),[a,l]=C.useState("journald"),[c,d]=C.useState(""),[m,f]=C.useState(""),[g,b]=C.useState(""),[v,y]=C.useState(""),[x,w]=C.useState(""),[E,A]=C.useState(""),[T,M]=C.useState(),[R,z]=C.useState(!1);async function U(){z(!0),M(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=x.trim(),c.trim()&&(j.host=c.trim())):a==="docker"&&(j.driver="docker",j.container=E.trim(),c.trim()&&(j.host=c.trim()));const O=await Z4(j);t(O,j.name),e()}catch(j){M(j instanceof Error?j.message:String(j))}finally{z(!1)}}return h.jsx(Qs,{icon:h.jsx(j2,{}),onClose:e,size:"md",title:"Add log source",children:h.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:j=>{j.preventDefault(),U()},children:[h.jsx(Ws,{label:"Name",children:h.jsx(St,{autoFocus:!0,onChange:j=>s(j.target.value),placeholder:"PROD",value:i})}),h.jsxs(Ws,{label:"Type",children:[h.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:[h.jsx("option",{value:"journald",children:"systemd journal (journald)"}),h.jsx("option",{value:"docker",children:"Docker container"}),h.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),h.jsx("option",{value:"file",children:"Local file"}),h.jsx("option",{value:"command",children:"Command"})]}),h.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:GL[a]})]}),a==="journald"||a==="docker"?h.jsx(Ws,{label:"Host (optional — leave blank to run locally)",children:h.jsx(St,{onChange:j=>d(j.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:c})}):null,a==="journald"?h.jsx(Ws,{label:"Unit",children:h.jsx(St,{onChange:j=>w(j.target.value),placeholder:"jobjourney",value:x})}):null,a==="docker"?h.jsx(Ws,{label:"Container",children:h.jsx(St,{onChange:j=>A(j.target.value),placeholder:"brainctl-api",value:E})}):null,a==="ssh"?h.jsx(Ws,{label:"Host",children:h.jsx(St,{onChange:j=>d(j.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:c})}):null,a==="file"||a==="ssh"?h.jsx(Ws,{label:a==="ssh"?"Remote path":"File path",children:h.jsx(St,{onChange:j=>f(j.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?h.jsxs(h.Fragment,{children:[h.jsx(Ws,{label:"Command",children:h.jsx(St,{onChange:j=>b(j.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:g})}),h.jsx(Ws,{label:"Working directory (optional)",children:h.jsx(St,{onChange:j=>y(j.target.value),placeholder:"/srv/app",value:v})})]}):null,T?h.jsx("div",{className:"text-red-600",children:T}):null,h.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[h.jsx(fe,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),h.jsx(fe,{disabled:R||!i.trim(),size:"sm",type:"submit",children:R?"Saving…":"Add source"})]})]})})}function Ws({label:e,children:t}){return h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const uS=4;function YL({services:e,initialService:t,onClose:i}){const[s,a]=C.useState([]),[l,c]=C.useState(!1),[d,m]=C.useState(()=>[0]),[f,g]=C.useState(()=>{const M=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return M?{0:M}:{}}),b=C.useRef(1);C.useEffect(()=>{let M=!1;return X4().then(R=>{M||a(R)}),()=>{M=!0}},[]);const v=[...e.map(M=>({target:{kind:"service",name:M},label:M,group:"Services"})),...s.map(M=>({target:{kind:"source",name:M.name},label:M.name,group:"Log sources"}))],y=v.map(M=>M.target);function x(){if(d.length>=uS||y.length===0)return;const M=b.current++,R=new Set(Object.values(f).map(lS)),z=y.find(U=>!R.has(lS(U)))??y[0];m(U=>[...U,M]),g(U=>({...U,[M]:z}))}function w(M){m(R=>R.filter(z=>z!==M)),g(R=>{const z={...R};return delete z[M],z})}function E(M,R){g(z=>({...z,[M]:R}))}function A(M,R){a(M);const z=d[0];z!==void 0&&E(z,{kind:"source",name:R})}const T=h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{children:"Logs"}),h.jsxs(fe,{onClick:()=>c(!0),size:"sm",type:"button",variant:"outline",children:[h.jsx(jn,{}),"Add source"]}),h.jsxs(fe,{disabled:d.length>=uS||y.length===0,onClick:x,size:"sm",type:"button",variant:"outline",children:[h.jsx(jn,{}),"Add pane"]})]});return h.jsxs(h.Fragment,{children:[h.jsx(QC,{maxWidthClass:"max-w-[1500px]",onClose:i,title:T,children:y.length===0?h.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:h.jsxs("div",{children:[h.jsx("p",{children:"No services or log sources yet."}),h.jsxs(fe,{className:"mt-2",onClick:()=>c(!0),size:"sm",type:"button",children:[h.jsx(jn,{}),"Add a log source"]})]})}):h.jsx("div",{className:me("grid h-full min-h-0 gap-3",d.length>1?"lg:grid-cols-2":"grid-cols-1",d.length>2?"lg:grid-rows-2":"grid-rows-1"),children:d.map(M=>h.jsx(XL,{onChangeTarget:R=>E(M,R),onRemove:d.length>1?()=>w(M):void 0,options:v,target:f[M]??y[0]},M))})}),l?h.jsx(WL,{onAdded:A,onClose:()=>c(!1)}):null]})}function XL({options:e,target:t,onChangeTarget:i,onRemove:s}){const[a,l]=C.useState(""),[c,d]=C.useState(!0),[m,f]=C.useState(!1);return h.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:h.jsx(ZC,{fill:!0,hideStdout:m,leading:h.jsx(qL,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:l,setStreaming:d,streaming:c,target:t,trailing:s?h.jsx(fe,{"aria-label":"Remove pane",onClick:s,size:"icon",type:"button",variant:"ghost",children:h.jsx(ys,{})}):void 0})})}function ZL({rows:e,revealAll:t,onAdd:i,onRemove:s,onUpdate:a}){return e.length===0?h.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",h.jsx("button",{className:"underline",onClick:i,type:"button",children:"Add one"}),"."]}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full font-mono text-[11px]",children:[h.jsx("thead",{className:"text-left text-muted-foreground",children:h.jsxs("tr",{children:[h.jsx("th",{className:"py-1 pr-3",children:"Key"}),h.jsx("th",{className:"py-1 pr-3",children:"Value"}),h.jsx("th",{className:"py-1 w-8"})]})}),h.jsx("tbody",{children:e.map((l,c)=>{const d=!l.reveal&&!t;return h.jsxs("tr",{className:"border-t border-border/40",children:[h.jsx("td",{className:"py-1 pr-3 align-top",children:h.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})}),h.jsx("td",{className:"py-1 pr-3 align-top",children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.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:d?"password":"text",value:l.value}),h.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?h.jsx(T2,{size:14}):h.jsx(O0,{size:14})})]})}),h.jsx("td",{className:"py-1 align-top",children:h.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>s(c),type:"button",children:h.jsx(Vc,{size:14})})})]},c)})})]})})}function QL({serviceName:e,onClose:t,onPick:i}){const[s,a]=C.useState(),[l,c]=C.useState(),[d,m]=C.useState(!0),[f,g]=C.useState();C.useEffect(()=>{let y=!1;return m(!0),c(void 0),(async()=>{try{const x=await iM(e,f);y||a(x)}catch(x){y||c(x instanceof Error?x.message:String(x))}finally{y||m(!1)}})(),()=>{y=!0}},[e,f]);function b(y){if(y.kind==="directory"){g(y.relativePath);return}y.supported&&i(y.relativePath)}function v(){if(!s||s.isRoot)return;const y=s.relativePath,x=y.includes("/")?y.slice(0,y.lastIndexOf("/")):"";g(x||void 0)}return h.jsx(Qs,{icon:h.jsx(bd,{}),onClose:t,size:"lg",title:"Pick a config file",children:h.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsxs(fe,{disabled:!s||s.isRoot,onClick:v,size:"sm",type:"button",variant:"outline",children:[h.jsx(D0,{})," Up"]}),h.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:s?.relativePath||"./"})]}),l?h.jsx("div",{className:"text-red-600",children:l}):d?h.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!s||s.entries.length===0?h.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):h.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:h.jsx("ul",{className:"divide-y divide-border/40",children:s.entries.map(y=>{const x=y.kind==="directory",w=x||y.supported;return h.jsx("li",{children:h.jsxs("button",{className:me("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:()=>b(y),type:"button",children:[x?h.jsx(Ia,{size:14}):h.jsx(A2,{size:14}),h.jsx("span",{className:"flex-1 truncate font-mono",children:y.name}),!x&&y.format?h.jsx(Ve,{size:"small",variant:"secondary",children:y.format}):null]})},y.relativePath)})})}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",h.jsx("code",{children:".env*"}),", ",h.jsx("code",{children:"appsettings*.json"}),", and"," ",h.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function JC(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function JL(e){const{error:t,success:i}=vn(),[s,a]=C.useState([]),[l,c]=C.useState(),[d,m]=C.useState(),[f,g]=C.useState(!0),[b,v]=C.useState(!1),[y,x]=C.useState(!1),[w,E]=C.useState(!1),[A,T]=C.useState();C.useEffect(()=>{let H=!1;return g(!0),T(void 0),(async()=>{try{const G=await nM(e);if(H)return;a(G.files),G.files.length>0?c(J=>J??G.files[0].path):(c(void 0),m(void 0))}catch(G){H||T(G instanceof Error?G.message:String(G))}finally{H||g(!1)}})(),()=>{H=!0}},[e]);const M=C.useCallback(async H=>{v(!0),T(void 0);try{const G=await ky(e,H),J={path:G.path,relativePath:G.relativePath,format:G.format};G.format==="env"?m({info:J,exists:G.exists,rows:G.entries.map(P=>({...P,reveal:!1}))}):m({info:J,exists:G.exists,text:G.format==="json"?JC(G.content):G.content}),E(!1)}catch(G){T(G instanceof Error?G.message:String(G))}finally{v(!1)}},[e]);C.useEffect(()=>{l&&M(l)},[l,M]);function R(H,G){m(J=>{if(!J?.rows)return J;const P=J.rows.map((ee,q)=>q===H?{...ee,...G}:ee);return{...J,rows:P}}),E(!0)}function z(){m(H=>H?.rows?{...H,rows:[...H.rows,{key:"",value:"",secret:!1,reveal:!0}]}:H),E(!0)}function U(H){m(G=>G?.rows?{...G,rows:G.rows.filter((J,P)=>P!==H)}:G),E(!0)}function j(H){m(G=>G&&{...G,text:H}),E(!0)}async function O(){if(d){x(!0);try{if(d.info.format==="env"&&d.rows){const H=await sM(e,d.info.path,d.rows.map(G=>({key:G.key.trim(),value:G.value})));m({info:{path:H.path,relativePath:H.relativePath,format:H.format},exists:H.exists,rows:H.entries.map(G=>({...G,reveal:!1}))}),i(`Saved ${H.entries.length} entries to ${H.relativePath}.`)}else if(d.text!==void 0){const H=await rM(e,d.info.path,d.text);m({info:{path:H.path,relativePath:H.relativePath,format:H.format},exists:H.exists,text:H.content}),i(`Saved ${H.relativePath}.`)}E(!1)}catch(H){t(H instanceof Error?H.message:String(H))}finally{x(!1)}}}async function K(H){try{const G=await ky(e,H),J={path:G.path,relativePath:G.relativePath,format:G.format};return a(P=>P.some(ee=>ee.path===J.path)?P:[...P,J]),c(J.path),i(`Loaded ${J.relativePath}.`),!0}catch(G){return t(G instanceof Error?G.message:String(G)),!1}}return{files:s,selectedPath:l,setSelectedPath:c,loaded:d,loadingList:f,loadingFile:b,saving:y,dirty:w,error:A,addRow:z,removeRow:U,updateRow:R,updateText:j,save:O,pickFile:K}}function e9({serviceName:e}){const{files:t,selectedPath:i,setSelectedPath:s,loaded:a,loadingList:l,loadingFile:c,saving:d,dirty:m,error:f,addRow:g,removeRow:b,updateRow:v,updateText:y,save:x,pickFile:w}=JL(e),[E,A]=C.useState(!1),[T,M]=C.useState(!1);return l?h.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?h.jsx("div",{className:"text-red-600",children:f}):h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?h.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:R=>s(R.target.value),value:i??"",children:t.map(R=>h.jsxs("option",{value:R.path,children:[R.relativePath," [",R.format,"]"]},R.path))}):h.jsx("span",{className:"text-muted-foreground",children:"none detected"}),h.jsxs(fe,{onClick:()=>M(!0),size:"sm",type:"button",variant:"outline",children:[h.jsx(bd,{})," Browse files"]}),a?h.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),h.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?h.jsxs(h.Fragment,{children:[h.jsxs(fe,{onClick:()=>A(R=>!R),size:"sm",type:"button",variant:"outline",children:[E?h.jsx(T2,{}):h.jsx(O0,{}),E?"Hide secrets":"Reveal secrets"]}),h.jsxs(fe,{onClick:g,size:"sm",type:"button",variant:"outline",children:[h.jsx(jn,{})," Add"]})]}):null,h.jsxs(fe,{disabled:!m||d||!a,onClick:x,size:"sm",type:"button",children:[h.jsx(L2,{})," ",d?"Saving…":"Save"]})]})]}),f&&!a?h.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?h.jsx("div",{className:me(c&&"opacity-60 transition-opacity"),children:h.jsx(ZL,{revealAll:E,rows:a.rows,onAdd:g,onRemove:b,onUpdate:v})}):a?.text!==void 0?h.jsxs("div",{className:me("space-y-1",c&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?h.jsx("div",{className:"flex justify-end",children:h.jsx(fe,{onClick:()=>y(JC(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,h.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:R=>y(R.target.value),spellCheck:!1,value:a.text})]}):c?h.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?h.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?h.jsx(QL,{onClose:()=>M(!1),onPick:R=>{w(R).then(z=>{z&&M(!1)})},serviceName:e}):null]})}function t9({serviceName:e,status:t,timeline:i,onRefresh:s}){const{error:a,success:l}=vn(),[c,d]=C.useState(!1),m=t?.inspector,f=t?.state==="running",g=C.useMemo(()=>i.filter(y=>y.kind==="service.http"&&y.service===e).map(y=>{const x=y.data??{};return{id:x.id??y.id,startedAt:y.timestamp,method:x.method??"?",path:x.path??"?",status:x.status??0,durationMs:x.durationMs??0,reqBytes:x.reqBytes??0,resBytes:x.resBytes??0}}).slice(-500).reverse(),[i,e]);async function b(y){d(!0);try{await sn(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:y?"true":"false"}),await s(),l(y?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(x){a(x instanceof Error?x.message:String(x))}finally{d(!1)}}if(!f)return h.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return h.jsxs("div",{className:"space-y-2",children:[h.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."}),h.jsxs(fe,{disabled:c,onClick:()=>b(!0),size:"sm",type:"button",children:[h.jsx(R2,{})," Start HTTP inspector"]})]});const v=m.port?`http://127.0.0.1:${m.port}`:void 0;return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),v?h.jsxs(h.Fragment,{children:[h.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:v}),h.jsxs(fe,{onClick:()=>{navigator.clipboard.writeText(v),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[h.jsx(k2,{})," Copy"]}),h.jsx(fe,{onClick:()=>window.open(v,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):h.jsx("span",{className:"text-muted-foreground",children:"starting…"}),h.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),h.jsxs(fe,{disabled:c,onClick:()=>b(!1),size:"sm",type:"button",variant:"outline",children:[h.jsx(vd,{})," Stop"]})]}),g.length===0?h.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):h.jsx("div",{className:"max-h-80 overflow-auto",children:h.jsxs("table",{className:"w-full font-mono text-[11px]",children:[h.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:h.jsxs("tr",{children:[h.jsx("th",{className:"py-1 pr-3",children:"Time"}),h.jsx("th",{className:"py-1 pr-3",children:"Method"}),h.jsx("th",{className:"py-1 pr-3",children:"Path"}),h.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),h.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),h.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),h.jsx("tbody",{children:g.map(y=>h.jsxs("tr",{className:"border-t border-border/40",children:[h.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(y.startedAt).toLocaleTimeString()}),h.jsx("td",{className:"py-1 pr-3",children:y.method}),h.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:y.path}),h.jsx("td",{className:me("py-1 pr-3 text-right",i9(y.status)),children:y.status}),h.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:n9(y.resBytes)}),h.jsx("td",{className:"py-1 pr-3 text-right",children:y.durationMs.toFixed(1)})]},y.id))})]})})]})}function i9(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 n9(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function s9({rows:e}){if(e.length===0)return h.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 h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full font-mono text-[11px]",children:[h.jsx("thead",{className:"text-left text-muted-foreground",children:h.jsxs("tr",{children:[h.jsx("th",{className:"py-1 pr-3",children:"PID"}),h.jsx("th",{className:"py-1 pr-3",children:"PPID"}),h.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),h.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),h.jsx("th",{className:"py-1",children:"Command"})]})}),h.jsx("tbody",{children:t.map(s=>{const a=i.has(s.ppid);return h.jsxs("tr",{className:"border-t border-border/40",children:[h.jsx("td",{className:"py-1 pr-3",children:s.pid}),h.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:s.ppid}),h.jsx("td",{className:"py-1 pr-3 text-right",children:s.cpuPercent.toFixed(1)}),h.jsx("td",{className:"py-1 pr-3 text-right",children:s.rssMb.toFixed(1)}),h.jsx("td",{className:me("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:s.command})]},s.pid)})})]})})}const r9=500;function a9(e){const[t,i]=C.useState(),[s,a]=C.useState([]),[l,c]=C.useState(),[d,m]=C.useState(!1),f=C.useRef();C.useEffect(()=>{f.current=void 0,i(void 0),a([]);const b=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),v=y=>{try{const x=JSON.parse(y.data);x.run.id!==f.current&&(f.current=x.run.id,a([])),i(x.run),x.line&&a(w=>[...w,x.line].slice(-r9))}catch{}};return b.addEventListener("status",v),b.addEventListener("output",v),()=>b.close()},[e]);const g=C.useCallback(async b=>{m(!0),c(void 0);try{await oM(e,b)}catch(v){c(v instanceof Error?v.message:String(v))}finally{m(!1)}},[e]);return{run:t,lines:s,error:l,starting:d,start:g}}const o9={running:"secondary",passed:"success",failed:"error",error:"error"},l9={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function c9({serviceName:e}){const{run:t,lines:i,error:s,starting:a,start:l}=a9(e),[c,d]=C.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("form",{className:"flex items-center gap-2",onSubmit:g=>{g.preventDefault(),m||l(c.trim()||void 0)},children:[h.jsx(St,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:g=>d(g.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:c}),h.jsx(fe,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),s?h.jsx("div",{className:"text-red-600",children:s}):null,t?h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[h.jsx(Ve,{size:"small",variant:o9[t.status],children:l9[t.status]}),h.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?h.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?h.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):h.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),i.length>0?h.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,b)=>h.jsx("div",{className:me(g.stream==="stderr"&&"text-red-500"),children:g.text},b))}):null,f?h.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",h.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 u9({serviceName:e,status:t,health:i,timeline:s,onRefresh:a}){const[l,c]=C.useState("processes"),d=i?.processTree?.processes??[];return h.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[h.jsxs("div",{className:"mb-2 flex gap-1",children:[h.jsxs(ic,{active:l==="processes",onClick:()=>c("processes"),children:["Processes ",d.length?h.jsx(Ve,{variant:"secondary",size:"small",children:d.length}):null]}),h.jsxs(ic,{active:l==="http",onClick:()=>c("http"),children:["HTTP",t?.inspector?.enabled?h.jsx(Ve,{variant:"success",size:"small",children:"on"}):null]}),h.jsx(ic,{active:l==="env",onClick:()=>c("env"),children:"Env"}),h.jsx(ic,{active:l==="tests",onClick:()=>c("tests"),children:"Tests"}),h.jsx(ic,{active:l==="logs",onClick:()=>c("logs"),children:"Logs"})]}),l==="processes"?h.jsx(s9,{rows:d}):null,l==="http"?h.jsx(t9,{serviceName:e,status:t,timeline:s,onRefresh:a}):null,l==="env"?h.jsx(e9,{serviceName:e}):null,l==="tests"?h.jsx(c9,{serviceName:e}):null,l==="logs"?h.jsx(KL,{serviceName:e}):null]})}function ic({active:e,onClick:t,children:i}){return h.jsx("button",{className:me("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:i})}function h9({allServices:e,group:t,onRefresh:i,ports:s,services:a,health:l,statuses:c,timeline:d,selectedService:m,onSelectService:f,onDropService:g}){const[b,v]=C.useState(!1),[y,x]=C.useState(!1),[w,E]=C.useState(!1),A=a.some(R=>Uo(c[R.name]?.state));function T(R){!g||!R.dataTransfer.types.includes(Lc)||(R.preventDefault(),R.dataTransfer.dropEffect="copy",E(!0))}function M(R){if(!g)return;R.preventDefault(),E(!1);const z=R.dataTransfer.getData(Lc);z&&g(z)}return h.jsxs("section",{className:me("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:T,onDragLeave:()=>E(!1),onDrop:M,children:[h.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[h.jsxs("button",{"aria-expanded":!y,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>x(R=>!R),type:"button",children:[h.jsx(vs,{className:me("size-3.5 shrink-0 text-muted-foreground transition-transform",y&&"-rotate-90")}),h.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),h.jsx(Ve,{size:"small",variant:"secondary",children:t.services.length})]}),h.jsx(Ur,{label:"Edit group",children:h.jsx(fe,{"aria-expanded":b,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(R=>!R),size:"icon",type:"button",variant:"ghost",children:h.jsx(dg,{})})}),h.jsx(f_,{active:A,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await sn(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await sn(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const R=a[0];R&&f(R.name)}})]}),b?h.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:h.jsx(YC,{initialName:t.name,initialServices:t.services,onRefresh:i,onSaved:()=>v(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,y?null:h.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(R=>h.jsx(ek,{service:R,status:c[R.name],health:l[R.name],ports:s,onRefresh:i,timeline:d,selected:m===R.name,onSelect:()=>f(R.name)},R.name)):h.jsx(ut,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function ek({service:e,status:t,onRefresh:i,selected:s=!1,onSelect:a}){const l=t?.state??"stopped",c=Uo(l),[d,m]=C.useState(!1);return h.jsxs("div",{"aria-selected":s,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(Lc,e.name),e.cwd&&KC(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:me("group flex cursor-pointer items-center gap-2 border-l-2 px-3 py-1.5 transition-colors",d&&"opacity-50",s?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:a,role:"option",children:[h.jsx(d_,{command:e.command??""}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),h.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[h.jsx(tk,{kind:e.kind}),e.port?h.jsxs("span",{children:[":",e.port]}):null]})]}),h.jsx(ik,{state:l}),h.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:h.jsx(f_,{active:c,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:i,onStarted:a})})]})}const Lc="application/x-nomoreide-service",hS={local:{label:"local",className:"border-zinc-300 bg-zinc-100 text-zinc-600"},"docker-compose":{label:"docker",className:"border-sky-300 bg-sky-50 text-sky-700"},ssh:{label:"ssh",className:"border-violet-300 bg-violet-50 text-violet-700"}};function tk({kind:e}){const t=hS[e??"local"]??hS.local;return h.jsx("span",{className:me("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Uo(e){return e==="running"||e==="starting"}function d9({service:e,onRefresh:t}){const[i,s]=C.useState(e.port?String(e.port):""),[a,l]=C.useState(!1),{error:c,success:d}=vn(),m=i.trim()!==(e.port?String(e.port):"");C.useEffect(()=>{s(e.port?String(e.port):"")},[e.port]);async function f(g){g.preventDefault(),l(!0);try{await sn("/api/services",{name:e.name,command:e.command??"",cwd:e.cwd??"",port:i,description:e.description}),d(`Port saved for ${e.name}.`),await t()}catch(b){c(Oc("Save port",e.name,b))}finally{l(!1)}}return h.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:f,children:[h.jsx(St,{"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}),h.jsx(fe,{"aria-label":`Save port for ${e.name}`,disabled:a||!m,className:"size-8",size:"icon",title:"Save port",type:"submit",variant:"outline",children:h.jsx(L2,{})})]})}function f9(e){return`http://127.0.0.1:${e}`}function ik({state:e}){return h.jsx(Ve,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:me(e==="running"&&"font-mono"),children:e})}function m9({data:e,onRefresh:t}){const i=e.config.services[0]?.name??"",[s,a]=C.useState(i),[l,c]=C.useState(null),[d,m]=C.useState(!1),[f,g]=C.useState(!0),[b,v]=C.useState(!1),[y,x]=C.useState(!1),[w,E]=C.useState(!1),A=C.useRef({}),{error:T,message:M,success:R}=vn(),z=C.useMemo(()=>new Set(e.config.bundles.flatMap(N=>N.services)),[e.config.bundles]),U=C.useMemo(()=>{const N=new Map;for(const F of e.config.bundles)for(const $ of F.services)N.has($)||N.set($,F.name);return N},[e.config.bundles]),j=C.useMemo(()=>e.config.services.filter(N=>!z.has(N.name)),[e.config.services,z]),O=e.health??{},K=e.config.bundles.length>0||j.length>0;C.useEffect(()=>{!e.config.services.some(F=>F.name===s)&&i&&a(i)},[e.config.services,i,s]);const H=C.useMemo(()=>e.config.services.find(N=>N.name===s),[e.config.services,s]),G=s?e.runtime.services[s]:void 0,J=s?O[s]:void 0;async function P(N,F){if(!N.services.includes(F))try{await eM(N.name,N.services,F),R(`Added ${F} to ${N.name}.`),await t()}catch($){T($ instanceof Error?$.message:String($))}}async function ee(){if(H){if(Uo(G?.state)){T(`Stop ${H.name} before deleting it.`);return}if(window.confirm(`Delete service "${H.name}"? This removes it from your config.`))try{await J4(H.name),R(`Deleted ${H.name}.`),await t()}catch(N){T(N instanceof Error?N.message:String(N))}}}async function q(N){const F=e.config.bundles.filter($=>$.services.includes(N));if(F.length!==0)try{for(const $ of F)await tM($.name,$.services,N);M({text:`Removed ${N} from ${F.map($=>$.name).join(", ")}.`}),await t()}catch($){T($ instanceof Error?$.message:String($))}}return C.useEffect(()=>{const N=Object.fromEntries(e.config.services.map($=>[$.name,e.runtime.services[$.name]?.state??"stopped"])),F=A.current;if(Object.keys(F).length){const $=new Map,Z=new Map;for(const W of e.config.services){const D=N[W.name],ie=F[W.name];if(!ie||ie===D)continue;const ce=e.runtime.services[W.name],le=U.get(W.name);if(le){const he=$.get(le)??new Map;if(he.set(D,(he.get(D)??0)+1),$.set(le,he),D==="exited"){const ge=Z.get(le)??[];ge.push(ce?.exitCode),Z.set(le,ge)}continue}if(D==="running")R(`${W.name} is running.`);else if(D==="stopped")M({text:`${W.name} stopped.`});else if(D==="starting")M({text:`${W.name} is starting.`});else if(D==="exited"){const he=ce?.exitCode===void 0||ce.exitCode===null?"":` with code ${ce.exitCode}`;T(`${W.name} exited${he}.`)}}for(const[W,D]of $)g9({exitCodes:Z.get(W)??[],groupName:W,showErrorToast:T,showMessageToast:M,showSuccessToast:R,transitions:D})}A.current=N},[e.config.services,e.runtime.services,U,T,M,R]),h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:me("grid h-full min-h-0 overflow-hidden bg-card/85",f?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[h.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:h.jsxs(ms,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[h.jsx(ps,{className:"border-b border-border px-3 py-2",children:h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx(gs,{className:"text-sm",children:"Services"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(fe,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>m(!0),size:"sm",type:"button",variant:"outline",children:[h.jsx(j2,{className:"size-3.5"}),"Logs"]}),h.jsx(p9,{onCreateGroup:()=>c("group"),onCreateService:()=>c("service")})]})]})}),h.jsx(_s,{className:"p-0",children:K?h.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(N=>h.jsx(h9,{group:N,onRefresh:t,ports:e.ports,allServices:e.config.services,health:O,services:e.config.services.filter(F=>N.services.includes(F.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:s,onSelectService:a,onDropService:F=>{P(N,F)}},N.name)),j.length?h.jsxs("div",{className:me("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:N=>{N.dataTransfer.types.includes(Lc)&&(N.preventDefault(),N.dataTransfer.dropEffect="move",E(!0))},onDragLeave:()=>E(!1),onDrop:N=>{N.preventDefault(),E(!1);const F=N.dataTransfer.getData(Lc);F&&q(F)},children:[h.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:[h.jsx("span",{children:"Ungrouped"}),h.jsx("span",{className:"text-muted-foreground/80",children:j.length})]}),h.jsx("div",{className:"divide-y divide-border",children:j.map(N=>h.jsx(ek,{service:N,status:e.runtime.services[N.name],health:O[N.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:s===N.name,onSelect:()=>a(N.name)},N.name))})]}):null]}):h.jsx(id,{label:"No services registered yet."})})]})}),h.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:H?h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:H.name}),h.jsx(ik,{state:G?.state??"stopped"}),h.jsx(tk,{kind:H.kind}),h.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[h.jsx(d9,{service:H,onRefresh:t}),(()=>{const N=G?.url??(H.port?f9(H.port):void 0);return N?h.jsx(Ur,{label:`Open ${N}`,children:h.jsx(fe,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(N,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:h.jsx(N2,{})})}):null})(),J?.agentContext?h.jsx(Ur,{label:"Copy debug context for an AI agent",children:h.jsx(fe,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>v(!0),size:"icon",type:"button",variant:"outline",children:h.jsx(kc,{})})}):null,h.jsx(f_,{active:Uo(G?.state),baseUrl:`/api/services/${encodeURIComponent(H.name)}`,compact:!0,targetLabel:H.name,onRefresh:t}),h.jsx(Ur,{label:"Edit service",children:h.jsx(fe,{"aria-label":`Edit ${H.name}`,className:"size-7",onClick:()=>x(!0),size:"icon",type:"button",variant:"outline",children:h.jsx(dg,{})})}),h.jsx(Ur,{label:Uo(G?.state)?"Stop before deleting":"Delete service",children:h.jsx(fe,{"aria-label":`Delete ${H.name}`,className:"size-7",disabled:Uo(G?.state),onClick:()=>{ee()},size:"icon",type:"button",variant:"outline",children:h.jsx(Vc,{className:"text-destructive"})})}),h.jsx(Ur,{label:f?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:h.jsx(fe,{"aria-label":f?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>g(N=>!N),size:"icon",type:"button",variant:"ghost",children:f?h.jsx(k5,{}):h.jsx(Yr,{})})})]})]}),H.command?h.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:H.command,children:["$ ",H.command]}):null,H.cwd?h.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:H.cwd,children:H.cwd}):null,h.jsx(RL,{health:J})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:h.jsx(u9,{serviceName:H.name,status:G,health:J,timeline:e.timeline??[],onRefresh:t})})]}):h.jsx(id,{label:"Select a service to see details."})}),f?null:h.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[h.jsx(BL,{ports:e.ports}),h.jsx(SL,{events:e.timeline??[]})]})]}),b&&H&&J?.agentContext?h.jsx(Qs,{icon:h.jsx(kc,{}),onClose:()=>v(!1),title:`Agent context — ${H.name}`,children:h.jsx("div",{className:"p-4",children:h.jsx(iL,{context:J.agentContext})})}):null,y&&H?h.jsx(Qs,{icon:h.jsx(dg,{}),onClose:()=>x(!1),size:"lg",title:`Edit Service — ${H.name}`,children:h.jsx(oS,{cwd:e.cwd,initialService:H,onRefresh:t,onSaved:()=>x(!1)})}):null,l?h.jsx(Qs,{icon:l==="service"?h.jsx(jn,{}):h.jsx(C2,{}),onClose:()=>c(null),size:l==="service"?"lg":"md",title:l==="service"?"Add Service":"Create Group",children:l==="service"?h.jsx(oS,{cwd:e.cwd,onRefresh:t,onSaved:()=>c(null)}):h.jsx(YC,{services:j,onRefresh:t,onSaved:()=>c(null)})}):null,d?h.jsx(YL,{initialService:s||void 0,onClose:()=>m(!1),services:e.config.services.map(N=>N.name)}):null]})}function p9({onCreateService:e,onCreateGroup:t}){const[i,s]=C.useState(!1);function a(l){s(!1),l()}return h.jsxs("div",{className:"relative",children:[h.jsx(Ur,{label:"Add",side:"bottom",children:h.jsx(fe,{"aria-expanded":i,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>s(l=>!l),size:"icon",type:"button",variant:"ghost",children:h.jsx(jn,{})})}),i?h.jsxs(h.Fragment,{children:[h.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>s(!1),tabIndex:-1,type:"button"}),h.jsxs("div",{className:"absolute right-0 z-[50] mt-1 w-44 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg",role:"menu",children:[h.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:()=>a(e),role:"menuitem",type:"button",children:[h.jsx(jn,{}),"Create Service"]}),h.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:()=>a(t),role:"menuitem",type:"button",children:[h.jsx(C2,{}),"Create Group"]})]})]}):null]})}function g9({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(b=>b!=null),g=f.length?` with code ${f.join(", ")}`:"";i(`${t} group exited${g}.`)}return}const c=[...l.entries()].map(([m,f])=>`${f} ${m}`).join(", "),d=`${t} group updated: ${c}.`;l.has("exited")?i(d):s({text:d})}var _9=2,b9=1,v9=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"))},d=c.top+c.bottom,m=c.right+c.left,f=s-d,g=a-m-t;return{cols:Math.max(_9,Math.floor(g/e.css.cell.width)),rows:Math.max(b9,Math.floor(f/e.css.cell.height))}}};var nk=Object.defineProperty,y9=Object.getOwnPropertyDescriptor,x9=(e,t)=>{for(var i in t)nk(e,i,{get:t[i],enumerable:!0})},Ht=(e,t,i,s)=>{for(var a=s>1?void 0:s?y9(t,i):t,l=e.length-1,c;l>=0;l--)(c=e[l])&&(a=(s?c(t,i,a):c(a))||a);return s&&a&&nk(t,i,a),a},ve=(e,t)=>(i,s)=>t(i,s,e),dS="Terminal input",Pg={get:()=>dS,set:e=>dS=e},fS="Too much output to announce, navigate to rows manually to read",Ug={get:()=>fS,set:e=>fS=e};function S9(e){return e.replace(/\r?\n/g,"\r")}function w9(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function E9(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function C9(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");sk(a,t,i,s)}}function sk(e,t,i,s){e=S9(e),e=w9(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function rk(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 mS(e,t,i,s,a){rk(e,t,i),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Pr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function kd(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 k9=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 d=e.charCodeAt(l);56320<=d&&d<=57343?t[s++]=(c-55296)*1024+d-56320+65536:(t[s++]=c,t[s++]=d);continue}c!==65279&&(t[s++]=c)}return s}},N9=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,d,m=0,f=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let x=0,w;for(;(w=this.interim[++x]&63)&&x<4;)y<<=6,y|=w;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,A=E-x;for(;f<A;){if(f>=i)return 0;if(w=e[f++],(w&192)!==128){f--,v=!0;break}else this.interim[x++]=w,y<<=6,y|=w&63}v||(E===2?y<128?f--:t[s++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[s++]=y):y<65536||y>1114111||(t[s++]=y)),this.interim.fill(0)}let g=i-4,b=f;for(;b<i;){for(;b<g&&!((a=e[b])&128)&&!((l=e[b+1])&128)&&!((c=e[b+2])&128)&&!((d=e[b+3])&128);)t[s++]=a,t[s++]=l,t[s++]=c,t[s++]=d,b+=4;if(a=e[b++],a<128)t[s++]=a;else if((a&224)===192){if(b>=i)return this.interim[0]=a,s;if(l=e[b++],(l&192)!==128){b--;continue}if(m=(a&31)<<6|l&63,m<128){b--;continue}t[s++]=m}else if((a&240)===224){if(b>=i)return this.interim[0]=a,s;if(l=e[b++],(l&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,s;if(c=e[b++],(c&192)!==128){b--;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(b>=i)return this.interim[0]=a,s;if(l=e[b++],(l&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,s;if(c=e[b++],(c&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=l,this.interim[2]=c,s;if(d=e[b++],(d&192)!==128){b--;continue}if(m=(a&7)<<18|(l&63)<<12|(c&63)<<6|d&63,m<65536||m>1114111)continue;t[s++]=m}}return s}},ak="",Fr=" ",Xc=class ok{constructor(){this.fg=0,this.bg=0,this.extended=new sd}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 ok;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}},sd=class lk{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 lk(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},zn=class ck extends Xc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new sd,this.combinedData=""}static fromCharData(t){let i=new ck;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?Pr(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()]}},pS="di$target",Hg="di$dependencies",up=new Map;function T9(e){return e[Hg]||[]}function vi(e){if(up.has(e))return up.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");A9(t,i,a)};return t._id=e,up.set(e,t),t}function A9(e,t,i){t[pS]===t?t[Hg].push({id:e,index:i}):(t[Hg]=[{id:e,index:i}],t[pS]=t)}var Vi=vi("BufferService"),uk=vi("CoreMouseService"),Ua=vi("CoreService"),M9=vi("CharsetService"),m_=vi("InstantiationService"),hk=vi("LogService"),qi=vi("OptionsService"),dk=vi("OscLinkService"),R9=vi("UnicodeService"),Zc=vi("DecorationService"),Fg=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 zn,c=i.getTrimmedLength(),d=-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,d=l.extended.urlId;continue}else f=l.extended.urlId!==d;else m!==-1&&(f=!0);if(f||m!==-1&&g===c-1){let b=this._oscLinkService.getLinkData(d)?.uri;if(b){let v={start:{x:m+1,y:e},end:{x:g+(!f&&g===c-1?1:0),y:e}},y=!1;if(!a?.allowNonHttpProtocols)try{let x=new URL(b);["http:","https:"].includes(x.protocol)||(y=!0)}catch{y=!0}y||s.push({text:b,range:v,activate:(x,w)=>a?a.activate(x,w,v):D9(x,w),hover:(x,w)=>a?.hover?.(x,w,v),leave:(x,w)=>a?.leave?.(x,w,v)})}f=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=g,d=l.extended.urlId):(m=-1,d=-1)}}t(s)}};Fg=Ht([ve(0,Vi),ve(1,qi),ve(2,dk)],Fg);function D9(e,t){if(confirm(`Do you want to navigate to ${t}?
20
+
21
+ 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 Nd=vi("CharSizeService"),er=vi("CoreBrowserService"),p_=vi("MouseService"),tr=vi("RenderService"),O9=vi("SelectionService"),fk=vi("CharacterJoinerService"),Qo=vi("ThemeService"),mk=vi("LinkProviderService"),L9=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?gS.isErrorNoTelemetry(e)?new gS(e.message+`
22
+
23
+ `+e.stack):new Error(e.message+`
24
+
25
+ `+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)}},j9=new L9;function Ph(e){B9(e)||j9.onUnexpectedError(e)}var $g="Canceled";function B9(e){return e instanceof z9?!0:e instanceof Error&&e.name===$g&&e.message===$g}var z9=class extends Error{constructor(){super($g),this.name=this.message}};function I9(e){return new Error(`Illegal argument: ${e}`)}var gS=class Vg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Vg)return t;let i=new Vg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},qg=class pk extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,pk.prototype)}};function pn(e,t=0){return e[e.length-(1+t)]}var P9;(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})(P9||={});function U9(e,t){let i=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(i,arguments))),a}}var gk;(e=>{function t(R){return R&&typeof R=="object"&&typeof R[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*a(R){yield R}e.single=a;function l(R){return t(R)?R:a(R)}e.wrap=l;function c(R){return R||i}e.from=c;function*d(R){for(let z=R.length-1;z>=0;z--)yield R[z]}e.reverse=d;function m(R){return!R||R[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(R){return R[Symbol.iterator]().next().value}e.first=f;function g(R,z){let U=0;for(let j of R)if(z(j,U++))return!0;return!1}e.some=g;function b(R,z){for(let U of R)if(z(U))return U}e.find=b;function*v(R,z){for(let U of R)z(U)&&(yield U)}e.filter=v;function*y(R,z){let U=0;for(let j of R)yield z(j,U++)}e.map=y;function*x(R,z){let U=0;for(let j of R)yield*z(j,U++)}e.flatMap=x;function*w(...R){for(let z of R)yield*z}e.concat=w;function E(R,z,U){let j=U;for(let O of R)j=z(j,O);return j}e.reduce=E;function*A(R,z,U=R.length){for(z<0&&(z+=R.length),U<0?U+=R.length:U>R.length&&(U=R.length);z<U;z++)yield R[z]}e.slice=A;function T(R,z=Number.POSITIVE_INFINITY){let U=[];if(z===0)return[U,R];let j=R[Symbol.iterator]();for(let O=0;O<z;O++){let K=j.next();if(K.done)return[U,e.empty()];U.push(K.value)}return[U,{[Symbol.iterator](){return j}}]}e.consume=T;async function M(R){let z=[];for await(let U of R)z.push(U);return Promise.resolve(z)}e.asyncToArray=M})(gk||={});function ja(e){if(gk.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 H9(...e){return Dt(()=>ja(e))}function Dt(e){return{dispose:U9(()=>{e()})}}var _k=class bk{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{ja(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?bk.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)}};_k.DISABLE_DISPOSED_WARNING=!1;var $r=_k,Ge=class{constructor(){this._store=new $r,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Ge.None=Object.freeze({dispose(){}});var Go=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}},Zs=typeof window=="object"?window:globalThis,Kg=class Gg{constructor(t){this.element=t,this.next=Gg.Undefined,this.prev=Gg.Undefined}};Kg.Undefined=new Kg(void 0);var jt=Kg,_S=class{constructor(){this._first=jt.Undefined,this._last=jt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===jt.Undefined}clear(){let e=this._first;for(;e!==jt.Undefined;){let t=e.next;e.prev=jt.Undefined,e.next=jt.Undefined,e=t}this._first=jt.Undefined,this._last=jt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new jt(e);if(this._first===jt.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!==jt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==jt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==jt.Undefined&&e.next!==jt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===jt.Undefined&&e.next===jt.Undefined?(this._first=jt.Undefined,this._last=jt.Undefined):e.next===jt.Undefined?(this._last=this._last.prev,this._last.next=jt.Undefined):e.prev===jt.Undefined&&(this._first=this._first.next,this._first.prev=jt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==jt.Undefined;)yield e.element,e=e.next}},F9=globalThis.performance&&typeof globalThis.performance.now=="function",$9=class vk{static create(t){return new vk(t)}constructor(t){this._now=F9&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Ti;(e=>{e.None=()=>Ge.None;function t(J,P){return b(J,()=>{},0,void 0,!0,void 0,P)}e.defer=t;function i(J){return(P,ee=null,q)=>{let N=!1,F;return F=J($=>{if(!N)return F?F.dispose():N=!0,P.call(ee,$)},null,q),N&&F.dispose(),F}}e.once=i;function s(J,P,ee){return f((q,N=null,F)=>J($=>q.call(N,P($)),null,F),ee)}e.map=s;function a(J,P,ee){return f((q,N=null,F)=>J($=>{P($),q.call(N,$)},null,F),ee)}e.forEach=a;function l(J,P,ee){return f((q,N=null,F)=>J($=>P($)&&q.call(N,$),null,F),ee)}e.filter=l;function c(J){return J}e.signal=c;function d(...J){return(P,ee=null,q)=>{let N=H9(...J.map(F=>F($=>P.call(ee,$))));return g(N,q)}}e.any=d;function m(J,P,ee,q){let N=ee;return s(J,F=>(N=P(N,F),N),q)}e.reduce=m;function f(J,P){let ee,q={onWillAddFirstListener(){ee=J(N.fire,N)},onDidRemoveLastListener(){ee?.dispose()}},N=new de(q);return P?.add(N),N.event}function g(J,P){return P instanceof Array?P.push(J):P&&P.add(J),J}function b(J,P,ee=100,q=!1,N=!1,F,$){let Z,W,D,ie=0,ce,le={leakWarningThreshold:F,onWillAddFirstListener(){Z=J(ge=>{ie++,W=P(W,ge),q&&!D&&(he.fire(W),W=void 0),ce=()=>{let Se=W;W=void 0,D=void 0,(!q||ie>1)&&he.fire(Se),ie=0},typeof ee=="number"?(clearTimeout(D),D=setTimeout(ce,ee)):D===void 0&&(D=0,queueMicrotask(ce))})},onWillRemoveListener(){N&&ie>0&&ce?.()},onDidRemoveLastListener(){ce=void 0,Z.dispose()}},he=new de(le);return $?.add(he),he.event}e.debounce=b;function v(J,P=0,ee){return e.debounce(J,(q,N)=>q?(q.push(N),q):[N],P,void 0,!0,void 0,ee)}e.accumulate=v;function y(J,P=(q,N)=>q===N,ee){let q=!0,N;return l(J,F=>{let $=q||!P(F,N);return q=!1,N=F,$},ee)}e.latch=y;function x(J,P,ee){return[e.filter(J,P,ee),e.filter(J,q=>!P(q),ee)]}e.split=x;function w(J,P=!1,ee=[],q){let N=ee.slice(),F=J(W=>{N?N.push(W):Z.fire(W)});q&&q.add(F);let $=()=>{N?.forEach(W=>Z.fire(W)),N=null},Z=new de({onWillAddFirstListener(){F||(F=J(W=>Z.fire(W)),q&&q.add(F))},onDidAddFirstListener(){N&&(P?setTimeout($):$())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return q&&q.add(Z),Z.event}e.buffer=w;function E(J,P){return(ee,q,N)=>{let F=P(new T);return J(function($){let Z=F.evaluate($);Z!==A&&ee.call(q,Z)},void 0,N)}}e.chain=E;let A=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(ee=>(P(ee),ee)),this}filter(P){return this.steps.push(ee=>P(ee)?ee:A),this}reduce(P,ee){let q=ee;return this.steps.push(N=>(q=P(q,N),q)),this}latch(P=(ee,q)=>ee===q){let ee=!0,q;return this.steps.push(N=>{let F=ee||!P(N,q);return ee=!1,q=N,F?N:A}),this}evaluate(P){for(let ee of this.steps)if(P=ee(P),P===A)break;return P}}function M(J,P,ee=q=>q){let q=(...Z)=>$.fire(ee(...Z)),N=()=>J.on(P,q),F=()=>J.removeListener(P,q),$=new de({onWillAddFirstListener:N,onDidRemoveLastListener:F});return $.event}e.fromNodeEventEmitter=M;function R(J,P,ee=q=>q){let q=(...Z)=>$.fire(ee(...Z)),N=()=>J.addEventListener(P,q),F=()=>J.removeEventListener(P,q),$=new de({onWillAddFirstListener:N,onDidRemoveLastListener:F});return $.event}e.fromDOMEventEmitter=R;function z(J){return new Promise(P=>i(J)(P))}e.toPromise=z;function U(J){let P=new de;return J.then(ee=>{P.fire(ee)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}e.fromPromise=U;function j(J,P){return J(ee=>P.fire(ee))}e.forward=j;function O(J,P,ee){return P(ee),J(q=>P(q))}e.runAndSubscribe=O;class K{constructor(P,ee){this._observable=P,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new de(q),ee&&ee.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,ee){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function H(J,P){return new K(J,P).emitter.event}e.fromObservable=H;function G(J){return(P,ee,q)=>{let N=0,F=!1,$={beginUpdate(){N++},endUpdate(){N--,N===0&&(J.reportChanges(),F&&(F=!1,P.call(ee)))},handlePossibleChange(){},handleChange(){F=!0}};J.addObserver($),J.reportChanges();let Z={dispose(){J.removeObserver($)}};return q instanceof $r?q.add(Z):Array.isArray(q)&&q.push(Z),Z}}e.fromObservableLight=G})(Ti||={});var Wg=class Yg{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Yg._idPool++}`,Yg.all.add(this)}start(t){this._stopWatch=new $9,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}}};Wg.all=new Set,Wg._idPool=0;var V9=Wg,q9=-1,yk=class xk{constructor(t,i,s=(xk._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(),d=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${c}):`;console.warn(d),console.warn(l);let m=new W9(d,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}};yk._idPool=1;var K9=yk,G9=class Sk{constructor(t){this.value=t}static create(){let t=new Error;return new Sk(t.stack??"")}print(){console.warn(this.value.split(`
26
+ `).slice(2).join(`
27
+ `))}},W9=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Y9=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},X9=0,hp=class{constructor(e){this.value=e,this.id=X9++}},Z9=2,Q9,de=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new K9(t?.onListenerError??Ph,this._options?.leakWarningThreshold??q9):void 0,this._perfMon=this._options?._profName?new V9(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 d=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(d);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new Y9(`${d}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(this._options?.onListenerError||Ph)(f),Ge.None}if(this._disposed)return Ge.None;i&&(t=t.bind(i));let a=new hp(t),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=G9.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof hp?(this._deliveryQueue??=new J9,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 $r?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*Z9<=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||Ph;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 hp)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}},J9=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}},Xg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new de,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new de,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}};Xg.INSTANCE=new Xg;var g_=Xg;function ej(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}g_.INSTANCE.onDidChangeZoomLevel;function tj(e){return g_.INSTANCE.getZoomFactor(e)}g_.INSTANCE.onDidChangeFullscreen;var Jo=typeof navigator=="object"?navigator.userAgent:"",Zg=Jo.indexOf("Firefox")>=0,ij=Jo.indexOf("AppleWebKit")>=0,__=Jo.indexOf("Chrome")>=0,nj=!__&&Jo.indexOf("Safari")>=0;Jo.indexOf("Electron/")>=0;Jo.indexOf("Android")>=0;var dp=!1;if(typeof Zs.matchMedia=="function"){let e=Zs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Zs.matchMedia("(display-mode: fullscreen)");dp=e.matches,ej(Zs,e,({matches:i})=>{dp&&t.matches||(dp=i)})}var Ho="en",Qg=!1,Jg=!1,Uh=!1,wk=!1,Eh,Hh=Ho,bS=Ho,sj,Xs,Oa=globalThis,_n;typeof Oa.vscode<"u"&&typeof Oa.vscode.process<"u"?_n=Oa.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(_n=process);var rj=typeof _n?.versions?.electron=="string",aj=rj&&_n?.type==="renderer";if(typeof _n=="object"){Qg=_n.platform==="win32",Jg=_n.platform==="darwin",Uh=_n.platform==="linux",Uh&&_n.env.SNAP&&_n.env.SNAP_REVISION,_n.env.CI||_n.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Eh=Ho,Hh=Ho;let e=_n.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Eh=t.userLocale,bS=t.osLocale,Hh=t.resolvedLanguage||Ho,sj=t.languagePack?.translationsConfigFile}catch{}wk=!0}else typeof navigator=="object"&&!aj?(Xs=navigator.userAgent,Qg=Xs.indexOf("Windows")>=0,Jg=Xs.indexOf("Macintosh")>=0,(Xs.indexOf("Macintosh")>=0||Xs.indexOf("iPad")>=0||Xs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Uh=Xs.indexOf("Linux")>=0,Xs?.indexOf("Mobi")>=0,Hh=globalThis._VSCODE_NLS_LANGUAGE||Ho,Eh=navigator.language.toLowerCase(),bS=Eh):console.error("Unable to resolve platform.");var Ek=Qg,us=Jg,oj=Uh,vS=wk,bs=Xs,Lr=Hh,lj;(e=>{function t(){return Lr}e.value=t;function i(){return Lr.length===2?Lr==="en":Lr.length>=3?Lr[0]==="e"&&Lr[1]==="n"&&Lr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Lr==="en"}e.isDefault=s})(lj||={});var cj=typeof Oa.postMessage=="function"&&!Oa.importScripts;(()=>{if(cj){let e=[];Oa.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}),Oa.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var uj=!!(bs&&bs.indexOf("Chrome")>=0);bs&&bs.indexOf("Firefox")>=0;!uj&&bs&&bs.indexOf("Safari")>=0;bs&&bs.indexOf("Edg/")>=0;bs&&bs.indexOf("Android")>=0;var Mo=typeof navigator=="object"?navigator:{};vS||document.queryCommandSupported&&document.queryCommandSupported("copy")||Mo&&Mo.clipboard&&Mo.clipboard.writeText,vS||Mo&&Mo.clipboard&&Mo.clipboard.readText;var b_=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}},fp=new b_,yS=new b_,xS=new b_,hj=new Array(230),Ck;(e=>{function t(d){return fp.keyCodeToStr(d)}e.toString=t;function i(d){return fp.strToKeyCode(d)}e.fromString=i;function s(d){return yS.keyCodeToStr(d)}e.toUserSettingsUS=s;function a(d){return xS.keyCodeToStr(d)}e.toUserSettingsGeneral=a;function l(d){return yS.strToKeyCode(d)||xS.strToKeyCode(d)}e.fromUserSettings=l;function c(d){if(d>=98&&d<=113)return null;switch(d){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return fp.keyCodeToStr(d)}e.toElectronAccelerator=c})(Ck||={});var dj=class kk{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 kk&&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 fj([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},fj=class{constructor(e){if(e.length===0)throw I9("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 mj(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Ck.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(Zg)switch(t){case 59:return 85;case 60:if(oj)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(us)return 57;break}else if(ij&&(us&&t===93||!us&&t===92))return 57;return hj[t]||0}var pj=us?256:2048,gj=512,_j=1024,bj=us?2048:256,SS=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=mj(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|=pj),this.altKey&&(t|=gj),this.shiftKey&&(t|=_j),this.metaKey&&(t|=bj),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new dj(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},wS=new WeakMap;function vj(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 yj=class{static getSameOriginWindowChain(e){let t=wS.get(e);if(!t){t=[],wS.set(e,t);let i=e,s;do s=vj(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 d=l.iframeElement.getBoundingClientRect();i+=d.top,s+=d.left}return{top:i,left:s}}},Ch=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=yj.getPositionOfChildWindowRelativeToAncestorWindow(t,i.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ES=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(__){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 d=e;d.deltaMode===d.DOM_DELTA_LINE?Zg&&!us?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")nj&&Ek?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 d=e;d.deltaMode===d.DOM_DELTA_LINE?Zg&&!us?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()}},Nk=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),xj;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof Sj?!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:Nk})})(xj||={});var Sj=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?Nk:(this._emitter||(this._emitter=new de),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},v_=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 qg("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},i)}setIfNotSet(t,i){if(this._isDisposed)throw new qg("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},i))}},wj=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 qg("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}},Ej;(e=>{async function t(s){let a,l=await Promise.all(s.map(c=>c.then(d=>d,d=>{a||(a=d)})));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})(Ej||={});var CS=class Dn{static fromArray(t){return new Dn(i=>{i.emitMany(t)})}static fromPromise(t){return new Dn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Dn(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Dn(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 de,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 Dn(async s=>{for await(let a of t)s.emitOne(i(a))})}map(t){return Dn.map(this,t)}static filter(t,i){return new Dn(async s=>{for await(let a of t)i(a)&&s.emitOne(a)})}filter(t){return Dn.filter(this,t)}static coalesce(t){return Dn.filter(t,i=>!!i)}coalesce(){return Dn.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Dn.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())}};CS.EMPTY=CS.fromArray([]);var{getWindow:ls,getWindowId:Cj,onDidRegisterWindow:kj}=(function(){let e=new Map,t={window:Zs,disposables:new $r};e.set(Zs.vscodeWindowId,t);let i=new de,s=new de,a=new de;function l(c,d){return(typeof c=="number"?e.get(c):void 0)??(d?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(c){if(e.has(c.vscodeWindowId))return Ge.None;let d=new $r,m={window:c,disposables:d.add(new $r)};return e.set(c.vscodeWindowId,m),d.add(Dt(()=>{e.delete(c.vscodeWindowId),s.fire(c)})),d.add(Pe(c,pi.BEFORE_UNLOAD,()=>{a.fire(c)})),i.fire(m),d},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:l,getWindow(c){let d=c;if(d?.ownerDocument?.defaultView)return d.ownerDocument.defaultView.window;let m=c;return m?.view?m.view.window:Zs},getDocument(c){return ls(c).document}}})(),Nj=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Pe(e,t,i,s){return new Nj(e,t,i,s)}var kS=function(e,t,i,s){return Pe(e,t,i,s)},y_,Tj=class extends wj{constructor(e){super(),this.defaultTarget=e&&ls(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},NS=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){Ph(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(NS.sort),c.shift().execute();s.set(l,!1)};y_=(l,c,d=0)=>{let m=Cj(l),f=new NS(c,d),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 Aj(e){let t=e.getBoundingClientRect(),i=ls(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"},Mj=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=tn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=tn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=tn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=tn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=tn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=tn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=tn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=tn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=tn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=tn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=tn(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=tn(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=tn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=tn(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 tn(e){return typeof e=="number"?`${e}px`:e}function Cc(e){return new Mj(e)}var Tk=class{constructor(){this._hooks=new $r,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=ls(e)}this._hooks.add(Pe(l,pi.POINTER_MOVE,c=>{if(c.buttons!==i){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(Pe(l,pi.POINTER_UP,c=>this.stopMonitoring(!0)))}};function Rj(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 ss;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ss||={});var mc=class ji extends Ge{constructor(){super(),this.dispatched=!1,this.targets=new _S,this.ignoreTargets=new _S,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ti.runAndSubscribe(kj,({window:t,disposables:i})=>{i.add(Pe(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Pe(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(Pe(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Zs,disposables:this._store}))}static addTarget(t){if(!ji.isTouchDevice())return Ge.None;ji.INSTANCE||(ji.INSTANCE=new ji);let i=ji.INSTANCE.targets.push(t);return Dt(i)}static ignoreTarget(t){if(!ji.isTouchDevice())return Ge.None;ji.INSTANCE||(ji.INSTANCE=new ji);let i=ji.INSTANCE.ignoreTargets.push(t);return Dt(i)}static isTouchDevice(){return"ontouchstart"in Zs||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(ss.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 d=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(d.identifier))){console.warn("move of an UNKNOWN touch",d);continue}let m=this.activeTouches[d.identifier],f=Date.now()-m.initialTimeStamp;if(f<ji.HOLD_DELAY&&Math.abs(m.initialPageX-pn(m.rollingPageX))<30&&Math.abs(m.initialPageY-pn(m.rollingPageY))<30){let g=this.newGestureEvent(ss.Tap,m.initialTarget);g.pageX=pn(m.rollingPageX),g.pageY=pn(m.rollingPageY),this.dispatchEvent(g)}else if(f>=ji.HOLD_DELAY&&Math.abs(m.initialPageX-pn(m.rollingPageX))<30&&Math.abs(m.initialPageY-pn(m.rollingPageY))<30){let g=this.newGestureEvent(ss.Contextmenu,m.initialTarget);g.pageX=pn(m.rollingPageX),g.pageY=pn(m.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=pn(m.rollingPageX),b=pn(m.rollingPageY),v=pn(m.rollingTimestamps)-m.rollingTimestamps[0],y=g-m.rollingPageX[0],x=b-m.rollingPageY[0],w=[...this.targets].filter(E=>m.initialTarget instanceof Node&&E.contains(m.initialTarget));this.inertia(t,w,s,Math.abs(y)/v,y>0?1:-1,g,Math.abs(x)/v,x>0?1:-1,b)}this.dispatchEvent(this.newGestureEvent(ss.End,m.initialTarget)),delete this.activeTouches[d.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===ss.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>ji.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===ss.Change||t.type===ss.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,d,m,f){this.handle=y_(t,()=>{let g=Date.now(),b=g-s,v=0,y=0,x=!0;a+=ji.SCROLL_FRICTION*b,d+=ji.SCROLL_FRICTION*b,a>0&&(x=!1,v=l*a*b),d>0&&(x=!1,y=m*d*b);let w=this.newGestureEvent(ss.Change);w.translationX=v,w.translationY=y,i.forEach(E=>E.dispatchEvent(w)),x||this.inertia(t,i,g,a,l,c+v,d,m,f+y)})}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],d=this.newGestureEvent(ss.Change,c.initialTarget);d.translationX=l.pageX-pn(c.rollingPageX),d.translationY=l.pageY-pn(c.rollingPageY),d.pageX=l.pageX,d.pageY=l.pageY,this.dispatchEvent(d),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)}};mc.SCROLL_FRICTION=-.005,mc.HOLD_DELAY=700,mc.CLEAR_TAP_COUNT_TIME=400,Ht([Rj],mc,"isTouchDevice",1);var Dj=mc,x_=class extends Ge{onclick(e,t){this._register(Pe(e,pi.CLICK,i=>t(new Ch(ls(e),i))))}onmousedown(e,t){this._register(Pe(e,pi.MOUSE_DOWN,i=>t(new Ch(ls(e),i))))}onmouseover(e,t){this._register(Pe(e,pi.MOUSE_OVER,i=>t(new Ch(ls(e),i))))}onmouseleave(e,t){this._register(Pe(e,pi.MOUSE_LEAVE,i=>t(new Ch(ls(e),i))))}onkeydown(e,t){this._register(Pe(e,pi.KEY_DOWN,i=>t(new SS(i))))}onkeyup(e,t){this._register(Pe(e,pi.KEY_UP,i=>t(new SS(i))))}oninput(e,t){this._register(Pe(e,pi.INPUT,t))}onblur(e,t){this._register(Pe(e,pi.BLUR,t))}onfocus(e,t){this._register(Pe(e,pi.FOCUS,t))}onchange(e,t){this._register(Pe(e,pi.CHANGE,t))}ignoreGesture(e){return Dj.ignoreTarget(e)}},TS=11,Oj=class extends x_{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=TS+"px",this.domNode.style.height=TS+"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 Tk),this._register(kS(this.bgDomNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(kS(this.domNode,pi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Tj),this._pointerdownScheduleRepeatTimer=this._register(new v_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ls(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()}},Lj=class e0{constructor(t,i,s,a,l,c,d){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,a=a|0,l=l|0,c=c|0,d=d|0),this.rawScrollLeft=a,this.rawScrollTop=d,i<0&&(i=0),a+i>s&&(a=s-i),a<0&&(a=0),l<0&&(l=0),d+l>c&&(d=c-l),d<0&&(d=0),this.width=i,this.scrollWidth=s,this.scrollLeft=a,this.height=l,this.scrollHeight=c,this.scrollTop=d}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 e0(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 e0(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,d=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:d,scrollTopChanged:m}}},jj=class extends Ge{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Lj(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 MS(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=MS.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)))}},AS=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function mp(e,t){let i=t-e;return function(s){return e+i*Ij(s)}}function Bj(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var MS=class t0{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),Bj(mp(t,a),mp(l,i),.33)}return mp(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 AS(s,a,!1)}return new AS(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return t0.start(t,i,s)}static start(t,i,s){s=s+10;let a=Date.now()-10;return new t0(t,i,a,s)}};function zj(e){return Math.pow(e,3)}function Ij(e){return 1-zj(1-e)}var Pj=class extends Ge{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new v_)}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":"")))}},Uj=140,Ak=class extends x_{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 Pj(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Tk),this._shouldRender=!0,this.domNode=Cc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Pe(this.domNode.domNode,pi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Oj(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Cc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Pe(this.slider.domNode,pi.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);i<=a&&a<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let a=Aj(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(Ek&&c>Uj){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let d=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(d))},()=>{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()}},Mk=class i0{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 i0(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),d=Math.max(0,c-2*i),m=a>0&&a>s;if(!m)return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(d),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(s*d/a))),g=(d-f)/(a-s),b=l*g;return{computedAvailableSize:Math.round(c),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:g,computedSliderPosition:Math.round(b)}}_refreshComputedValues(){let t=i0._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)}},Hj=class extends Ak{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Mk(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}},Fj=class extends Ak{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Mk(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}},$j=500,RS=50,Vj=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},n0=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(__){let i=ls(t.browserEvent),s=tj(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 Vj(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),d=Math.abs(i.deltaY),m=Math.max(Math.min(a,c),1),f=Math.max(Math.min(l,d),1),g=Math.max(a,c),b=Math.max(l,d);g%m===0&&b%f===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};n0.INSTANCE=new n0;var qj=n0,Kj=class extends x_{constructor(e,t,i){super(),this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new de),this.onWillScroll=this._onWillScroll.event,this._options=Wj(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 Fj(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Hj(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=Cc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Cc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Cc(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 v_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ja(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,us&&(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 ES(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ja(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new ES(i))};this._mouseWheelToDispose.push(Pe(this._listenOnDomNode,pi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=qj.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=!us&&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 d=this._scrollable.getFutureScrollPosition(),m={};if(a){let f=RS*a,g=d.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,g)}if(l){let f=RS*l,g=d.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(m,g)}m=this._scrollable.validateScrollPosition(m),(d.scrollLeft!==m.scrollLeft||d.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(),$j)}},Gj=class extends Kj{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 Wj(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,us&&(t.className+=" mac"),t}var s0=class extends Ge{constructor(e,t,i,s,a,l,c,d){super(),this._bufferService=i,this._optionsService=c,this._renderService=d,this._onRequestScrollLines=this._register(new de),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new jj({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>y_(s.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Gj(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(`
28
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};s0=Ht([ve(2,Vi),ve(3,er),ve(4,uk),ve(5,Qo),ve(6,qi),ve(7,tr)],s0);var r0=class extends Ge{constructor(e,t,i,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(l=>this._removeDecoration(l))),this._register(Dt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};r0=Ht([ve(1,Vi),ve(2,er),ve(3,Zc),ve(4,tr)],r0);var Yj=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)}},is={full:0,left:0,center:0,right:0},jr={full:0,left:0,center:0,right:0},nc={full:0,left:0,center:0,right:0},rd=class extends Ge{constructor(e,t,i,s,a,l,c,d){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=a,this._optionsService=l,this._themeService=c,this._coreBrowserService=d,this._colorZoneStore=new Yj,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);jr.full=this._canvas.width,jr.left=e,jr.center=t,jr.right=e,this._refreshDrawHeightConstants(),nc.full=1,nc.left=1,nc.center=1+jr.left,nc.right=1+jr.left+jr.center}_refreshDrawHeightConstants(){is.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);is.left=t,is.center=t,is.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*is.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*is.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*is.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*is.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(nc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-is[e.position||"full"]/2),jr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+is[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}))}};rd=Ht([ve(2,Vi),ve(3,Zc),ve(4,tr),ve(5,qi),ve(6,Qo),ve(7,er)],rd);var oe;(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=`
29
+ `,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=""))(oe||={});var Fh;(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="Ÿ"))(Fh||={});var Rk;(e=>e.ST=`${oe.ESC}\\`)(Rk||={});var a0=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(`${oe.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)}}};a0=Ht([ve(2,Vi),ve(3,qi),ve(4,Ua),ve(5,tr)],a0);var gi=0,_i=0,bi=0,Ut=0,DS={css:"#00000000",rgba:0},si;(e=>{function t(a,l,c,d){return d!==void 0?`#${wa(a)}${wa(l)}${wa(c)}${wa(d)}`:`#${wa(a)}${wa(l)}${wa(c)}`}e.toCss=t;function i(a,l,c,d=255){return(a<<24|l<<16|c<<8|d)>>>0}e.toRgba=i;function s(a,l,c,d){return{css:e.toCss(a,l,c,d),rgba:e.toRgba(a,l,c,d)}}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,b=f.rgba>>16&255,v=f.rgba>>8&255,y=m.rgba>>24&255,x=m.rgba>>16&255,w=m.rgba>>8&255;gi=y+Math.round((g-y)*Ut),_i=x+Math.round((b-x)*Ut),bi=w+Math.round((v-w)*Ut);let E=si.toCss(gi,_i,bi),A=si.toRgba(gi,_i,bi);return{css:E,rgba:A}}e.blend=t;function i(m){return(m.rgba&255)===255}e.isOpaque=i;function s(m,f,g){let b=$h.ensureContrastRatio(m.rgba,f.rgba,g);if(b)return si.toColor(b>>24&255,b>>16&255,b>>8&255)}e.ensureContrastRatio=s;function a(m){let f=(m.rgba|255)>>>0;return[gi,_i,bi]=$h.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]=$h.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 d(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=d})(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 Ui;(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,d=a/255,m=l/255,f=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),b=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return f*.2126+g*.7152+b*.0722}e.relativeLuminance2=i})(Ui||={});var $h;(e=>{function t(c,d){if(Ut=(d&255)/255,Ut===1)return d;let m=d>>24&255,f=d>>16&255,g=d>>8&255,b=c>>24&255,v=c>>16&255,y=c>>8&255;return gi=b+Math.round((m-b)*Ut),_i=v+Math.round((f-v)*Ut),bi=y+Math.round((g-y)*Ut),si.toRgba(gi,_i,bi)}e.blend=t;function i(c,d,m){let f=Ui.relativeLuminance(c>>8),g=Ui.relativeLuminance(d>>8);if(Ys(f,g)<m){if(g<f){let y=s(c,d,m),x=Ys(f,Ui.relativeLuminance(y>>8));if(x<m){let w=a(c,d,m),E=Ys(f,Ui.relativeLuminance(w>>8));return x>E?y:w}return y}let b=a(c,d,m),v=Ys(f,Ui.relativeLuminance(b>>8));if(v<m){let y=s(c,d,m),x=Ys(f,Ui.relativeLuminance(y>>8));return v>x?b:y}return b}}e.ensureContrastRatio=i;function s(c,d,m){let f=c>>24&255,g=c>>16&255,b=c>>8&255,v=d>>24&255,y=d>>16&255,x=d>>8&255,w=Ys(Ui.relativeLuminance2(v,y,x),Ui.relativeLuminance2(f,g,b));for(;w<m&&(v>0||y>0||x>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),w=Ys(Ui.relativeLuminance2(v,y,x),Ui.relativeLuminance2(f,g,b));return(v<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=s;function a(c,d,m){let f=c>>24&255,g=c>>16&255,b=c>>8&255,v=d>>24&255,y=d>>16&255,x=d>>8&255,w=Ys(Ui.relativeLuminance2(v,y,x),Ui.relativeLuminance2(f,g,b));for(;w<m&&(v<255||y<255||x<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),w=Ys(Ui.relativeLuminance2(v,y,x),Ui.relativeLuminance2(f,g,b));return(v<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=a;function l(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=l})($h||={});function wa(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ys(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Xj=class extends Xc{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()]}},ad=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new zn}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,d=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!==d||this._workCell.bg!==m){if(f-a>1){let g=this._getJoinedRanges(s,c,l,t,a);for(let b=0;b<g.length;b++)i.push(g[b])}a=f,c=l,d=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||Fr.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(d){console.error(d)}for(let d=1;d<this._characterJoiners.length;d++)try{let m=this._characterJoiners[d].handler(l);for(let f=0;f<m.length;f++)ad._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 d=i;d<this._bufferService.cols;d++){let m=t.getWidth(d),f=t.getString(d).length||Fr.length;if(m!==0){if(!a&&c[0]<=l&&(c[0]=d,a=!0),c[1]<=l){if(c[1]=d,c=e[++s],!c)break;c[0]<=l?(c[0]=d,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}};ad=Ht([ve(0,Vi)],ad);function Zj(e){return 57508<=e&&e<=57558}function Qj(e){return 9472<=e&&e<=9631}function Jj(e){return Zj(e)||Qj(e)}function eB(){return{css:{canvas:kh(),cell:kh()},device:{canvas:kh(),cell:kh(),char:{width:0,height:0,left:0,top:0}}}}function kh(){return{width:0,height:0}}var o0=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 zn,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,d,m,f,g){let b=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();i&&x<l+1&&(x=l+1);let w,E=0,A="",T=0,M=0,R=0,z=0,U=!1,j=0,O=!1,K=0,H=0,G=[],J=f!==-1&&g!==-1;for(let P=0;P<x;P++){e.loadCell(P,this._workCell);let ee=this._workCell.getWidth();if(ee===0)continue;let q=!1,N=P>=H,F=P,$=this._workCell;if(v.length>0&&P===v[0][0]&&N){let Be=v.shift(),Ft=this._isCellInSelection(Be[0],t);for(T=Be[0]+1;T<Be[1];T++)N&&=Ft===this._isCellInSelection(T,t);N&&=!i||l<Be[0]||l>=Be[1],N?(q=!0,$=new Xj(this._workCell,e.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),F=Be[1]-1,ee=$.getWidth()):H=Be[1]}let Z=this._isCellInSelection(P,t),W=i&&P===l,D=J&&P>=f&&P<=g,ie=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Be=>{ie=!0});let ce=$.getChars()||Fr;if(ce===" "&&($.isUnderline()||$.isOverline())&&(ce=" "),K=ee*d-m.get(ce,$.isBold(),$.isItalic()),!w)w=this._document.createElement("span");else if(E&&(Z&&O||!Z&&!O&&$.bg===M)&&(Z&&O&&y.selectionForeground||$.fg===R)&&$.extended.ext===z&&D===U&&K===j&&!W&&!q&&!ie&&N){$.isInvisible()?A+=Fr:A+=ce,E++;continue}else E&&(w.textContent=A),w=this._document.createElement("span"),E=0,A="";if(M=$.bg,R=$.fg,z=$.extended.ext,U=D,j=K,O=Z,q&&l>=P&&l<=F&&(l=P),!this._coreService.isCursorHidden&&W&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&G.push("xterm-cursor-blink"),G.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline");break}}if($.isBold()&&G.push("xterm-bold"),$.isItalic()&&G.push("xterm-italic"),$.isDim()&&G.push("xterm-dim"),$.isInvisible()?A=Fr:A=$.getChars()||Fr,$.isUnderline()&&(G.push(`xterm-underline-${$.extended.underlineStyle}`),A===" "&&(A=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Xc.toColorRGB($.getUnderlineColor()).join(",")})`;else{let Be=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&Be<8&&(Be+=8),w.style.textDecorationColor=y.ansi[Be].css}$.isOverline()&&(G.push("xterm-overline"),A===" "&&(A=" ")),$.isStrikethrough()&&G.push("xterm-strikethrough"),D&&(w.style.textDecoration="underline");let le=$.getFgColor(),he=$.getFgColorMode(),ge=$.getBgColor(),Se=$.getBgColorMode(),ze=!!$.isInverse();if(ze){let Be=le;le=ge,ge=Be;let Ft=he;he=Se,Se=Ft}let Ee,st,ot=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Be=>{Be.options.layer!=="top"&&ot||(Be.backgroundColorRGB&&(Se=50331648,ge=Be.backgroundColorRGB.rgba>>8&16777215,Ee=Be.backgroundColorRGB),Be.foregroundColorRGB&&(he=50331648,le=Be.foregroundColorRGB.rgba>>8&16777215,st=Be.foregroundColorRGB),ot=Be.options.layer==="top")}),!ot&&Z&&(Ee=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ge=Ee.rgba>>8&16777215,Se=50331648,ot=!0,y.selectionForeground&&(he=50331648,le=y.selectionForeground.rgba>>8&16777215,st=y.selectionForeground)),ot&&G.push("xterm-decoration-top");let lt;switch(Se){case 16777216:case 33554432:lt=y.ansi[ge],G.push(`xterm-bg-${ge}`);break;case 50331648:lt=si.toColor(ge>>16,ge>>8&255,ge&255),this._addStyle(w,`background-color:#${OS((ge>>>0).toString(16),"0",6)}`);break;default:ze?(lt=y.foreground,G.push("xterm-bg-257")):lt=y.background}switch(Ee||$.isDim()&&(Ee=Tt.multiplyOpacity(lt,.5)),he){case 16777216:case 33554432:$.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(w,lt,y.ansi[le],$,Ee,void 0)||G.push(`xterm-fg-${le}`);break;case 50331648:let Be=si.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(w,lt,Be,$,Ee,st)||this._addStyle(w,`color:#${OS(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,lt,y.foreground,$,Ee,st)||ze&&G.push("xterm-fg-257")}G.length&&(w.className=G.join(" "),G.length=0),!W&&!q&&!ie&&N?E++:w.textContent=A,K!==this.defaultSpacing&&(w.style.letterSpacing=`${K}px`),b.push(w),P=F}return w&&E&&(w.textContent=A),b}_applyMinimumContrast(e,t,i,s,a,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||Jj(s.getCode()))return!1;let c=this._getContrastCache(s),d;if(!a&&!l&&(d=c.getColor(t.rgba,i.rgba)),d===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);d=Tt.ensureContrastRatio(a||t,l||i,m),c.setColor((a||t).rgba,(l||i).rgba,d??null)}return d?(this._addStyle(e,`color:${d.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]}};o0=Ht([ve(1,fk),ve(2,qi),ve(3,er),ve(4,Ua),ve(5,Zc),ve(6,Qo)],o0);function OS(e,t,i){for(;e.length<i;)e=t+e;return e}var tB=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}},iB=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,d=Math.max(l,0),m=Math.min(c,e.rows-1);if(d>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=l,this.viewportEndRow=c,this.viewportCappedStartRow=d,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 nB(){return new iB}var pp="xterm-dom-renderer-owner-",Mn="xterm-rows",Nh="xterm-fg-",LS="xterm-bg-",sc="xterm-focus",Th="xterm-selection",sB=1,l0=class extends Ge{constructor(e,t,i,s,a,l,c,d,m,f,g,b,v,y){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=b,this._coreBrowserService=v,this._themeService=y,this._terminalClass=sB++,this._rowElements=[],this._selectionRenderModel=nB(),this.onRequestRedraw=this._register(new de).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Mn),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(Th),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=eB(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(o0,document),this._element.classList.add(pp+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(Dt(()=>{this._element.classList.remove(pp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new tB(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} .${Mn} 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} .${Mn} { 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} .${Mn} .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} .${Mn}.${sc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Mn}.${sc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Mn}.${sc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Mn} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Mn} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Mn} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Mn} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Mn} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Th} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Th} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Th} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,c]of e.ansi.entries())t+=`${this._terminalSelector} .${Nh}${l} { color: ${c.css}; }${this._terminalSelector} .${Nh}${l}.xterm-dim { color: ${Tt.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${LS}${l} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${Nh}257 { color: ${Tt.opaque(e.background).css}; }${this._terminalSelector} .${Nh}257.xterm-dim { color: ${Tt.multiplyOpacity(Tt.opaque(e.background),.5).css}; }${this._terminalSelector} .${LS}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(sc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(sc),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,d=this._document.createDocumentFragment();if(i){let m=e[0]>t[0];d.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;d.appendChild(this._createSelectionElement(l,m,f));let g=c-l-1;if(d.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,g)),l!==c){let b=a===c?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(c,0,b))}}this._selectionContainer.appendChild(d)}_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,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let f=m+i.ydisp,g=this._rowElements[m],b=i.lines.get(f);if(!g||!b)break;g.replaceChildren(...this._rowFactory.createRow(b,f,f===s,c,d,a,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${pp}${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 d=this._bufferService.buffer,m=d.ybase+d.y,f=Math.min(d.x,a-1),g=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=i;y<=s;++y){let x=y+d.ydisp,w=this._rowElements[y],E=d.lines.get(x);if(!w||!E)break;w.replaceChildren(...this._rowFactory.createRow(E,x,x===m,b,v,f,g,this.dimensions.css.cell.width,this._widthCache,l?y===i?e:0:-1,l?(y===s?t:a)-1:-1))}}};l0=Ht([ve(7,m_),ve(8,Nd),ve(9,qi),ve(10,Vi),ve(11,Ua),ve(12,er),ve(13,Qo)],l0);var c0=class extends Ge{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new de),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new aB(this._optionsService))}catch{this._measureStrategy=this._register(new rB(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())}};c0=Ht([ve(2,qi)],c0);var Dk=class extends Ge{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},rB=class extends Dk{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}},aB=class extends Dk{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}},oB=class extends Ge{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new lB(this._window)),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new de),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ti.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Pe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Pe(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},lB=class extends Ge{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Go),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Dt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Pe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},cB=class extends Ge{constructor(){super(),this.linkProviders=[],this._register(Dt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function S_(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 uB(e,t,i,s,a,l,c,d,m){if(!l)return;let f=S_(e,t,i);if(f)return f[0]=Math.ceil((f[0]+(m?c/2:0))/c),f[1]=Math.ceil(f[1]/d),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 u0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,a){return uB(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=S_(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])}}};u0=Ht([ve(0,tr),ve(1,Nd)],u0);var hB=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=[]}},Ok={};x9(Ok,{getSafariVersion:()=>fB,isChromeOS:()=>zk,isFirefox:()=>Lk,isIpad:()=>mB,isIphone:()=>pB,isLegacyEdge:()=>dB,isLinux:()=>w_,isMac:()=>od,isNode:()=>Td,isSafari:()=>jk,isWindows:()=>Bk});var Td=typeof process<"u"&&"title"in process,Qc=Td?"node":navigator.userAgent,Jc=Td?"node":navigator.platform,Lk=Qc.includes("Firefox"),dB=Qc.includes("Edge"),jk=/^((?!chrome|android).)*safari/i.test(Qc);function fB(){if(!jk)return 0;let e=Qc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var od=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Jc),mB=Jc==="iPad",pB=Jc==="iPhone",Bk=["Windows","Win16","Win32","WinCE"].includes(Jc),w_=Jc.indexOf("Linux")>=0,zk=/\bCrOS\b/.test(Qc),Ik=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()}},gB=class extends Ik{_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())}}},_B=class extends Ik{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},ld=!Td&&"requestIdleCallback"in window?_B:gB,bB=class{constructor(){this._queue=new ld}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},h0=class extends Ge{constructor(e,t,i,s,a,l,c,d,m){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=a,this._coreBrowserService=d,this._renderer=this._register(new Go),this._pausedResizeTask=new bB,this._observerDisposable=this._register(new Go),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 de),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new de),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new de),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new de),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new hB((f,g)=>this._renderRows(f,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new vB(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()}};h0=Ht([ve(2,qi),ve(3,Nd),ve(4,Ua),ve(5,Zc),ve(6,Vi),ve(7,er),ve(8,Qo)],h0);var vB=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 yB(e,t,i,s){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return wB(a,l,e,t,i,s)+Ad(l,t,i,s)+EB(a,l,e,t,i,s);let c;if(l===t)return c=a>e?"D":"C",Bc(Math.abs(a-e),jc(c,s));c=l>t?"D":"C";let d=Math.abs(l-t),m=SB(l>t?e:a,i)+(d-1)*i.cols+1+xB(l>t?a:e);return Bc(m,jc(c,s))}function xB(e,t){return e-1}function SB(e,t){return t.cols-e}function wB(e,t,i,s,a,l){return Ad(t,s,a,l).length===0?"":Bc(Uk(e,t,e,t-Ba(t,a),!1,a).length,jc("D",l))}function Ad(e,t,i,s){let a=e-Ba(e,i),l=t-Ba(t,i),c=Math.abs(a-l)-CB(e,t,i);return Bc(c,jc(Pk(e,t),s))}function EB(e,t,i,s,a,l){let c;Ad(t,s,a,l).length>0?c=s-Ba(s,a):c=t;let d=s,m=kB(e,t,i,s,a,l);return Bc(Uk(e,c,i,d,m==="C",a).length,jc(m,l))}function CB(e,t,i){let s=0,a=e-Ba(e,i),l=t-Ba(t,i);for(let c=0;c<Math.abs(a-l);c++){let d=Pk(e,t)==="A"?-1:1;i.buffer.lines.get(a+d*c)?.isWrapped&&s++}return s}function Ba(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 kB(e,t,i,s,a,l){let c;return Ad(i,s,a,l).length>0?c=s-Ba(s,a):c=t,e<i&&c<=s||e>=i&&c<s?"C":"D"}function Pk(e,t){return e>t?"A":"B"}function Uk(e,t,i,s,a,l){let c=e,d=t,m="";for(;(c!==i||d!==s)&&d>=0&&d<l.buffer.lines.length;)c+=a?1:-1,a&&c>l.cols-1?(m+=l.buffer.translateBufferLineToString(d,!1,e,c),c=0,e=0,d++):!a&&c<0&&(m+=l.buffer.translateBufferLineToString(d,!1,0,e+1),c=l.cols-1,e=c,d--);return m+l.buffer.translateBufferLineToString(d,!1,e,c)}function jc(e,t){let i=t?"O":"[";return oe.ESC+i+e}function Bc(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var NB=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 gp=50,TB=15,AB=50,MB=500,RB=" ",DB=new RegExp(RB,"g"),d0=class extends Ge{constructor(e,t,i,s,a,l,c,d,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=d,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new zn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new de),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new de),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new de),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new de),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 NB(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 d=i.translateBufferLineToString(c,!0,a,l);s.push(d)}}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),d=i.translateBufferLineToString(l,!0);c?.isWrapped?s[s.length-1]+=d:s.push(d)}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(DB," ")).join(Bk?`\r
30
+ `:`
31
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),w_&&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=S_(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,-gp),gp),t/=gp,t/Math.abs(t)+Math.round(t*(TB-1)))}shouldForceSelection(e){return od?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(),AB)}_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&&!(od&&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<MB&&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=yB(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),d=this._convertViewportColToCharacterIndex(l,e[0]),m=d,f=e[0]-d,g=0,b=0,v=0,y=0;if(c.charAt(d)===" "){for(;d>0&&c.charAt(d-1)===" ";)d--;for(;m<c.length&&c.charAt(m+1)===" ";)m++}else{let E=e[0],A=e[0];l.getWidth(E)===0&&(g++,E--),l.getWidth(A)===2&&(b++,A++);let T=l.getString(A).length;for(T>1&&(y+=T-1,m+=T-1);E>0&&d>0&&!this._isCharWordSeparator(l.loadCell(E-1,this._workCell));){l.loadCell(E-1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,E--):M>1&&(v+=M-1,d-=M-1),d--,E--}for(;A<l.length&&m+1<c.length&&!this._isCharWordSeparator(l.loadCell(A+1,this._workCell));){l.loadCell(A+1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,A++):M>1&&(y+=M-1,m+=M-1),m++,A++}}m++;let x=d+f-g+v,w=Math.min(this._bufferService.cols,m-d+g+b-v-y);if(!(!t&&c.slice(d,m).trim()==="")){if(i&&x===0&&l.getCodePoint(0)!==32){let E=a.lines.get(e[1]-1);if(E&&l.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let A=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(A){let T=this._bufferService.cols-A.start;x-=T,w+=T}}}if(s&&x+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let E=a.lines.get(e[1]+1);if(E?.isWrapped&&E.getCodePoint(0)!==32){let A=this._getWordAt([0,e[1]+1],!1,!1,!0);A&&(w+=A.length)}}return{start:x,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)}};d0=Ht([ve(3,Vi),ve(4,Ua),ve(5,p_),ve(6,qi),ve(7,tr),ve(8,er)],d0);var BS=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={}}},zS=class{constructor(){this._color=new BS,this._css=new BS}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})()),Ca=Bt.toColor("#ffffff"),pc=Bt.toColor("#000000"),IS=Bt.toColor("#ffffff"),PS=pc,rc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},OB=Ca,f0=class extends Ge{constructor(e){super(),this._optionsService=e,this._contrastCache=new zS,this._halfContrastCache=new zS,this._onChangeColors=this._register(new de),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ca,background:pc,cursor:IS,cursorAccent:PS,selectionForeground:void 0,selectionBackgroundTransparent:rc,selectionBackgroundOpaque:Tt.blend(pc,rc),selectionInactiveBackgroundTransparent:rc,selectionInactiveBackgroundOpaque:Tt.blend(pc,rc),scrollbarSliderBackground:Tt.opacity(Ca,.2),scrollbarSliderHoverBackground:Tt.opacity(Ca,.4),scrollbarSliderActiveBackground:Tt.opacity(Ca,.5),overviewRulerBorder:Ca,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=vt(e.foreground,Ca),t.background=vt(e.background,pc),t.cursor=Tt.blend(t.background,vt(e.cursor,IS)),t.cursorAccent=Tt.blend(t.background,vt(e.cursorAccent,PS)),t.selectionBackgroundTransparent=vt(e.selectionBackground,rc),t.selectionBackgroundOpaque=Tt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=vt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Tt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?vt(e.selectionForeground,DS):void 0,t.selectionForeground===DS&&(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=vt(e.scrollbarSliderBackground,Tt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=vt(e.scrollbarSliderHoverBackground,Tt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=vt(e.scrollbarSliderActiveBackground,Tt.opacity(t.foreground,.5)),t.overviewRulerBorder=vt(e.overviewRulerBorder,OB),t.ansi=li.slice(),t.ansi[0]=vt(e.black,li[0]),t.ansi[1]=vt(e.red,li[1]),t.ansi[2]=vt(e.green,li[2]),t.ansi[3]=vt(e.yellow,li[3]),t.ansi[4]=vt(e.blue,li[4]),t.ansi[5]=vt(e.magenta,li[5]),t.ansi[6]=vt(e.cyan,li[6]),t.ansi[7]=vt(e.white,li[7]),t.ansi[8]=vt(e.brightBlack,li[8]),t.ansi[9]=vt(e.brightRed,li[9]),t.ansi[10]=vt(e.brightGreen,li[10]),t.ansi[11]=vt(e.brightYellow,li[11]),t.ansi[12]=vt(e.brightBlue,li[12]),t.ansi[13]=vt(e.brightMagenta,li[13]),t.ansi[14]=vt(e.brightCyan,li[14]),t.ansi[15]=vt(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]=vt(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()}}};f0=Ht([ve(0,qi)],f0);function vt(e,t){if(e!==void 0)try{return Bt.toColor(e)}catch{}return t}var LB=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)}},jB=class{constructor(){this._services=new LB,this._services.set(m_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=T9(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)}},BB={trace:0,debug:1,info:2,warn:3,error:4,off:5},zB="xterm.js: ",m0=class extends Ge{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=BB[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?"":zB)+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)}};m0=Ht([ve(0,qi)],m0);var US=class extends Ge{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new de),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new de),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new de),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}},qe=3,ti=Object.freeze(new Xc),Ah=0,_p=2,gc=class Hk{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*qe);let a=i||zn.fromCharData([0,ak,1,0]);for(let l=0;l<t;++l)this.setCell(l,a);this.length=t}get(t){let i=this._data[t*qe+0],s=i&2097151;return[this._data[t*qe+1],i&2097152?this._combined[t]:s?Pr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*qe+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*qe+0]=t|2097152|i[2]<<22):this._data[t*qe+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*qe+0]>>22}hasWidth(t){return this._data[t*qe+0]&12582912}getFg(t){return this._data[t*qe+1]}getBg(t){return this._data[t*qe+2]}hasContent(t){return this._data[t*qe+0]&4194303}getCodePoint(t){let i=this._data[t*qe+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*qe+0]&2097152}getString(t){let i=this._data[t*qe+0];return i&2097152?this._combined[t]:i&2097151?Pr(i&2097151):""}isProtected(t){return this._data[t*qe+2]&536870912}loadCell(t,i){return Ah=t*qe,i.content=this._data[Ah+0],i.fg=this._data[Ah+1],i.bg=this._data[Ah+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*qe+0]=i.content,this._data[t*qe+1]=i.fg,this._data[t*qe+2]=i.bg}setCellFromCodepoint(t,i,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*qe+0]=i|s<<22,this._data[t*qe+1]=a.fg,this._data[t*qe+2]=a.bg}addCodepointToCell(t,i,s){let a=this._data[t*qe+0];a&2097152?this._combined[t]+=Pr(i):a&2097151?(this._combined[t]=Pr(a&2097151)+Pr(i),a&=-2097152,a|=2097152):a=i|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*qe+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 zn;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 zn;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*_p<this._data.buffer.byteLength;let s=t*qe;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 d=parseInt(a[c],10);d>=t&&delete this._combined[d]}let l=Object.keys(this._extendedAttrs);for(let c=0;c<l.length;c++){let d=parseInt(l[c],10);d>=t&&delete this._extendedAttrs[d]}}return this.length=t,s*4*_p<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*_p<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 Hk(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*qe+0]&4194303)return t+(this._data[t*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303||this._data[t*qe+2]&50331648)return t+(this._data[t*qe+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<qe;f++)this._data[(s+m)*qe+f]=c[(i+m)*qe+f];c[(i+m)*qe+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<qe;f++)this._data[(s+m)*qe+f]=c[(i+m)*qe+f];c[(i+m)*qe+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}let d=Object.keys(t._combined);for(let m=0;m<d.length;m++){let f=parseInt(d[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*qe+0],d=c&2097151,m=c&2097152?this._combined[i]:d?Pr(d):Fr;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 IB(e,t,i,s,a,l){let c=[];for(let d=0;d<e.length-1;d++){let m=d,f=e.get(++m);if(!f.isWrapped)continue;let g=[e.get(d)];for(;m<e.length&&f.isWrapped;)g.push(f),f=e.get(++m);if(!l&&s>=d&&s<m){d+=g.length-1;continue}let b=0,v=zc(g,b,t),y=1,x=0;for(;y<g.length;){let E=zc(g,y,t),A=E-x,T=i-v,M=Math.min(A,T);g[b].copyCellsFrom(g[y],x,v,M,!1),v+=M,v===i&&(b++,v=0),x+=M,x===E&&(y++,x=0),v===0&&b!==0&&g[b-1].getWidth(i-1)===2&&(g[b].copyCellsFrom(g[b-1],i-1,v++,1,!1),g[b-1].setCell(i-1,a))}g[b].replaceCells(v,i,a);let w=0;for(let E=g.length-1;E>0&&(E>b||g[E].getTrimmedLength()===0);E--)w++;w>0&&(c.push(d+g.length-w),c.push(w)),d+=g.length-1}return c}function PB(e,t){let i=[],s=0,a=t[s],l=0;for(let c=0;c<e.length;c++)if(a===c){let d=t[++s];e.onDeleteEmitter.fire({index:c-l,amount:d}),c+=d-1,l+=d,a=t[++s]}else i.push(c);return{layout:i,countRemoved:l}}function UB(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 HB(e,t,i){let s=[],a=e.map((m,f)=>zc(e,f,t)).reduce((m,f)=>m+f),l=0,c=0,d=0;for(;d<a;){if(a-d<i){s.push(a-d);break}l+=i;let m=zc(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),d+=g}return s}function zc(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 Fk=class $k{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=$k._nextId++,this._onDispose=this.register(new de),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ja(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Fk._nextId=1;var FB=Fk,di={},ka=di.B;di[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:"≥","{":"π","|":"≠","}":"£","~":"·"};di.A={"#":"£"};di.B=void 0;di[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};di.C=di[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};di.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};di.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};di.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};di.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};di.E=di[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};di.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};di.H=di[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};di["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var HS=4294967295,FS=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=ka,this.markers=[],this._nullCell=zn.fromCharData([0,ak,1,0]),this._whitespaceCell=zn.fromCharData([0,Fr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ld,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new US(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 sd),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 sd),this._whitespaceCell}getBlankLine(e,t){return new gc(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>HS?HS: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 US(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 gc(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 gc(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=IB(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ti),i);if(s.length>0){let a=PB(this.lines,s);UB(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 gc(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 d=this.lines.get(c);if(!d||!d.isWrapped&&d.getTrimmedLength()<=e)continue;let m=[d];for(;d.isWrapped&&c>0;)d=this.lines.get(--c),m.unshift(d);if(!i){let M=this.ybase+this.y;if(M>=c&&M<c+m.length)continue}let f=m[m.length-1].getTrimmedLength(),g=HB(m,this._cols,e),b=g.length-m.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+b):v=Math.max(0,this.lines.length-this.lines.maxLength+b);let y=[];for(let M=0;M<b;M++){let R=this.getBlankLine(ti,!0);y.push(R)}y.length>0&&(a.push({start:c+m.length+l,newLines:y}),l+=y.length),m.push(...y);let x=g.length-1,w=g[x];w===0&&(x--,w=g[x]);let E=m.length-b-1,A=f;for(;E>=0;){let M=Math.min(A,w);if(m[x]===void 0)break;if(m[x].copyCellsFrom(m[E],A-M,w-M,M,!0),w-=M,w===0&&(x--,w=g[x]),A-=M,A===0){E--;let R=Math.max(E,0);A=zc(m,R,this._cols)}}for(let M=0;M<m.length;M++)g[M]<e&&m[M].setCell(g[M],s);let T=b-v;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+t-1)}if(a.length>0){let c=[],d=[];for(let w=0;w<this.lines.length;w++)d.push(this.lines.get(w));let m=this.lines.length,f=m-1,g=0,b=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(b&&b.start>f+v){for(let E=b.newLines.length-1;E>=0;E--)this.lines.set(w--,b.newLines[E]);w++,c.push({index:f+1,amount:b.newLines.length}),v+=b.newLines.length,b=a[++g]}else this.lines.set(w,d[f--]);let y=0;for(let w=c.length-1;w>=0;w--)c[w].index+=y,this.lines.onInsertEmitter.fire(c[w]),y+=c[w].amount;let x=Math.max(0,m+l-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}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 FB(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)}},$B=class extends Ge{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new de),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 FS(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new FS(!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)}},Vk=2,qk=1,p0=class extends Ge{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Vk),this.rows=Math.max(e.rawOptions.rows||0,qk),this.buffers=this._register(new $B(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))}};p0=Ht([ve(0,qi)],p0);var Ro={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:od,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},VB=["normal","bold","100","200","300","400","500","600","700","800","900"],qB=class extends Ge{constructor(e){super(),this._onOptionChange=this._register(new de),this.onOptionChange=this._onOptionChange.event;let t={...Ro};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 Ro))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Ro))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=Ro[e]),!KB(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ro[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=VB.includes(t)?t:Ro[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 KB(e){return e==="block"||e==="underline"||e==="bar"}function _c(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]&&_c(e[s],t-1);return i}var $S=Object.freeze({insertMode:!1}),VS=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),g0=class extends Ge{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new de),this.onData=this._onData.event,this._onUserInput=this._register(new de),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new de),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=_c($S),this.decPrivateModes=_c(VS)}reset(){this.modes=_c($S),this.decPrivateModes=_c(VS)}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))}};g0=Ht([ve(0,Vi),ve(1,hk),ve(2,qi)],g0);var qS={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 bp(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 vp=String.fromCharCode,KS={DEFAULT:e=>{let t=[bp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${vp(t[0])}${vp(t[1])}${vp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${bp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${bp(e,!0)};${e.x};${e.y}${t}`}},_0=class extends Ge{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new de),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(qS))this.addProtocol(s,qS[s]);for(let s of Object.keys(KS))this.addEncoding(s,KS[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)}};_0=Ht([ve(0,Vi),ve(1,Ua),ve(2,qi)],_0);var yp=[[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]],GB=[[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 WB(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 YB=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<yp.length;++e)ci.fill(0,yp[e][0],yp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ci[e]:WB(e,GB)?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=Ma.extractWidth(t);a===0?s=!1:a>i&&(i=a)}return Ma.createPropertyValue(0,i,s)}},Ma=class Vh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new de,this.onChange=this._onChange.event;let t=new YB;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 d=this.charProperties(c,s),m=Vh.extractWidth(d);Vh.extractShouldJoin(d)&&(m-=Vh.extractWidth(s)),i+=m,s=d}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},XB=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 GS(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 ac=2147483647,ZB=256,Kk=class b0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>ZB)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new b0;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let a=t[s];if(Array.isArray(a))for(let l=0;l<a.length;++l)i.addSubParam(a[l]);else i.addParam(a)}return i}clone(){let t=new b0(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ac?ac: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>ac?ac: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,ac):t}},oc=[],QB=class{constructor(){this._state=0,this._active=oc,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=oc}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=oc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||oc,!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",kd(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=oc,this._id=-1,this._state=0}}},gn=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+=kd(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}},lc=[],JB=class{constructor(){this._handlers=Object.create(null),this._active=lc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=lc}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=lc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||lc,!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",kd(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=lc,this._ident=0}},bc=new Kk;bc.addParam(0);var WS=class{constructor(e){this._handler=e,this._data="",this._params=bc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():bc,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=kd(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=bc,this._data="",this._hitLimit=!1,i));return this._params=bc,this._data="",this._hitLimit=!1,t}},ez=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}},On=160,tz=(function(){let e=new ez(4095),t=Array.apply(null,Array(256)).map((d,m)=>m),i=(d,m)=>t.slice(d,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(On,0,2,0),e.add(On,8,5,8),e.add(On,6,0,6),e.add(On,11,0,11),e.add(On,13,13,13),e})(),iz=class extends Ge{constructor(e=tz){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 Kk,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 QB),this._dcsParser=this._register(new JB),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 d=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&m>-1){for(;m>=0&&(c=d[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=d[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 d=l;d<t;++d){switch(s=e[d],a=this._transitions.table[this.currentState<<8|(s<160?s:On)],a>>4){case 2:for(let v=d+1;;++v){if(v>=t||(s=e[v])<32||s>126&&s<On){this._printHandler(e,d,v),d=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<On){this._printHandler(e,d,v),d=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<On){this._printHandler(e,d,v),d=v-1;break}if(++v>=t||(s=e[v])<32||s>126&&s<On){this._printHandler(e,d,v),d=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:d,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,d),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(++d<t&&(s=e[d])>47&&s<60);d--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let g=this._escHandlers[this._collect<<8|s],b=g?g.length-1:-1;for(;b>=0&&(c=g[b](),c!==!0);b--)if(c instanceof Promise)return this._preserveStack(4,g,b,a,d),c;b<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let v=d+1;;++v)if(v>=t||(s=e[v])===24||s===26||s===27||s>127&&s<On){this._dcsParser.put(e,d,v),d=v-1;break}break;case 14:if(c=this._dcsParser.unhook(s!==24&&s!==26),c)return this._preserveStack(6,[],0,a,d),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=d+1;;v++)if(v>=t||(s=e[v])<32||s>127&&s<On){this._oscParser.put(e,d,v),d=v-1;break}break;case 6:if(c=this._oscParser.end(s!==24&&s!==26),c)return this._preserveStack(5,[],0,a,d),c;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},nz=/^([\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})$/,sz=/^[\da-f]+$/;function YS(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=nz.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),sz.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 xp(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 rz(e,t=16){let[i,s,a]=e;return`rgb:${xp(i,t)}/${xp(s,t)}/${xp(a,t)}`}var az={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Br=131072,XS=10;function ZS(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 QS=5e3,JS=0,oz=class extends Ge{constructor(e,t,i,s,a,l,c,d,m=new iz){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=c,this._unicodeService=d,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new k9,this._utf8Decoder=new N9,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ti.clone(),this._eraseAttrDataInternal=ti.clone(),this._onRequestBell=this._register(new de),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new de),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new de),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new de),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new de),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new de),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new de),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new de),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new de),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new de),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new de),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 v0(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,b)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:g,data:b})}),this._parser.setDcsHandlerFallback((f,g,b)=>{g==="HOOK"&&(b=b.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:g,payload:b})}),this._parser.setPrintHandler((f,g,b)=>this.print(f,g,b)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(oe.BEL,()=>this.bell()),this._parser.setExecuteHandler(oe.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(oe.BS,()=>this.backspace()),this._parser.setExecuteHandler(oe.HT,()=>this.tab()),this._parser.setExecuteHandler(oe.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(oe.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Fh.IND,()=>this.index()),this._parser.setExecuteHandler(Fh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Fh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new gn(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new gn(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new gn(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new gn(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new gn(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new gn(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new gn(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new gn(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new gn(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new gn(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new gn(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new gn(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 di)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 WS((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"),QS))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${QS} 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>Br&&(l=this._parseStack.position+Br)}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<Br&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Br))),c||this._dirtyRowTracker.clearRange(),e.length>Br)for(let f=l;f<e.length;f+=Br){let g=f+Br<e.length?f+Br:e.length,b=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,b))return this._preserveStack(s,a,b,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 d=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(d,this._bufferService.rows-1)})}print(e,t,i){let s,a,l=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,d=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,g=this._curAttrData,b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&b.getWidth(this._activeBuffer.x-1)===2&&b.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let y=t;y<i;++y){if(s=e[y],s<127&&l){let A=l[String.fromCharCode(s)];A&&(s=A.charCodeAt(0))}let x=this._unicodeService.charProperties(s,v);a=Ma.extractWidth(x);let w=Ma.extractShouldJoin(x),E=w?Ma.extractWidth(v):0;if(v=x,c&&this._onA11yChar.fire(Pr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-E>d){if(m){let A=b,T=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&b instanceof gc&&b.copyCellsFrom(A,T,0,E,!1);T<d;)A.setCellFromCodepoint(T++,0,1,g)}else if(this._activeBuffer.x=d-1,a===2)continue}if(w&&this._activeBuffer.x){let A=b.getWidth(this._activeBuffer.x-1)?1:2;b.addCodepointToCell(this._activeBuffer.x-A,s,a);for(let T=a-E;--T>=0;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(f&&(b.insertCells(this._activeBuffer.x,a-E,this._activeBuffer.getNullCell(g)),b.getWidth(d-1)===2&&b.setCellFromCodepoint(d-1,0,1,g)),b.setCellFromCodepoint(this._activeBuffer.x++,s,a,g),a>0)for(;--a;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<d&&i-t>0&&b.getWidth(this._activeBuffer.x)===0&&!b.hasContent(this._activeBuffer.x)&&b.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=>ZS(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new WS(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new gn(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=Ma.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),d=0;for(let f=0;f<l.length;){let g=l.codePointAt(f)||0;c[d++]=g,f+=g>65535?2:1}let m=d;for(let f=1;f<i;++f)c.copyWithin(m,0,d),m+=d;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(oe.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(oe.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(oe.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(oe.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(oe.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,ka),this._charsetService.setgCharset(1,ka),this._charsetService.setgCharset(2,ka),this._charsetService.setgCharset(3,ka);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:d,cols:m}=this._bufferService,{active:f,alt:g}=d,b=this._optionsService.rawOptions,v=(w,E)=>(c.triggerDataEvent(`${oe.ESC}[${t?"":"?"}${w};${E}$y`),!0),y=w=>w?1:2,x=e.params[0];return t?x===2?v(x,4):x===4?v(x,y(c.modes.insertMode)):x===12?v(x,3):x===20?v(x,y(b.convertEol)):v(x,0):x===1?v(x,y(s.applicationCursorKeys)):x===3?v(x,b.windowOptions.setWinLines?m===80?2:m===132?1:0:0):x===6?v(x,y(s.origin)):x===7?v(x,y(s.wraparound)):x===8?v(x,3):x===9?v(x,y(a==="X10")):x===12?v(x,y(b.cursorBlink)):x===25?v(x,y(!c.isCursorHidden)):x===45?v(x,y(s.reverseWraparound)):x===66?v(x,y(s.applicationKeypad)):x===67?v(x,4):x===1e3?v(x,y(a==="VT200")):x===1002?v(x,y(a==="DRAG")):x===1003?v(x,y(a==="ANY")):x===1004?v(x,y(s.sendFocus)):x===1005?v(x,4):x===1006?v(x,y(l==="SGR")):x===1015?v(x,4):x===1016?v(x,y(l==="SGR_PIXELS")):x===1048?v(x,1):x===47||x===1047||x===1049?v(x,y(f===g)):x===2004?v(x,y(s.bracketedPasteMode)):x===2026?v(x,y(s.synchronizedOutput)):v(x,0)}_updateAttrColor(e,t,i,s,a){return t===2?(e|=50331648,e&=-16777216,e|=Xc.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),d=0;do s[1]===5&&(a=1),s[l+d+1+a]=c[d];while(++d<c.length&&d+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(`${oe.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.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(`${oe.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(!ZS(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(`${oe.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>XS&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>XS&&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(ew(l))if(a==="?")t.push({type:0,index:l});else{let c=YS(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=YS(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]);ew(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,ka),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(az[e[0]],di[e[1]]||ka),!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 zn;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(`${oe.ESC}${c}${oe.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)}},v0=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&&(JS=e,e=t,t=JS),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};v0=Ht([ve(0,Vi)],v0);function ew(e){return 0<=e&&e<256}var lz=5e7,tw=12,cz=50,uz=class extends Ge{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new de),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>lz)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=d=>performance.now()-i>=tw?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(i,d);a.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(c);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=tw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>cz&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},y0=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let d=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(m,d)),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)))}};y0=Ht([ve(0,Vi)],y0);var iw=!1,hz=class extends Ge{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Go),this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onData=this._register(new de),this.onData=this._onData.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new de),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new de),this._instantiationService=new jB,this.optionsService=this._register(new qB(e)),this._instantiationService.setService(qi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(p0)),this._instantiationService.setService(Vi,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(m0)),this._instantiationService.setService(hk,this._logService),this.coreService=this._register(this._instantiationService.createInstance(g0)),this._instantiationService.setService(Ua,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(_0)),this._instantiationService.setService(uk,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ma)),this._instantiationService.setService(R9,this.unicodeService),this._charsetService=this._instantiationService.createInstance(XB),this._instantiationService.setService(M9,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(y0),this._instantiationService.setService(dk,this._oscLinkService),this._inputHandler=this._register(new oz(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 uz((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 de),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&&!iw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),iw=!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,Vk),t=Math.max(t,qk),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(GS.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(GS(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Dt(()=>{for(let t of e)t.dispose()})}}},dz={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 fz(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=oe.ESC+"OA":a.key=oe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":oe.DEL,e.altKey&&(a.key=oe.ESC+a.key);break;case 9:if(e.shiftKey){a.key=oe.ESC+"[Z";break}a.key=oe.HT,a.cancel=!0;break;case 13:a.key=e.altKey?oe.ESC+oe.CR:oe.CR,a.cancel=!0;break;case 27:a.key=oe.ESC,e.altKey&&(a.key=oe.ESC+oe.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;l?a.key=oe.ESC+"[1;"+(l+1)+"D":t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D";break;case 39:if(e.metaKey)break;l?a.key=oe.ESC+"[1;"+(l+1)+"C":t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C";break;case 38:if(e.metaKey)break;l?a.key=oe.ESC+"[1;"+(l+1)+"A":t?a.key=oe.ESC+"OA":a.key=oe.ESC+"[A";break;case 40:if(e.metaKey)break;l?a.key=oe.ESC+"[1;"+(l+1)+"B":t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=oe.ESC+"[2~");break;case 46:l?a.key=oe.ESC+"[3;"+(l+1)+"~":a.key=oe.ESC+"[3~";break;case 36:l?a.key=oe.ESC+"[1;"+(l+1)+"H":t?a.key=oe.ESC+"OH":a.key=oe.ESC+"[H";break;case 35:l?a.key=oe.ESC+"[1;"+(l+1)+"F":t?a.key=oe.ESC+"OF":a.key=oe.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=oe.ESC+"[5;"+(l+1)+"~":a.key=oe.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=oe.ESC+"[6;"+(l+1)+"~":a.key=oe.ESC+"[6~";break;case 112:l?a.key=oe.ESC+"[1;"+(l+1)+"P":a.key=oe.ESC+"OP";break;case 113:l?a.key=oe.ESC+"[1;"+(l+1)+"Q":a.key=oe.ESC+"OQ";break;case 114:l?a.key=oe.ESC+"[1;"+(l+1)+"R":a.key=oe.ESC+"OR";break;case 115:l?a.key=oe.ESC+"[1;"+(l+1)+"S":a.key=oe.ESC+"OS";break;case 116:l?a.key=oe.ESC+"[15;"+(l+1)+"~":a.key=oe.ESC+"[15~";break;case 117:l?a.key=oe.ESC+"[17;"+(l+1)+"~":a.key=oe.ESC+"[17~";break;case 118:l?a.key=oe.ESC+"[18;"+(l+1)+"~":a.key=oe.ESC+"[18~";break;case 119:l?a.key=oe.ESC+"[19;"+(l+1)+"~":a.key=oe.ESC+"[19~";break;case 120:l?a.key=oe.ESC+"[20;"+(l+1)+"~":a.key=oe.ESC+"[20~";break;case 121:l?a.key=oe.ESC+"[21;"+(l+1)+"~":a.key=oe.ESC+"[21~";break;case 122:l?a.key=oe.ESC+"[23;"+(l+1)+"~":a.key=oe.ESC+"[23~";break;case 123:l?a.key=oe.ESC+"[24;"+(l+1)+"~":a.key=oe.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=oe.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=oe.DEL:e.keyCode===219?a.key=oe.ESC:e.keyCode===220?a.key=oe.FS:e.keyCode===221&&(a.key=oe.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let c=dz[e.keyCode]?.[e.shiftKey?1:0];if(c)a.key=oe.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){let d=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(d);e.shiftKey&&(m=m.toUpperCase()),a.key=oe.ESC+m}else if(e.keyCode===32)a.key=oe.ESC+(e.ctrlKey?oe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),a.key=oe.ESC+d,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=oe.US),e.key==="@"&&(a.key=oe.NUL));break}return a}var Wt=0,mz=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ld,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ld,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}},Sp=0,nw=0,pz=class extends Ge{constructor(){super(),this._decorations=new mz(e=>e?.marker.line),this._onDecorationRegistered=this._register(new de),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new de),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 gz(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=>{Sp=a.options.x??0,nw=Sp+(a.options.width??1),e>=Sp&&e<nw&&(!i||(a.options.layer??"bottom")===i)&&s(a)})}},gz=class extends $r{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new de),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new de),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()}},_z=1e3,bz=class{constructor(e,t=_z){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,cd=class extends Ge{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new bz(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(`
32
+ `))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Pe(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Dt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<sw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
33
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===sw+1&&(this._liveRegion.textContent+=Ug.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=[],d=l?.translateToString(!0,void 0,void 0,c)||"",m=(i.ydisp+a+1).toString(),f=this._rowElements[a];f&&(d.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=d,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,d;if(t===0?(c=i,d=this._rowElements.pop(),this._rowContainer.removeChild(d)):(c=this._rowElements.shift(),d=i,this._rowContainer.removeChild(c)),c.removeEventListener("focus",this._topBoundaryFocusListener),d.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:d,offset:m})=>{let f=d instanceof Text?d.parentNode:d,g=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(f);if(!b)return console.warn("columns is null. Race condition?"),null;let v=m<b.length?b[m]:b.slice(-1)[0]+1;return v>=this._terminal.cols&&(++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})`}};cd=Ht([ve(1,m_),ve(2,er),ve(3,tr)],cd);var x0=class extends Ge{constructor(e,t,i,s,a){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new de),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new de),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Dt(()=>{ja(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Pe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Pe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Pe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Pe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let a=i[s];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):a.provideLinks(e.y,l=>{if(this._isMouseOut)return;let c=l?.map(d=>({link:d}));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],d=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=d;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(d=>this._linkAtPosition(d.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&&vz(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,ja(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}}};x0=Ht([ve(1,p_),ve(2,tr),ve(3,Vi),ve(4,mk)],x0);function vz(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 yz=class extends hz{constructor(e={}){super(e),this._linkifier=this._register(new Go),this.browser=Ok,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Go),this._onCursorMove=this._register(new de),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new de),this.onKey=this._onKey.event,this._onRender=this._register(new de),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new de),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new de),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new de),this.onBell=this._onBell.event,this._onFocus=this._register(new de),this._onBlur=this._register(new de),this._onA11yCharEmitter=this._register(new de),this._onA11yTabEmitter=this._register(new de),this._onWillOpen=this._register(new de),this._setup(),this._decorationService=this._instantiationService.createInstance(pz),this._instantiationService.setService(Zc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(cB),this._instantiationService.setService(mk,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Fg)),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(`${oe.ESC}]${s};${rz(a)}${Rk.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(cd,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.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(oe.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,d=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=d+"px",this.textarea.style.top=c+"px",this.textarea.style.width=l+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Pe(this.element,"copy",t=>{this.hasSelection()&&E9(t,this._selectionService)}));let e=t=>C9(t,this.textarea,this.coreService,this.optionsService);this._register(Pe(this.textarea,"paste",e)),this._register(Pe(this.element,"paste",e)),Lk?this._register(Pe(this.element,"mousedown",t=>{t.button===2&&mS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Pe(this.element,"contextmenu",t=>{mS(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),w_&&this._register(Pe(this.element,"auxclick",t=>{t.button===1&&rk(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Pe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Pe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Pe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Pe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Pe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Pe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Pe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Pe(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Pg.get()),zk||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(oB,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(er,this._coreBrowserService),this._register(Pe(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Pe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c0,this._document,this._helperContainer),this._instantiationService.setService(Nd,this._charSizeService),this._themeService=this._instantiationService.createInstance(f0),this._instantiationService.setService(Qo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ad),this._instantiationService.setService(fk,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(h0,this.rows,this.screenElement)),this._instantiationService.setService(tr,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(a0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(u0),this._instantiationService.setService(p_,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(x0,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(s0,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(d0,this.element,this.screenElement,s)),this._instantiationService.setService(O9,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(r0,this.screenElement)),this._register(Pe(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(cd,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(rd,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(rd,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l0,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 d,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(d=3,l.button!==void 0&&(d=l.button<3?l.button:3)):d=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,d=l.button<3?l.button:3;break;case"mousedown":m=1,d=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,d=4;break;default:return!1}return m===void 0||d===void 0||d>4?!1:e.coreMouseService.triggerMouseEvent({col:c.col,row:c.row,x:c.x,y:c.y,button:d,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:l=>(i(l),l.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(l)),wheel:l=>(i(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&i(l)},mousemove:l=>{l.buttons||i(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l&8?s.mousemove||(t.addEventListener("mousemove",a.mousemove),s.mousemove=a.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),l&16?s.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),s.wheel=a.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),l&2?s.mouseup||(s.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),l&4?s.mousedrag||(s.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Pe(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return i(l),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(l)})),this._register(Pe(t,"wheel",l=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let c=oe.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){sk(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=fz(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===oe.ETX||i.key===oe.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)&&(xz(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(oe.ESC+"[I"):this.coreService.triggerDataEvent(oe.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(`${oe.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(`${oe.ESC}[6;${a};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function xz(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var Sz=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)}},wz=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 zn)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},rw=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 wz(t)}getNullCell(){return new zn}},Ez=class extends Ge{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new de),this.onBufferChange=this._onBufferChange.event,this._normal=new rw(this._core.buffers.normal,"normal"),this._alternate=new rw(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)}},Cz=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)}},kz=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}},Nz=["cols","rows"],ns=0,Tz=class extends Ge{constructor(e){super(),this._core=this._register(new yz(e)),this._addonManager=this._register(new Sz),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(Nz.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 Cz(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new kz(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 Ez(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
34
+ `,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 Pg.get()},set promptLabel(e){Pg.set(e)},get tooMuchOutput(){return Ug.get()},set tooMuchOutput(e){Ug.set(e)}}}_verifyIntegers(...e){for(ns of e)if(ns===1/0||isNaN(ns)||ns%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ns of e)if(ns&&(ns===1/0||isNaN(ns)||ns%1!==0||ns<0))throw new Error("This API only accepts positive integers")}};function Az({sessionId:e,active:t}){const i=C.useRef(null),s=C.useRef(null),a=C.useRef(null),l=C.useRef(null),[c,d]=C.useState("Local workspace"),[m,f]=C.useState("connecting"),[g,b]=C.useState("Opening shell"),v=C.useCallback(()=>{const x=l.current,w=a.current;if(!x||x.readyState!==WebSocket.OPEN||!w)return;w.fit();const E=w.proposeDimensions();E&&x.send(JSON.stringify({cols:E.cols,rows:E.rows,type:"resize"}))},[]);C.useEffect(()=>{if(!i.current)return;const x=new Tz({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"}}),w=new v9;x.loadAddon(w),x.open(i.current),s.current=x,a.current=w;const E=new WebSocket(Mz(e));l.current=E;const A=x.onData(T=>{E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({data:T,type:"input"}))});return E.addEventListener("open",()=>{f("running"),b("Shell connected"),v()}),E.addEventListener("message",T=>{const M=Rz(T.data);if(M){if(M.type==="output"){x.write(M.data);return}if(M.type==="error"){f("error"),b(M.error);return}f(M.state==="idle"?"connecting":M.state),M.cwd&&d(M.cwd),b(M.error??M.shell??"Shell connected")}}),E.addEventListener("close",()=>{f(T=>T==="exited"?T:"exited"),b("Socket closed")}),E.addEventListener("error",()=>{f("error"),b("Terminal socket error")}),window.addEventListener("resize",v),window.setTimeout(v,0),()=>{window.removeEventListener("resize",v),A.dispose(),E.close(),x.dispose(),l.current=null,s.current=null,a.current=null}},[e,v]),C.useEffect(()=>{if(!t)return;const x=window.setTimeout(()=>{v(),s.current?.focus()},0);return()=>window.clearTimeout(x)},[t,v]);const y=C.useCallback(x=>{const w=l.current;if(!w||w.readyState!==WebSocket.OPEN)return;const E=a.current?.proposeDimensions();w.send(JSON.stringify({cols:E?.cols,rows:E?.rows,...x}))},[]);return h.jsxs("section",{className:me("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[h.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:[h.jsx("div",{className:"min-w-0",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ve,{className:me("border-white/15 bg-white/10 text-white shadow-none",m==="running"&&"border-emerald-400/35 text-emerald-200",m==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:m}),h.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[c," · ",g]})]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(fe,{"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:[h.jsx(O2,{}),"Restart"]}),h.jsxs(fe,{"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:[h.jsx(vd,{}),"Stop"]})]})]}),h.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden p-3",ref:i})]})}function Mz(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function Rz(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function Dz(){const[e,t]=C.useState([]),[i,s]=C.useState(null),[a,l]=C.useState(!1);C.useEffect(()=>{let m=!1;return(async()=>{let f=await lM().catch(()=>[]);if(f.length===0){const g=await Fm().catch(()=>null);f=g?[g]:[]}m||(t(f),s(f[0]?.id??null))})(),()=>{m=!0}},[]);const c=C.useCallback(async()=>{l(!0);try{const m=await Fm();t(f=>[...f,m]),s(m.id)}finally{l(!1)}},[]),d=C.useCallback(async m=>{l(!0);try{await cM(m);const f=e.findIndex(b=>b.id===m),g=e.filter(b=>b.id!==m);if(g.length===0){const b=await Fm();t([b]),s(b.id);return}if(t(g),i===m){const b=g[Math.min(f,g.length-1)];s(b.id)}}finally{l(!1)}},[e,i]);return h.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[h.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)=>h.jsxs("div",{className:me("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===i?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[h.jsxs("button",{"aria-selected":m.id===i,className:"max-w-[160px] truncate font-medium",onClick:()=>s(m.id),role:"tab",type:"button",children:["Terminal ",f+1]}),h.jsx("button",{"aria-label":`Close Terminal ${f+1}`,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:()=>{d(m.id)},type:"button",children:h.jsx(ys,{className:"size-3"})})]},m.id)),h.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:h.jsx(jn,{className:"size-4"})})]}),h.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?h.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>h.jsx("div",{className:"absolute inset-0",children:h.jsx(Az,{active:m.id===i,sessionId:m.id})},m.id))})]})}const Oz=800;function Gk({activeHunkIndex:e=0,diff:t}){const i=jz(t),s=C.useRef([]),[a,l]=C.useState(!1),c=C.useMemo(()=>i.reduce((m,f)=>Math.max(m,f.content.length),0),[i]),d=c>Oz;if(C.useEffect(()=>{l(!1)},[t]),C.useEffect(()=>{if(d&&!a)return;s.current[e]?.scrollIntoView({block:"start",behavior:"smooth"})},[e,t,d,a]),d&&!a){const m=i.filter(g=>g.kind==="add").length,f=i.filter(g=>g.kind==="delete").length;return h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-6",children:h.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[h.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),h.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",c.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),h.jsxs("p",{className:"font-mono text-[11px]",children:[h.jsxs("span",{className:"text-emerald-700",children:["+",m]})," ",h.jsxs("span",{className:"text-red-700",children:["-",f]})," lines changed"]}),h.jsx(fe,{onClick:()=>l(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return h.jsx("div",{className:"absolute inset-0 overflow-auto bg-white text-xs leading-6",children:h.jsx("div",{className:"min-w-full font-mono",children:i.map((m,f)=>h.jsxs("div",{className:me("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",m.kind==="add"&&"bg-emerald-50 text-emerald-800",m.kind==="delete"&&"bg-red-50 text-red-800",aw(i,f)&&m.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:m.hunkIndex!==null&&aw(i,f)?g=>{s.current[m.hunkIndex??0]=g}:void 0,children:[h.jsx(ow,{value:m.oldLine}),h.jsx(ow,{value:m.newLine}),h.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:m.content||" "})]},`${f}-${m.content}`))})})}function Lz(e){return e.split(`
35
+ `).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 jz(e){const t=Bz(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function Bz(e){let t=null,i=null,s=null;return e.split(`
36
+ `).map(a=>{if(zz(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 aw(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 zz(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 ow({value:e}){return h.jsx("span",{className:me("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function Iz({branch:e,error:t,files:i,selectedFile:s,onSelectFile:a,root:l}){const c=C.useMemo(()=>Fz(i).filter(f=>f.files.length),[i]),[d,m]=C.useState({staged:!1,unstaged:!1,untracked:!1});return h.jsxs(ms,{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-none border-0 bg-transparent",children:[h.jsx(ps,{className:"border-b border-border px-2.5 py-1.5",children:h.jsxs(gs,{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx(Nc,{className:"size-3.5"}),h.jsx("span",{className:"truncate",children:"Changes"})]}),h.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?h.jsx(Ve,{variant:"outline",children:e}):null,h.jsx(Ve,{variant:"secondary",children:i.length})]})]})}),h.jsx(_s,{className:"min-h-0 flex-1 overflow-auto p-0",children:c.length?c.map(f=>h.jsx(Pz,{collapsed:d[f.id],group:f,onSelectFile:a,onToggle:()=>m(g=>({...g,[f.id]:!g[f.id]})),root:l,selectedFile:s},f.id)):h.jsx(ut,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function Pz({collapsed:e,group:t,onSelectFile:i,onToggle:s,root:a,selectedFile:l}){const c=e?Yr:vs;return h.jsxs("section",{className:"border-b border-border last:border-b-0",children:[h.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/55 px-2.5 py-1 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:s,type:"button",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx(c,{className:"size-3.5"}),h.jsx("span",{className:"truncate",children:t.label})]}),h.jsx(Ve,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:h.jsx("div",{children:t.files.map(d=>h.jsx(Uz,{active:l===d.path,file:d,group:t.id,onClick:()=>i(d.path),root:a},d.path))})]})}function Uz({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("/"),d=a?GC(qC(a,t.path)):{};return h.jsxs(fe,{className:me("grid h-auto w-full grid-cols-[1fr_auto] items-center gap-2 rounded-none border-b border-border px-2.5 py-1.5 text-left",e&&"bg-muted"),onClick:s,type:"button",variant:"ghost",...d,children:[h.jsxs("span",{className:"min-w-0",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx(u_,{path:t.path}),h.jsx("span",{className:"truncate text-[13px] font-medium",children:l})]}),c?h.jsx("span",{className:"block truncate pl-5 text-[10px] text-muted-foreground",children:c}):null]}),h.jsx("span",{className:me("w-3.5 shrink-0 text-center font-mono text-[11px] font-semibold",i==="untracked"&&"text-amber-700",i==="staged"&&"text-emerald-700",i==="unstaged"&&"text-zinc-800"),children:Hz(t,i)})]})}function Hz(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function Fz(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 $z(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 d="";for(let m=0;m<c.length;m+=1){const f=c[m],g=m===c.length-1,b=d?`${d}/${f}`:f;let v=i.get(b);v||(v={name:f,path:b,children:[],isFile:g},i.set(b,v),i.get(d).children.push(v)),d=b}}const a=l=>{l.children.sort((c,d)=>c.isFile!==d.isFile?c.isFile?1:-1:c.name.localeCompare(d.name)),l.children.forEach(a)};return a(t),t}function Vz({paths:e,status:t,selectedFile:i,onSelectFile:s,branch:a,root:l}){const c=C.useMemo(()=>$z(e),[e]),d=C.useMemo(()=>{const y=new Map;for(const x of t)y.set(x.path,x);return y},[t]),[m,f]=C.useState({"":!0}),[g,b]=C.useState(!1);C.useEffect(()=>{if(g||c.children.length===0)return;const y={"":!0};for(const x of c.children)x.isFile||(y[x.path]=!0);f(y),b(!0)},[g,c.children]);function v(y){f(x=>({...x,[y]:!x[y]}))}return h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[h.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:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[h.jsx(Ia,{className:"size-3.5"}),h.jsx("span",{className:"truncate",children:"Files"})]}),h.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[a?h.jsx(Ve,{variant:"outline",children:a}):null,h.jsx(Ve,{variant:"secondary",children:e.length})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:c.children.length===0?h.jsx(ut,{variant:"muted",className:"m-3 text-center",children:"No tracked files."}):c.children.map(y=>h.jsx(Wk,{depth:0,expanded:m,node:y,onSelectFile:s,onToggle:v,root:l,selectedFile:i,statusByPath:d},y.path))})]})}function Wk({depth:e,expanded:t,node:i,onSelectFile:s,onToggle:a,root:l,selectedFile:c,statusByPath:d}){const m=t[i.path]??!1,f=6+e*12,g=l?GC(qC(l,i.path)):{};if(i.isFile){const y=d.get(i.path),x=c===i.path;return h.jsxs("button",{className:me("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",x&&"bg-muted font-medium"),onClick:()=>s(i.path),style:{paddingLeft:f},type:"button",...g,children:[h.jsx(u_,{path:i.path}),h.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),y?h.jsx(qz,{file:y}):null]})}const b=m?vs:Yr,v=m?bd:Ia;return h.jsxs("div",{children:[h.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:[h.jsx(b,{className:"size-3.5 shrink-0 text-muted-foreground"}),h.jsx(v,{className:"size-3.5 shrink-0 text-amber-600"}),h.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]}),m?i.children.map(y=>h.jsx(Wk,{depth:e+1,expanded:t,node:y,onSelectFile:s,onToggle:a,root:l,selectedFile:c,statusByPath:d},y.path)):null]})}function qz({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 h.jsx("span",{className:me("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}var wp,lw;function Kz(){if(lw)return wp;lw=1;function e(B){return B instanceof Map?B.clear=B.delete=B.set=function(){throw new Error("map is read-only")}:B instanceof Set&&(B.add=B.clear=B.delete=function(){throw new Error("set is read-only")}),Object.freeze(B),Object.getOwnPropertyNames(B).forEach(se=>{const _e=B[se],Ie=typeof _e;(Ie==="object"||Ie==="function")&&!Object.isFrozen(_e)&&e(_e)}),B}class t{constructor(se){se.data===void 0&&(se.data={}),this.data=se.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(B){return B.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(B,...se){const _e=Object.create(null);for(const Ie in B)_e[Ie]=B[Ie];return se.forEach(function(Ie){for(const Ct in Ie)_e[Ct]=Ie[Ct]}),_e}const a="</span>",l=B=>!!B.scope,c=(B,{prefix:se})=>{if(B.startsWith("language:"))return B.replace("language:","language-");if(B.includes(".")){const _e=B.split(".");return[`${se}${_e.shift()}`,..._e.map((Ie,Ct)=>`${Ie}${"_".repeat(Ct+1)}`)].join(" ")}return`${se}${B}`};class d{constructor(se,_e){this.buffer="",this.classPrefix=_e.classPrefix,se.walk(this)}addText(se){this.buffer+=i(se)}openNode(se){if(!l(se))return;const _e=c(se.scope,{prefix:this.classPrefix});this.span(_e)}closeNode(se){l(se)&&(this.buffer+=a)}value(){return this.buffer}span(se){this.buffer+=`<span class="${se}">`}}const m=(B={})=>{const se={children:[]};return Object.assign(se,B),se};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(se){this.top.children.push(se)}openNode(se){const _e=m({scope:se});this.add(_e),this.stack.push(_e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(se){return this.constructor._walk(se,this.rootNode)}static _walk(se,_e){return typeof _e=="string"?se.addText(_e):_e.children&&(se.openNode(_e),_e.children.forEach(Ie=>this._walk(se,Ie)),se.closeNode(_e)),se}static _collapse(se){typeof se!="string"&&se.children&&(se.children.every(_e=>typeof _e=="string")?se.children=[se.children.join("")]:se.children.forEach(_e=>{f._collapse(_e)}))}}class g extends f{constructor(se){super(),this.options=se}addText(se){se!==""&&this.add(se)}startScope(se){this.openNode(se)}endScope(){this.closeNode()}__addSublanguage(se,_e){const Ie=se.root;_e&&(Ie.scope=`language:${_e}`),this.add(Ie)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(B){return B?typeof B=="string"?B:B.source:null}function v(B){return w("(?=",B,")")}function y(B){return w("(?:",B,")*")}function x(B){return w("(?:",B,")?")}function w(...B){return B.map(_e=>b(_e)).join("")}function E(B){const se=B[B.length-1];return typeof se=="object"&&se.constructor===Object?(B.splice(B.length-1,1),se):{}}function A(...B){return"("+(E(B).capture?"":"?:")+B.map(Ie=>b(Ie)).join("|")+")"}function T(B){return new RegExp(B.toString()+"|").exec("").length-1}function M(B,se){const _e=B&&B.exec(se);return _e&&_e.index===0}const R=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function z(B,{joinWith:se}){let _e=0;return B.map(Ie=>{_e+=1;const Ct=_e;let yt=b(Ie),Ne="";for(;yt.length>0;){const ye=R.exec(yt);if(!ye){Ne+=yt;break}Ne+=yt.substring(0,ye.index),yt=yt.substring(ye.index+ye[0].length),ye[0][0]==="\\"&&ye[1]?Ne+="\\"+String(Number(ye[1])+Ct):(Ne+=ye[0],ye[0]==="("&&_e++)}return Ne}).map(Ie=>`(${Ie})`).join(se)}const U=/\b\B/,j="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",H="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",G="\\b(0b[01]+)",J="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",P=(B={})=>{const se=/^#![ ]*\//;return B.binary&&(B.begin=w(se,/.*\b/,B.binary,/\b.*/)),s({scope:"meta",begin:se,end:/$/,relevance:0,"on:begin":(_e,Ie)=>{_e.index!==0&&Ie.ignoreMatch()}},B)},ee={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ee]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ee]},F={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/},$=function(B,se,_e={}){const Ie=s({scope:"comment",begin:B,end:se,contains:[]},_e);Ie.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ct=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ie.contains.push({begin:w(/[ ]+/,"(",Ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},Z=$("//","$"),W=$("/\\*","\\*/"),D=$("#","$"),ie={scope:"number",begin:K,relevance:0},ce={scope:"number",begin:H,relevance:0},le={scope:"number",begin:G,relevance:0},he={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ee,{begin:/\[/,end:/\]/,relevance:0,contains:[ee]}]},ge={scope:"title",begin:j,relevance:0},Se={scope:"title",begin:O,relevance:0},ze={begin:"\\.\\s*"+O,relevance:0};var st=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:ee,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:G,COMMENT:$,C_BLOCK_COMMENT_MODE:W,C_LINE_COMMENT_MODE:Z,C_NUMBER_MODE:ce,C_NUMBER_RE:H,END_SAME_AS_BEGIN:function(B){return Object.assign(B,{"on:begin":(se,_e)=>{_e.data._beginMatch=se[1]},"on:end":(se,_e)=>{_e.data._beginMatch!==se[1]&&_e.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:j,MATCH_NOTHING_RE:U,METHOD_GUARD:ze,NUMBER_MODE:ie,NUMBER_RE:K,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:N,REGEXP_MODE:he,RE_STARTERS_RE:J,SHEBANG:P,TITLE_MODE:ge,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:Se});function ot(B,se){B.input[B.index-1]==="."&&se.ignoreMatch()}function lt(B,se){B.className!==void 0&&(B.scope=B.className,delete B.className)}function Be(B,se){se&&B.beginKeywords&&(B.begin="\\b("+B.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",B.__beforeBegin=ot,B.keywords=B.keywords||B.beginKeywords,delete B.beginKeywords,B.relevance===void 0&&(B.relevance=0))}function Ft(B,se){Array.isArray(B.illegal)&&(B.illegal=A(...B.illegal))}function Qr(B,se){if(B.match){if(B.begin||B.end)throw new Error("begin & end are not supported with match");B.begin=B.match,delete B.match}}function xs(B,se){B.relevance===void 0&&(B.relevance=1)}const Fa=(B,se)=>{if(!B.beforeMatch)return;if(B.starts)throw new Error("beforeMatch cannot be used with starts");const _e=Object.assign({},B);Object.keys(B).forEach(Ie=>{delete B[Ie]}),B.keywords=_e.keywords,B.begin=w(_e.beforeMatch,v(_e.begin)),B.starts={relevance:0,contains:[Object.assign(_e,{endsParent:!0})]},B.relevance=0,delete _e.beforeMatch},Jr=["of","and","for","in","not","or","if","then","parent","list","value"],ea="keyword";function ir(B,se,_e=ea){const Ie=Object.create(null);return typeof B=="string"?Ct(_e,B.split(" ")):Array.isArray(B)?Ct(_e,B):Object.keys(B).forEach(function(yt){Object.assign(Ie,ir(B[yt],se,yt))}),Ie;function Ct(yt,Ne){se&&(Ne=Ne.map(ye=>ye.toLowerCase())),Ne.forEach(function(ye){const je=ye.split("|");Ie[je[0]]=[yt,Ss(je[0],je[1])]})}}function Ss(B,se){return se?Number(se):tl(B)?0:1}function tl(B){return Jr.includes(B.toLowerCase())}const $a={},Ot=B=>{console.error(B)},ws=(B,...se)=>{console.log(`WARN: ${B}`,...se)},yi=(B,se)=>{$a[`${B}/${se}`]||(console.log(`Deprecated as of ${B}. ${se}`),$a[`${B}/${se}`]=!0)},Es=new Error;function Cs(B,se,{key:_e}){let Ie=0;const Ct=B[_e],yt={},Ne={};for(let ye=1;ye<=se.length;ye++)Ne[ye+Ie]=Ct[ye],yt[ye+Ie]=!0,Ie+=T(se[ye-1]);B[_e]=Ne,B[_e]._emit=yt,B[_e]._multi=!0}function Va(B){if(Array.isArray(B.begin)){if(B.skip||B.excludeBegin||B.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Es;if(typeof B.beginScope!="object"||B.beginScope===null)throw Ot("beginScope must be object"),Es;Cs(B,B.begin,{key:"beginScope"}),B.begin=z(B.begin,{joinWith:""})}}function nr(B){if(Array.isArray(B.end)){if(B.skip||B.excludeEnd||B.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Es;if(typeof B.endScope!="object"||B.endScope===null)throw Ot("endScope must be object"),Es;Cs(B,B.end,{key:"endScope"}),B.end=z(B.end,{joinWith:""})}}function il(B){B.scope&&typeof B.scope=="object"&&B.scope!==null&&(B.beginScope=B.scope,delete B.scope)}function qa(B){il(B),typeof B.beginScope=="string"&&(B.beginScope={_wrap:B.beginScope}),typeof B.endScope=="string"&&(B.endScope={_wrap:B.endScope}),Va(B),nr(B)}function ks(B){function se(Ne,ye){return new RegExp(b(Ne),"m"+(B.case_insensitive?"i":"")+(B.unicodeRegex?"u":"")+(ye?"g":""))}class _e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ye,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,ye]),this.matchAt+=T(ye)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ye=this.regexes.map(je=>je[1]);this.matcherRe=se(z(ye,{joinWith:"|"}),!0),this.lastIndex=0}exec(ye){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(ye);if(!je)return null;const $t=je.findIndex((Ns,Ga)=>Ga>0&&Ns!==void 0),Mt=this.matchIndexes[$t];return je.splice(0,$t),Object.assign(je,Mt)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ye){if(this.multiRegexes[ye])return this.multiRegexes[ye];const je=new _e;return this.rules.slice(ye).forEach(([$t,Mt])=>je.addRule($t,Mt)),je.compile(),this.multiRegexes[ye]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ye,je){this.rules.push([ye,je]),je.type==="begin"&&this.count++}exec(ye){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let $t=je.exec(ye);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const Mt=this.getMatcher(0);Mt.lastIndex=this.lastIndex+1,$t=Mt.exec(ye)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Ct(Ne){const ye=new Ie;return Ne.contains.forEach(je=>ye.addRule(je.begin,{rule:je,type:"begin"})),Ne.terminatorEnd&&ye.addRule(Ne.terminatorEnd,{type:"end"}),Ne.illegal&&ye.addRule(Ne.illegal,{type:"illegal"}),ye}function yt(Ne,ye){const je=Ne;if(Ne.isCompiled)return je;[lt,Qr,qa,Fa].forEach(Mt=>Mt(Ne,ye)),B.compilerExtensions.forEach(Mt=>Mt(Ne,ye)),Ne.__beforeBegin=null,[Be,Ft,xs].forEach(Mt=>Mt(Ne,ye)),Ne.isCompiled=!0;let $t=null;return typeof Ne.keywords=="object"&&Ne.keywords.$pattern&&(Ne.keywords=Object.assign({},Ne.keywords),$t=Ne.keywords.$pattern,delete Ne.keywords.$pattern),$t=$t||/\w+/,Ne.keywords&&(Ne.keywords=ir(Ne.keywords,B.case_insensitive)),je.keywordPatternRe=se($t,!0),ye&&(Ne.begin||(Ne.begin=/\B|\b/),je.beginRe=se(je.begin),!Ne.end&&!Ne.endsWithParent&&(Ne.end=/\B|\b/),Ne.end&&(je.endRe=se(je.end)),je.terminatorEnd=b(je.end)||"",Ne.endsWithParent&&ye.terminatorEnd&&(je.terminatorEnd+=(Ne.end?"|":"")+ye.terminatorEnd)),Ne.illegal&&(je.illegalRe=se(Ne.illegal)),Ne.contains||(Ne.contains=[]),Ne.contains=[].concat(...Ne.contains.map(function(Mt){return yn(Mt==="self"?Ne:Mt)})),Ne.contains.forEach(function(Mt){yt(Mt,je)}),Ne.starts&&yt(Ne.starts,ye),je.matcher=Ct(je),je}if(B.compilerExtensions||(B.compilerExtensions=[]),B.contains&&B.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return B.classNameAliases=s(B.classNameAliases||{}),yt(B)}function fi(B){return B?B.endsWithParent||fi(B.starts):!1}function yn(B){return B.variants&&!B.cachedVariants&&(B.cachedVariants=B.variants.map(function(se){return s(B,{variants:null},se)})),B.cachedVariants?B.cachedVariants:fi(B)?s(B,{starts:B.starts?s(B.starts):null}):Object.isFrozen(B)?s(B):B}var xi="11.11.1";class nl extends Error{constructor(se,_e){super(se),this.name="HTMLInjectionError",this.html=_e}}const ta=i,Ka=s,tt=Symbol("nomatch"),Hn=7,rn=function(B){const se=Object.create(null),_e=Object.create(null),Ie=[];let Ct=!0;const yt="Could not find the language '{}', did you forget to load/include a language module?",Ne={disableAutodetect:!0,name:"Plain text",contains:[]};let ye={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function je(ue){return ye.noHighlightRe.test(ue)}function $t(ue){let Me=ue.className+" ";Me+=ue.parentNode?ue.parentNode.className:"";const We=ye.languageDetectRe.exec(Me);if(We){const ht=Ii(We[1]);return ht||(ws(yt.replace("{}",We[1])),ws("Falling back to no-highlight mode for this block.",ue)),ht?We[1]:"no-highlight"}return Me.split(/\s+/).find(ht=>je(ht)||Ii(ht))}function Mt(ue,Me,We){let ht="",qt="";typeof Me=="object"?(ht=ue,We=Me.ignoreIllegals,qt=Me.language):(yi("10.7.0","highlight(lang, code, ...args) has been deprecated."),yi("10.7.0",`Please use highlight(code, options) instead.
37
+ https://github.com/highlightjs/highlight.js/issues/2277`),qt=ue,ht=Me),We===void 0&&(We=!0);const Oi={code:ht,language:qt};na("before:highlight",Oi);const an=Oi.result?Oi.result:Ns(Oi.language,Oi.code,We);return an.code=Oi.code,na("after:highlight",an),an}function Ns(ue,Me,We,ht){const qt=Object.create(null);function Oi(pe,Te){return pe.keywords[Te]}function an(){if(!Le.keywords){Xt.addText(dt);return}let pe=0;Le.keywordPatternRe.lastIndex=0;let Te=Le.keywordPatternRe.exec(dt),He="";for(;Te;){He+=dt.substring(pe,Te.index);const Ze=Si.case_insensitive?Te[0].toLowerCase():Te[0],Lt=Oi(Le,Ze);if(Lt){const[xn,cl]=Lt;if(Xt.addText(He),He="",qt[Ze]=(qt[Ze]||0)+1,qt[Ze]<=Hn&&(or+=cl),xn.startsWith("_"))He+=Te[0];else{const ou=Si.classNameAliases[xn]||xn;on(Te[0],ou)}}else He+=Te[0];pe=Le.keywordPatternRe.lastIndex,Te=Le.keywordPatternRe.exec(dt)}He+=dt.substring(pe),Xt.addText(He)}function Ki(){if(dt==="")return;let pe=null;if(typeof Le.subLanguage=="string"){if(!se[Le.subLanguage]){Xt.addText(dt);return}pe=Ns(Le.subLanguage,dt,!0,au[Le.subLanguage]),au[Le.subLanguage]=pe._top}else pe=Wa(dt,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(or+=pe.relevance),Xt.__addSublanguage(pe._emitter,pe.language)}function Et(){Le.subLanguage!=null?Ki():an(),dt=""}function on(pe,Te){pe!==""&&(Xt.startScope(Te),Xt.addText(pe),Xt.endScope())}function su(pe,Te){let He=1;const Ze=Te.length-1;for(;He<=Ze;){if(!pe._emit[He]){He++;continue}const Lt=Si.classNameAliases[pe[He]]||pe[He],xn=Te[He];Lt?on(xn,Lt):(dt=xn,an(),dt=""),He++}}function Xa(pe,Te){return pe.scope&&typeof pe.scope=="string"&&Xt.openNode(Si.classNameAliases[pe.scope]||pe.scope),pe.beginScope&&(pe.beginScope._wrap?(on(dt,Si.classNameAliases[pe.beginScope._wrap]||pe.beginScope._wrap),dt=""):pe.beginScope._multi&&(su(pe.beginScope,Te),dt="")),Le=Object.create(pe,{parent:{value:Le}}),Le}function al(pe,Te,He){let Ze=M(pe.endRe,He);if(Ze){if(pe["on:end"]){const Lt=new t(pe);pe["on:end"](Te,Lt),Lt.isMatchIgnored&&(Ze=!1)}if(Ze){for(;pe.endsParent&&pe.parent;)pe=pe.parent;return pe}}if(pe.endsWithParent)return al(pe.parent,Te,He)}function Za(pe){return Le.matcher.regexIndex===0?(dt+=pe[0],1):(lr=!0,0)}function Od(pe){const Te=pe[0],He=pe.rule,Ze=new t(He),Lt=[He.__beforeBegin,He["on:begin"]];for(const xn of Lt)if(xn&&(xn(pe,Ze),Ze.isMatchIgnored))return Za(Te);return He.skip?dt+=Te:(He.excludeBegin&&(dt+=Te),Et(),!He.returnBegin&&!He.excludeBegin&&(dt=Te)),Xa(He,pe),He.returnBegin?0:Te.length}function Gi(pe){const Te=pe[0],He=Me.substring(pe.index),Ze=al(Le,pe,He);if(!Ze)return tt;const Lt=Le;Le.endScope&&Le.endScope._wrap?(Et(),on(Te,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(Et(),su(Le.endScope,pe)):Lt.skip?dt+=Te:(Lt.returnEnd||Lt.excludeEnd||(dt+=Te),Et(),Lt.excludeEnd&&(dt=Te));do Le.scope&&Xt.closeNode(),!Le.skip&&!Le.subLanguage&&(or+=Le.relevance),Le=Le.parent;while(Le!==Ze.parent);return Ze.starts&&Xa(Ze.starts,pe),Lt.returnEnd?0:Te.length}function ol(){const pe=[];for(let Te=Le;Te!==Si;Te=Te.parent)Te.scope&&pe.unshift(Te.scope);pe.forEach(Te=>Xt.openNode(Te))}let sa={};function Qa(pe,Te){const He=Te&&Te[0];if(dt+=pe,He==null)return Et(),0;if(sa.type==="begin"&&Te.type==="end"&&sa.index===Te.index&&He===""){if(dt+=Me.slice(Te.index,Te.index+1),!Ct){const Ze=new Error(`0 width match regex (${ue})`);throw Ze.languageName=ue,Ze.badRule=sa.rule,Ze}return 1}if(sa=Te,Te.type==="begin")return Od(Te);if(Te.type==="illegal"&&!We){const Ze=new Error('Illegal lexeme "'+He+'" for mode "'+(Le.scope||"<unnamed>")+'"');throw Ze.mode=Le,Ze}else if(Te.type==="end"){const Ze=Gi(Te);if(Ze!==tt)return Ze}if(Te.type==="illegal"&&He==="")return dt+=`
38
+ `,1;if(ll>1e5&&ll>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return dt+=He,He.length}const Si=Ii(ue);if(!Si)throw Ot(yt.replace("{}",ue)),new Error('Unknown language: "'+ue+'"');const ru=ks(Si);let Ja="",Le=ht||ru;const au={},Xt=new ye.__emitter(ye);ol();let dt="",or=0,Ms=0,ll=0,lr=!1;try{if(Si.__emitTokens)Si.__emitTokens(Me,Xt);else{for(Le.matcher.considerAll();;){ll++,lr?lr=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=Ms;const pe=Le.matcher.exec(Me);if(!pe)break;const Te=Me.substring(Ms,pe.index),He=Qa(Te,pe);Ms=pe.index+He}Qa(Me.substring(Ms))}return Xt.finalize(),Ja=Xt.toHTML(),{language:ue,value:Ja,relevance:or,illegal:!1,_emitter:Xt,_top:Le}}catch(pe){if(pe.message&&pe.message.includes("Illegal"))return{language:ue,value:ta(Me),illegal:!0,relevance:0,_illegalBy:{message:pe.message,index:Ms,context:Me.slice(Ms-100,Ms+100),mode:pe.mode,resultSoFar:Ja},_emitter:Xt};if(Ct)return{language:ue,value:ta(Me),illegal:!1,relevance:0,errorRaised:pe,_emitter:Xt,_top:Le};throw pe}}function Ga(ue){const Me={value:ta(ue),illegal:!1,relevance:0,_top:Ne,_emitter:new ye.__emitter(ye)};return Me._emitter.addText(ue),Me}function Wa(ue,Me){Me=Me||ye.languages||Object.keys(se);const We=Ga(ue),ht=Me.filter(Ii).filter(rr).map(Et=>Ns(Et,ue,!1));ht.unshift(We);const qt=ht.sort((Et,on)=>{if(Et.relevance!==on.relevance)return on.relevance-Et.relevance;if(Et.language&&on.language){if(Ii(Et.language).supersetOf===on.language)return 1;if(Ii(on.language).supersetOf===Et.language)return-1}return 0}),[Oi,an]=qt,Ki=Oi;return Ki.secondBest=an,Ki}function Xn(ue,Me,We){const ht=Me&&_e[Me]||We;ue.classList.add("hljs"),ue.classList.add(`language-${ht}`)}function Vt(ue){let Me=null;const We=$t(ue);if(je(We))return;if(na("before:highlightElement",{el:ue,language:We}),ue.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ue);return}if(ue.children.length>0&&(ye.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(ue)),ye.throwUnescapedHTML))throw new nl("One of your code blocks includes unescaped HTML.",ue.innerHTML);Me=ue;const ht=Me.textContent,qt=We?Mt(ht,{language:We,ignoreIllegals:!0}):Wa(ht);ue.innerHTML=qt.value,ue.dataset.highlighted="yes",Xn(ue,We,qt.language),ue.result={language:qt.language,re:qt.relevance,relevance:qt.relevance},qt.secondBest&&(ue.secondBest={language:qt.secondBest.language,relevance:qt.secondBest.relevance}),na("after:highlightElement",{el:ue,result:qt,text:ht})}function Di(ue){ye=Ka(ye,ue)}const sr=()=>{Ya(),yi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function sl(){Ya(),yi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let tu=!1;function Ya(){function ue(){Ya()}if(document.readyState==="loading"){tu||window.addEventListener("DOMContentLoaded",ue,!1),tu=!0;return}document.querySelectorAll(ye.cssSelector).forEach(Vt)}function iu(ue,Me){let We=null;try{We=Me(B)}catch(ht){if(Ot("Language definition for '{}' could not be registered.".replace("{}",ue)),Ct)Ot(ht);else throw ht;We=Ne}We.name||(We.name=ue),se[ue]=We,We.rawDefinition=Me.bind(null,B),We.aliases&&Ts(We.aliases,{languageName:ue})}function ia(ue){delete se[ue];for(const Me of Object.keys(_e))_e[Me]===ue&&delete _e[Me]}function rl(){return Object.keys(se)}function Ii(ue){return ue=(ue||"").toLowerCase(),se[ue]||se[_e[ue]]}function Ts(ue,{languageName:Me}){typeof ue=="string"&&(ue=[ue]),ue.forEach(We=>{_e[We.toLowerCase()]=Me})}function rr(ue){const Me=Ii(ue);return Me&&!Me.disableAutodetect}function ar(ue){ue["before:highlightBlock"]&&!ue["before:highlightElement"]&&(ue["before:highlightElement"]=Me=>{ue["before:highlightBlock"](Object.assign({block:Me.el},Me))}),ue["after:highlightBlock"]&&!ue["after:highlightElement"]&&(ue["after:highlightElement"]=Me=>{ue["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Yt(ue){ar(ue),Ie.push(ue)}function nu(ue){const Me=Ie.indexOf(ue);Me!==-1&&Ie.splice(Me,1)}function na(ue,Me){const We=ue;Ie.forEach(function(ht){ht[We]&&ht[We](Me)})}function As(ue){return yi("10.7.0","highlightBlock will be removed entirely in v12.0"),yi("10.7.0","Please use highlightElement now."),Vt(ue)}Object.assign(B,{highlight:Mt,highlightAuto:Wa,highlightAll:Ya,highlightElement:Vt,highlightBlock:As,configure:Di,initHighlighting:sr,initHighlightingOnLoad:sl,registerLanguage:iu,unregisterLanguage:ia,listLanguages:rl,getLanguage:Ii,registerAliases:Ts,autoDetection:rr,inherit:Ka,addPlugin:Yt,removePlugin:nu}),B.debugMode=function(){Ct=!1},B.safeMode=function(){Ct=!0},B.versionString=xi,B.regex={concat:w,lookahead:v,either:A,optional:x,anyNumberOfTimes:y};for(const ue in st)typeof st[ue]=="object"&&e(st[ue]);return Object.assign(B,st),B},Ri=rn({});return Ri.newInstance=()=>rn({}),wp=Ri,Ri.HighlightJS=Ri,Ri.default=Ri,wp}var Ep,cw;function Gz(){if(cw)return Ep;cw=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/}]},d=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,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,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 Ep=e,Ep}var Cp,uw;function Wz(){if(uw)return Cp;uw=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"}}),d={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:/'/},b={match:/\\'/},v={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,s]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=t.SHEBANG({binary:`(${y.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},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],A=["true","false"],T={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["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"],U=["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:E,literal:A,built_in:[...M,...R,"set","shopt",...z,...U]},contains:[x,t.SHEBANG(),w,v,c,d,T,m,f,g,b,s]}}return Cp=e,Cp}var kp,hw;function Yz(){if(hw)return kp;hw=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="("+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})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},x=i.optional(l)+t.IDENT_RE+"\\s*\\(",A={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[v,m,s,t.C_BLOCK_COMMENT_MODE,b,g],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:T.concat([{begin:/\(/,end:/\)/,keywords:A,contains:T.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+d+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[t.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,g,b,m,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,g,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:A,disableAutodetect:!0,illegal:"</",contains:[].concat(M,R,T,[v,{begin:t.IDENT_RE+"::",keywords:A},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:g,keywords:A}}}return kp=e,kp}var Np,dw;function Xz(){if(dw)return Np;dw=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!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})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(g,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:i.optional(l)+t.IDENT_RE,relevance:0},x=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"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["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"],z={type:E,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},U={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},j=[U,v,m,s,t.C_BLOCK_COMMENT_MODE,b,g],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:j.concat([{begin:/\(/,end:/\)/,keywords:z,contains:j.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+d+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:z,relevance:0},{begin:x,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[g,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,g,b,m,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,g,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(O,K,U,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:z,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Np=e,Np}var Tp,fw;function Zz(){if(fw)return Tp;fw=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"],d={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},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},v=t.inherit(b,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},x=t.inherit(y,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,x]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},A=t.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});y.contains=[E,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],x.contains=[A,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[g,E,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},R=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",z={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,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,M,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,M,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:"("+R+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[T,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},z]}}return Tp=e,Tp}var Ap,mw;function Qz(){if(mw)return Ap;mw=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(),d=["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,b=e(f),v={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},y="and or not only",x=/@-?\w[\w]*(-\w+)*/,w="[a-zA-Z-][a-zA-Z0-9_-]*",E=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,v,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+w,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,...E,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...E,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:g.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:x},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...E,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b"}]}}return Ap=m,Ap}var Mp,pw;function Jz(){if(pw)return Mp;pw=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},d={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}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},v=t.inherit(g,{contains:[]}),y=t.inherit(b,{contains:[]});g.contains.push(y),b.contains.push(v);let x=[s,f];return[g,b,v,y].forEach(T=>{T.contains=T.contains.concat(x)}),x=x.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},s,c,g,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,a,f,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Mp=e,Mp}var Rp,gw;function eI(){if(gw)return Rp;gw=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 Rp=e,Rp}var Dp,_w;function tI(){if(_w)return Dp;_w=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+)*/),d={"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)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:d},v={className:"string",contains:[t.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},y="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${x}))?([eE][+-]?(${x})|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"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},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:d},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:d},{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:[E]},{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:d},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,g),relevance:0}].concat(f,g);b.contains=j,E.contains=j;const G=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:j}}];return g.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(G).concat(g).concat(j)}}return Dp=e,Dp}var Op,bw;function iI(){if(bw)return Op;bw=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 Op=e,Op}var Lp,vw;function nI(){if(vw)return Lp;vw=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 Lp=e,Lp}var jp,yw;function sI(){if(yw)return jp;yw=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/},d={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,d,s,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,g=/"(\\"|[^"])*"/,b=/'[^']*'/,v=i.either(f,g,b),y=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:y,className:"attr",starts:{end:/$/,contains:[a,m,c,l,d,s]}}]}}return jp=e,jp}var Bp,xw;function rI(){if(xw)return Bp;xw=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,d,m){return m===-1?"":c.replace(d,f=>a(c,d,m-1))}function l(c){const d=c.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",f=m+a("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),x={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"]}]},E={className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:x,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:[d.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[E,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:x,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:x,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 Bp=l,Bp}var zp,Sw;function aI(){if(Sw)return zp;Sw=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"],d=[].concat(l,s,a);function m(f){const g=f.regex,b=(Se,{after:ze})=>{const Ee="</"+Se[0].slice(1);return Se.input.indexOf(Ee,ze)!==-1},v=e,y={begin:"<>",end:"</>"},x=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Se,ze)=>{const Ee=Se[0].length+Se.index,st=Se.input[Ee];if(st==="<"||st===","){ze.ignoreMatch();return}st===">"&&(b(Se,{after:Ee})||ze.ignoreMatch());let ot;const lt=Se.input.substring(Ee);if(ot=lt.match(/^\s*=/)){ze.ignoreMatch();return}if((ot=lt.match(/^\s+extends\s+/))&&ot.index===0){ze.ignoreMatch();return}}},E={$pattern:e,keyword:t,literal:i,built_in:d,"variable.language":c},A="[0-9](_?[0-9])*",T=`\\.(${A})`,M="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",R={className:"number",variants:[{begin:`(\\b(${M})((${T})|\\.)?|(${T}))[eE][+-]?(${A})\\b`},{begin:`\\b(${M})\\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},z={className:"subst",begin:"\\$\\{",end:"\\}",keywords:E,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,z],subLanguage:"xml"}},j={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,z],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,z],subLanguage:"graphql"}},K={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,z]},G={className:"comment",variants:[f.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:v+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),f.C_BLOCK_COMMENT_MODE,f.C_LINE_COMMENT_MODE]},J=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,U,j,O,K,{match:/\$\d+/},R];z.contains=J.concat({begin:/\{/,end:/\}/,keywords:E,contains:["self"].concat(J)});const P=[].concat(G,z.contains),ee=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:E,contains:["self"].concat(P)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:ee},N={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"}}]},F={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]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Z={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(Se){return g.concat("(?!",Se.join("|"),")")}const ie={match:g.concat(/\b/,D([...l,"super","import"].map(Se=>`${Se}\\s*\\(`)),v,g.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:g.concat(/\./,g.lookahead(g.concat(v,/(?![0-9A-Za-z$_(])/))),end:v,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},he="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",ge={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(he)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:E,exports:{PARAMS_CONTAINS:ee,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,U,j,O,K,G,{match:/\$\d+/},R,F,{scope:"attr",match:v+g.lookahead(":"),relevance:0},ge,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,f.REGEXP_MODE,{className:"function",begin:he,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:f.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:ee}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:x},{begin:w.begin,"on:begin":w.isTrulyOpeningTag,end:w.end}],subLanguage:"xml",contains:[{begin:w.begin,end:w.end,skip:!0,contains:["self"]}]}]},Z,{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},ce,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},ie,W,N,le,{match:/\$[(.]/}]}}return zp=m,zp}var Ip,ww;function oI(){if(ww)return Ip;ww=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 Ip=e,Ip}var Pp,Ew;function lI(){if(Ew)return Pp;Ew=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"},d={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},b={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(b);const v={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},y={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(b,{className:"string"}),"self"]}]},x=s,w=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),E={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},A=E;return A.variants[1].contains=[E],E.variants[1].contains=[A],{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,d,m,v,y,{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:[E,l.C_LINE_COMMENT_MODE,w],relevance:0},l.C_LINE_COMMENT_MODE,w,v,y,b,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,y]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
39
+ `},x]}}return Pp=a,Pp}var Up,Cw;function cI(){if(Cw)return Up;Cw=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(),d=["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 b=e(g),v=m,y="and or not only",x="[\\w-]+",w="("+x+"|@\\{"+x+"\\})",E=[],A=[],T=function(P){return{className:"string",begin:"~?"+P+".*?"+P}},M=function(P,ee,q){return{className:P,begin:ee,relevance:q}},R={$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},z={begin:"\\(",end:"\\)",contains:A,keywords:R,relevance:0};A.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,T("'"),T('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.HEXCOLOR,z,M("variable","@@?"+x,10),M("variable","@\\{"+x+"\\}"),M("built_in","~?`[^`]*?`"),{className:"attribute",begin:x+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const U=A.concat({begin:/\{/,end:/\}/,contains:E}),j={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(A)},O={begin:w+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:A}}]},K={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:R,returnEnd:!0,contains:A,relevance:0}},H={className:"variable",variants:[{begin:"@"+x+"\\s*:",relevance:15},{begin:"@"+x}],starts:{end:"[;}]",returnEnd:!0,contains:U}},G={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,M("keyword","all\\b"),M("variable","@\\{"+x+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,M("selector-tag",w,0),M("selector-id","#"+w),M("selector-class","\\."+w,0),M("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:U},{begin:"!important"},b.FUNCTION_DISPATCH]},J={begin:x+`:(:)?(${v.join("|")})`,returnBegin:!0,contains:[G]};return E.push(g.C_LINE_COMMENT_MODE,g.C_BLOCK_COMMENT_MODE,K,H,J,O,G,j,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:E}}return Up=f,Up}var Hp,kw;function uI(){if(kw)return Hp;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 Hp=e,Hp}var Fp,Nw;function hI(){if(Nw)return Fp;Nw=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"}},d={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,d]}}return Fp=e,Fp}var $p,Tw;function dI(){if(Tw)return $p;Tw=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},d={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},b=[t.BACKSLASH_ESCAPE,c,f],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(E,A,T="\\1")=>{const M=T==="\\1"?T:i.concat(T,A);return i.concat(i.concat("(?:",E,")"),A,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,T,a)},x=(E,A,T)=>i.concat(i.concat("(?:",E,")"),A,/(?:\\.|[^\\\/])*?/,T,a),w=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},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:y("s|tr|y",i.either(...v,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",i.either(...v,{capture:!0}),/\1/)},{begin:x("m|qr",/\(/,/\)/)},{begin:x("m|qr",/\[/,/\]/)},{begin:x("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,d.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:w}}return $p=e,$p}var Vp,Aw;function fI(){if(Aw)return Vp;Aw=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 Vp=e,Vp}var qp,Mw;function mI(){if(Mw)return qp;Mw=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),d={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}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),v={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(q,N)=>{N.data._beginMatch=q[1]||q[2]},"on:end":(q,N)=>{N.data._beginMatch!==q[1]&&N.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
40
+ ]`,w={scope:"string",variants:[b,g,v,y]},E={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},A=["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"],M=["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"],z={keyword:T,literal:(q=>{const N=[];return q.forEach(F=>{N.push(F),F.toLowerCase()===F?N.push(F.toUpperCase()):N.push(F.toLowerCase())}),N})(A),built_in:M},U=q=>q.map(N=>N.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,i.concat(x,"+"),i.concat("(?!",U(M).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},O=i.concat(a,"\\b(?!\\()"),K={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,i.concat(/::/,i.lookahead(/(?!class\b)/)),O],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"}}]},H={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},G={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[H,d,K,t.C_BLOCK_COMMENT_MODE,w,E,j]},J={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",U(T).join("\\b|"),"|",U(M).join("\\b|"),"\\b)"),a,i.concat(x,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[G]};G.contains.push(J);const P=[H,K,t.C_BLOCK_COMMENT_MODE,w,E,j],ee={begin:i.concat(/#\[\s*\\?/,i.either(l,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:A,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:A,keyword:["new","array"]},contains:["self",...P]},...P,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:z,contains:[ee,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/},d,J,K,{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:z,contains:["self",ee,d,K,t.C_BLOCK_COMMENT_MODE,w,E]}]},{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,E]}}return qp=e,qp}var Kp,Rw;function pI(){if(Rw)return Kp;Rw=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 Kp=e,Kp}var Gp,Dw;function gI(){if(Dw)return Gp;Dw=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Gp=e,Gp}var Wp,Ow;function _I(){if(Ow)return Wp;Ow=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:/#/},b={begin:/\{\{/,relevance:0},v={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,b,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,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",x=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,w=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${x}))[eE][+-]?(${y})[jJ]?(?=${w})`},{begin:`(${x})[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(${y})[jJ](?=${w})`}]},A={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,E,v,t.HASH_COMMENT_MODE]}]};return g.contains=[v,E,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},v,A,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:[E,T,v]}]}}return Wp=e,Wp}var Yp,Lw;function bI(){if(Lw)return Yp;Lw=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return Yp=e,Yp}var Xp,jw;function vI(){if(jw)return Xp;jw=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 Xp=e,Xp}var Zp,Bw;function yI(){if(Bw)return Zp;Bw=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*\(/))},d="([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!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:m,literal:f,built_in: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_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],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:b}},{className:"punctuation",begin:"->"},c]}}return Zp=e,Zp}var Qp,zw;function xI(){if(zw)return Qp;zw=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(),d=["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),b=c,v=l,y="@[a-z-]+",x="and or not only",E={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:":(:)?("+b.join("|")+")"},E,{begin:/\(/,end:/\)/,contains:[g.CSS_NUMBER_MODE]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.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,E,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:y,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},contains:[{begin:y,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},E,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,g.HEXCOLOR,g.CSS_NUMBER_MODE]},g.FUNCTION_DISPATCH]}}return Qp=m,Qp}var Jp,Iw;function SI(){if(Iw)return Jp;Iw=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 Jp=e,Jp}var eg,Pw;function wI(){if(Pw)return eg;Pw=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"],d=["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"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],v=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["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"],x=b,w=[...g,...f].filter(U=>!b.includes(U)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},A={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:i.concat(/\b/,i.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function M(U){return i.concat(/\b/,i.either(...U.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:M(y),relevance:0};function z(U,{exceptions:j,when:O}={}){const K=O;return j=j||[],U.map(H=>H.match(/\|\d+$/)||j.includes(H)?H:K(H)?`${H}|0`:H)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(w,{when:U=>U.length<3}),literal:c,type:m,built_in:v},contains:[{scope:"type",match:M(d)},R,T,E,a,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,s,A]}}return eg=e,eg}var tg,Uw;function EI(){if(Uw)return tg;Uw=1;function e(O){return O?typeof O=="string"?O:O.source:null}function t(O){return i("(?=",O,")")}function i(...O){return O.map(H=>e(H)).join("")}function s(O){const K=O[O.length-1];return typeof K=="object"&&K.constructor===Object?(O.splice(O.length-1,1),K):{}}function a(...O){return"("+(s(O).capture?"":"?:")+O.map(G=>e(G)).join("|")+")"}const l=O=>i(/\b/,O,/\w$/.test(O)?/\b/:/\B/),c=["Protocol","Type"].map(l),d=["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"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],v=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],y=["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"],x=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(x,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),E=i(x,w,"*"),A=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(A,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),M=i(A,T,"*"),R=i(/[A-Z]/,T,"*"),z=["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\(/,M,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],U=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function j(O){const K={match:/\s+/,relevance:0},H=O.COMMENT("/\\*","\\*/",{contains:["self"]}),G=[O.C_LINE_COMMENT_MODE,H],J={match:[/\./,a(...c,...d)],className:{2:"keyword"}},P={match:i(/\./,a(...f)),relevance:0},ee=f.filter(tt=>typeof tt=="string").concat(["_|0"]),q=f.filter(tt=>typeof tt!="string").concat(m).map(l),N={variants:[{className:"keyword",match:a(...q,...d)}]},F={$pattern:a(/\b\w+/,/#\w+/),keyword:ee.concat(v),literal:g},$=[J,P,N],Z={match:i(/\./,a(...y)),relevance:0},W={className:"built_in",match:i(/\b/,a(...y),/(?=\()/)},D=[Z,W],ie={match:/->/,relevance:0},ce={className:"operator",relevance:0,variants:[{match:E},{match:`\\.(\\.|${w})+`}]},le=[ie,ce],he="([0-9]_*)+",ge="([0-9a-fA-F]_*)+",Se={className:"number",relevance:0,variants:[{match:`\\b(${he})(\\.(${he}))?([eE][+-]?(${he}))?\\b`},{match:`\\b0x(${ge})(\\.(${ge}))?([pP][+-]?(${he}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ze=(tt="")=>({className:"subst",variants:[{match:i(/\\/,tt,/[0\\tnr"']/)},{match:i(/\\/,tt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Ee=(tt="")=>({className:"subst",match:i(/\\/,tt,/[\t ]*(?:[\r\n]|\r\n)/)}),st=(tt="")=>({className:"subst",label:"interpol",begin:i(/\\/,tt,/\(/),end:/\)/}),ot=(tt="")=>({begin:i(tt,/"""/),end:i(/"""/,tt),contains:[ze(tt),Ee(tt),st(tt)]}),lt=(tt="")=>({begin:i(tt,/"/),end:i(/"/,tt),contains:[ze(tt),st(tt)]}),Be={className:"string",variants:[ot(),ot("#"),ot("##"),ot("###"),lt(),lt("#"),lt("##"),lt("###")]},Ft=[O.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[O.BACKSLASH_ESCAPE]}],Qr={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ft},xs=tt=>{const Hn=i(tt,/\//),rn=i(/\//,tt);return{begin:Hn,end:rn,contains:[...Ft,{scope:"comment",begin:`#(?!.*${rn})`,end:/$/}]}},Fa={scope:"regexp",variants:[xs("###"),xs("##"),xs("#"),Qr]},Jr={match:i(/`/,M,/`/)},ea={className:"variable",match:/\$\d+/},ir={className:"variable",match:`\\$${T}+`},Ss=[Jr,ea,ir],tl={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:U,contains:[...le,Se,Be]}]}},$a={scope:"keyword",match:i(/@/,a(...z),t(a(/\(/,/\s+/)))},Ot={scope:"meta",match:i(/@/,M)},ws=[tl,$a,Ot],yi={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:R,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(R)),relevance:0}]},Es={begin:/</,end:/>/,keywords:F,contains:[...G,...$,...ws,ie,yi]};yi.contains.push(Es);const Cs={match:i(M,/\s*:/),keywords:"_|0",relevance:0},Va={begin:/\(/,end:/\)/,relevance:0,keywords:F,contains:["self",Cs,...G,Fa,...$,...D,...le,Se,Be,...Ss,...ws,yi]},nr={begin:/</,end:/>/,keywords:"repeat each",contains:[...G,yi]},il={begin:a(t(i(M,/\s*:/)),t(i(M,/\s+/,M,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:M}]},qa={begin:/\(/,end:/\)/,keywords:F,contains:[il,...G,...$,...le,Se,Be,...ws,yi,Va],endsParent:!0,illegal:/["']/},ks={match:[/(func|macro)/,/\s+/,a(Jr.match,M,E)],className:{1:"keyword",3:"title.function"},contains:[nr,qa,K],illegal:[/\[/,/%/]},fi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[nr,qa,K],illegal:/\[|%/},yn={match:[/operator/,/\s+/,E],className:{1:"keyword",3:"title"}},xi={begin:[/precedencegroup/,/\s+/,R],className:{1:"keyword",3:"title"},contains:[yi],keywords:[...b,...g],end:/}/},nl={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ta={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ka={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,M,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:F,contains:[nr,...$,{begin:/:/,end:/\{/,keywords:F,contains:[{scope:"title.class.inherited",match:R},...$],relevance:0}]};for(const tt of Be.variants){const Hn=tt.contains.find(Ri=>Ri.label==="interpol");Hn.keywords=F;const rn=[...$,...D,...le,Se,Be,...Ss];Hn.contains=[...rn,{begin:/\(/,end:/\)/,contains:["self",...rn]}]}return{name:"Swift",keywords:F,contains:[...G,ks,fi,nl,ta,Ka,yn,xi,{beginKeywords:"import",end:/$/,contains:[...G],relevance:0},Fa,...$,...D,...le,Se,Be,...Ss,...ws,yi,Va]}}return tg=j,tg}var ig,Hw;function CI(){if(Hw)return ig;Hw=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}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},m=t.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},w={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},A=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},w,E,c,d],T=[...A];return T.pop(),T.push(m),x.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}return ig=e,ig}var ng,Fw;function kI(){if(Fw)return ng;Fw=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],i=["true","false","null","undefined","NaN","Infinity"],s=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(l,s,a);function m(g){const b=g.regex,v=(ze,{after:Ee})=>{const st="</"+ze[0].slice(1);return ze.input.indexOf(st,Ee)!==-1},y=e,x={begin:"<>",end:"</>"},w=/<[A-Za-z0-9\\._:-]+\s*\/>/,E={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ze,Ee)=>{const st=ze[0].length+ze.index,ot=ze.input[st];if(ot==="<"||ot===","){Ee.ignoreMatch();return}ot===">"&&(v(ze,{after:st})||Ee.ignoreMatch());let lt;const Be=ze.input.substring(st);if(lt=Be.match(/^\s*=/)){Ee.ignoreMatch();return}if((lt=Be.match(/^\s+extends\s+/))&&lt.index===0){Ee.ignoreMatch();return}}},A={$pattern:e,keyword:t,literal:i,built_in:d,"variable.language":c},T="[0-9](_?[0-9])*",M=`\\.(${T})`,R="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",z={className:"number",variants:[{begin:`(\\b(${R})((${M})|\\.)?|(${M}))[eE][+-]?(${T})\\b`},{begin:`\\b(${R})\\b((${M})\\b|\\.)?|(${M})\\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},U={className:"subst",begin:"\\$\\{",end:"\\}",keywords:A,contains:[]},j={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},O={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,U],subLanguage:"css"}},K={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[g.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[g.BACKSLASH_ESCAPE,U]},J={className:"comment",variants:[g.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:y+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),g.C_BLOCK_COMMENT_MODE,g.C_LINE_COMMENT_MODE]},P=[g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,O,K,H,{match:/\$\d+/},z];U.contains=P.concat({begin:/\{/,end:/\}/,keywords:A,contains:["self"].concat(P)});const ee=[].concat(J,U.contains),q=ee.concat([{begin:/(\s*)\(/,end:/\)/,keywords:A,contains:["self"].concat(ee)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:q},F={variants:[{match:[/class/,/\s+/,y,/\s+/,/extends/,/\s+/,b.concat(y,"(",b.concat(/\./,y),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,y],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...s,...a]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,y,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(ze){return b.concat("(?!",ze.join("|"),")")}const ce={match:b.concat(/\b/,ie([...l,"super","import"].map(ze=>`${ze}\\s*\\(`)),y,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:b.concat(/\./,b.lookahead(b.concat(y,/(?![0-9A-Za-z$_(])/))),end:y,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},he={match:[/get|set/,/\s+/,y,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},ge="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+g.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,y,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(ge)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:A,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[g.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,g.APOS_STRING_MODE,g.QUOTE_STRING_MODE,j,O,K,H,J,{match:/\$\d+/},z,$,{scope:"attr",match:y+b.lookahead(":"),relevance:0},Se,{begin:"("+g.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[J,g.REGEXP_MODE,{className:"function",begin:ge,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:A,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:w},{begin:E.begin,"on:begin":E.isTrulyOpeningTag,end:E.end}],subLanguage:"xml",contains:[{begin:E.begin,end:E.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+g.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,g.inherit(g.TITLE_MODE,{begin:y,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+y,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},ce,D,F,he,{match:/\$[(.]/}]}}function f(g){const b=g.regex,v=m(g),y=e,x=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],w={begin:[/namespace/,/\s+/,g.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},E={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:x},contains:[v.exports.CLASS_REFERENCE]},A={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},T=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],M={$pattern:e,keyword:t.concat(T),literal:i,built_in:d.concat(x),"variable.language":c},R={className:"meta",begin:"@"+y},z=(K,H,G)=>{const J=K.contains.findIndex(P=>P.label===H);if(J===-1)throw new Error("can not find mode to replace");K.contains.splice(J,1,G)};Object.assign(v.keywords,M),v.exports.PARAMS_CONTAINS.push(R);const U=v.contains.find(K=>K.scope==="attr"),j=Object.assign({},U,{match:b.concat(y,b.lookahead(/\s*\?:/))});v.exports.PARAMS_CONTAINS.push([v.exports.CLASS_REFERENCE,U,j]),v.contains=v.contains.concat([R,w,E,j]),z(v,"shebang",g.SHEBANG()),z(v,"use_strict",A);const O=v.contains.find(K=>K.label==="func.def");return O.relevance=0,Object.assign(v,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),v}return ng=f,ng}var sg,$w;function NI(){if($w)return sg;$w=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}/,d=/(\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(/# */,d,/ *#/)},{begin:i.concat(/# */,i.either(c,l),/ +/,i.either(d,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])|[%&])?/}]},b={className:"label",begin:/^\w+:/},v=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=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,b,v,y,{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:[y]}]}}return sg=e,sg}var rg,Vw;function TI(){if(Vw)return rg;Vw=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_]+/},d={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,d,l,t.QUOTE_STRING_MODE,f,g,m]}}return rg=e,rg}var ag,qw;function AI(){if(qw)return ag;qw=1;var e=Kz();return e.registerLanguage("xml",Gz()),e.registerLanguage("bash",Wz()),e.registerLanguage("c",Yz()),e.registerLanguage("cpp",Xz()),e.registerLanguage("csharp",Zz()),e.registerLanguage("css",Qz()),e.registerLanguage("markdown",Jz()),e.registerLanguage("diff",eI()),e.registerLanguage("ruby",tI()),e.registerLanguage("go",iI()),e.registerLanguage("graphql",nI()),e.registerLanguage("ini",sI()),e.registerLanguage("java",rI()),e.registerLanguage("javascript",aI()),e.registerLanguage("json",oI()),e.registerLanguage("kotlin",lI()),e.registerLanguage("less",cI()),e.registerLanguage("lua",uI()),e.registerLanguage("makefile",hI()),e.registerLanguage("perl",dI()),e.registerLanguage("objectivec",fI()),e.registerLanguage("php",mI()),e.registerLanguage("php-template",pI()),e.registerLanguage("plaintext",gI()),e.registerLanguage("python",_I()),e.registerLanguage("python-repl",bI()),e.registerLanguage("r",vI()),e.registerLanguage("rust",yI()),e.registerLanguage("scss",xI()),e.registerLanguage("shell",SI()),e.registerLanguage("sql",wI()),e.registerLanguage("swift",EI()),e.registerLanguage("yaml",CI()),e.registerLanguage("typescript",kI()),e.registerLanguage("vbnet",NI()),e.registerLanguage("wasm",TI()),e.HighlightJS=e,e.default=e,ag=e,ag}var MI=AI();const S0=e5(MI);function E_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ha=E_();function Yk(e){Ha=e}var Na={exec:()=>null};function Do(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 it(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(Bi.caret,"$1"),i=i.replace(a,c),s},getRegex:()=>new RegExp(i,t)};return s}var RI=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Bi={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:Do(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Do(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Do(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Do(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Do(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Do(e=>new RegExp(`^ {0,${e}}>`))},DI=/^(?:[ \t]*(?:\n|$))+/,OI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,eu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,C_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Xk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Zk=it(Xk).replace(/bull/g,C_).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(),BI=it(Xk).replace(/bull/g,C_).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(),k_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zI=/^[^\n]+/,N_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,II=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",N_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),PI=it(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C_).getRegex(),Md="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",T_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,UI=it("^ {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",T_).replace("tag",Md).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qk=it(k_).replace("hr",eu).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",Md).getRegex(),HI=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qk).getRegex(),A_={blockquote:HI,code:OI,def:II,fences:LI,heading:jI,hr:eu,html:UI,lheading:Zk,list:PI,newline:DI,paragraph:Qk,table:Na,text:zI},Kw=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eu).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",Md).getRegex(),FI={...A_,lheading:BI,table:Kw,paragraph:it(k_).replace("hr",eu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kw).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",Md).getRegex()},$I={...A_,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T_).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:Na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(k_).replace("hr",eu).replace("heading",` *#{1,6} *[^
41
+ ]`).replace("lheading",Zk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},VI=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qI=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jk=/^( {2,}|\\)\n(?!\s*$)/,KI=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,el=/[\p{P}\p{S}]/u,Rd=/[\s\p{P}\p{S}]/u,M_=/[^\s\p{P}\p{S}]/u,GI=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Rd).getRegex(),e3=/(?!~)[\p{P}\p{S}]/u,WI=/(?!~)[\s\p{P}\p{S}]/u,YI=/(?:[^\s\p{P}\p{S}]|~)/u,XI=it(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",RI?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),t3=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ZI=it(t3,"u").replace(/punct/g,el).getRegex(),QI=it(t3,"u").replace(/punct/g,e3).getRegex(),i3="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",JI=it(i3,"gu").replace(/notPunctSpace/g,M_).replace(/punctSpace/g,Rd).replace(/punct/g,el).getRegex(),eP=it(i3,"gu").replace(/notPunctSpace/g,YI).replace(/punctSpace/g,WI).replace(/punct/g,e3).getRegex(),tP=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,M_).replace(/punctSpace/g,Rd).replace(/punct/g,el).getRegex(),iP=it(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,el).getRegex(),nP="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",sP=it(nP,"gu").replace(/notPunctSpace/g,M_).replace(/punctSpace/g,Rd).replace(/punct/g,el).getRegex(),rP=it(/\\(punct)/,"gu").replace(/punct/g,el).getRegex(),aP=it(/^<(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(),oP=it(T_).replace("(?:-->|$)","-->").getRegex(),lP=it("^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",oP).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ud=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cP=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ud).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),n3=it(/^!?\[(label)\]\[(ref)\]/).replace("label",ud).replace("ref",N_).getRegex(),s3=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",N_).getRegex(),uP=it("reflink|nolink(?!\\()","g").replace("reflink",n3).replace("nolink",s3).getRegex(),Gw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,R_={_backpedal:Na,anyPunctuation:rP,autolink:aP,blockSkip:XI,br:Jk,code:qI,del:Na,delLDelim:Na,delRDelim:Na,emStrongLDelim:ZI,emStrongRDelimAst:JI,emStrongRDelimUnd:tP,escape:VI,link:cP,nolink:s3,punctuation:GI,reflink:n3,reflinkSearch:uP,tag:lP,text:KI,url:Na},hP={...R_,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",ud).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ud).getRegex()},w0={...R_,emStrongRDelimAst:eP,emStrongLDelim:QI,delLDelim:iP,delRDelim:sP,url:it(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Gw).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:it(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Gw).getRegex()},dP={...w0,br:it(Jk).replace("{2,}","*").getRegex(),text:it(w0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Mh={normal:A_,gfm:FI,pedantic:$I},cc={normal:R_,gfm:w0,breaks:dP,pedantic:hP},fP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ww=e=>fP[e];function rs(e,t){if(t){if(Bi.escapeTest.test(e))return e.replace(Bi.escapeReplace,Ww)}else if(Bi.escapeTestNoEncode.test(e))return e.replace(Bi.escapeReplaceNoEncode,Ww);return e}function Yw(e){try{e=encodeURI(e).replace(Bi.percentDecode,"%")}catch{return null}return e}function Xw(e,t){let i=e.replace(Bi.findPipe,(l,c,d)=>{let m=!1,f=c;for(;--f>=0&&d[f]==="\\";)m=!m;return m?"|":" |"}),s=i.split(Bi.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(Bi.slashPipe,"|");return s}function zr(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 Zw(e){let t=e.split(`
42
+ `),i=t.length-1;for(;i>=0&&Bi.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
43
+ `)}function mP(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 pP(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 Qw(e,t,i,s,a){let l=t.href,c=t.title||null,d=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:d,tokens:s.inlineTokens(d)};return s.state.inLink=!1,m}function gP(e,t,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
44
+ `).map(l=>{let c=l.match(i.other.beginningSpace);if(c===null)return l;let[d]=c;return d.length>=a.length?l.slice(a.length):l}).join(`
45
+ `)}var hd=class{options;rules;lexer;constructor(e){this.options=e||Ha}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]:Zw(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=gP(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=zr(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:zr(t[0],`
46
+ `),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:zr(t[0],`
47
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=zr(t[0],`
48
+ `).split(`
49
+ `),s="",a="",l=[];for(;i.length>0;){let c=!1,d=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))d.push(i[m]),c=!0;else if(!c)d.push(i[m]);else break;i=i.slice(m);let f=d.join(`
50
+ `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
51
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
52
+ ${f}`:f,a=a?`${a}
53
+ ${g}`:g;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,l,!0),this.lexer.state.top=b,i.length===0)break;let v=l.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let y=v,x=y.raw+`
54
+ `+i.join(`
55
+ `),w=this.blockquote(x);l[l.length-1]=w,s=s.substring(0,s.length-y.raw.length)+w.raw,a=a.substring(0,a.length-y.text.length)+w.text;break}else if(v?.type==="list"){let y=v,x=y.raw+`
56
+ `+i.join(`
57
+ `),w=this.list(x);l[l.length-1]=w,s=s.substring(0,s.length-v.raw.length)+w.raw,a=a.substring(0,a.length-y.raw.length)+w.raw,i=x.substring(l.at(-1).raw.length).split(`
58
+ `);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 b=pP(t[2].split(`
59
+ `,1)[0],t[1].length),v=e.split(`
60
+ `,1)[0],y=!b.trim(),x=0;if(this.options.pedantic?(x=2,g=b.trimStart()):y?x=t[1].length+1:(x=b.search(this.rules.other.nonSpaceChar),x=x>4?1:x,g=b.slice(x),x+=t[1].length),y&&this.rules.other.blankLine.test(v)&&(f+=v+`
61
+ `,e=e.substring(v.length+1),m=!0),!m){let w=this.rules.other.nextBulletRegex(x),E=this.rules.other.hrRegex(x),A=this.rules.other.fencesBeginRegex(x),T=this.rules.other.headingBeginRegex(x),M=this.rules.other.htmlBeginRegex(x),R=this.rules.other.blockquoteBeginRegex(x);for(;e;){let z=e.split(`
62
+ `,1)[0],U;if(v=z,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),U=v):U=v.replace(this.rules.other.tabCharGlobal," "),A.test(v)||T.test(v)||M.test(v)||R.test(v)||w.test(v)||E.test(v))break;if(U.search(this.rules.other.nonSpaceChar)>=x||!v.trim())g+=`
63
+ `+U.slice(x);else{if(y||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(b)||T.test(b)||E.test(b))break;g+=`
64
+ `+v}y=!v.trim(),f+=z+`
65
+ `,e=e.substring(z.length+1),b=U.slice(x)}}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 d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m of a.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let f=m.tokens[0];if(m.task&&(f?.type==="text"||f?.type==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(m.raw);if(g){let b={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};m.checked=b.checked,a.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=b.raw+m.tokens[0].raw,m.tokens[0].text=b.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(b)):m.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):m.tokens.unshift(b)}}else m.task&&(m.task=!1);if(!a.loose){let g=m.tokens.filter(v=>v.type==="space"),b=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=b}}if(a.loose)for(let m of a.items){m.loose=!0;for(let f of m.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let i=Zw(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:zr(t[0],`
66
+ `),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=Xw(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
67
+ `):[],l={type:"table",raw:zr(t[0],`
68
+ `),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(Xw(c,l.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),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:zr(t[0],`
69
+ `),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)===`
70
+ `?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=zr(i.slice(0,-1),"\\");if((i.length-l.length)%2===0)return}else{let l=mP(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)),Qw(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 Qw(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,d=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]){d+=c;continue}else if((s[5]||s[6])&&a%3&&!((a+c)%3)){m+=c;continue}if(d-=c,d>0)continue;c=Math.min(c,c+d+m);let g=[...s[0]][0].length,b=e.slice(0,a+s.index+g+c);if(Math.min(a,c)%2){let y=b.slice(1,-1);return{type:"em",raw:b,text:y,tokens:this.lexer.inlineTokens(y)}}let v=b.slice(2,-2);return{type:"strong",raw:b,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!i||this.rules.inline.punctuation.exec(i))){let a=[...s[0]].length-1,l,c,d=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]){d+=c;continue}if(d-=c,d>0)continue;c=Math.min(c,c+d);let f=[...s[0]][0].length,g=e.slice(0,a+s.index+f+c),b=g.slice(a,-a);return{type:"del",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let i,s;return t[2]==="@"?(i=t[1],s="mailto:"+i):(i=t[1],s=i),{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,s;if(t[2]==="@")i=t[0],s="mailto:"+i;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);i=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:i}}}},Gn=class E0{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ha,this.options.tokenizer=this.options.tokenizer||new hd,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:Bi,block:Mh.normal,inline:cc.normal};this.options.pedantic?(i.block=Mh.pedantic,i.inline=cc.pedantic):this.options.gfm&&(i.block=Mh.gfm,this.options.breaks?i.inline=cc.breaks:i.inline=cc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Mh,inline:cc}}static lex(t,i){return new E0(i).lex(t)}static lexInline(t,i){return new E0(i).inlineTokens(t)}lex(t){t=t.replace(Bi.carriageReturn,`
71
+ `),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(Bi.tabCharGlobal," ").replace(Bi.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(d=>(l=d.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 d=i.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
72
+ `:i.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let d=i.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`
73
+ `)?"":`
74
+ `)+l.raw,d.text+=`
75
+ `+l.text,this.inlineQueue.at(-1).src=d.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 d=i.at(-1);d?.type==="paragraph"||d?.type==="text"?(d.raw+=(d.raw.endsWith(`
76
+ `)?"":`
77
+ `)+l.raw,d.text+=`
78
+ `+l.raw,this.inlineQueue.at(-1).src=d.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 d=1/0,m=t.slice(1),f;this.options.extensions.startBlock.forEach(g=>{f=g.call({lexer:this},m),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(c=t.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let d=i.at(-1);s&&d?.type==="paragraph"?(d.raw+=(d.raw.endsWith(`
79
+ `)?"":`
80
+ `)+l.raw,d.text+=`
81
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.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 d=i.at(-1);d?.type==="text"?(d.raw+=(d.raw.endsWith(`
82
+ `)?"":`
83
+ `)+l.raw,d.text+=`
84
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.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,d="",m=1/0;for(;t;){if(t.length<m)m=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}c||(d=""),c=!1;let f;if(this.options.extensions?.inline?.some(b=>(f=b.call({lexer:this},t,i))?(t=t.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let b=i.at(-1);f.type==="text"&&b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(t,s,d)){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,d)){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 b=1/0,v=t.slice(1),y;this.options.extensions.startInline.forEach(x=>{y=x.call({lexer:this},v),typeof y=="number"&&y>=0&&(b=Math.min(b,y))}),b<1/0&&b>=0&&(g=t.substring(0,b+1))}if(f=this.tokenizer.inlineText(g)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(d=f.raw.slice(-1)),c=!0;let b=i.at(-1);b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},dd=class{options;parser;constructor(e){this.options=e||Ha}space(e){return""}code({text:e,lang:t,escaped:i}){let s=(t||"").match(Bi.notSpaceStart)?.[0],a=e.replace(Bi.endingNewline,"")+`
85
+ `;return s?'<pre><code class="language-'+rs(s)+'">'+(i?a:rs(a,!0))+`</code></pre>
86
+ `:"<pre><code>"+(i?a:rs(a,!0))+`</code></pre>
87
+ `}blockquote({tokens:e}){return`<blockquote>
88
+ ${this.parser.parse(e)}</blockquote>
89
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
90
+ `}hr(e){return`<hr>
91
+ `}list(e){let t=e.ordered,i=e.start,s="";for(let c=0;c<e.items.length;c++){let d=e.items[c];s+=this.listitem(d)}let a=t?"ol":"ul",l=t&&i!==1?' start="'+i+'"':"";return"<"+a+l+`>
92
+ `+s+"</"+a+`>
93
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
94
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
95
+ `}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>
96
+ <thead>
97
+ `+t+`</thead>
98
+ `+s+`</table>
99
+ `}tablerow({text:e}){return`<tr>
100
+ ${e}</tr>
101
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
102
+ `}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>${rs(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=Yw(e);if(a===null)return s;e=a;let l='<a href="'+e+'"';return t&&(l+=' title="'+rs(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=Yw(e);if(a===null)return rs(i);e=a;let l=`<img src="${e}" alt="${rs(i)}"`;return t&&(l+=` title="${rs(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:rs(e.text)}},D_=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}},Wn=class C0{options;renderer;textRenderer;constructor(t){this.options=t||Ha,this.options.renderer=this.options.renderer||new dd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new D_}static parse(t,i){return new C0(i).parse(t)}static parseInline(t,i){return new C0(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,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){i+=d||"";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 d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=d||"";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 d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return s}},vc=class{options;block;constructor(e){this.options=e||Ha}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?Gn.lex:Gn.lexInline}provideParser(e=this.block){return e?Wn.parse:Wn.parseInline}},_P=class{defaults=E_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Wn;Renderer=dd;TextRenderer=D_;Lexer=Gn;Tokenizer=hd;Hooks=vc;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 d=a.renderer.apply(this,c);return d===!1&&(d=l.apply(this,c)),d}: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 dd(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,d=i.renderer[c],m=a[c];a[c]=(...f)=>{let g=d.apply(a,f);return g===!1&&(g=m.apply(a,f)),g||""}}s.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new hd(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,d=i.tokenizer[c],m=a[c];a[c]=(...f)=>{let g=d.apply(a,f);return g===!1&&(g=m.apply(a,f)),g}}s.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new vc;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,d=i.hooks[c],m=a[c];vc.passThroughHooks.has(l)?a[c]=f=>{if(this.defaults.async&&vc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,f);return m.call(a,b)})();let g=d.call(a,f);return m.call(a,g)}:a[c]=(...f)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,f);return b===!1&&(b=await m.apply(a,f)),b})();let g=d.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 d=[];return d.push(l.call(this,c)),a&&(d=d.concat(a.call(this,c))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Gn.lex(e,t??this.defaults)}parser(e,t){return Wn.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,d=await(a.hooks?await a.hooks.provideLexer(e):e?Gn.lex:Gn.lexInline)(c,a),m=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(m,a.walkTokens));let f=await(a.hooks?await a.hooks.provideParser(e):e?Wn.parse:Wn.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?Gn.lex:Gn.lexInline)(t,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(e):e?Wn.parse:Wn.parseInline)(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=`
103
+ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+rs(i.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(i);throw i}}},za=new _P;function pt(e,t){return za.parse(e,t)}pt.options=pt.setOptions=function(e){return za.setOptions(e),pt.defaults=za.defaults,Yk(pt.defaults),pt};pt.getDefaults=E_;pt.defaults=Ha;pt.use=function(...e){return za.use(...e),pt.defaults=za.defaults,Yk(pt.defaults),pt};pt.walkTokens=function(e,t){return za.walkTokens(e,t)};pt.parseInline=za.parseInline;pt.Parser=Wn;pt.parser=Wn.parse;pt.Renderer=dd;pt.TextRenderer=D_;pt.Lexer=Gn;pt.lexer=Gn.lex;pt.Tokenizer=hd;pt.Hooks=vc;pt.parse=pt;pt.options;pt.setOptions;pt.use;pt.walkTokens;pt.parseInline;Wn.parse;Gn.lex;function bP(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 vP({content:e}){const t=C.useMemo(()=>{const s=pt.parse(e,{async:!1,gfm:!0,breaks:!1});return bP(s)},[e]),i=C.useRef(null);return C.useEffect(()=>{const s=i.current;s&&s.querySelectorAll("pre code").forEach(a=>{S0.highlightElement(a)})},[t]),h.jsx("div",{ref:i,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function r3(e){return typeof e>"u"||e===null}function yP(e){return typeof e=="object"&&e!==null}function xP(e){return Array.isArray(e)?e:r3(e)?[]:[e]}function SP(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 wP(e,t){var i="",s;for(s=0;s<t;s+=1)i+=e;return i}function EP(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var CP=r3,kP=yP,NP=xP,TP=wP,AP=EP,MP=SP,hi={isNothing:CP,isObject:kP,toArray:NP,repeat:TP,isNegativeZero:AP,extend:MP};function a3(e,t){var i="",s=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+=`
104
+
105
+ `+e.mark.snippet),s+" "+i):s}function Ic(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=a3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ic.prototype=Object.create(Error.prototype);Ic.prototype.constructor=Ic;Ic.prototype.toString=function(t){return this.name+": "+a3(this,t)};var Hi=Ic;function og(e,t,i,s,a){var l="",c="",d=Math.floor(a/2)-1;return s-t>d&&(l=" ... ",t=s-d+l.length),i-s>d&&(c=" ...",i=s+d-c.length),{str:l+e.slice(t,i).replace(/\t/g,"→")+c,pos:s-t+l.length}}function lg(e,t){return hi.repeat(" ",t-e.length)+e}function RP(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 d="",m,f,g=Math.min(e.line+t.linesAfter,a.length).toString().length,b=t.maxLength-(t.indent+g+3);for(m=1;m<=t.linesBefore&&!(c-m<0);m++)f=og(e.buffer,s[c-m],a[c-m],e.position-(s[c]-s[c-m]),b),d=hi.repeat(" ",t.indent)+lg((e.line-m+1).toString(),g)+" | "+f.str+`
106
+ `+d;for(f=og(e.buffer,s[c],a[c],e.position,b),d+=hi.repeat(" ",t.indent)+lg((e.line+1).toString(),g)+" | "+f.str+`
107
+ `,d+=hi.repeat("-",t.indent+g+3+f.pos)+`^
108
+ `,m=1;m<=t.linesAfter&&!(c+m>=a.length);m++)f=og(e.buffer,s[c+m],a[c+m],e.position-(s[c]-s[c+m]),b),d+=hi.repeat(" ",t.indent)+lg((e.line+m+1).toString(),g)+" | "+f.str+`
109
+ `;return d.replace(/\n$/,"")}var DP=RP,OP=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],LP=["scalar","sequence","mapping"];function jP(e){var t={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(s){t[String(s)]=i})}),t}function BP(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(OP.indexOf(i)===-1)throw new Hi('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=jP(t.styleAliases||null),LP.indexOf(this.kind)===-1)throw new Hi('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Mi=BP;function Jw(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 zP(){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 k0(e){return this.extend(e)}k0.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 Hi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(l){if(!(l instanceof Mi))throw new Hi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new Hi("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 Hi("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 Hi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(k0.prototype);return a.implicit=(this.implicit||[]).concat(i),a.explicit=(this.explicit||[]).concat(s),a.compiledImplicit=Jw(a,"implicit"),a.compiledExplicit=Jw(a,"explicit"),a.compiledTypeMap=zP(a.compiledImplicit,a.compiledExplicit),a};var o3=k0,l3=new Mi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),c3=new Mi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),u3=new Mi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),h3=new o3({explicit:[l3,c3,u3]});function IP(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function PP(){return null}function UP(e){return e===null}var d3=new Mi("tag:yaml.org,2002:null",{kind:"scalar",resolve:IP,construct:PP,predicate:UP,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function HP(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 FP(e){return e==="true"||e==="True"||e==="TRUE"}function $P(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var f3=new Mi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:HP,construct:FP,predicate:$P,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 VP(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qP(e){return 48<=e&&e<=55}function KP(e){return 48<=e&&e<=57}function GP(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(!VP(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!qP(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!KP(e.charCodeAt(i)))return!1;s=!0}return!(!s||a==="_")}function WP(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 YP(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!hi.isNegativeZero(e)}var m3=new Mi("tag:yaml.org,2002:int",{kind:"scalar",resolve:GP,construct:WP,predicate:YP,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"]}}),XP=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ZP(e){return!(e===null||!XP.test(e)||e[e.length-1]==="_")}function QP(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 JP=/^[-+]?[0-9]+e/;function eU(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(hi.isNegativeZero(e))return"-0.0";return i=e.toString(10),JP.test(i)?i.replace("e",".e"):i}function tU(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||hi.isNegativeZero(e))}var p3=new Mi("tag:yaml.org,2002:float",{kind:"scalar",resolve:ZP,construct:QP,predicate:tU,represent:eU,defaultStyle:"lowercase"}),g3=h3.extend({implicit:[d3,f3,m3,p3]}),_3=g3,b3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),v3=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 iU(e){return e===null?!1:b3.exec(e)!==null||v3.exec(e)!==null}function nU(e){var t,i,s,a,l,c,d,m=0,f=null,g,b,v;if(t=b3.exec(e),t===null&&(t=v3.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],d=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(g=+t[10],b=+(t[11]||0),f=(g*60+b)*6e4,t[9]==="-"&&(f=-f)),v=new Date(Date.UTC(i,s,a,l,c,d,m)),f&&v.setTime(v.getTime()-f),v}function sU(e){return e.toISOString()}var y3=new Mi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:iU,construct:nU,instanceOf:Date,represent:sU});function rU(e){return e==="<<"||e===null}var x3=new Mi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:rU}),O_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
110
+ \r`;function aU(e){if(e===null)return!1;var t,i,s=0,a=e.length,l=O_;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 oU(e){var t,i,s=e.replace(/[\r\n=]/g,""),a=s.length,l=O_,c=0,d=[];for(t=0;t<a;t++)t%4===0&&t&&(d.push(c>>16&255),d.push(c>>8&255),d.push(c&255)),c=c<<6|l.indexOf(s.charAt(t));return i=a%4*6,i===0?(d.push(c>>16&255),d.push(c>>8&255),d.push(c&255)):i===18?(d.push(c>>10&255),d.push(c>>2&255)):i===12&&d.push(c>>4&255),new Uint8Array(d)}function lU(e){var t="",i=0,s,a,l=e.length,c=O_;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 cU(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var S3=new Mi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:aU,construct:oU,predicate:cU,represent:lU}),uU=Object.prototype.hasOwnProperty,hU=Object.prototype.toString;function dU(e){if(e===null)return!0;var t=[],i,s,a,l,c,d=e;for(i=0,s=d.length;i<s;i+=1){if(a=d[i],c=!1,hU.call(a)!=="[object Object]")return!1;for(l in a)if(uU.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 fU(e){return e!==null?e:[]}var w3=new Mi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dU,construct:fU}),mU=Object.prototype.toString;function pU(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],mU.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;l[t]=[a[0],s[a[0]]]}return!0}function gU(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 E3=new Mi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pU,construct:gU}),_U=Object.prototype.hasOwnProperty;function bU(e){if(e===null)return!0;var t,i=e;for(t in i)if(_U.call(i,t)&&i[t]!==null)return!1;return!0}function vU(e){return e!==null?e:{}}var C3=new Mi("tag:yaml.org,2002:set",{kind:"mapping",resolve:bU,construct:vU}),L_=_3.extend({implicit:[y3,x3],explicit:[S3,w3,E3,C3]}),Wr=Object.prototype.hasOwnProperty,fd=1,k3=2,N3=3,md=4,cg=1,yU=2,e2=3,xU=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,SU=/[\x85\u2028\u2029]/,wU=/[,\[\]\{\}]/,T3=/^(?:!|!!|![a-z\-]+!)$/i,A3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function t2(e){return Object.prototype.toString.call(e)}function hs(e){return e===10||e===13}function La(e){return e===9||e===32}function nn(e){return e===9||e===32||e===10||e===13}function Fo(e){return e===44||e===91||e===93||e===123||e===125}function EU(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function CU(e){return e===120?2:e===117?4:e===85?8:0}function kU(e){return 48<=e&&e<=57?e-48:-1}function i2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
111
+ `: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 NU(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function M3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var R3=new Array(256),D3=new Array(256);for(var Oo=0;Oo<256;Oo++)R3[Oo]=i2(Oo)?1:0,D3[Oo]=i2(Oo);function TU(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||L_,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 O3(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=DP(i),new Hi(t,i)}function Re(e,t){throw O3(e,t)}function pd(e,t){e.onWarning&&e.onWarning.call(null,O3(e,t))}var n2={YAML:function(t,i,s){var a,l,c;t.version!==null&&Re(t,"duplication of %YAML directive"),s.length!==1&&Re(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&Re(t,"ill-formed argument of the YAML directive"),l=parseInt(a[1],10),c=parseInt(a[2],10),l!==1&&Re(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&pd(t,"unsupported YAML version of the document")},TAG:function(t,i,s){var a,l;s.length!==2&&Re(t,"TAG directive accepts exactly two arguments"),a=s[0],l=s[1],T3.test(a)||Re(t,"ill-formed tag handle (first argument) of the TAG directive"),Wr.call(t.tagMap,a)&&Re(t,'there is a previously declared suffix for "'+a+'" tag handle'),A3.test(l)||Re(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Re(t,"tag prefix is malformed: "+l)}t.tagMap[a]=l}};function Vr(e,t,i,s){var a,l,c,d;if(t<i){if(d=e.input.slice(t,i),s)for(a=0,l=d.length;a<l;a+=1)c=d.charCodeAt(a),c===9||32<=c&&c<=1114111||Re(e,"expected valid JSON character");else xU.test(d)&&Re(e,"the stream contains non-printable characters");e.result+=d}}function s2(e,t,i,s){var a,l,c,d;for(hi.isObject(i)||Re(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(i),c=0,d=a.length;c<d;c+=1)l=a[c],Wr.call(t,l)||(M3(t,l,i[l]),s[l]=!0)}function $o(e,t,i,s,a,l,c,d,m){var f,g;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),f=0,g=a.length;f<g;f+=1)Array.isArray(a[f])&&Re(e,"nested arrays are not supported inside keys"),typeof a=="object"&&t2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&t2(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)s2(e,t,l[f],i);else s2(e,t,l,i);else!e.json&&!Wr.call(i,a)&&Wr.call(t,a)&&(e.line=c||e.line,e.lineStart=d||e.lineStart,e.position=m||e.position,Re(e,"duplicated mapping key")),M3(t,a,l),delete i[a];return t}function j_(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Re(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ri(e,t,i){for(var s=0,a=e.input.charCodeAt(e.position);a!==0;){for(;La(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(hs(a))for(j_(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&&pd(e,"deficient indentation"),s}function Dd(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||nn(i)))}function B_(e,t){t===1?e.result+=" ":t>1&&(e.result+=hi.repeat(`
112
+ `,t-1))}function AU(e,t,i){var s,a,l,c,d,m,f,g,b=e.kind,v=e.result,y;if(y=e.input.charCodeAt(e.position),nn(y)||Fo(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(a=e.input.charCodeAt(e.position+1),nn(a)||i&&Fo(a)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,d=!1;y!==0;){if(y===58){if(a=e.input.charCodeAt(e.position+1),nn(a)||i&&Fo(a))break}else if(y===35){if(s=e.input.charCodeAt(e.position-1),nn(s))break}else{if(e.position===e.lineStart&&Dd(e)||i&&Fo(y))break;if(hs(y))if(m=e.line,f=e.lineStart,g=e.lineIndent,ri(e,!1,-1),e.lineIndent>=t){d=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=m,e.lineStart=f,e.lineIndent=g;break}}d&&(Vr(e,l,c,!1),B_(e,e.line-m),l=c=e.position,d=!1),La(y)||(c=e.position+1),y=e.input.charCodeAt(++e.position)}return Vr(e,l,c,!1),e.result?!0:(e.kind=b,e.result=v,!1)}function MU(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(Vr(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 hs(i)?(Vr(e,s,a,!0),B_(e,ri(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Dd(e)?Re(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Re(e,"unexpected end of the stream within a single quoted scalar")}function RU(e,t){var i,s,a,l,c,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=s=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return Vr(e,i,e.position,!0),e.position++,!0;if(d===92){if(Vr(e,i,e.position,!0),d=e.input.charCodeAt(++e.position),hs(d))ri(e,!1,t);else if(d<256&&R3[d])e.result+=D3[d],e.position++;else if((c=CU(d))>0){for(a=c,l=0;a>0;a--)d=e.input.charCodeAt(++e.position),(c=EU(d))>=0?l=(l<<4)+c:Re(e,"expected hexadecimal character");e.result+=NU(l),e.position++}else Re(e,"unknown escape sequence");i=s=e.position}else hs(d)?(Vr(e,i,s,!0),B_(e,ri(e,!1,t)),i=s=e.position):e.position===e.lineStart&&Dd(e)?Re(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}Re(e,"unexpected end of the stream within a double quoted scalar")}function DU(e,t){var i=!0,s,a,l,c=e.tag,d,m=e.anchor,f,g,b,v,y,x=Object.create(null),w,E,A,T;if(T=e.input.charCodeAt(e.position),T===91)g=93,y=!1,d=[];else if(T===123)g=125,y=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),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=y?"mapping":"sequence",e.result=d,!0;i?T===44&&Re(e,"expected the node content, but found ','"):Re(e,"missed comma between flow collection entries"),E=w=A=null,b=v=!1,T===63&&(f=e.input.charCodeAt(e.position+1),nn(f)&&(b=v=!0,e.position++,ri(e,!0,t))),s=e.line,a=e.lineStart,l=e.position,Wo(e,t,fd,!1,!0),E=e.tag,w=e.result,ri(e,!0,t),T=e.input.charCodeAt(e.position),(v||e.line===s)&&T===58&&(b=!0,T=e.input.charCodeAt(++e.position),ri(e,!0,t),Wo(e,t,fd,!1,!0),A=e.result),y?$o(e,d,x,E,w,A,s,a,l):b?d.push($o(e,null,x,E,w,A,s,a,l)):d.push(w),ri(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(i=!0,T=e.input.charCodeAt(++e.position)):i=!1}Re(e,"unexpected end of the stream within a flow collection")}function OU(e,t){var i,s,a=cg,l=!1,c=!1,d=t,m=0,f=!1,g,b;if(b=e.input.charCodeAt(e.position),b===124)s=!1;else if(b===62)s=!0;else return!1;for(e.kind="scalar",e.result="";b!==0;)if(b=e.input.charCodeAt(++e.position),b===43||b===45)cg===a?a=b===43?e2:yU:Re(e,"repeat of a chomping mode identifier");else if((g=kU(b))>=0)g===0?Re(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Re(e,"repeat of an indentation width identifier"):(d=t+g-1,c=!0);else break;if(La(b)){do b=e.input.charCodeAt(++e.position);while(La(b));if(b===35)do b=e.input.charCodeAt(++e.position);while(!hs(b)&&b!==0)}for(;b!==0;){for(j_(e),e.lineIndent=0,b=e.input.charCodeAt(e.position);(!c||e.lineIndent<d)&&b===32;)e.lineIndent++,b=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>d&&(d=e.lineIndent),hs(b)){m++;continue}if(e.lineIndent<d){a===e2?e.result+=hi.repeat(`
113
+ `,l?1+m:m):a===cg&&l&&(e.result+=`
114
+ `);break}for(s?La(b)?(f=!0,e.result+=hi.repeat(`
115
+ `,l?1+m:m)):f?(f=!1,e.result+=hi.repeat(`
116
+ `,m+1)):m===0?l&&(e.result+=" "):e.result+=hi.repeat(`
117
+ `,m):e.result+=hi.repeat(`
118
+ `,l?1+m:m),l=!0,c=!0,m=0,i=e.position;!hs(b)&&b!==0;)b=e.input.charCodeAt(++e.position);Vr(e,i,e.position,!1)}return!0}function r2(e,t){var i,s=e.tag,a=e.anchor,l=[],c,d=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),m=e.input.charCodeAt(e.position);m!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),!(m!==45||(c=e.input.charCodeAt(e.position+1),!nn(c))));){if(d=!0,e.position++,ri(e,!0,-1)&&e.lineIndent<=t){l.push(null),m=e.input.charCodeAt(e.position);continue}if(i=e.line,Wo(e,t,N3,!1,!0),l.push(e.result),ri(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)Re(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return d?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=l,!0):!1}function LU(e,t,i){var s,a,l,c,d,m,f=e.tag,g=e.anchor,b={},v=Object.create(null),y=null,x=null,w=null,E=!1,A=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=b),T=e.input.charCodeAt(e.position);T!==0;){if(!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Re(e,"tab characters must not be used in indentation")),s=e.input.charCodeAt(e.position+1),l=e.line,(T===63||T===58)&&nn(s))T===63?(E&&($o(e,b,v,y,x,null,c,d,m),y=x=w=null),A=!0,E=!0,a=!0):E?(E=!1,a=!0):Re(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=s;else{if(c=e.line,d=e.lineStart,m=e.position,!Wo(e,i,k3,!1,!0))break;if(e.line===l){for(T=e.input.charCodeAt(e.position);La(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),nn(T)||Re(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&($o(e,b,v,y,x,null,c,d,m),y=x=w=null),A=!0,E=!1,a=!1,y=e.tag,x=e.result;else if(A)Re(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=g,!0}else if(A)Re(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=g,!0}if((e.line===l||e.lineIndent>t)&&(E&&(c=e.line,d=e.lineStart,m=e.position),Wo(e,t,md,!0,a)&&(E?x=e.result:w=e.result),E||($o(e,b,v,y,x,w,c,d,m),y=x=w=null),ri(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&T!==0)Re(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&$o(e,b,v,y,x,null,c,d,m),A&&(e.tag=f,e.anchor=g,e.kind="mapping",e.result=b),A}function jU(e){var t,i=!1,s=!1,a,l,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&Re(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(i=!0,c=e.input.charCodeAt(++e.position)):c===33?(s=!0,a="!!",c=e.input.charCodeAt(++e.position)):a="!",t=e.position,i){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(l=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):Re(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!nn(c);)c===33&&(s?Re(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),T3.test(a)||Re(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),wU.test(l)&&Re(e,"tag suffix cannot contain flow indicator characters")}l&&!A3.test(l)&&Re(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Re(e,"tag name is malformed: "+l)}return i?e.tag=l:Wr.call(e.tagMap,a)?e.tag=e.tagMap[a]+l:a==="!"?e.tag="!"+l:a==="!!"?e.tag="tag:yaml.org,2002:"+l:Re(e,'undeclared tag handle "'+a+'"'),!0}function BU(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&Re(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!nn(i)&&!Fo(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function zU(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&&!nn(s)&&!Fo(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&Re(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Wr.call(e.anchorMap,i)||Re(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],ri(e,!0,-1),!0}function Wo(e,t,i,s,a){var l,c,d,m=1,f=!1,g=!1,b,v,y,x,w,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=c=d=md===i||N3===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(;jU(e)||BU(e);)ri(e,!0,-1)?(f=!0,d=l,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):d=!1;if(d&&(d=f||a),(m===1||md===i)&&(fd===i||k3===i?w=t:w=t+1,E=e.position-e.lineStart,m===1?d&&(r2(e,E)||LU(e,E,w))||DU(e,w)?g=!0:(c&&OU(e,w)||MU(e,w)||RU(e,w)?g=!0:zU(e)?(g=!0,(e.tag!==null||e.anchor!==null)&&Re(e,"alias node should not have any properties")):AU(e,w,fd===i)&&(g=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(g=d&&r2(e,E))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Re(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),b=0,v=e.implicitTypes.length;b<v;b+=1)if(x=e.implicitTypes[b],x.resolve(e.result)){e.result=x.construct(e.result),e.tag=x.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Wr.call(e.typeMap[e.kind||"fallback"],e.tag))x=e.typeMap[e.kind||"fallback"][e.tag];else for(x=null,y=e.typeMap.multi[e.kind||"fallback"],b=0,v=y.length;b<v;b+=1)if(e.tag.slice(0,y[b].tag.length)===y[b].tag){x=y[b];break}x||Re(e,"unknown tag !<"+e.tag+">"),e.result!==null&&x.kind!==e.kind&&Re(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Re(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||g}function IU(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&&!nn(c);)c=e.input.charCodeAt(++e.position);for(s=e.input.slice(i,e.position),a=[],s.length<1&&Re(e,"directive name must not be less than one character in length");c!==0;){for(;La(c);)c=e.input.charCodeAt(++e.position);if(c===35){do c=e.input.charCodeAt(++e.position);while(c!==0&&!hs(c));break}if(hs(c))break;for(i=e.position;c!==0&&!nn(c);)c=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}c!==0&&j_(e),Wr.call(n2,s)?n2[s](e,s,a):pd(e,'unknown document directive "'+s+'"')}if(ri(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ri(e,!0,-1)):l&&Re(e,"directives end mark is expected"),Wo(e,e.lineIndent-1,md,!1,!0),ri(e,!0,-1),e.checkLineBreaks&&SU.test(e.input.slice(t,e.position))&&pd(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Dd(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ri(e,!0,-1));return}if(e.position<e.length-1)Re(e,"end of the stream or a document separator is expected");else return}function L3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
119
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new TU(e,t),s=e.indexOf("\0");for(s!==-1&&(i.position=s,Re(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)IU(i);return i.documents}function PU(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var s=L3(e,i);if(typeof t!="function")return s;for(var a=0,l=s.length;a<l;a+=1)t(s[a])}function UU(e,t){var i=L3(e,t);if(i.length!==0){if(i.length===1)return i[0];throw new Hi("expected a single document in the stream, but found more")}}var HU=PU,FU=UU,j3={loadAll:HU,load:FU},B3=Object.prototype.toString,z3=Object.prototype.hasOwnProperty,z_=65279,$U=9,Pc=10,VU=13,qU=32,KU=33,GU=34,N0=35,WU=37,YU=38,XU=39,ZU=42,I3=44,QU=45,gd=58,JU=61,eH=62,tH=63,iH=64,P3=91,U3=93,nH=96,H3=123,sH=124,F3=125,zi={};zi[0]="\\0";zi[7]="\\a";zi[8]="\\b";zi[9]="\\t";zi[10]="\\n";zi[11]="\\v";zi[12]="\\f";zi[13]="\\r";zi[27]="\\e";zi[34]='\\"';zi[92]="\\\\";zi[133]="\\N";zi[160]="\\_";zi[8232]="\\L";zi[8233]="\\P";var rH=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],aH=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function oH(e,t){var i,s,a,l,c,d,m;if(t===null)return{};for(i={},s=Object.keys(t),a=0,l=s.length;a<l;a+=1)c=s[a],d=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),m=e.compiledTypeMap.fallback[c],m&&z3.call(m.styleAliases,d)&&(d=m.styleAliases[d]),i[c]=d;return i}function lH(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 Hi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+hi.repeat("0",s-t.length)+t}var cH=1,Uc=2;function uH(e){this.schema=e.schema||L_,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=hi.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=oH(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==='"'?Uc:cH,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 a2(e,t){for(var i=hi.repeat(" ",t),s=0,a=-1,l="",c,d=e.length;s<d;)a=e.indexOf(`
120
+ `,s),a===-1?(c=e.slice(s),s=d):(c=e.slice(s,a+1),s=a+1),c.length&&c!==`
121
+ `&&(l+=i),l+=c;return l}function T0(e,t){return`
122
+ `+hi.repeat(" ",e.indent*t)}function hH(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 _d(e){return e===qU||e===$U}function Hc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==z_||65536<=e&&e<=1114111}function o2(e){return Hc(e)&&e!==z_&&e!==VU&&e!==Pc}function l2(e,t,i){var s=o2(e),a=s&&!_d(e);return(i?s:s&&e!==I3&&e!==P3&&e!==U3&&e!==H3&&e!==F3)&&e!==N0&&!(t===gd&&!a)||o2(t)&&!_d(t)&&e===N0||t===gd&&a}function dH(e){return Hc(e)&&e!==z_&&!_d(e)&&e!==QU&&e!==tH&&e!==gd&&e!==I3&&e!==P3&&e!==U3&&e!==H3&&e!==F3&&e!==N0&&e!==YU&&e!==ZU&&e!==KU&&e!==sH&&e!==JU&&e!==eH&&e!==XU&&e!==GU&&e!==WU&&e!==iH&&e!==nH}function fH(e){return!_d(e)&&e!==gd}function yc(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 $3(e){var t=/^\n* /;return t.test(e)}var V3=1,A0=2,q3=3,K3=4,Bo=5;function mH(e,t,i,s,a,l,c,d){var m,f=0,g=null,b=!1,v=!1,y=s!==-1,x=-1,w=dH(yc(e,0))&&fH(yc(e,e.length-1));if(t||c)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=yc(e,m),!Hc(f))return Bo;w=w&&l2(f,g,d),g=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=yc(e,m),f===Pc)b=!0,y&&(v=v||m-x-1>s&&e[x+1]!==" ",x=m);else if(!Hc(f))return Bo;w=w&&l2(f,g,d),g=f}v=v||y&&m-x-1>s&&e[x+1]!==" "}return!b&&!v?w&&!c&&!a(e)?V3:l===Uc?Bo:A0:i>9&&$3(e)?Bo:c?l===Uc?Bo:A0:v?K3:q3}function pH(e,t,i,s,a){e.dump=(function(){if(t.length===0)return e.quotingType===Uc?'""':"''";if(!e.noCompatMode&&(rH.indexOf(t)!==-1||aH.test(t)))return e.quotingType===Uc?'"'+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),d=s||e.flowLevel>-1&&i>=e.flowLevel;function m(f){return hH(e,f)}switch(mH(t,d,e.indent,c,m,e.quotingType,e.forceQuotes&&!s,a)){case V3:return t;case A0:return"'"+t.replace(/'/g,"''")+"'";case q3:return"|"+c2(t,e.indent)+u2(a2(t,l));case K3:return">"+c2(t,e.indent)+u2(a2(gH(t,c),l));case Bo:return'"'+_H(t)+'"';default:throw new Hi("impossible error: invalid scalar style")}})()}function c2(e,t){var i=$3(e)?String(t):"",s=e[e.length-1]===`
123
+ `,a=s&&(e[e.length-2]===`
124
+ `||e===`
125
+ `),l=a?"+":s?"":"-";return i+l+`
126
+ `}function u2(e){return e[e.length-1]===`
127
+ `?e.slice(0,-1):e}function gH(e,t){for(var i=/(\n+)([^\n]*)/g,s=(function(){var f=e.indexOf(`
128
+ `);return f=f!==-1?f:e.length,i.lastIndex=f,h2(e.slice(0,f),t)})(),a=e[0]===`
129
+ `||e[0]===" ",l,c;c=i.exec(e);){var d=c[1],m=c[2];l=m[0]===" ",s+=d+(!a&&!l&&m!==""?`
130
+ `:"")+h2(m,t),a=l}return s}function h2(e,t){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,s,a=0,l,c=0,d=0,m="";s=i.exec(e);)d=s.index,d-a>t&&(l=c>a?c:d,m+=`
131
+ `+e.slice(a,l),a=l+1),c=d;return m+=`
132
+ `,e.length-a>t&&c>a?m+=e.slice(a,c)+`
133
+ `+e.slice(c+1):m+=e.slice(a),m.slice(1)}function _H(e){for(var t="",i=0,s,a=0;a<e.length;i>=65536?a+=2:a++)i=yc(e,a),s=zi[i],!s&&Hc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=s||lH(i);return t}function bH(e,t,i){var s="",a=e.tag,l,c,d;for(l=0,c=i.length;l<c;l+=1)d=i[l],e.replacer&&(d=e.replacer.call(i,String(l),d)),(Js(e,t,d,!1,!1)||typeof d>"u"&&Js(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function d2(e,t,i,s){var a="",l=e.tag,c,d,m;for(c=0,d=i.length;c<d;c+=1)m=i[c],e.replacer&&(m=e.replacer.call(i,String(c),m)),(Js(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&Js(e,t+1,null,!0,!0,!1,!0))&&((!s||a!=="")&&(a+=T0(e,t)),e.dump&&Pc===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=l,e.dump=a||"[]"}function vH(e,t,i){var s="",a=e.tag,l=Object.keys(i),c,d,m,f,g;for(c=0,d=l.length;c<d;c+=1)g="",s!==""&&(g+=", "),e.condenseFlow&&(g+='"'),m=l[c],f=i[m],e.replacer&&(f=e.replacer.call(i,m,f)),Js(e,t,m,!1,!1)&&(e.dump.length>1024&&(g+="? "),g+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Js(e,t,f,!1,!1)&&(g+=e.dump,s+=g));e.tag=a,e.dump="{"+s+"}"}function yH(e,t,i,s){var a="",l=e.tag,c=Object.keys(i),d,m,f,g,b,v;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new Hi("sortKeys must be a boolean or a function");for(d=0,m=c.length;d<m;d+=1)v="",(!s||a!=="")&&(v+=T0(e,t)),f=c[d],g=i[f],e.replacer&&(g=e.replacer.call(i,f,g)),Js(e,t+1,f,!0,!0,!0)&&(b=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,b&&(e.dump&&Pc===e.dump.charCodeAt(0)?v+="?":v+="? "),v+=e.dump,b&&(v+=T0(e,t)),Js(e,t+1,g,!0,b)&&(e.dump&&Pc===e.dump.charCodeAt(0)?v+=":":v+=": ",v+=e.dump,a+=v));e.tag=l,e.dump=a||"{}"}function f2(e,t,i){var s,a,l,c,d,m;for(a=i?e.explicitTypes:e.implicitTypes,l=0,c=a.length;l<c;l+=1)if(d=a[l],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof t=="object"&&t instanceof d.instanceOf)&&(!d.predicate||d.predicate(t))){if(i?d.multi&&d.representName?e.tag=d.representName(t):e.tag=d.tag:e.tag="?",d.represent){if(m=e.styleMap[d.tag]||d.defaultStyle,B3.call(d.represent)==="[object Function]")s=d.represent(t,m);else if(z3.call(d.represent,m))s=d.represent[m](t,m);else throw new Hi("!<"+d.tag+'> tag resolver accepts not "'+m+'" style');e.dump=s}return!0}return!1}function Js(e,t,i,s,a,l,c){e.tag=null,e.dump=i,f2(e,i,!1)||f2(e,i,!0);var d=B3.call(e.dump),m=s,f;s&&(s=e.flowLevel<0||e.flowLevel>t);var g=d==="[object Object]"||d==="[object Array]",b,v;if(g&&(b=e.duplicates.indexOf(i),v=b!==-1),(e.tag!==null&&e.tag!=="?"||v||e.indent!==2&&t>0)&&(a=!1),v&&e.usedDuplicates[b])e.dump="*ref_"+b;else{if(g&&v&&!e.usedDuplicates[b]&&(e.usedDuplicates[b]=!0),d==="[object Object]")s&&Object.keys(e.dump).length!==0?(yH(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(vH(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(d==="[object Array]")s&&e.dump.length!==0?(e.noArrayIndent&&!c&&t>0?d2(e,t-1,e.dump,a):d2(e,t,e.dump,a),v&&(e.dump="&ref_"+b+e.dump)):(bH(e,t,e.dump),v&&(e.dump="&ref_"+b+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&pH(e,e.dump,t,l,m);else{if(d==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Hi("unacceptable kind of an object to dump "+d)}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 xH(e,t){var i=[],s=[],a,l;for(M0(e,i,s),a=0,l=s.length;a<l;a+=1)t.duplicates.push(i[s[a]]);t.usedDuplicates=new Array(l)}function M0(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)M0(e[a],t,i);else for(s=Object.keys(e),a=0,l=s.length;a<l;a+=1)M0(e[s[a]],t,i)}function SH(e,t){t=t||{};var i=new uH(t);i.noRefs||xH(e,i);var s=e;return i.replacer&&(s=i.replacer.call({"":s},"",s)),Js(i,0,s,!0,!0)?i.dump+`
134
+ `:""}var wH=SH,EH={dump:wH};function I_(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 CH=Mi,kH=o3,NH=h3,TH=g3,AH=_3,MH=L_,RH=j3.load,DH=j3.loadAll,OH=EH.dump,LH=Hi,jH={binary:S3,float:p3,map:u3,null:d3,pairs:E3,set:C3,timestamp:y3,bool:f3,int:m3,merge:x3,omap:w3,seq:c3,str:l3},BH=I_("safeLoad","load"),zH=I_("safeLoadAll","loadAll"),IH=I_("safeDump","dump"),PH={Type:CH,Schema:kH,FAILSAFE_SCHEMA:NH,JSON_SCHEMA:TH,CORE_SCHEMA:AH,DEFAULT_SCHEMA:MH,load:RH,loadAll:DH,dump:OH,YAMLException:LH,types:jH,safeLoad:BH,safeLoadAll:zH,safeDump:IH};function G3(e){return e!==null&&typeof e=="object"}function W3(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 Y3(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]=C.useState(s),c={paddingLeft:`${i*1.1}rem`};if(!G3(t))return h.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:c,children:[h.jsxs("span",{className:"text-zinc-500",children:[e,":"]}),h.jsx("span",{className:me("whitespace-pre-wrap break-words",W3(t)),children:Y3(t)})]});const d=Array.isArray(t)?t.map((f,g)=>[String(g),f]):Object.entries(t),m=Array.isArray(t)?`[${d.length}]`:`{${d.length}}`;return h.jsxs("div",{children:[h.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?h.jsx(vs,{className:"size-3.5 shrink-0 text-zinc-400"}):h.jsx(Yr,{className:"size-3.5 shrink-0 text-zinc-400"}),h.jsx("span",{className:"font-medium text-zinc-700",children:e}),h.jsx("span",{className:"text-zinc-400",children:m})]}),a?d.map(([f,g])=>h.jsx(X3,{label:f,value:g,depth:i+1,defaultOpen:i<1},f)):null]})}function UH({content:e}){const t=C.useMemo(()=>{try{const s=PH.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 h.jsx("div",{className:"p-4",children:h.jsxs(ut,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!G3(t.value))return h.jsx("div",{className:"p-4 font-mono text-[12px]",children:h.jsx("span",{className:W3(t.value),children:Y3(t.value)})});const i=Array.isArray(t.value)?t.value.map((s,a)=>[String(a),s]):Object.entries(t.value);return h.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:i.map(([s,a])=>h.jsx(X3,{label:s,value:a,depth:0,defaultOpen:!0},s))})}function HH(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function FH(e){const t=e.split("/").pop()?.toLowerCase()??"",i=t.includes(".")?t.split(".").pop()??"":"",s={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"ini",ini:"ini",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"xml",xml:"xml",sql:"sql",dockerfile:"dockerfile"};return s[i]?s[i]:t==="dockerfile"?"dockerfile":null}function $H(e,t){const i=e.endsWith(`
135
+ `)?e.slice(0,-1):e;return!t||!S0.getLanguage(t)?i.split(`
136
+ `).map(m2):i.split(`
137
+ `).map(s=>{if(!s)return"";try{return S0.highlight(s,{language:t,ignoreIllegals:!0}).value}catch{return m2(s)}})}function m2(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VH({content:e,path:t}){const i=C.useMemo(()=>FH(t),[t]),s=C.useMemo(()=>$H(e,i),[e,i]),a=`${Math.max(2,String(s.length).length)}ch`;return h.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:s.map((l,c)=>h.jsxs("div",{className:"flex",children:[h.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}),h.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800",dangerouslySetInnerHTML:{__html:l||" "}})]},c))})}function qH({path:e,isModified:t,onViewDiff:i}){const[s,a]=C.useState(null),[l,c]=C.useState(null),[d,m]=C.useState(!1),f=C.useMemo(()=>HH(e),[e]),[g,b]=C.useState("preview");return C.useEffect(()=>{b(f?"preview":"source")},[f]),C.useEffect(()=>{if(!e){a(null);return}let v=!0;return m(!0),c(null),G4(e).then(y=>{v&&(a(y),m(!1))}).catch(y=>{v&&(c(y instanceof Error?y.message:String(y)),m(!1))}),()=>{v=!1}},[e]),e?h.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[h.jsx("span",{children:"Read-only view of tracked file."}),s?.truncated?h.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,s?.binary?h.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f&&!s?.binary?h.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[h.jsxs("button",{type:"button",onClick:()=>b("preview"),"aria-pressed":g==="preview",className:me("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",g==="preview"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[h.jsx(O0,{className:"size-3.5"}),"Preview"]}),h.jsxs("button",{type:"button",onClick:()=>b("source"),"aria-pressed":g==="source",className:me("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",g==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[h.jsx(D5,{className:"size-3.5"}),"Source"]})]}):null,t?h.jsx(fe,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50",children:l?h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"destructive",children:l})}):d?h.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):s?.binary?h.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):s?f&&g==="preview"?f==="markdown"?h.jsx(vP,{content:s.content}):h.jsx(UH,{content:s.content}):h.jsx(VH,{content:s.content,path:e}):null})]}):h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function KH({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 p2(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 d=a.children.get(l);d||(d={name:l,fullPath:s.slice(0,c+1).join("/"),children:new Map},a.children.set(l,d)),a=d}),a.branch=i}return t}function g2({label:e,tree:t,onSelect:i,defaultOpen:s,forceOpen:a}){const[l,c]=C.useState(s??!1),d=a||l,m=t.children.size===0;return h.jsxs("div",{className:"mb-1",children:[h.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:[d?h.jsx(vs,{size:12}):h.jsx(Yr,{size:12}),e,m?null:h.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),d&&!m?h.jsx("ul",{children:Array.from(t.children.values()).map(f=>h.jsx(Z3,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function Z3({node:e,depth:t,onSelect:i,forceOpen:s}){const[a,l]=C.useState(!0),c=s||a,d=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!d&&m?h.jsx("li",{children:h.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:[h.jsx(Nc,{size:11,className:"shrink-0 opacity-70"}),h.jsx("span",{className:"truncate",children:e.name}),m.current?h.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):h.jsxs("li",{children:[h.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:[d?c?h.jsx(vs,{size:11}):h.jsx(Yr,{size:11}):h.jsx("span",{className:"inline-block w-[11px]"}),h.jsx("span",{className:"truncate",children:e.name})]}),c&&d?h.jsx("ul",{children:Array.from(e.children.values()).map(g=>h.jsx(Z3,{node:g,depth:t+1,onSelect:i,forceOpen:s},g.fullPath))}):null]})}function GH({selectedCommit:e,selectedFile:t,diff:i,diffLoading:s,diffError:a}){return h.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-white border-b border-border",children:[h.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[h.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),h.jsxs("span",{children:[e.author," <",e.email,">"]}),h.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),h.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"destructive",children:a})}):e?s?h.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?h.jsx(Gk,{activeHunkIndex:0,diff:i}):h.jsx("div",{className:"p-4",children:h.jsx(ut,{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."})}):h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function WH({files:e,filesError:t,selectedHash:i,selectedFile:s,onSelect:a}){return h.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[h.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:h.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?h.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?h.jsx("div",{className:"p-3",children:h.jsx(ut,{variant:"destructive",children:t})}):i?e.length===0?h.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):h.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>h.jsx("li",{children:h.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:[h.jsx("span",{className:YH(l.index),children:l.index.trim()||"·"}),h.jsx("span",{className:"truncate font-mono",children:l.path})]})},l.path))}):h.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function YH(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 _2=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function uc(e){return _2[e%_2.length]}function XH({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=hc(e,c),b=a?4:3.5;return h.jsxs("svg",{width:m,height:l,viewBox:`0 0 ${m} ${l}`,style:{flex:"0 0 auto",display:"block"},children:[s.map(v=>h.jsx("line",{x1:hc(v,c),y1:0,x2:hc(v,c),y2:l,stroke:uc(v),strokeWidth:1.5},`t-${v}`)),h.jsx("line",{x1:g,y1:0,x2:g,y2:f,stroke:uc(e),strokeWidth:1.5}),i.map((v,y)=>{const x=hc(v.fromLane,c),w=hc(v.toLane,c);if(x===w)return h.jsx("line",{x1:x,y1:f,x2:w,y2:l,stroke:uc(v.toLane),strokeWidth:1.5},`e-${y}`);const E=f+(l-f)/2;return h.jsx("path",{d:`M ${x} ${f} C ${x} ${E}, ${w} ${E}, ${w} ${l}`,fill:"none",stroke:uc(v.toLane),strokeWidth:1.5},`e-${y}`)}),h.jsx("circle",{cx:g,cy:f,r:b,fill:uc(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function hc(e,t){return e*t+t/2}const b2=28;function ZH({commits:e,loading:t,error:i,selectedHash:s,maxLanes:a,rowRefs:l,onSelect:c,onLoadMore:d}){return h.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[h.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?h.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),h.jsx(fe,{disabled:t,onClick:d,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i?h.jsx("div",{className:"p-3",children:h.jsx(ut,{variant:"destructive",children:i})}):t&&e.length===0?h.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?h.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):h.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>h.jsx("li",{ref:f=>{f?l.current.set(m.hash,f):l.current.delete(m.hash)},children:h.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:b2},title:`${m.hash}
138
+ ${m.author} <${m.email}>
139
+ ${m.subject}`,children:[h.jsx(XH,{lane:m.lane,laneCount:Math.max(m.laneCount,a),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:b2}),h.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),h.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(f=>h.jsx("span",{className:JH(f.kind),children:f.name},`${f.kind}-${f.name}`)),h.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),h.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),h.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:QH(m.timestamp)})]})},m.hash))})})]})}function QH(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 JH(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 v2=200;function eF(){const[e,t]=C.useState([]),[i,s]=C.useState(v2),[a,l]=C.useState(!0),[c,d]=C.useState(null),[m,f]=C.useState(null),[g,b]=C.useState([]),[v,y]=C.useState(null),[x,w]=C.useState(null),[E,A]=C.useState(""),[T,M]=C.useState(!1),[R,z]=C.useState(null);C.useEffect(()=>{let O=!0;return l(!0),d(null),$4(i).then(K=>{O&&(t(K),K.length>0&&!K.some(H=>H.hash===m)&&f(K[0].hash))}).catch(K=>{O&&d(K instanceof Error?K.message:String(K))}).finally(()=>{O&&l(!1)}),()=>{O=!1}},[i]),C.useEffect(()=>{if(!m){b([]),w(null);return}let O=!0;return y(null),q4(m).then(K=>{O&&(b(K),w(K[0]?.path??null))}).catch(K=>{O&&y(K instanceof Error?K.message:String(K))}),()=>{O=!1}},[m]),C.useEffect(()=>{if(!m){A("");return}let O=!0;return z(null),M(!0),V4(m,x??void 0).then(K=>{O&&A(K)}).catch(K=>{O&&z(K instanceof Error?K.message:String(K))}).finally(()=>{O&&M(!1)}),()=>{O=!1}},[m,x]);const U=C.useMemo(()=>e.reduce((O,K)=>Math.max(O,K.laneCount),1),[e]),j=e.find(O=>O.hash===m)??null;return{commits:e,loading:a,error:c,selectedHash:m,setSelectedHash:f,files:g,filesError:v,selectedFile:x,setSelectedFile:w,diff:E,diffLoading:T,diffError:R,maxLanes:U,selectedCommit:j,loadMore:()=>s(O=>O+v2)}}function tF({branches:e=[]}){const{commits:t,loading:i,error:s,selectedHash:a,setSelectedHash:l,files:c,filesError:d,selectedFile:m,setSelectedFile:f,diff:g,diffLoading:b,diffError:v,maxLanes:y,selectedCommit:x,loadMore:w}=eF(),[E,A]=C.useState(""),T=C.useMemo(()=>{const O=E.trim().toLowerCase();return O?e.filter(K=>K.name.toLowerCase().includes(O)):e},[e,E]),M=C.useMemo(()=>p2(T.filter(O=>!O.remote)),[T]),R=C.useMemo(()=>p2(T.filter(O=>O.remote)),[T]),z=E.trim().length>0,U=C.useRef(new Map);function j(O){const K=O.remote?"remote":"branch",H=t.find(J=>J.refs.some(P=>P.kind===K&&P.name===O.name));if(!H)return;l(H.hash);const G=U.current.get(H.hash);G&&G.scrollIntoView({block:"center",behavior:"smooth"})}return h.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[h.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[h.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[h.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),h.jsx("input",{type:"search",value:E,onChange:O=>A(O.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"})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[h.jsx(g2,{label:"Local",tree:M,onSelect:j,defaultOpen:!0,forceOpen:z}),h.jsx(g2,{label:"Remote",tree:R,onSelect:j,forceOpen:z})]})]}),h.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[h.jsx(GH,{selectedCommit:x,selectedFile:m,diff:g,diffLoading:b,diffError:v}),h.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[h.jsx(ZH,{commits:t,loading:i,error:s,selectedHash:a,maxLanes:y,rowRefs:U,onSelect:l,onLoadMore:w}),h.jsx(WH,{files:c,filesError:d,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}function iF({data:e}){const[t,i]=C.useState("changes"),[s,a]=C.useState("changes"),[l,c]=C.useState(e.git.status?.files[0]?.path??""),[d,m]=C.useState(""),[f,g]=C.useState([]),[b,v]=C.useState(null),[y,x]=C.useState(""),[w,E]=C.useState(null),[A,T]=C.useState(0),[M,R]=C.useState(null),z=e.git.status?.files??[],U=C.useMemo(()=>z.map(Z=>Z.path),[z]),j=C.useMemo(()=>Lz(y),[y]);C.useEffect(()=>{const Z=e.git.status?.files[0]?.path??"";c(W=>W&&e.git.status?.files.some(D=>D.path===W)?W:Z)},[e.git.status?.files]),C.useEffect(()=>{if(s!=="all"||f.length>0)return;let Z=!0;return v(null),K4().then(W=>{Z&&g(W)}).catch(W=>{Z&&v(W instanceof Error?W.message:String(W))}),()=>{Z=!1}},[s,f.length]),C.useEffect(()=>{if(!l){x("");return}let Z=!0;return E(null),W4(l).then(W=>{Z&&(x(W),T(0),R(null))}).catch(W=>{Z&&E(W instanceof Error?W.message:String(W))}),()=>{Z=!1}},[l]);function O(Z){T(0),R(null),c(Z)}function K(){const Z=KH({activeHunkIndex:A,filePaths:U,hunkCount:j.hunks,pendingNextFilePath:M,selectedFile:l});Z.kind==="hunk"?(R(null),T(Z.activeHunkIndex)):Z.kind==="confirm-next-file"?R(Z.filePath):Z.kind==="file"?O(Z.filePath):R(null)}function H(){if(R(null),A>0){T(D=>D-1);return}const Z=z.findIndex(D=>D.path===l),W=z[Z-1];W&&O(W.path)}const G=z.findIndex(Z=>Z.path===l),J=!!(j.hunks&&A<j.hunks-1||z[G+1]),P=!!(A>0||z[G-1]),ee=M?`End of file. Click Next again to open ${M}.`:null,q=Z=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${Z?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,N=Z=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${Z?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,F=C.useMemo(()=>new Set(z.map(Z=>Z.path)),[z]);function $(){d&&(a("changes"),O(d))}return h.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[h.jsx("button",{type:"button",className:q(t==="changes"),onClick:()=>i("changes"),children:"Changes"}),h.jsx("button",{type:"button",className:q(t==="graph"),onClick:()=>i("graph"),children:"Tree"})]}),h.jsx("div",{className:"min-h-0 flex-1",children:t==="graph"?h.jsx(tF,{branches:e.git.branches??[]}):h.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[h.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[h.jsx("button",{className:N(s==="changes"),onClick:()=>a("changes"),type:"button",children:"Changes"}),h.jsx("button",{className:N(s==="all"),onClick:()=>a("all"),type:"button",children:"All files"})]}),s==="changes"?h.jsx(Iz,{branch:e.git.status?.branch||void 0,error:e.git.error,files:e.git.status?.files??[],selectedFile:l,onSelectFile:O,root:e.git.cwd}):b?h.jsx(ut,{variant:"destructive",className:"m-3",children:b}):h.jsx(Vz,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:f,root:e.git.cwd,selectedFile:d,status:e.git.status?.files??[]})]}),s==="all"?h.jsx(qH,{isModified:F.has(d),onViewDiff:$,path:d}):h.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[h.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:l||"Diff"}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[h.jsx("span",{children:"Long rows wrap inside the editor pane."}),j.additions||j.deletions?h.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[h.jsxs("span",{className:"text-emerald-700",children:["+",j.additions]}),h.jsxs("span",{className:"text-red-700",children:["-",j.deletions]})]}):null]})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[ee?h.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:ee}):null,h.jsxs(fe,{disabled:!l||!P,onClick:H,size:"sm",type:"button",variant:"outline",children:[h.jsx(v5,{}),"Previous"]}),h.jsxs(fe,{disabled:!l||!J,onClick:K,size:"sm",type:"button",variant:"outline",children:[h.jsx(_5,{}),"Next"]})]})]}),h.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:w?h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"destructive",children:w})}):l?h.jsx(Gk,{activeHunkIndex:A,diff:y||"No unstaged diff for this file."}):h.jsx("div",{className:"p-4",children:h.jsx(ut,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function nF({initialPath:e,onSelect:t,selectedPath:i}){const[s,a]=C.useState(e),[l,c]=C.useState(null),[d,m]=C.useState(null),[f,g]=C.useState(!1),b=sF(l);return C.useEffect(()=>{a(e)},[e]),C.useEffect(()=>{let v=!0;return g(!0),m(null),U2(s).then(y=>{v&&(c(y),t(y.path))}).catch(y=>{v&&m(y instanceof Error?y.message:String(y))}).finally(()=>{v&&g(!1)}),()=>{v=!1}},[s,t]),h.jsxs("div",{className:"rounded-md border border-border bg-background",children:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[b?h.jsx(fe,{"aria-label":"Open parent folder",onClick:()=>l&&a(l.parent),size:"icon",type:"button",variant:"ghost",children:h.jsx(vs,{className:"rotate-90"})}):null,h.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l?.path??s}),f?h.jsx(ds,{className:"size-4 animate-spin text-muted-foreground"}):null]}),h.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[d?h.jsx(ut,{variant:"destructive",className:"m-1",children:d}):null,!d&&l?.entries.length===0?h.jsx(ut,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,l?.entries.map(v=>h.jsxs(fe,{className:me("h-8 w-full justify-start rounded-sm px-2 text-left",i===v.path&&"bg-muted"),onClick:()=>a(v.path),title:v.path,type:"button",variant:"ghost",children:[h.jsx(Ia,{className:"text-accent"}),h.jsx("span",{className:"truncate",children:v.name})]},v.path))]})]})}function sF(e){return!!(e&&e.parent!==e.path)}function y2(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function rF({data:e,onRefresh:t}){const[i,s]=C.useState(!1),[a,l]=C.useState(e.git.cwd),[c,d]=C.useState(null),[m,f]=C.useState(!1),[g,b]=C.useState(e.git.cwd),v=C.useRef(null),y=e.git.selectedRepository,x=y?.name??y2(e.git.cwd),{error:w,success:E}=vn(),A=oF({gitCwd:e.git.cwd});C.useEffect(()=>{l(e.git.cwd),b(e.git.cwd)},[e.git.cwd]),C.useEffect(()=>{if(!i)return;function j(O){v.current&&O.target instanceof Node&&!v.current.contains(O.target)&&s(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[i]);async function T(j){try{await sn("/api/git/select",{name:j}),s(!1),await t(),E(`Switched to ${j}.`)}catch(O){w(O instanceof Error?O.message:String(O))}}async function M(j){const O=j.trim();if(!aF(O)){const K="Please add an absolute path. Paths beginning with ~ are not expanded here.";return d(K),w(K),!1}try{const K=y2(O);return await sn("/api/git/repositories",{name:K,path:O}),d(null),await t(),E(`Added Git project ${K}.`),!0}catch(K){const H=K instanceof Error?K.message:String(K);return d(H),w(H),!1}}async function R(j){try{await Y4(j),await t(),E(`Removed Git project ${j}.`)}catch(O){w(O instanceof Error?O.message:String(O))}}async function z(j){j.preventDefault(),await M(a)&&s(!1)}function U(){d(null),b(A.selectedPath),f(!0)}return h.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:v,children:[h.jsxs(fe,{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:[h.jsx(Ia,{className:"text-muted-foreground"}),h.jsx("span",{className:"truncate",children:x}),h.jsx(vs,{className:me("ml-auto transition-transform",i&&"rotate-180")})]}),h.jsx(fe,{"aria-label":"Add Git project",onClick:U,size:"sm",type:"button",variant:"outline",children:h.jsx(jn,{})}),i?h.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:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[h.jsx(V5,{className:"size-3.5 text-muted-foreground"}),h.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),h.jsx(Ve,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),h.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?h.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(j=>{const O=j.name===y?.name;return h.jsxs("div",{className:me("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",O&&"bg-muted/70"),children:[h.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{T(j.name)},type:"button",children:[h.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:j.name}),h.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:j.path})]}),O?h.jsx(Fc,{className:"size-3.5"}):h.jsx("span",{className:"size-3.5"}),h.jsx(fe,{"aria-label":`Remove ${j.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{R(j.name)},size:"icon",title:`Remove ${j.name}`,type:"button",variant:"ghost",children:h.jsx(Vc,{className:"size-3.5 text-destructive"})})]},j.name)})}):h.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),h.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[h.jsxs("form",{className:"flex gap-1.5",onSubmit:z,children:[h.jsx(St,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:j=>{l(j.target.value),d(null)},placeholder:"/absolute/path",value:a}),h.jsxs(fe,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[h.jsx(jn,{className:"size-3"}),"Add"]}),h.jsx(fe,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:U,size:"sm",type:"button",variant:"outline",children:h.jsx(rA,{className:"size-3"})})]}),c?h.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:c}):null]})]}):null,m?h.jsx(lF,{confirmLabel:A.confirmLabel,errorMessage:c,initialPath:A.initialPath,selectedPath:g,title:"Add Git Project",onCancel:()=>f(!1),onSelect:b,onUse:async()=>{await M(g)&&(f(!1),s(!1))}}):null]})}function aF(e){return e.startsWith("/")}function oF({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function lF({confirmLabel:e="Use this folder",errorMessage:t,initialPath:i,onCancel:s,onSelect:a,onUse:l,selectedPath:c,title:d="Choose Git Project Folder"}){return h_.createPortal(h.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:h.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[h.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:h.jsx(Ia,{className:"size-4"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-sm font-semibold",children:d}),h.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:c})]}),h.jsx(fe,{"aria-label":"Close folder picker",onClick:s,size:"icon",variant:"ghost",children:h.jsx(ys,{})})]}),h.jsx(nF,{initialPath:i,onSelect:a,selectedPath:c}),t?h.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,h.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[h.jsx(fe,{onClick:s,type:"button",variant:"outline",children:"Cancel"}),h.jsx(fe,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function cF({branches:e,currentBranch:t,disabled:i,onRefresh:s}){const[a,l]=C.useState(!1),[c,d]=C.useState(""),[m,f]=C.useState(null),[g,b]=C.useState(null),[v,y]=C.useState(null),x=e.filter(R=>!R.remote),w=e.filter(R=>R.remote);async function E(R,z){f(R),y(null),b(null);try{await z(),await s()}catch(U){y(U instanceof Error?U.message:String(U))}finally{f(null)}}async function A(R){await E(`switch:${R}`,async()=>{await sn("/api/git/branches/switch",{name:R}),l(!1)})}async function T(){await E("fetch",async()=>{await sn("/api/git/fetch",{}),b("Fetched latest branch refs.")})}async function M(R){R.preventDefault();const z=c.trim();if(!z){y("Branch name is required.");return}await E("create",async()=>{await sn("/api/git/branches",{name:z}),d(""),l(!1)})}return h.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?h.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:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h.jsx(Nc,{className:"size-4 text-muted-foreground"}),h.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[h.jsx(fe,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{T()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:h.jsx(D2,{className:me(m==="fetch"&&"animate-spin")})}),h.jsx(fe,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:h.jsx(ys,{})})]})]}),h.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?h.jsxs(h.Fragment,{children:[h.jsx(x2,{branches:x,busy:m!==null,disabled:i,label:"Local",onSwitch:A}),h.jsx(x2,{branches:w,busy:m!==null,disabled:i,label:"Remote",onSwitch:A})]}):h.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),h.jsxs("div",{className:"border-t border-border p-3",children:[h.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:M,children:[h.jsx(St,{"aria-label":"New branch name",disabled:i||m!==null,onChange:R=>{d(R.target.value),y(null),b(null)},placeholder:"feature/new-work",value:c}),h.jsxs(fe,{disabled:i||m!==null,type:"submit",children:[h.jsx(dA,{}),"Create"]})]}),v||g?h.jsx(ut,{className:"mt-3 px-3 py-2 text-xs",variant:v?"destructive":"muted",children:v??g}):null]})]}):null,h.jsxs(fe,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>l(R=>!R),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[h.jsx(Nc,{className:"size-4"}),h.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),h.jsx(vs,{className:me("size-4 transition-transform",a&&"rotate-180")})]})]})}function x2({branches:e,busy:t,disabled:i,label:s,onSwitch:a}){return h.jsxs("section",{children:[h.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=>h.jsxs("button",{className:me("grid w-full grid-cols-[1fr_auto] items-center gap-2 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 hover:bg-muted",l.current&&"bg-muted/70"),disabled:i||t||l.current,onClick:()=>{a(l.name)},type:"button",children:[h.jsxs("span",{className:"min-w-0",children:[h.jsx("span",{className:"block truncate font-medium",children:l.name}),l.upstream?h.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",l.upstream]}):null]}),h.jsx(Ve,{variant:l.current?"success":l.remote?"outline":"secondary",children:l.current?"current":l.remote?"remote":"local"})]},`${l.remote?"remote":"local"}:${l.name}`)):h.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",s.toLowerCase()," branches."]})]})}function uF(e=!1){return me("group/sidebar hidden h-full shrink-0 overflow-x-hidden overflow-y-auto border-r border-border bg-card/85 py-5 backdrop-blur transition-[width,padding] duration-200 md:flex md:flex-col",e?"w-64 px-4":"w-16 px-2 hover:w-64 hover:px-4")}function hF(e,t=!1){return me("relative grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center justify-start gap-0 overflow-hidden rounded-md px-0 text-[15px] font-medium transition-[background-color,color,width] duration-150",t?"w-full":"w-12 group-hover/sidebar:w-full",e?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-muted")}function dF(e=!1,t=!1){return me("min-w-0 overflow-hidden text-left text-current transition duration-150 whitespace-pre",e?"translate-x-1 opacity-100":"opacity-0 group-hover/sidebar:translate-x-1 group-hover/sidebar:opacity-100",t?"pr-10":"pr-3")}function fF(e=!1){return me("flex size-12 items-center justify-center text-current transition-transform duration-150 [&_svg]:size-5",e?"translate-x-0":"-translate-x-px group-hover/sidebar:translate-x-0")}function mF({docked:e,onToggleDock:t}){return h.jsxs("div",{className:me("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[h.jsxs("span",{className:me("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[h.jsx("span",{children:"Made with"}),h.jsx(mA,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),h.jsx("span",{children:"by Robert Wang"}),h.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:h.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:h.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"})})})]}),h.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:me("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?h.jsx(BA,{}):h.jsx(IA,{})})]})}function pF({className:e}){return h.jsxs("div",{className:me("min-w-0",e),children:[h.jsxs("div",{className:"flex items-baseline gap-1.5",children:[h.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),h.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.34"]})]}),h.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function gF(){const[e,t]=C.useState(()=>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"),[i,s]=C.useState(null),[a,l]=C.useState(null),[c,d]=C.useState(!0),{error:m,success:f}=vn(),[g,b]=C.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),v=C.useCallback(async(x={})=>{x.silent||d(!0),l(null);try{s(await Q4()),x.notify&&f("Dashboard refreshed.")}catch(w){const E=w instanceof Error?w.message:String(w);l(E),m(E)}finally{d(!1)}},[m,f]);C.useEffect(()=>{v()},[v]),C.useEffect(()=>{function x(){document.visibilityState==="visible"&&v({silent:!0})}const w=window.setInterval(x,5e3);return window.addEventListener("focus",x),document.addEventListener("visibilitychange",x),()=>{window.clearInterval(w),window.removeEventListener("focus",x),document.removeEventListener("visibilitychange",x)}},[e,v]),C.useEffect(()=>{const x=e==="git"?"/git":e==="agent"?"/agent":e==="errors"?"/errors":e==="database"?"/database":e==="terminal"?"/terminal":"/";window.location.pathname!==x&&window.history.pushState(null,"",x)},[e]),C.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(g))},[g]);const y=C.useMemo(()=>i?Object.values(i.runtime.services).filter(x=>x.state==="running").length:0,[i]);return h.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[h.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[h.jsxs("aside",{className:uF(g),children:[h.jsxs("div",{className:me("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",g?"w-full":"w-12 group-hover/sidebar:w-full"),children:[h.jsx("div",{className:"flex size-12 items-center justify-center",children:h.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary",children:h.jsx("img",{alt:"NoMoreIDE",className:"size-full object-cover",src:k4})})}),h.jsx(pF,{className:me("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",g?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),h.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[h.jsx(Lo,{active:e==="services",badge:y,docked:g,icon:h.jsx(s4,{}),label:"Services",onClick:()=>t("services")}),h.jsx(Lo,{active:e==="git",docked:g,icon:h.jsx(Nc,{}),label:"Git Review",onClick:()=>t("git")}),h.jsx(Lo,{active:e==="errors",docked:g,icon:h.jsx(hg,{}),label:"Error Inbox",onClick:()=>t("errors")}),h.jsx(Lo,{active:e==="database",docked:g,icon:h.jsx($c,{}),label:"Database",onClick:()=>t("database")}),h.jsx(Lo,{active:e==="terminal",docked:g,icon:h.jsx(h4,{}),label:"Terminal",onClick:()=>t("terminal")}),h.jsx(Lo,{active:e==="agent",docked:g,icon:h.jsx(kc,{}),label:"Agent",onClick:()=>t("agent")})]}),h.jsx(mF,{docked:g,onToggleDock:()=>b(x=>!x)})]}),h.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[h.jsxs("header",{className:me("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(UA,{className:"size-4 text-muted-foreground md:hidden"}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:e==="git"?"Git Review":e==="agent"?"Agent":e==="errors"?"Error Inbox":e==="database"?"Database":e==="terminal"?"Terminal":"Services"}),h.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:i?.git.selectedRepository?.name??i?.git.cwd??"Local workspace"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[a?h.jsx(Ve,{variant:"danger",children:a}):null,i&&e==="git"?h.jsx(rF,{data:i,onRefresh:v}):null,h.jsxs(fe,{onClick:()=>{v({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[h.jsx(D2,{className:me(c&&"animate-spin")}),"Refresh"]})]})]}),c&&!i?h.jsx(ut,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,h.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[i&&e==="services"?h.jsx(m9,{data:i,onRefresh:v}):null,i&&e==="git"?h.jsx(iF,{data:i}):null,e==="agent"?h.jsx(d7,{}):null,e==="errors"?h.jsx(eL,{}):null,e==="database"?h.jsx(Y7,{}):null,e==="terminal"?h.jsx(Dz,{}):null]})]})]}),i&&e==="git"?h.jsx(cF,{branches:i.git.branches,currentBranch:i.git.status?.branch||void 0,disabled:!i.git.status,onRefresh:v}):null,h.jsx(A7,{onOpenAgentPage:e==="agent"?void 0:()=>t("agent")})]})}function Lo({active:e,badge:t,docked:i,icon:s,label:a,onClick:l}){return h.jsxs(fe,{"aria-label":a,title:a,className:hF(e,i),variant:"ghost",onClick:l,type:"button",children:[h.jsx("span",{className:fF(i),children:s}),h.jsx("span",{className:dF(i,t!==void 0),children:a}),t!==void 0?h.jsx(Ve,{appearance:t>0?"solid":"outline",className:me("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground":t>0?"":"border-border bg-background text-muted-foreground","absolute right-1.5 top-1.5 h-4 min-w-4 rounded-full px-1 text-[10px] leading-none shadow-none group-hover/sidebar:right-2 group-hover/sidebar:top-1/2 group-hover/sidebar:-translate-y-1/2 group-hover/sidebar:text-xs",i&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}w2.createRoot(document.getElementById("root")).render(h.jsx(C.StrictMode,{children:h.jsx(gF,{})}));