nomoreide 0.1.27 → 0.1.29

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.
Files changed (41) hide show
  1. package/dist/core/config-store.d.ts +4 -1
  2. package/dist/core/config-store.js +85 -0
  3. package/dist/core/config-store.js.map +1 -1
  4. package/dist/core/log-sources.d.ts +21 -0
  5. package/dist/core/log-sources.js +219 -0
  6. package/dist/core/log-sources.js.map +1 -0
  7. package/dist/core/service-log-source.d.ts +9 -0
  8. package/dist/core/service-log-source.js +49 -0
  9. package/dist/core/service-log-source.js.map +1 -0
  10. package/dist/core/terminal-manager.d.ts +40 -0
  11. package/dist/core/terminal-manager.js +64 -0
  12. package/dist/core/terminal-manager.js.map +1 -0
  13. package/dist/core/terminal-session.d.ts +91 -0
  14. package/dist/core/terminal-session.js +159 -0
  15. package/dist/core/terminal-session.js.map +1 -0
  16. package/dist/core/types.d.ts +59 -0
  17. package/dist/web/client/assets/index-CeFClKXu.css +1 -0
  18. package/dist/web/client/assets/index-nPZzqQbs.js +40 -0
  19. package/dist/web/client/index.html +2 -2
  20. package/dist/web/routes/context.d.ts +2 -0
  21. package/dist/web/routes/context.js.map +1 -1
  22. package/dist/web/routes/git-routes.js +9 -1
  23. package/dist/web/routes/git-routes.js.map +1 -1
  24. package/dist/web/routes/index.js +4 -0
  25. package/dist/web/routes/index.js.map +1 -1
  26. package/dist/web/routes/log-sources-routes.d.ts +6 -0
  27. package/dist/web/routes/log-sources-routes.js +102 -0
  28. package/dist/web/routes/log-sources-routes.js.map +1 -0
  29. package/dist/web/routes/service-routes.js +24 -2
  30. package/dist/web/routes/service-routes.js.map +1 -1
  31. package/dist/web/routes/shell-routes.js +8 -1
  32. package/dist/web/routes/shell-routes.js.map +1 -1
  33. package/dist/web/routes/terminal-routes.d.ts +7 -0
  34. package/dist/web/routes/terminal-routes.js +25 -0
  35. package/dist/web/routes/terminal-routes.js.map +1 -0
  36. package/dist/web/server.d.ts +2 -0
  37. package/dist/web/server.js +104 -0
  38. package/dist/web/server.js.map +1 -1
  39. package/package.json +6 -1
  40. package/dist/web/client/assets/index-BSh_mD42.css +0 -1
  41. package/dist/web/client/assets/index-CD6SvvAp.js +0 -26
@@ -0,0 +1,40 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const h of l.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function eN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jf={exports:{}},wl={};var Fb;function tN(){if(Fb)return wl;Fb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,l){var h=null;if(l!==void 0&&(h=""+l),o.key!==void 0&&(h=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:h,ref:o!==void 0?o:null,props:l}}return wl.Fragment=t,wl.jsx=s,wl.jsxs=s,wl}var Vb;function iN(){return Vb||(Vb=1,jf.exports=tN()),jf.exports}var u=iN(),Bf={exports:{}},Pe={};var $b;function sN(){if($b)return Pe;$b=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=b&&R[b]||R["@@iterator"],typeof R=="function"?R:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function T(R,te,ce){this.props=R,this.context=te,this.refs=C,this.updater=ce||x}T.prototype.isReactComponent={},T.prototype.setState=function(R,te){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,te,"setState")},T.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function O(){}O.prototype=T.prototype;function k(R,te,ce){this.props=R,this.context=te,this.refs=C,this.updater=ce||x}var D=k.prototype=new O;D.constructor=k,w(D,T.prototype),D.isPureReactComponent=!0;var U=Array.isArray;function P(){}var B={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function F(R,te,ce){var le=ce.ref;return{$$typeof:e,type:R,key:te,ref:le!==void 0?le:null,props:ce}}function Y(R,te){return F(R.type,te,R.props)}function $(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function G(R){var te={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ce){return te[ce]})}var I=/\/+/g;function ie(R,te){return typeof R=="object"&&R!==null&&R.key!=null?G(""+R.key):te.toString(36)}function J(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(te){R.status==="pending"&&(R.status="fulfilled",R.value=te)},function(te){R.status==="pending"&&(R.status="rejected",R.reason=te)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function A(R,te,ce,le,fe){var pe=typeof R;(pe==="undefined"||pe==="boolean")&&(R=null);var Se=!1;if(R===null)Se=!0;else switch(pe){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(R.$$typeof){case e:case t:Se=!0;break;case _:return Se=R._init,A(Se(R._payload),te,ce,le,fe)}}if(Se)return fe=fe(R),Se=le===""?"."+ie(R,0):le,U(fe)?(ce="",Se!=null&&(ce=Se.replace(I,"$&/")+"/"),A(fe,te,ce,"",function(tt){return tt})):fe!=null&&($(fe)&&(fe=Y(fe,ce+(fe.key==null||R&&R.key===fe.key?"":(""+fe.key).replace(I,"$&/")+"/")+Se)),te.push(fe)),1;Se=0;var Be=le===""?".":le+":";if(U(R))for(var Ee=0;Ee<R.length;Ee++)le=R[Ee],pe=Be+ie(le,Ee),Se+=A(le,te,ce,pe,fe);else if(Ee=S(R),typeof Ee=="function")for(R=Ee.call(R),Ee=0;!(le=R.next()).done;)le=le.value,pe=Be+ie(le,Ee++),Se+=A(le,te,ce,pe,fe);else if(pe==="object"){if(typeof R.then=="function")return A(J(R),te,ce,le,fe);throw te=String(R),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Se}function q(R,te,ce){if(R==null)return R;var le=[],fe=0;return A(R,le,"","",function(pe){return te.call(ce,pe,fe++)}),le}function V(R){if(R._status===-1){var te=R._result;te=te(),te.then(function(ce){(R._status===0||R._status===-1)&&(R._status=1,R._result=ce)},function(ce){(R._status===0||R._status===-1)&&(R._status=2,R._result=ce)}),R._status===-1&&(R._status=0,R._result=te)}if(R._status===1)return R._result.default;throw R._result}var Z=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},Q={map:q,forEach:function(R,te,ce){q(R,function(){te.apply(this,arguments)},ce)},count:function(R){var te=0;return q(R,function(){te++}),te},toArray:function(R){return q(R,function(te){return te})||[]},only:function(R){if(!$(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Pe.Activity=v,Pe.Children=Q,Pe.Component=T,Pe.Fragment=s,Pe.Profiler=o,Pe.PureComponent=k,Pe.StrictMode=r,Pe.Suspense=m,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return B.H.useMemoCache(R)}},Pe.cache=function(R){return function(){return R.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(R,te,ce){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var le=w({},R.props),fe=R.key;if(te!=null)for(pe in te.key!==void 0&&(fe=""+te.key),te)!M.call(te,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&te.ref===void 0||(le[pe]=te[pe]);var pe=arguments.length-2;if(pe===1)le.children=ce;else if(1<pe){for(var Se=Array(pe),Be=0;Be<pe;Be++)Se[Be]=arguments[Be+2];le.children=Se}return F(R.type,fe,le)},Pe.createContext=function(R){return R={$$typeof:h,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:l,_context:R},R},Pe.createElement=function(R,te,ce){var le,fe={},pe=null;if(te!=null)for(le in te.key!==void 0&&(pe=""+te.key),te)M.call(te,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(fe[le]=te[le]);var Se=arguments.length-2;if(Se===1)fe.children=ce;else if(1<Se){for(var Be=Array(Se),Ee=0;Ee<Se;Ee++)Be[Ee]=arguments[Ee+2];fe.children=Be}if(R&&R.defaultProps)for(le in Se=R.defaultProps,Se)fe[le]===void 0&&(fe[le]=Se[le]);return F(R,pe,fe)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(R){return{$$typeof:f,render:R}},Pe.isValidElement=$,Pe.lazy=function(R){return{$$typeof:_,_payload:{_status:-1,_result:R},_init:V}},Pe.memo=function(R,te){return{$$typeof:d,type:R,compare:te===void 0?null:te}},Pe.startTransition=function(R){var te=B.T,ce={};B.T=ce;try{var le=R(),fe=B.S;fe!==null&&fe(ce,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(P,Z)}catch(pe){Z(pe)}finally{te!==null&&ce.types!==null&&(te.types=ce.types),B.T=te}},Pe.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Pe.use=function(R){return B.H.use(R)},Pe.useActionState=function(R,te,ce){return B.H.useActionState(R,te,ce)},Pe.useCallback=function(R,te){return B.H.useCallback(R,te)},Pe.useContext=function(R){return B.H.useContext(R)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(R,te){return B.H.useDeferredValue(R,te)},Pe.useEffect=function(R,te){return B.H.useEffect(R,te)},Pe.useEffectEvent=function(R){return B.H.useEffectEvent(R)},Pe.useId=function(){return B.H.useId()},Pe.useImperativeHandle=function(R,te,ce){return B.H.useImperativeHandle(R,te,ce)},Pe.useInsertionEffect=function(R,te){return B.H.useInsertionEffect(R,te)},Pe.useLayoutEffect=function(R,te){return B.H.useLayoutEffect(R,te)},Pe.useMemo=function(R,te){return B.H.useMemo(R,te)},Pe.useOptimistic=function(R,te){return B.H.useOptimistic(R,te)},Pe.useReducer=function(R,te,ce){return B.H.useReducer(R,te,ce)},Pe.useRef=function(R){return B.H.useRef(R)},Pe.useState=function(R){return B.H.useState(R)},Pe.useSyncExternalStore=function(R,te,ce){return B.H.useSyncExternalStore(R,te,ce)},Pe.useTransition=function(){return B.H.useTransition()},Pe.version="19.2.6",Pe}var qb;function vg(){return qb||(qb=1,Bf.exports=sN()),Bf.exports}var N=vg(),zf={exports:{}},El={},If={exports:{}},Pf={};var Kb;function nN(){return Kb||(Kb=1,(function(e){function t(A,q){var V=A.length;A.push(q);e:for(;0<V;){var Z=V-1>>>1,Q=A[Z];if(0<o(Q,q))A[Z]=q,A[V]=Q,V=Z;else break e}}function s(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var q=A[0],V=A.pop();if(V!==q){A[0]=V;e:for(var Z=0,Q=A.length,R=Q>>>1;Z<R;){var te=2*(Z+1)-1,ce=A[te],le=te+1,fe=A[le];if(0>o(ce,V))le<Q&&0>o(fe,ce)?(A[Z]=fe,A[le]=V,Z=le):(A[Z]=ce,A[te]=V,Z=te);else if(le<Q&&0>o(fe,V))A[Z]=fe,A[le]=V,Z=le;else break e}}return q}function o(A,q){var V=A.sortIndex-q.sortIndex;return V!==0?V:A.id-q.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 h=Date,f=h.now();e.unstable_now=function(){return h.now()-f}}var m=[],d=[],_=1,v=null,b=3,S=!1,x=!1,w=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function D(A){for(var q=s(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=A)r(d),q.sortIndex=q.expirationTime,t(m,q);else break;q=s(d)}}function U(A){if(w=!1,D(A),!x)if(s(m)!==null)x=!0,P||(P=!0,G());else{var q=s(d);q!==null&&J(U,q.startTime-A)}}var P=!1,B=-1,M=5,F=-1;function Y(){return C?!0:!(e.unstable_now()-F<M)}function $(){if(C=!1,P){var A=e.unstable_now();F=A;var q=!0;try{e:{x=!1,w&&(w=!1,O(B),B=-1),S=!0;var V=b;try{t:{for(D(A),v=s(m);v!==null&&!(v.expirationTime>A&&Y());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,b=v.priorityLevel;var Q=Z(v.expirationTime<=A);if(A=e.unstable_now(),typeof Q=="function"){v.callback=Q,D(A),q=!0;break t}v===s(m)&&r(m),D(A)}else r(m);v=s(m)}if(v!==null)q=!0;else{var R=s(d);R!==null&&J(U,R.startTime-A),q=!1}}break e}finally{v=null,b=V,S=!1}q=void 0}}finally{q?G():P=!1}}}var G;if(typeof k=="function")G=function(){k($)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,ie=I.port2;I.port1.onmessage=$,G=function(){ie.postMessage(null)}}else G=function(){T($,0)};function J(A,q){B=T(function(){A(e.unstable_now())},q)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(A){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var V=b;b=q;try{return A()}finally{b=V}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(A,q){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var V=b;b=A;try{return q()}finally{b=V}},e.unstable_scheduleCallback=function(A,q,V){var Z=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Z+V:Z):V=Z,A){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=V+Q,A={id:_++,callback:q,priorityLevel:A,startTime:V,expirationTime:Q,sortIndex:-1},V>Z?(A.sortIndex=V,t(d,A),s(m)===null&&A===s(d)&&(w?(O(B),B=-1):w=!0,J(U,V-Z))):(A.sortIndex=Q,t(m,A),x||S||(x=!0,P||(P=!0,G()))),A},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(A){var q=b;return function(){var V=b;b=q;try{return A.apply(this,arguments)}finally{b=V}}}})(Pf)),Pf}var Gb;function rN(){return Gb||(Gb=1,If.exports=nN()),If.exports}var Uf={exports:{}},Ti={};var Wb;function aN(){if(Wb)return Ti;Wb=1;var e=vg();function t(m){var d="https://react.dev/errors/"+m;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)d+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(m,d,_){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:d,implementation:_}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,d){if(m==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ti.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ti.createPortal=function(m,d){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(m,d,null,_)},Ti.flushSync=function(m){var d=h.T,_=r.p;try{if(h.T=null,r.p=2,m)return m()}finally{h.T=d,r.p=_,r.d.f()}},Ti.preconnect=function(m,d){typeof m=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(m,d))},Ti.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Ti.preinit=function(m,d){if(typeof m=="string"&&d&&typeof d.as=="string"){var _=d.as,v=f(_,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;_==="style"?r.d.S(m,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:S}):_==="script"&&r.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ti.preinitModule=function(m,d){if(typeof m=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var _=f(d.as,d.crossOrigin);r.d.M(m,{crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(m)},Ti.preload=function(m,d){if(typeof m=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var _=d.as,v=f(_,d.crossOrigin);r.d.L(m,_,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ti.preloadModule=function(m,d){if(typeof m=="string")if(d){var _=f(d.as,d.crossOrigin);r.d.m(m,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(m)},Ti.requestFormReset=function(m){r.d.r(m)},Ti.unstable_batchedUpdates=function(m,d){return m(d)},Ti.useFormState=function(m,d,_){return h.H.useFormState(m,d,_)},Ti.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ti.version="19.2.6",Ti}var Yb;function wS(){if(Yb)return Uf.exports;Yb=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(),Uf.exports=aN(),Uf.exports}var Xb;function oN(){if(Xb)return El;Xb=1;var e=rN(),t=vg(),s=wS();function r(i){var n="https://react.dev/errors/"+i;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var n=i,a=i;if(i.alternate)for(;n.return;)n=n.return;else{i=n;do n=i,(n.flags&4098)!==0&&(a=n.return),i=n.return;while(i)}return n.tag===3?a:null}function h(i){if(i.tag===13){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function f(i){if(i.tag===31){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function m(i){if(l(i)!==i)throw Error(r(188))}function d(i){var n=i.alternate;if(!n){if(n=l(i),n===null)throw Error(r(188));return n!==i?null:i}for(var a=i,c=n;;){var p=a.return;if(p===null)break;var g=p.alternate;if(g===null){if(c=p.return,c!==null){a=c;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===a)return m(p),i;if(g===c)return m(p),n;g=g.sibling}throw Error(r(188))}if(a.return!==c.return)a=p,c=g;else{for(var y=!1,E=p.child;E;){if(E===a){y=!0,a=p,c=g;break}if(E===c){y=!0,c=p,a=g;break}E=E.sibling}if(!y){for(E=g.child;E;){if(E===a){y=!0,a=g,c=p;break}if(E===c){y=!0,c=g,a=p;break}E=E.sibling}if(!y)throw Error(r(189))}}if(a.alternate!==c)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?i:n}function _(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i;for(i=i.child;i!==null;){if(n=_(i),n!==null)return n;i=i.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),k=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var I=Symbol.for("react.client.reference");function ie(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===I?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case P:return"SuspenseList";case F:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case k:return i.displayName||"Context";case O:return(i._context.displayName||"Context")+".Consumer";case D:var n=i.render;return i=i.displayName,i||(i=n.displayName||n.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case B:return n=i.displayName||null,n!==null?n:ie(i.type)||"Memo";case M:n=i._payload,i=i._init;try{return ie(i(n))}catch{}}return null}var J=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},Z=[],Q=-1;function R(i){return{current:i}}function te(i){0>Q||(i.current=Z[Q],Z[Q]=null,Q--)}function ce(i,n){Q++,Z[Q]=i.current,i.current=n}var le=R(null),fe=R(null),pe=R(null),Se=R(null);function Be(i,n){switch(ce(pe,n),ce(fe,i),ce(le,null),n.nodeType){case 9:case 11:i=(i=n.documentElement)&&(i=i.namespaceURI)?hb(i):0;break;default:if(i=n.tagName,n=n.namespaceURI)n=hb(n),i=db(n,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}te(le),ce(le,i)}function Ee(){te(le),te(fe),te(pe)}function tt(i){i.memoizedState!==null&&ce(Se,i);var n=le.current,a=db(n,i.type);n!==a&&(ce(fe,i),ce(le,a))}function nt(i){fe.current===i&&(te(le),te(fe)),Se.current===i&&(te(Se),bl._currentValue=V)}var rt,je;function Pt(i){if(rt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);rt=n&&n[1]||"",je=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+rt+i+je}var Dr=!1;function nn(i,n){if(!i||Dr)return"";Dr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){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(ee){var X=ee}Reflect.construct(i,[],ae)}else{try{ae.call()}catch(ee){X=ee}i.call(ae.prototype)}}else{try{throw Error()}catch(ee){X=ee}(ae=i())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),y=g[0],E=g[1];if(y&&E){var L=y.split(`
4
+ `),W=E.split(`
5
+ `);for(p=c=0;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===L.length||p===W.length)for(c=L.length-1,p=W.length-1;1<=c&&0<=p&&L[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(L[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||L[c]!==W[p]){var se=`
6
+ `+L[c].replace(" at new "," at ");return i.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",i.displayName)),se}while(1<=c&&0<=p);break}}}finally{Dr=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?Pt(a):""}function va(i,n){switch(i.tag){case 26:case 27:case 5:return Pt(i.type);case 16:return Pt("Lazy");case 13:return i.child!==n&&n!==null?Pt("Suspense Fallback"):Pt("Suspense");case 19:return Pt("SuspenseList");case 0:case 15:return nn(i.type,!1);case 11:return nn(i.type.render,!1);case 1:return nn(i.type,!0);case 31:return Pt("Activity");default:return""}}function Or(i){try{var n="",a=null;do n+=va(i,a),a=i,i=i.return;while(i);return n}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Lr=Object.prototype.hasOwnProperty,zn=e.unstable_scheduleCallback,rn=e.unstable_cancelCallback,ko=e.unstable_shouldYield,ba=e.unstable_requestPaint,At=e.unstable_now,an=e.unstable_getCurrentPriorityLevel,pi=e.unstable_ImmediatePriority,on=e.unstable_UserBlockingPriority,ln=e.unstable_NormalPriority,ya=e.unstable_LowPriority,In=e.unstable_IdlePriority,To=e.log,xa=e.unstable_setDisableYieldValue,cn=null,li=null;function cs(i){if(typeof To=="function"&&xa(i),li&&typeof li.setStrictMode=="function")try{li.setStrictMode(cn,i)}catch{}}var gi=Math.clz32?Math.clz32:Sa,Mo=Math.log,jr=Math.LN2;function Sa(i){return i>>>=0,i===0?32:31-(Mo(i)/jr|0)|0}var et=256,Ms=262144,Wi=4194304;function Ci(i){var n=i&42;if(n!==0)return n;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function j(i,n,a){var c=i.pendingLanes;if(c===0)return 0;var p=0,g=i.suspendedLanes,y=i.pingedLanes;i=i.warmLanes;var E=c&134217727;return E!==0?(c=E&~g,c!==0?p=Ci(c):(y&=E,y!==0?p=Ci(y):a||(a=E&~i,a!==0&&(p=Ci(a))))):(E=c&~g,E!==0?p=Ci(E):y!==0?p=Ci(y):a||(a=c&~i,a!==0&&(p=Ci(a)))),p===0?0:n!==0&&n!==p&&(n&g)===0&&(g=p&-p,a=n&-n,g>=a||g===32&&(a&4194048)!==0)?n:p}function ne(i,n){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&n)===0}function me(i,n){switch(i){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ze(){var i=Wi;return Wi<<=1,(Wi&62914560)===0&&(Wi=4194304),i}function St(i){for(var n=[],a=0;31>a;a++)n.push(i);return n}function gt(i,n){i.pendingLanes|=n,n!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ke(i,n,a,c,p,g){var y=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var E=i.entanglements,L=i.expirationTimes,W=i.hiddenUpdates;for(a=y&~a;0<a;){var se=31-gi(a),ae=1<<se;E[se]=0,L[se]=-1;var X=W[se];if(X!==null)for(W[se]=null,se=0;se<X.length;se++){var ee=X[se];ee!==null&&(ee.lane&=-536870913)}a&=~ae}c!==0&&be(i,c,0),g!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=g&~(y&~n))}function be(i,n,a){i.pendingLanes|=n,i.suspendedLanes&=~n;var c=31-gi(n);i.entangledLanes|=n,i.entanglements[c]=i.entanglements[c]|1073741824|a&261930}function Le(i,n){var a=i.entangledLanes|=n;for(i=i.entanglements;a;){var c=31-gi(a),p=1<<c;p&n|i[c]&n&&(i[c]|=n),a&=~p}}function Ut(i,n){var a=n&-n;return a=(a&42)!==0?1:kt(a),(a&(i.suspendedLanes|n))!==0?0:a}function kt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function un(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function wa(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:jb(i.type))}function Ea(i,n){var a=q.p;try{return q.p=i,n()}finally{q.p=a}}var zs=Math.random().toString(36).slice(2),Ht="__reactFiber$"+zs,Ni="__reactProps$"+zs,Pn="__reactContainer$"+zs,Ao="__reactEvents$"+zs,mc="__reactListeners$"+zs,Ca="__reactHandles$"+zs,pc="__reactResources$"+zs,Br="__reactMarker$"+zs;function Ro(i){delete i[Ht],delete i[Ni],delete i[Ao],delete i[mc],delete i[Ca]}function Ai(i){var n=i[Ht];if(n)return n;for(var a=i.parentNode;a;){if(n=a[Pn]||a[Ht]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(i=bb(i);i!==null;){if(a=i[Ht])return a;i=bb(i)}return n}i=a,a=i.parentNode}return null}function hn(i){if(i=i[Ht]||i[Pn]){var n=i.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return i}return null}function Un(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i.stateNode;throw Error(r(33))}function Hn(i){var n=i[pc];return n||(n=i[pc]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(i){i[Br]=!0}var gc=new Set,zr={};function dn(i,n){ue(i,n),ue(i+"Capture",n)}function ue(i,n){for(zr[i]=n,i=0;i<n.length;i++)gc.add(n[i])}var Ae=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]*$"),Ge={},lt={};function Ft(i){return Lr.call(lt,i)?!0:Lr.call(Ge,i)?!1:Ae.test(i)?lt[i]=!0:(Ge[i]=!0,!1)}function ki(i,n,a){if(Ft(n))if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(n);return}}i.setAttribute(n,""+a)}}function Yi(i,n,a){if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(n);return}i.setAttribute(n,""+a)}}function zi(i,n,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(n,a,""+c)}}function xt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Xi(i){var n=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _c(i,n,a){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,n);if(!i.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,g=c.set;return Object.defineProperty(i,n,{configurable:!0,get:function(){return p.call(this)},set:function(y){a=""+y,g.call(this,y)}}),Object.defineProperty(i,n,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){i._valueTracker=null,delete i[n]}}}}function Na(i){if(!i._valueTracker){var n=Xi(i)?"checked":"value";i._valueTracker=_c(i,n,""+i[n])}}function Do(i){if(!i)return!1;var n=i._valueTracker;if(!n)return!0;var a=n.getValue(),c="";return i&&(c=Xi(i)?i.checked?"true":"false":i.value),i=c,i!==a?(n.setValue(i),!0):!1}function ka(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Oh=/[\n"\\]/g;function Ii(i){return i.replace(Oh,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Oo(i,n,a,c,p,g,y,E){i.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?i.type=y:i.removeAttribute("type"),n!=null?y==="number"?(n===0&&i.value===""||i.value!=n)&&(i.value=""+xt(n)):i.value!==""+xt(n)&&(i.value=""+xt(n)):y!=="submit"&&y!=="reset"||i.removeAttribute("value"),n!=null?Ta(i,y,xt(n)):a!=null?Ta(i,y,xt(a)):c!=null&&i.removeAttribute("value"),p==null&&g!=null&&(i.defaultChecked=!!g),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.name=""+xt(E):i.removeAttribute("name")}function Ir(i,n,a,c,p,g,y,E){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),n!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||n!=null)){Na(i);return}a=a!=null?""+xt(a):"",n=n!=null?""+xt(n):a,E||n===i.value||(i.value=n),i.defaultValue=n}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=E?i.checked:!!c,i.defaultChecked=!!c,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.name=y),Na(i)}function Ta(i,n,a){n==="number"&&ka(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function _i(i,n,a,c){if(i=i.options,n){n={};for(var p=0;p<a.length;p++)n["$"+a[p]]=!0;for(a=0;a<i.length;a++)p=n.hasOwnProperty("$"+i[a].value),i[a].selected!==p&&(i[a].selected=p),p&&c&&(i[a].defaultSelected=!0)}else{for(a=""+xt(a),n=null,p=0;p<i.length;p++){if(i[p].value===a){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}n!==null||i[p].disabled||(n=i[p])}n!==null&&(n.selected=!0)}}function vc(i,n,a){if(n!=null&&(n=""+xt(n),n!==i.value&&(i.value=n),a==null)){i.defaultValue!==n&&(i.defaultValue=n);return}i.defaultValue=a!=null?""+xt(a):""}function Ma(i,n,a,c){if(n==null){if(c!=null){if(a!=null)throw Error(r(92));if(J(c)){if(1<c.length)throw Error(r(93));c=c[0]}a=c}a==null&&(a=""),n=a}a=xt(n),i.defaultValue=a,c=i.textContent,c===a&&c!==""&&c!==null&&(i.value=c),Na(i)}function Oe(i,n){if(n){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=n;return}}i.textContent=n}var bc=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 Gt(i,n,a){var c=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?i.setProperty(n,""):n==="float"?i.cssFloat="":i[n]="":c?i.setProperty(n,a):typeof a!="number"||a===0||bc.has(n)?n==="float"?i.cssFloat=a:i[n]=(""+a).trim():i[n]=a+"px"}function ct(i,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(i=i.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var p in n)c=n[p],n.hasOwnProperty(p)&&a[p]!==c&&Gt(i,p,c)}else for(var g in n)n.hasOwnProperty(g)&&Gt(i,g,n[g])}function Fn(i){if(i.indexOf("-")===-1)return!1;switch(i){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 fn=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"]]),Lo=/^[\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 Vn(i){return Lo.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function de(){}var Te=null;function Ue(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Xe=null,Rt=null;function us(i){var n=hn(i);if(n&&(i=n.stateNode)){var a=i[Ni]||null;e:switch(i=n.stateNode,n.type){case"input":if(Oo(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ii(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var c=a[n];if(c!==i&&c.form===i.form){var p=c[Ni]||null;if(!p)throw Error(r(90));Oo(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(n=0;n<a.length;n++)c=a[n],c.form===i.form&&Do(c)}break e;case"textarea":vc(i,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&_i(i,!!a.multiple,n,!1)}}}var jo=!1;function yc(i,n,a){if(jo)return i(n,a);jo=!0;try{var c=i(n);return c}finally{if(jo=!1,(Xe!==null||Rt!==null)&&(ou(),Xe&&(n=Xe,i=Rt,Rt=Xe=null,us(n),i)))for(n=0;n<i.length;n++)us(i[n])}}function Bo(i,n){var a=i.stateNode;if(a===null)return null;var c=a[Ni]||null;if(c===null)return null;a=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lh=!1;if(mn)try{var zo={};Object.defineProperty(zo,"passive",{get:function(){Lh=!0}}),window.addEventListener("test",zo,zo),window.removeEventListener("test",zo,zo)}catch{Lh=!1}var $n=null,jh=null,xc=null;function d_(){if(xc)return xc;var i,n=jh,a=n.length,c,p="value"in $n?$n.value:$n.textContent,g=p.length;for(i=0;i<a&&n[i]===p[i];i++);var y=a-i;for(c=1;c<=y&&n[a-c]===p[g-c];c++);return xc=p.slice(i,1<c?1-c:void 0)}function Sc(i){var n=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&n===13&&(i=13)):i=n,i===10&&(i=13),32<=i||i===13?i:0}function wc(){return!0}function f_(){return!1}function Pi(i){function n(a,c,p,g,y){this._reactName=a,this._targetInst=p,this.type=c,this.nativeEvent=g,this.target=y,this.currentTarget=null;for(var E in i)i.hasOwnProperty(E)&&(a=i[E],this[E]=a?a(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?wc:f_,this.isPropagationStopped=f_,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=wc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=wc)},persist:function(){},isPersistent:wc}),n}var Pr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ec=Pi(Pr),Io=v({},Pr,{view:0,detail:0}),QE=Pi(Io),Bh,zh,Po,Cc=v({},Io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Po&&(Po&&i.type==="mousemove"?(Bh=i.screenX-Po.screenX,zh=i.screenY-Po.screenY):zh=Bh=0,Po=i),Bh)},movementY:function(i){return"movementY"in i?i.movementY:zh}}),m_=Pi(Cc),JE=v({},Cc,{dataTransfer:0}),eC=Pi(JE),tC=v({},Io,{relatedTarget:0}),Ih=Pi(tC),iC=v({},Pr,{animationName:0,elapsedTime:0,pseudoElement:0}),sC=Pi(iC),nC=v({},Pr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),rC=Pi(nC),aC=v({},Pr,{data:0}),p_=Pi(aC),oC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lC={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"},cC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uC(i){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(i):(i=cC[i])?!!n[i]:!1}function Ph(){return uC}var hC=v({},Io,{key:function(i){if(i.key){var n=oC[i.key]||i.key;if(n!=="Unidentified")return n}return i.type==="keypress"?(i=Sc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?lC[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(i){return i.type==="keypress"?Sc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Sc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),dC=Pi(hC),fC=v({},Cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),g_=Pi(fC),mC=v({},Io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),pC=Pi(mC),gC=v({},Pr,{propertyName:0,elapsedTime:0,pseudoElement:0}),_C=Pi(gC),vC=v({},Cc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),bC=Pi(vC),yC=v({},Pr,{newState:0,oldState:0}),xC=Pi(yC),SC=[9,13,27,32],Uh=mn&&"CompositionEvent"in window,Uo=null;mn&&"documentMode"in document&&(Uo=document.documentMode);var wC=mn&&"TextEvent"in window&&!Uo,__=mn&&(!Uh||Uo&&8<Uo&&11>=Uo),v_=" ",b_=!1;function y_(i,n){switch(i){case"keyup":return SC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Aa=!1;function EC(i,n){switch(i){case"compositionend":return x_(n);case"keypress":return n.which!==32?null:(b_=!0,v_);case"textInput":return i=n.data,i===v_&&b_?null:i;default:return null}}function CC(i,n){if(Aa)return i==="compositionend"||!Uh&&y_(i,n)?(i=d_(),xc=jh=$n=null,Aa=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return __&&n.locale!=="ko"?null:n.data;default:return null}}var NC={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 S_(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n==="input"?!!NC[i.type]:n==="textarea"}function w_(i,n,a,c){Xe?Rt?Rt.push(c):Rt=[c]:Xe=c,n=mu(n,"onChange"),0<n.length&&(a=new Ec("onChange","change",null,a,c),i.push({event:a,listeners:n}))}var Ho=null,Fo=null;function kC(i){rb(i,0)}function Nc(i){var n=Un(i);if(Do(n))return i}function E_(i,n){if(i==="change")return n}var C_=!1;if(mn){var Hh;if(mn){var Fh="oninput"in document;if(!Fh){var N_=document.createElement("div");N_.setAttribute("oninput","return;"),Fh=typeof N_.oninput=="function"}Hh=Fh}else Hh=!1;C_=Hh&&(!document.documentMode||9<document.documentMode)}function k_(){Ho&&(Ho.detachEvent("onpropertychange",T_),Fo=Ho=null)}function T_(i){if(i.propertyName==="value"&&Nc(Fo)){var n=[];w_(n,Fo,i,Ue(i)),yc(kC,n)}}function TC(i,n,a){i==="focusin"?(k_(),Ho=n,Fo=a,Ho.attachEvent("onpropertychange",T_)):i==="focusout"&&k_()}function MC(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Nc(Fo)}function AC(i,n){if(i==="click")return Nc(n)}function RC(i,n){if(i==="input"||i==="change")return Nc(n)}function DC(i,n){return i===n&&(i!==0||1/i===1/n)||i!==i&&n!==n}var Zi=typeof Object.is=="function"?Object.is:DC;function Vo(i,n){if(Zi(i,n))return!0;if(typeof i!="object"||i===null||typeof n!="object"||n===null)return!1;var a=Object.keys(i),c=Object.keys(n);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var p=a[c];if(!Lr.call(n,p)||!Zi(i[p],n[p]))return!1}return!0}function M_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function A_(i,n){var a=M_(i);i=0;for(var c;a;){if(a.nodeType===3){if(c=i+a.textContent.length,i<=n&&c>=n)return{node:a,offset:n-i};i=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=M_(a)}}function R_(i,n){return i&&n?i===n?!0:i&&i.nodeType===3?!1:n&&n.nodeType===3?R_(i,n.parentNode):"contains"in i?i.contains(n):i.compareDocumentPosition?!!(i.compareDocumentPosition(n)&16):!1:!1}function D_(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var n=ka(i.document);n instanceof i.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)i=n.contentWindow;else break;n=ka(i.document)}return n}function Vh(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n&&(n==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||n==="textarea"||i.contentEditable==="true")}var OC=mn&&"documentMode"in document&&11>=document.documentMode,Ra=null,$h=null,$o=null,qh=!1;function O_(i,n,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qh||Ra==null||Ra!==ka(c)||(c=Ra,"selectionStart"in c&&Vh(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),$o&&Vo($o,c)||($o=c,c=mu($h,"onSelect"),0<c.length&&(n=new Ec("onSelect","select",null,n,a),i.push({event:n,listeners:c}),n.target=Ra)))}function Ur(i,n){var a={};return a[i.toLowerCase()]=n.toLowerCase(),a["Webkit"+i]="webkit"+n,a["Moz"+i]="moz"+n,a}var Da={animationend:Ur("Animation","AnimationEnd"),animationiteration:Ur("Animation","AnimationIteration"),animationstart:Ur("Animation","AnimationStart"),transitionrun:Ur("Transition","TransitionRun"),transitionstart:Ur("Transition","TransitionStart"),transitioncancel:Ur("Transition","TransitionCancel"),transitionend:Ur("Transition","TransitionEnd")},Kh={},L_={};mn&&(L_=document.createElement("div").style,"AnimationEvent"in window||(delete Da.animationend.animation,delete Da.animationiteration.animation,delete Da.animationstart.animation),"TransitionEvent"in window||delete Da.transitionend.transition);function Hr(i){if(Kh[i])return Kh[i];if(!Da[i])return i;var n=Da[i],a;for(a in n)if(n.hasOwnProperty(a)&&a in L_)return Kh[i]=n[a];return i}var j_=Hr("animationend"),B_=Hr("animationiteration"),z_=Hr("animationstart"),LC=Hr("transitionrun"),jC=Hr("transitionstart"),BC=Hr("transitioncancel"),I_=Hr("transitionend"),P_=new Map,Gh="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(" ");Gh.push("scrollEnd");function As(i,n){P_.set(i,n),dn(n,[i])}var kc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hs=[],Oa=0,Wh=0;function Tc(){for(var i=Oa,n=Wh=Oa=0;n<i;){var a=hs[n];hs[n++]=null;var c=hs[n];hs[n++]=null;var p=hs[n];hs[n++]=null;var g=hs[n];if(hs[n++]=null,c!==null&&p!==null){var y=c.pending;y===null?p.next=p:(p.next=y.next,y.next=p),c.pending=p}g!==0&&U_(a,p,g)}}function Mc(i,n,a,c){hs[Oa++]=i,hs[Oa++]=n,hs[Oa++]=a,hs[Oa++]=c,Wh|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function Yh(i,n,a,c){return Mc(i,n,a,c),Ac(i)}function Fr(i,n){return Mc(i,null,null,n),Ac(i)}function U_(i,n,a){i.lanes|=a;var c=i.alternate;c!==null&&(c.lanes|=a);for(var p=!1,g=i.return;g!==null;)g.childLanes|=a,c=g.alternate,c!==null&&(c.childLanes|=a),g.tag===22&&(i=g.stateNode,i===null||i._visibility&1||(p=!0)),i=g,g=g.return;return i.tag===3?(g=i.stateNode,p&&n!==null&&(p=31-gi(a),i=g.hiddenUpdates,c=i[p],c===null?i[p]=[n]:c.push(n),n.lane=a|536870912),g):null}function Ac(i){if(50<dl)throw dl=0,rf=null,Error(r(185));for(var n=i.return;n!==null;)i=n,n=i.return;return i.tag===3?i.stateNode:null}var La={};function zC(i,n,a,c){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qi(i,n,a,c){return new zC(i,n,a,c)}function Xh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function pn(i,n){var a=i.alternate;return a===null?(a=Qi(i.tag,n,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=n,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,n=i.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function H_(i,n){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=n,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,n=a.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i}function Rc(i,n,a,c,p,g){var y=0;if(c=i,typeof i=="function")Xh(i)&&(y=1);else if(typeof i=="string")y=F3(i,a,le.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case F:return i=Qi(31,a,n,p),i.elementType=F,i.lanes=g,i;case w:return Vr(a.children,p,g,n);case C:y=8,p|=24;break;case T:return i=Qi(12,a,n,p|2),i.elementType=T,i.lanes=g,i;case U:return i=Qi(13,a,n,p),i.elementType=U,i.lanes=g,i;case P:return i=Qi(19,a,n,p),i.elementType=P,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:y=10;break e;case O:y=9;break e;case D:y=11;break e;case B:y=14;break e;case M:y=16,c=null;break e}y=29,a=Error(r(130,i===null?"null":typeof i,"")),c=null}return n=Qi(y,a,n,p),n.elementType=i,n.type=c,n.lanes=g,n}function Vr(i,n,a,c){return i=Qi(7,i,c,n),i.lanes=a,i}function Zh(i,n,a){return i=Qi(6,i,null,n),i.lanes=a,i}function F_(i){var n=Qi(18,null,null,0);return n.stateNode=i,n}function Qh(i,n,a){return n=Qi(4,i.children!==null?i.children:[],i.key,n),n.lanes=a,n.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},n}var V_=new WeakMap;function ds(i,n){if(typeof i=="object"&&i!==null){var a=V_.get(i);return a!==void 0?a:(n={value:i,source:n,stack:Or(n)},V_.set(i,n),n)}return{value:i,source:n,stack:Or(n)}}var ja=[],Ba=0,Dc=null,qo=0,fs=[],ms=0,qn=null,Is=1,Ps="";function gn(i,n){ja[Ba++]=qo,ja[Ba++]=Dc,Dc=i,qo=n}function $_(i,n,a){fs[ms++]=Is,fs[ms++]=Ps,fs[ms++]=qn,qn=i;var c=Is;i=Ps;var p=32-gi(c)-1;c&=~(1<<p),a+=1;var g=32-gi(n)+p;if(30<g){var y=p-p%5;g=(c&(1<<y)-1).toString(32),c>>=y,p-=y,Is=1<<32-gi(n)+p|a<<p|c,Ps=g+i}else Is=1<<g|a<<p|c,Ps=i}function Jh(i){i.return!==null&&(gn(i,1),$_(i,1,0))}function ed(i){for(;i===Dc;)Dc=ja[--Ba],ja[Ba]=null,qo=ja[--Ba],ja[Ba]=null;for(;i===qn;)qn=fs[--ms],fs[ms]=null,Ps=fs[--ms],fs[ms]=null,Is=fs[--ms],fs[ms]=null}function q_(i,n){fs[ms++]=Is,fs[ms++]=Ps,fs[ms++]=qn,Is=n.id,Ps=n.overflow,qn=i}var vi=null,wt=null,Je=!1,Kn=null,ps=!1,td=Error(r(519));function Gn(i){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ko(ds(n,i)),td}function K_(i){var n=i.stateNode,a=i.type,c=i.memoizedProps;switch(n[Ht]=i,n[Ni]=c,a){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(a=0;a<ml.length;a++)Ye(ml[a],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),Ir(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Ma(n,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||c.suppressHydrationWarning===!0||cb(n.textContent,a)?(c.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),c.onScroll!=null&&Ye("scroll",n),c.onScrollEnd!=null&&Ye("scrollend",n),c.onClick!=null&&(n.onclick=de),n=!0):n=!1,n||Gn(i,!0)}function G_(i){for(vi=i.return;vi;)switch(vi.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:vi=vi.return}}function za(i){if(i!==vi)return!1;if(!Je)return G_(i),Je=!0,!1;var n=i.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||yf(i.type,i.memoizedProps)),a=!a),a&&wt&&Gn(i),G_(i),n===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));wt=vb(i)}else if(n===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));wt=vb(i)}else n===27?(n=wt,or(i.type)?(i=Cf,Cf=null,wt=i):wt=n):wt=vi?_s(i.stateNode.nextSibling):null;return!0}function $r(){wt=vi=null,Je=!1}function id(){var i=Kn;return i!==null&&(Vi===null?Vi=i:Vi.push.apply(Vi,i),Kn=null),i}function Ko(i){Kn===null?Kn=[i]:Kn.push(i)}var sd=R(null),qr=null,_n=null;function Wn(i,n,a){ce(sd,n._currentValue),n._currentValue=a}function vn(i){i._currentValue=sd.current,te(sd)}function nd(i,n,a){for(;i!==null;){var c=i.alternate;if((i.childLanes&n)!==n?(i.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),i===a)break;i=i.return}}function rd(i,n,a,c){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var g=p.dependencies;if(g!==null){var y=p.child;g=g.firstContext;e:for(;g!==null;){var E=g;g=p;for(var L=0;L<n.length;L++)if(E.context===n[L]){g.lanes|=a,E=g.alternate,E!==null&&(E.lanes|=a),nd(g.return,a,i),c||(y=null);break e}g=E.next}}else if(p.tag===18){if(y=p.return,y===null)throw Error(r(341));y.lanes|=a,g=y.alternate,g!==null&&(g.lanes|=a),nd(y,a,i),y=null}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===i){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}}function Ia(i,n,a,c){i=null;for(var p=n,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var y=p.alternate;if(y===null)throw Error(r(387));if(y=y.memoizedProps,y!==null){var E=p.type;Zi(p.pendingProps.value,y.value)||(i!==null?i.push(E):i=[E])}}else if(p===Se.current){if(y=p.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(bl):i=[bl])}p=p.return}i!==null&&rd(n,i,a,c),n.flags|=262144}function Oc(i){for(i=i.firstContext;i!==null;){if(!Zi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Kr(i){qr=i,_n=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function bi(i){return W_(qr,i)}function Lc(i,n){return qr===null&&Kr(i),W_(i,n)}function W_(i,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},_n===null){if(i===null)throw Error(r(308));_n=n,i.dependencies={lanes:0,firstContext:n},i.flags|=524288}else _n=_n.next=n;return a}var IC=typeof AbortController<"u"?AbortController:function(){var i=[],n=this.signal={aborted:!1,addEventListener:function(a,c){i.push(c)}};this.abort=function(){n.aborted=!0,i.forEach(function(a){return a()})}},PC=e.unstable_scheduleCallback,UC=e.unstable_NormalPriority,Wt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ad(){return{controller:new IC,data:new Map,refCount:0}}function Go(i){i.refCount--,i.refCount===0&&PC(UC,function(){i.controller.abort()})}var Wo=null,od=0,Pa=0,Ua=null;function HC(i,n){if(Wo===null){var a=Wo=[];od=0,Pa=hf(),Ua={status:"pending",value:void 0,then:function(c){a.push(c)}}}return od++,n.then(Y_,Y_),n}function Y_(){if(--od===0&&Wo!==null){Ua!==null&&(Ua.status="fulfilled");var i=Wo;Wo=null,Pa=0,Ua=null;for(var n=0;n<i.length;n++)(0,i[n])()}}function FC(i,n){var a=[],c={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return i.then(function(){c.status="fulfilled",c.value=n;for(var p=0;p<a.length;p++)(0,a[p])(n)},function(p){for(c.status="rejected",c.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),c}var X_=A.S;A.S=function(i,n){Ov=At(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&HC(i,n),X_!==null&&X_(i,n)};var Gr=R(null);function ld(){var i=Gr.current;return i!==null?i:_t.pooledCache}function jc(i,n){n===null?ce(Gr,Gr.current):ce(Gr,n.pool)}function Z_(){var i=ld();return i===null?null:{parent:Wt._currentValue,pool:i}}var Ha=Error(r(460)),cd=Error(r(474)),Bc=Error(r(542)),zc={then:function(){}};function Q_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function J_(i,n,a){switch(a=i[a],a===void 0?i.push(n):a!==n&&(n.then(de,de),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,t0(i),i;default:if(typeof n.status=="string")n.then(de,de);else{if(i=_t,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=n,i.status="pending",i.then(function(c){if(n.status==="pending"){var p=n;p.status="fulfilled",p.value=c}},function(c){if(n.status==="pending"){var p=n;p.status="rejected",p.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,t0(i),i}throw Yr=n,Ha}}function Wr(i){try{var n=i._init;return n(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Yr=a,Ha):a}}var Yr=null;function e0(){if(Yr===null)throw Error(r(459));var i=Yr;return Yr=null,i}function t0(i){if(i===Ha||i===Bc)throw Error(r(483))}var Fa=null,Yo=0;function Ic(i){var n=Yo;return Yo+=1,Fa===null&&(Fa=[]),J_(Fa,i,n)}function Xo(i,n){n=n.props.ref,i.ref=n!==void 0?n:null}function Pc(i,n){throw n.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(n),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)))}function i0(i){function n(H,z){if(i){var K=H.deletions;K===null?(H.deletions=[z],H.flags|=16):K.push(z)}}function a(H,z){if(!i)return null;for(;z!==null;)n(H,z),z=z.sibling;return null}function c(H){for(var z=new Map;H!==null;)H.key!==null?z.set(H.key,H):z.set(H.index,H),H=H.sibling;return z}function p(H,z){return H=pn(H,z),H.index=0,H.sibling=null,H}function g(H,z,K){return H.index=K,i?(K=H.alternate,K!==null?(K=K.index,K<z?(H.flags|=67108866,z):K):(H.flags|=67108866,z)):(H.flags|=1048576,z)}function y(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function E(H,z,K,re){return z===null||z.tag!==6?(z=Zh(K,H.mode,re),z.return=H,z):(z=p(z,K),z.return=H,z)}function L(H,z,K,re){var Re=K.type;return Re===w?se(H,z,K.props.children,re,K.key):z!==null&&(z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===M&&Wr(Re)===z.type)?(z=p(z,K.props),Xo(z,K),z.return=H,z):(z=Rc(K.type,K.key,K.props,null,H.mode,re),Xo(z,K),z.return=H,z)}function W(H,z,K,re){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=Qh(K,H.mode,re),z.return=H,z):(z=p(z,K.children||[]),z.return=H,z)}function se(H,z,K,re,Re){return z===null||z.tag!==7?(z=Vr(K,H.mode,re,Re),z.return=H,z):(z=p(z,K),z.return=H,z)}function ae(H,z,K){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Zh(""+z,H.mode,K),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return K=Rc(z.type,z.key,z.props,null,H.mode,K),Xo(K,z),K.return=H,K;case x:return z=Qh(z,H.mode,K),z.return=H,z;case M:return z=Wr(z),ae(H,z,K)}if(J(z)||G(z))return z=Vr(z,H.mode,K,null),z.return=H,z;if(typeof z.then=="function")return ae(H,Ic(z),K);if(z.$$typeof===k)return ae(H,Lc(H,z),K);Pc(H,z)}return null}function X(H,z,K,re){var Re=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Re!==null?null:E(H,z,""+K,re);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return K.key===Re?L(H,z,K,re):null;case x:return K.key===Re?W(H,z,K,re):null;case M:return K=Wr(K),X(H,z,K,re)}if(J(K)||G(K))return Re!==null?null:se(H,z,K,re,null);if(typeof K.then=="function")return X(H,z,Ic(K),re);if(K.$$typeof===k)return X(H,z,Lc(H,K),re);Pc(H,K)}return null}function ee(H,z,K,re,Re){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return H=H.get(K)||null,E(z,H,""+re,Re);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return H=H.get(re.key===null?K:re.key)||null,L(z,H,re,Re);case x:return H=H.get(re.key===null?K:re.key)||null,W(z,H,re,Re);case M:return re=Wr(re),ee(H,z,K,re,Re)}if(J(re)||G(re))return H=H.get(K)||null,se(z,H,re,Re,null);if(typeof re.then=="function")return ee(H,z,K,Ic(re),Re);if(re.$$typeof===k)return ee(H,z,K,Lc(z,re),Re);Pc(z,re)}return null}function Ce(H,z,K,re){for(var Re=null,it=null,Me=z,Fe=z=0,Qe=null;Me!==null&&Fe<K.length;Fe++){Me.index>Fe?(Qe=Me,Me=null):Qe=Me.sibling;var st=X(H,Me,K[Fe],re);if(st===null){Me===null&&(Me=Qe);break}i&&Me&&st.alternate===null&&n(H,Me),z=g(st,z,Fe),it===null?Re=st:it.sibling=st,it=st,Me=Qe}if(Fe===K.length)return a(H,Me),Je&&gn(H,Fe),Re;if(Me===null){for(;Fe<K.length;Fe++)Me=ae(H,K[Fe],re),Me!==null&&(z=g(Me,z,Fe),it===null?Re=Me:it.sibling=Me,it=Me);return Je&&gn(H,Fe),Re}for(Me=c(Me);Fe<K.length;Fe++)Qe=ee(Me,H,Fe,K[Fe],re),Qe!==null&&(i&&Qe.alternate!==null&&Me.delete(Qe.key===null?Fe:Qe.key),z=g(Qe,z,Fe),it===null?Re=Qe:it.sibling=Qe,it=Qe);return i&&Me.forEach(function(dr){return n(H,dr)}),Je&&gn(H,Fe),Re}function De(H,z,K,re){if(K==null)throw Error(r(151));for(var Re=null,it=null,Me=z,Fe=z=0,Qe=null,st=K.next();Me!==null&&!st.done;Fe++,st=K.next()){Me.index>Fe?(Qe=Me,Me=null):Qe=Me.sibling;var dr=X(H,Me,st.value,re);if(dr===null){Me===null&&(Me=Qe);break}i&&Me&&dr.alternate===null&&n(H,Me),z=g(dr,z,Fe),it===null?Re=dr:it.sibling=dr,it=dr,Me=Qe}if(st.done)return a(H,Me),Je&&gn(H,Fe),Re;if(Me===null){for(;!st.done;Fe++,st=K.next())st=ae(H,st.value,re),st!==null&&(z=g(st,z,Fe),it===null?Re=st:it.sibling=st,it=st);return Je&&gn(H,Fe),Re}for(Me=c(Me);!st.done;Fe++,st=K.next())st=ee(Me,H,Fe,st.value,re),st!==null&&(i&&st.alternate!==null&&Me.delete(st.key===null?Fe:st.key),z=g(st,z,Fe),it===null?Re=st:it.sibling=st,it=st);return i&&Me.forEach(function(J3){return n(H,J3)}),Je&&gn(H,Fe),Re}function mt(H,z,K,re){if(typeof K=="object"&&K!==null&&K.type===w&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case S:e:{for(var Re=K.key;z!==null;){if(z.key===Re){if(Re=K.type,Re===w){if(z.tag===7){a(H,z.sibling),re=p(z,K.props.children),re.return=H,H=re;break e}}else if(z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===M&&Wr(Re)===z.type){a(H,z.sibling),re=p(z,K.props),Xo(re,K),re.return=H,H=re;break e}a(H,z);break}else n(H,z);z=z.sibling}K.type===w?(re=Vr(K.props.children,H.mode,re,K.key),re.return=H,H=re):(re=Rc(K.type,K.key,K.props,null,H.mode,re),Xo(re,K),re.return=H,H=re)}return y(H);case x:e:{for(Re=K.key;z!==null;){if(z.key===Re)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){a(H,z.sibling),re=p(z,K.children||[]),re.return=H,H=re;break e}else{a(H,z);break}else n(H,z);z=z.sibling}re=Qh(K,H.mode,re),re.return=H,H=re}return y(H);case M:return K=Wr(K),mt(H,z,K,re)}if(J(K))return Ce(H,z,K,re);if(G(K)){if(Re=G(K),typeof Re!="function")throw Error(r(150));return K=Re.call(K),De(H,z,K,re)}if(typeof K.then=="function")return mt(H,z,Ic(K),re);if(K.$$typeof===k)return mt(H,z,Lc(H,K),re);Pc(H,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,z!==null&&z.tag===6?(a(H,z.sibling),re=p(z,K),re.return=H,H=re):(a(H,z),re=Zh(K,H.mode,re),re.return=H,H=re),y(H)):a(H,z)}return function(H,z,K,re){try{Yo=0;var Re=mt(H,z,K,re);return Fa=null,Re}catch(Me){if(Me===Ha||Me===Bc)throw Me;var it=Qi(29,Me,null,H.mode);return it.lanes=re,it.return=H,it}}}var Xr=i0(!0),s0=i0(!1),Yn=!1;function ud(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hd(i,n){i=i.updateQueue,n.updateQueue===i&&(n.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Xn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Zn(i,n,a){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(at&2)!==0){var p=c.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),c.pending=n,n=Ac(i),U_(i,null,a),n}return Mc(i,c,n,a),Ac(i)}function Zo(i,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var c=n.lanes;c&=i.pendingLanes,a|=c,n.lanes=a,Le(i,a)}}function dd(i,n){var a=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var p=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?p=g=y:g=g.next=y,a=a.next}while(a!==null);g===null?p=g=n:g=g.next=n}else p=g=n;a={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=n:i.next=n,a.lastBaseUpdate=n}var fd=!1;function Qo(){if(fd){var i=Ua;if(i!==null)throw i}}function Jo(i,n,a,c){fd=!1;var p=i.updateQueue;Yn=!1;var g=p.firstBaseUpdate,y=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var L=E,W=L.next;L.next=null,y===null?g=W:y.next=W,y=L;var se=i.alternate;se!==null&&(se=se.updateQueue,E=se.lastBaseUpdate,E!==y&&(E===null?se.firstBaseUpdate=W:E.next=W,se.lastBaseUpdate=L))}if(g!==null){var ae=p.baseState;y=0,se=W=L=null,E=g;do{var X=E.lane&-536870913,ee=X!==E.lane;if(ee?(Ze&X)===X:(c&X)===X){X!==0&&X===Pa&&(fd=!0),se!==null&&(se=se.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ce=i,De=E;X=n;var mt=a;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){ae=Ce.call(mt,ae,X);break e}ae=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,X=typeof Ce=="function"?Ce.call(mt,ae,X):Ce,X==null)break e;ae=v({},ae,X);break e;case 2:Yn=!0}}X=E.callback,X!==null&&(i.flags|=64,ee&&(i.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:E.tag,payload:E.payload,callback:E.callback,next:null},se===null?(W=se=ee,L=ae):se=se.next=ee,y|=X;if(E=E.next,E===null){if(E=p.shared.pending,E===null)break;ee=E,E=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);se===null&&(L=ae),p.baseState=L,p.firstBaseUpdate=W,p.lastBaseUpdate=se,g===null&&(p.shared.lanes=0),ir|=y,i.lanes=y,i.memoizedState=ae}}function n0(i,n){if(typeof i!="function")throw Error(r(191,i));i.call(n)}function r0(i,n){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)n0(a[i],n)}var Va=R(null),Uc=R(0);function a0(i,n){i=kn,ce(Uc,i),ce(Va,n),kn=i|n.baseLanes}function md(){ce(Uc,kn),ce(Va,Va.current)}function pd(){kn=Uc.current,te(Va),te(Uc)}var Ji=R(null),gs=null;function Qn(i){var n=i.alternate;ce(Vt,Vt.current&1),ce(Ji,i),gs===null&&(n===null||Va.current!==null||n.memoizedState!==null)&&(gs=i)}function gd(i){ce(Vt,Vt.current),ce(Ji,i),gs===null&&(gs=i)}function o0(i){i.tag===22?(ce(Vt,Vt.current),ce(Ji,i),gs===null&&(gs=i)):Jn()}function Jn(){ce(Vt,Vt.current),ce(Ji,Ji.current)}function es(i){te(Ji),gs===i&&(gs=null),te(Vt)}var Vt=R(0);function Hc(i){for(var n=i;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wf(a)||Ef(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var bn=0,He=null,dt=null,Yt=null,Fc=!1,$a=!1,Zr=!1,Vc=0,el=0,qa=null,VC=0;function Lt(){throw Error(r(321))}function _d(i,n){if(n===null)return!1;for(var a=0;a<n.length&&a<i.length;a++)if(!Zi(i[a],n[a]))return!1;return!0}function vd(i,n,a,c,p,g){return bn=g,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,A.H=i===null||i.memoizedState===null?$0:Od,Zr=!1,g=a(c,p),Zr=!1,$a&&(g=c0(n,a,c,p)),l0(i),g}function l0(i){A.H=sl;var n=dt!==null&&dt.next!==null;if(bn=0,Yt=dt=He=null,Fc=!1,el=0,qa=null,n)throw Error(r(300));i===null||Xt||(i=i.dependencies,i!==null&&Oc(i)&&(Xt=!0))}function c0(i,n,a,c){He=i;var p=0;do{if($a&&(qa=null),el=0,$a=!1,25<=p)throw Error(r(301));if(p+=1,Yt=dt=null,i.updateQueue!=null){var g=i.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}A.H=q0,g=n(a,c)}while($a);return g}function $C(){var i=A.H,n=i.useState()[0];return n=typeof n.then=="function"?tl(n):n,i=i.useState()[0],(dt!==null?dt.memoizedState:null)!==i&&(He.flags|=1024),n}function bd(){var i=Vc!==0;return Vc=0,i}function yd(i,n,a){n.updateQueue=i.updateQueue,n.flags&=-2053,i.lanes&=~a}function xd(i){if(Fc){for(i=i.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}Fc=!1}bn=0,Yt=dt=He=null,$a=!1,el=Vc=0,qa=null}function Ri(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?He.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function $t(){if(dt===null){var i=He.alternate;i=i!==null?i.memoizedState:null}else i=dt.next;var n=Yt===null?He.memoizedState:Yt.next;if(n!==null)Yt=n,dt=i;else{if(i===null)throw He.alternate===null?Error(r(467)):Error(r(310));dt=i,i={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Yt===null?He.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function $c(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(i){var n=el;return el+=1,qa===null&&(qa=[]),i=J_(qa,i,n),n=He,(Yt===null?n.memoizedState:Yt.next)===null&&(n=n.alternate,A.H=n===null||n.memoizedState===null?$0:Od),i}function qc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return tl(i);if(i.$$typeof===k)return bi(i)}throw Error(r(438,String(i)))}function Sd(i){var n=null,a=He.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var c=He.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(p){return p.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=$c(),He.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(i),c=0;c<i;c++)a[c]=Y;return n.index++,a}function yn(i,n){return typeof n=="function"?n(i):n}function Kc(i){var n=$t();return wd(n,dt,i)}function wd(i,n,a){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var p=i.baseQueue,g=c.pending;if(g!==null){if(p!==null){var y=p.next;p.next=g.next,g.next=y}n.baseQueue=p=g,c.pending=null}if(g=i.baseState,p===null)i.memoizedState=g;else{n=p.next;var E=y=null,L=null,W=n,se=!1;do{var ae=W.lane&-536870913;if(ae!==W.lane?(Ze&ae)===ae:(bn&ae)===ae){var X=W.revertLane;if(X===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ae===Pa&&(se=!0);else if((bn&X)===X){W=W.next,X===Pa&&(se=!0);continue}else ae={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},L===null?(E=L=ae,y=g):L=L.next=ae,He.lanes|=X,ir|=X;ae=W.action,Zr&&a(g,ae),g=W.hasEagerState?W.eagerState:a(g,ae)}else X={lane:ae,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},L===null?(E=L=X,y=g):L=L.next=X,He.lanes|=ae,ir|=ae;W=W.next}while(W!==null&&W!==n);if(L===null?y=g:L.next=E,!Zi(g,i.memoizedState)&&(Xt=!0,se&&(a=Ua,a!==null)))throw a;i.memoizedState=g,i.baseState=y,i.baseQueue=L,c.lastRenderedState=g}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Ed(i){var n=$t(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=i;var c=a.dispatch,p=a.pending,g=n.memoizedState;if(p!==null){a.pending=null;var y=p=p.next;do g=i(g,y.action),y=y.next;while(y!==p);Zi(g,n.memoizedState)||(Xt=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),a.lastRenderedState=g}return[g,c]}function u0(i,n,a){var c=He,p=$t(),g=Je;if(g){if(a===void 0)throw Error(r(407));a=a()}else a=n();var y=!Zi((dt||p).memoizedState,a);if(y&&(p.memoizedState=a,Xt=!0),p=p.queue,kd(f0.bind(null,c,p,i),[i]),p.getSnapshot!==n||y||Yt!==null&&Yt.memoizedState.tag&1){if(c.flags|=2048,Ka(9,{destroy:void 0},d0.bind(null,c,p,a,n),null),_t===null)throw Error(r(349));g||(bn&127)!==0||h0(c,n,a)}return a}function h0(i,n,a){i.flags|=16384,i={getSnapshot:n,value:a},n=He.updateQueue,n===null?(n=$c(),He.updateQueue=n,n.stores=[i]):(a=n.stores,a===null?n.stores=[i]:a.push(i))}function d0(i,n,a,c){n.value=a,n.getSnapshot=c,m0(n)&&p0(i)}function f0(i,n,a){return a(function(){m0(n)&&p0(i)})}function m0(i){var n=i.getSnapshot;i=i.value;try{var a=n();return!Zi(i,a)}catch{return!0}}function p0(i){var n=Fr(i,2);n!==null&&$i(n,i,2)}function Cd(i){var n=Ri();if(typeof i=="function"){var a=i;if(i=a(),Zr){cs(!0);try{a()}finally{cs(!1)}}}return n.memoizedState=n.baseState=i,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:i},n}function g0(i,n,a,c){return i.baseState=a,wd(i,dt,typeof c=="function"?c:yn)}function qC(i,n,a,c,p){if(Yc(i))throw Error(r(485));if(i=n.action,i!==null){var g={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){g.listeners.push(y)}};A.T!==null?a(!0):g.isTransition=!1,c(g),a=n.pending,a===null?(g.next=n.pending=g,_0(n,g)):(g.next=a.next,n.pending=a.next=g)}}function _0(i,n){var a=n.action,c=n.payload,p=i.state;if(n.isTransition){var g=A.T,y={};A.T=y;try{var E=a(p,c),L=A.S;L!==null&&L(y,E),v0(i,n,E)}catch(W){Nd(i,n,W)}finally{g!==null&&y.types!==null&&(g.types=y.types),A.T=g}}else try{g=a(p,c),v0(i,n,g)}catch(W){Nd(i,n,W)}}function v0(i,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){b0(i,n,c)},function(c){return Nd(i,n,c)}):b0(i,n,a)}function b0(i,n,a){n.status="fulfilled",n.value=a,y0(n),i.state=a,n=i.pending,n!==null&&(a=n.next,a===n?i.pending=null:(a=a.next,n.next=a,_0(i,a)))}function Nd(i,n,a){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=a,y0(n),n=n.next;while(n!==c)}i.action=null}function y0(i){i=i.listeners;for(var n=0;n<i.length;n++)(0,i[n])()}function x0(i,n){return n}function S0(i,n){if(Je){var a=_t.formState;if(a!==null){e:{var c=He;if(Je){if(wt){t:{for(var p=wt,g=ps;p.nodeType!==8;){if(!g){p=null;break t}if(p=_s(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){wt=_s(p.nextSibling),c=p.data==="F!";break e}}Gn(c)}c=!1}c&&(n=a[0])}}return a=Ri(),a.memoizedState=a.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:x0,lastRenderedState:n},a.queue=c,a=H0.bind(null,He,c),c.dispatch=a,c=Cd(!1),g=Dd.bind(null,He,!1,c.queue),c=Ri(),p={state:n,dispatch:null,action:i,pending:null},c.queue=p,a=qC.bind(null,He,p,g,a),p.dispatch=a,c.memoizedState=i,[n,a,!1]}function w0(i){var n=$t();return E0(n,dt,i)}function E0(i,n,a){if(n=wd(i,n,x0)[0],i=Kc(yn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=tl(n)}catch(y){throw y===Ha?Bc:y}else c=n;n=$t();var p=n.queue,g=p.dispatch;return a!==n.memoizedState&&(He.flags|=2048,Ka(9,{destroy:void 0},KC.bind(null,p,a),null)),[c,g,i]}function KC(i,n){i.action=n}function C0(i){var n=$t(),a=dt;if(a!==null)return E0(n,a,i);$t(),n=n.memoizedState,a=$t();var c=a.queue.dispatch;return a.memoizedState=i,[n,c,!1]}function Ka(i,n,a,c){return i={tag:i,create:a,deps:c,inst:n,next:null},n=He.updateQueue,n===null&&(n=$c(),He.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=i.next=i:(c=a.next,a.next=i,i.next=c,n.lastEffect=i),i}function N0(){return $t().memoizedState}function Gc(i,n,a,c){var p=Ri();He.flags|=i,p.memoizedState=Ka(1|n,{destroy:void 0},a,c===void 0?null:c)}function Wc(i,n,a,c){var p=$t();c=c===void 0?null:c;var g=p.memoizedState.inst;dt!==null&&c!==null&&_d(c,dt.memoizedState.deps)?p.memoizedState=Ka(n,g,a,c):(He.flags|=i,p.memoizedState=Ka(1|n,g,a,c))}function k0(i,n){Gc(8390656,8,i,n)}function kd(i,n){Wc(2048,8,i,n)}function GC(i){He.flags|=4;var n=He.updateQueue;if(n===null)n=$c(),He.updateQueue=n,n.events=[i];else{var a=n.events;a===null?n.events=[i]:a.push(i)}}function T0(i){var n=$t().memoizedState;return GC({ref:n,nextImpl:i}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function M0(i,n){return Wc(4,2,i,n)}function A0(i,n){return Wc(4,4,i,n)}function R0(i,n){if(typeof n=="function"){i=i();var a=n(i);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return i=i(),n.current=i,function(){n.current=null}}function D0(i,n,a){a=a!=null?a.concat([i]):null,Wc(4,4,R0.bind(null,n,i),a)}function Td(){}function O0(i,n){var a=$t();n=n===void 0?null:n;var c=a.memoizedState;return n!==null&&_d(n,c[1])?c[0]:(a.memoizedState=[i,n],i)}function L0(i,n){var a=$t();n=n===void 0?null:n;var c=a.memoizedState;if(n!==null&&_d(n,c[1]))return c[0];if(c=i(),Zr){cs(!0);try{i()}finally{cs(!1)}}return a.memoizedState=[c,n],c}function Md(i,n,a){return a===void 0||(bn&1073741824)!==0&&(Ze&261930)===0?i.memoizedState=n:(i.memoizedState=a,i=jv(),He.lanes|=i,ir|=i,a)}function j0(i,n,a,c){return Zi(a,n)?a:Va.current!==null?(i=Md(i,a,c),Zi(i,n)||(Xt=!0),i):(bn&42)===0||(bn&1073741824)!==0&&(Ze&261930)===0?(Xt=!0,i.memoizedState=a):(i=jv(),He.lanes|=i,ir|=i,n)}function B0(i,n,a,c,p){var g=q.p;q.p=g!==0&&8>g?g:8;var y=A.T,E={};A.T=E,Dd(i,!1,n,a);try{var L=p(),W=A.S;if(W!==null&&W(E,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var se=FC(L,c);il(i,n,se,ss(i))}else il(i,n,c,ss(i))}catch(ae){il(i,n,{then:function(){},status:"rejected",reason:ae},ss())}finally{q.p=g,y!==null&&E.types!==null&&(y.types=E.types),A.T=y}}function WC(){}function Ad(i,n,a,c){if(i.tag!==5)throw Error(r(476));var p=z0(i).queue;B0(i,p,n,V,a===null?WC:function(){return I0(i),a(c)})}function z0(i){var n=i.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:V},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:a},next:null},i.memoizedState=n,i=i.alternate,i!==null&&(i.memoizedState=n),n}function I0(i){var n=z0(i);n.next===null&&(n=i.alternate.memoizedState),il(i,n.next.queue,{},ss())}function Rd(){return bi(bl)}function P0(){return $t().memoizedState}function U0(){return $t().memoizedState}function YC(i){for(var n=i.return;n!==null;){switch(n.tag){case 24:case 3:var a=ss();i=Xn(a);var c=Zn(n,i,a);c!==null&&($i(c,n,a),Zo(c,n,a)),n={cache:ad()},i.payload=n;return}n=n.return}}function XC(i,n,a){var c=ss();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Yc(i)?F0(n,a):(a=Yh(i,n,a,c),a!==null&&($i(a,i,c),V0(a,n,c)))}function H0(i,n,a){var c=ss();il(i,n,a,c)}function il(i,n,a,c){var p={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Yc(i))F0(n,p);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var y=n.lastRenderedState,E=g(y,a);if(p.hasEagerState=!0,p.eagerState=E,Zi(E,y))return Mc(i,n,p,0),_t===null&&Tc(),!1}catch{}if(a=Yh(i,n,p,c),a!==null)return $i(a,i,c),V0(a,n,c),!0}return!1}function Dd(i,n,a,c){if(c={lane:2,revertLane:hf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Yc(i)){if(n)throw Error(r(479))}else n=Yh(i,a,c,2),n!==null&&$i(n,i,2)}function Yc(i){var n=i.alternate;return i===He||n!==null&&n===He}function F0(i,n){$a=Fc=!0;var a=i.pending;a===null?n.next=n:(n.next=a.next,a.next=n),i.pending=n}function V0(i,n,a){if((a&4194048)!==0){var c=n.lanes;c&=i.pendingLanes,a|=c,n.lanes=a,Le(i,a)}}var sl={readContext:bi,use:qc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};sl.useEffectEvent=Lt;var $0={readContext:bi,use:qc,useCallback:function(i,n){return Ri().memoizedState=[i,n===void 0?null:n],i},useContext:bi,useEffect:k0,useImperativeHandle:function(i,n,a){a=a!=null?a.concat([i]):null,Gc(4194308,4,R0.bind(null,n,i),a)},useLayoutEffect:function(i,n){return Gc(4194308,4,i,n)},useInsertionEffect:function(i,n){Gc(4,2,i,n)},useMemo:function(i,n){var a=Ri();n=n===void 0?null:n;var c=i();if(Zr){cs(!0);try{i()}finally{cs(!1)}}return a.memoizedState=[c,n],c},useReducer:function(i,n,a){var c=Ri();if(a!==void 0){var p=a(n);if(Zr){cs(!0);try{a(n)}finally{cs(!1)}}}else p=n;return c.memoizedState=c.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},c.queue=i,i=i.dispatch=XC.bind(null,He,i),[c.memoizedState,i]},useRef:function(i){var n=Ri();return i={current:i},n.memoizedState=i},useState:function(i){i=Cd(i);var n=i.queue,a=H0.bind(null,He,n);return n.dispatch=a,[i.memoizedState,a]},useDebugValue:Td,useDeferredValue:function(i,n){var a=Ri();return Md(a,i,n)},useTransition:function(){var i=Cd(!1);return i=B0.bind(null,He,i.queue,!0,!1),Ri().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,n,a){var c=He,p=Ri();if(Je){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),_t===null)throw Error(r(349));(Ze&127)!==0||h0(c,n,a)}p.memoizedState=a;var g={value:a,getSnapshot:n};return p.queue=g,k0(f0.bind(null,c,g,i),[i]),c.flags|=2048,Ka(9,{destroy:void 0},d0.bind(null,c,g,a,n),null),a},useId:function(){var i=Ri(),n=_t.identifierPrefix;if(Je){var a=Ps,c=Is;a=(c&~(1<<32-gi(c)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Vc++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=VC++,n="_"+n+"r_"+a.toString(32)+"_";return i.memoizedState=n},useHostTransitionStatus:Rd,useFormState:S0,useActionState:S0,useOptimistic:function(i){var n=Ri();n.memoizedState=n.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Dd.bind(null,He,!0,a),a.dispatch=n,[i,n]},useMemoCache:Sd,useCacheRefresh:function(){return Ri().memoizedState=YC.bind(null,He)},useEffectEvent:function(i){var n=Ri(),a={impl:i};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Od={readContext:bi,use:qc,useCallback:O0,useContext:bi,useEffect:kd,useImperativeHandle:D0,useInsertionEffect:M0,useLayoutEffect:A0,useMemo:L0,useReducer:Kc,useRef:N0,useState:function(){return Kc(yn)},useDebugValue:Td,useDeferredValue:function(i,n){var a=$t();return j0(a,dt.memoizedState,i,n)},useTransition:function(){var i=Kc(yn)[0],n=$t().memoizedState;return[typeof i=="boolean"?i:tl(i),n]},useSyncExternalStore:u0,useId:P0,useHostTransitionStatus:Rd,useFormState:w0,useActionState:w0,useOptimistic:function(i,n){var a=$t();return g0(a,dt,i,n)},useMemoCache:Sd,useCacheRefresh:U0};Od.useEffectEvent=T0;var q0={readContext:bi,use:qc,useCallback:O0,useContext:bi,useEffect:kd,useImperativeHandle:D0,useInsertionEffect:M0,useLayoutEffect:A0,useMemo:L0,useReducer:Ed,useRef:N0,useState:function(){return Ed(yn)},useDebugValue:Td,useDeferredValue:function(i,n){var a=$t();return dt===null?Md(a,i,n):j0(a,dt.memoizedState,i,n)},useTransition:function(){var i=Ed(yn)[0],n=$t().memoizedState;return[typeof i=="boolean"?i:tl(i),n]},useSyncExternalStore:u0,useId:P0,useHostTransitionStatus:Rd,useFormState:C0,useActionState:C0,useOptimistic:function(i,n){var a=$t();return dt!==null?g0(a,dt,i,n):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:Sd,useCacheRefresh:U0};q0.useEffectEvent=T0;function Ld(i,n,a,c){n=i.memoizedState,a=a(c,n),a=a==null?n:v({},n,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var jd={enqueueSetState:function(i,n,a){i=i._reactInternals;var c=ss(),p=Xn(c);p.payload=n,a!=null&&(p.callback=a),n=Zn(i,p,c),n!==null&&($i(n,i,c),Zo(n,i,c))},enqueueReplaceState:function(i,n,a){i=i._reactInternals;var c=ss(),p=Xn(c);p.tag=1,p.payload=n,a!=null&&(p.callback=a),n=Zn(i,p,c),n!==null&&($i(n,i,c),Zo(n,i,c))},enqueueForceUpdate:function(i,n){i=i._reactInternals;var a=ss(),c=Xn(a);c.tag=2,n!=null&&(c.callback=n),n=Zn(i,c,a),n!==null&&($i(n,i,a),Zo(n,i,a))}};function K0(i,n,a,c,p,g,y){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,g,y):n.prototype&&n.prototype.isPureReactComponent?!Vo(a,c)||!Vo(p,g):!0}function G0(i,n,a,c){i=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,c),n.state!==i&&jd.enqueueReplaceState(n,n.state,null)}function Qr(i,n){var a=n;if("ref"in n){a={};for(var c in n)c!=="ref"&&(a[c]=n[c])}if(i=i.defaultProps){a===n&&(a=v({},a));for(var p in i)a[p]===void 0&&(a[p]=i[p])}return a}function W0(i){kc(i)}function Y0(i){console.error(i)}function X0(i){kc(i)}function Xc(i,n){try{var a=i.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function Z0(i,n,a){try{var c=i.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Bd(i,n,a){return a=Xn(a),a.tag=3,a.payload={element:null},a.callback=function(){Xc(i,n)},a}function Q0(i){return i=Xn(i),i.tag=3,i}function J0(i,n,a,c){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var g=c.value;i.payload=function(){return p(g)},i.callback=function(){Z0(n,a,c)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(i.callback=function(){Z0(n,a,c),typeof p!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var E=c.stack;this.componentDidCatch(c.value,{componentStack:E!==null?E:""})})}function ZC(i,n,a,c,p){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=a.alternate,n!==null&&Ia(n,a,p,!0),a=Ji.current,a!==null){switch(a.tag){case 31:case 13:return gs===null?lu():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=p,c===zc?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([c]):n.add(c),lf(i,c,p)),!1;case 22:return a.flags|=65536,c===zc?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([c]):a.add(c)),lf(i,c,p)),!1}throw Error(r(435,a.tag))}return lf(i,c,p),lu(),!1}if(Je)return n=Ji.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=p,c!==td&&(i=Error(r(422),{cause:c}),Ko(ds(i,a)))):(c!==td&&(n=Error(r(423),{cause:c}),Ko(ds(n,a))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,c=ds(c,a),p=Bd(i.stateNode,c,p),dd(i,p),jt!==4&&(jt=2)),!1;var g=Error(r(520),{cause:c});if(g=ds(g,a),hl===null?hl=[g]:hl.push(g),jt!==4&&(jt=2),n===null)return!0;c=ds(c,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,i=p&-p,a.lanes|=i,i=Bd(a.stateNode,c,i),dd(a,i),!1;case 1:if(n=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(sr===null||!sr.has(g))))return a.flags|=65536,p&=-p,a.lanes|=p,p=Q0(p),J0(p,i,a,c),dd(a,p),!1}a=a.return}while(a!==null);return!1}var zd=Error(r(461)),Xt=!1;function yi(i,n,a,c){n.child=i===null?s0(n,null,a,c):Xr(n,i.child,a,c)}function ev(i,n,a,c,p){a=a.render;var g=n.ref;if("ref"in c){var y={};for(var E in c)E!=="ref"&&(y[E]=c[E])}else y=c;return Kr(n),c=vd(i,n,a,y,g,p),E=bd(),i!==null&&!Xt?(yd(i,n,p),xn(i,n,p)):(Je&&E&&Jh(n),n.flags|=1,yi(i,n,c,p),n.child)}function tv(i,n,a,c,p){if(i===null){var g=a.type;return typeof g=="function"&&!Xh(g)&&g.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=g,iv(i,n,g,c,p)):(i=Rc(a.type,null,c,n,n.mode,p),i.ref=n.ref,i.return=n,n.child=i)}if(g=i.child,!qd(i,p)){var y=g.memoizedProps;if(a=a.compare,a=a!==null?a:Vo,a(y,c)&&i.ref===n.ref)return xn(i,n,p)}return n.flags|=1,i=pn(g,c),i.ref=n.ref,i.return=n,n.child=i}function iv(i,n,a,c,p){if(i!==null){var g=i.memoizedProps;if(Vo(g,c)&&i.ref===n.ref)if(Xt=!1,n.pendingProps=c=g,qd(i,p))(i.flags&131072)!==0&&(Xt=!0);else return n.lanes=i.lanes,xn(i,n,p)}return Id(i,n,a,c,p)}function sv(i,n,a,c){var p=c.children,g=i!==null?i.memoizedState:null;if(i===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,i!==null){for(c=n.child=i.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~g}else c=0,n.child=null;return nv(i,n,g,a,c)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},i!==null&&jc(n,g!==null?g.cachePool:null),g!==null?a0(n,g):md(),o0(n);else return c=n.lanes=536870912,nv(i,n,g!==null?g.baseLanes|a:a,a,c)}else g!==null?(jc(n,g.cachePool),a0(n,g),Jn(),n.memoizedState=null):(i!==null&&jc(n,null),md(),Jn());return yi(i,n,p,a),n.child}function nl(i,n){return i!==null&&i.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function nv(i,n,a,c,p){var g=ld();return g=g===null?null:{parent:Wt._currentValue,pool:g},n.memoizedState={baseLanes:a,cachePool:g},i!==null&&jc(n,null),md(),o0(n),i!==null&&Ia(i,n,c,!0),n.childLanes=p,null}function Zc(i,n){return n=Jc({mode:n.mode,children:n.children},i.mode),n.ref=i.ref,i.child=n,n.return=i,n}function rv(i,n,a){return Xr(n,i.child,null,a),i=Zc(n,n.pendingProps),i.flags|=2,es(n),n.memoizedState=null,i}function QC(i,n,a){var c=n.pendingProps,p=(n.flags&128)!==0;if(n.flags&=-129,i===null){if(Je){if(c.mode==="hidden")return i=Zc(n,c),n.lanes=536870912,nl(null,i);if(gd(n),(i=wt)?(i=_b(i,ps),i=i!==null&&i.data==="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:qn!==null?{id:Is,overflow:Ps}:null,retryLane:536870912,hydrationErrors:null},a=F_(i),a.return=n,n.child=a,vi=n,wt=null)):i=null,i===null)throw Gn(n);return n.lanes=536870912,null}return Zc(n,c)}var g=i.memoizedState;if(g!==null){var y=g.dehydrated;if(gd(n),p)if(n.flags&256)n.flags&=-257,n=rv(i,n,a);else if(n.memoizedState!==null)n.child=i.child,n.flags|=128,n=null;else throw Error(r(558));else if(Xt||Ia(i,n,a,!1),p=(a&i.childLanes)!==0,Xt||p){if(c=_t,c!==null&&(y=Ut(c,a),y!==0&&y!==g.retryLane))throw g.retryLane=y,Fr(i,y),$i(c,i,y),zd;lu(),n=rv(i,n,a)}else i=g.treeContext,wt=_s(y.nextSibling),vi=n,Je=!0,Kn=null,ps=!1,i!==null&&q_(n,i),n=Zc(n,c),n.flags|=4096;return n}return i=pn(i.child,{mode:c.mode,children:c.children}),i.ref=n.ref,n.child=i,i.return=n,i}function Qc(i,n){var a=n.ref;if(a===null)i!==null&&i.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(i===null||i.ref!==a)&&(n.flags|=4194816)}}function Id(i,n,a,c,p){return Kr(n),a=vd(i,n,a,c,void 0,p),c=bd(),i!==null&&!Xt?(yd(i,n,p),xn(i,n,p)):(Je&&c&&Jh(n),n.flags|=1,yi(i,n,a,p),n.child)}function av(i,n,a,c,p,g){return Kr(n),n.updateQueue=null,a=c0(n,c,a,p),l0(i),c=bd(),i!==null&&!Xt?(yd(i,n,g),xn(i,n,g)):(Je&&c&&Jh(n),n.flags|=1,yi(i,n,a,g),n.child)}function ov(i,n,a,c,p){if(Kr(n),n.stateNode===null){var g=La,y=a.contextType;typeof y=="object"&&y!==null&&(g=bi(y)),g=new a(c,g),n.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=jd,n.stateNode=g,g._reactInternals=n,g=n.stateNode,g.props=c,g.state=n.memoizedState,g.refs={},ud(n),y=a.contextType,g.context=typeof y=="object"&&y!==null?bi(y):La,g.state=n.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(Ld(n,a,y,c),g.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(y=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),y!==g.state&&jd.enqueueReplaceState(g,g.state,null),Jo(n,c,g,p),Qo(),g.state=n.memoizedState),typeof g.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(i===null){g=n.stateNode;var E=n.memoizedProps,L=Qr(a,E);g.props=L;var W=g.context,se=a.contextType;y=La,typeof se=="object"&&se!==null&&(y=bi(se));var ae=a.getDerivedStateFromProps;se=typeof ae=="function"||typeof g.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,se||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E||W!==y)&&G0(n,g,c,y),Yn=!1;var X=n.memoizedState;g.state=X,Jo(n,c,g,p),Qo(),W=n.memoizedState,E||X!==W||Yn?(typeof ae=="function"&&(Ld(n,a,ae,c),W=n.memoizedState),(L=Yn||K0(n,a,L,c,X,W,y))?(se||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(n.flags|=4194308)):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=W),g.props=c,g.state=W,g.context=y,c=L):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{g=n.stateNode,hd(i,n),y=n.memoizedProps,se=Qr(a,y),g.props=se,ae=n.pendingProps,X=g.context,W=a.contextType,L=La,typeof W=="object"&&W!==null&&(L=bi(W)),E=a.getDerivedStateFromProps,(W=typeof E=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(y!==ae||X!==L)&&G0(n,g,c,L),Yn=!1,X=n.memoizedState,g.state=X,Jo(n,c,g,p),Qo();var ee=n.memoizedState;y!==ae||X!==ee||Yn||i!==null&&i.dependencies!==null&&Oc(i.dependencies)?(typeof E=="function"&&(Ld(n,a,E,c),ee=n.memoizedState),(se=Yn||K0(n,a,se,c,X,ee,L)||i!==null&&i.dependencies!==null&&Oc(i.dependencies))?(W||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,ee,L),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,ee,L)),typeof g.componentDidUpdate=="function"&&(n.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof g.componentDidUpdate!="function"||y===i.memoizedProps&&X===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||y===i.memoizedProps&&X===i.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ee),g.props=c,g.state=ee,g.context=L,c=se):(typeof g.componentDidUpdate!="function"||y===i.memoizedProps&&X===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||y===i.memoizedProps&&X===i.memoizedState||(n.flags|=1024),c=!1)}return g=c,Qc(i,n),c=(n.flags&128)!==0,g||c?(g=n.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:g.render(),n.flags|=1,i!==null&&c?(n.child=Xr(n,i.child,null,p),n.child=Xr(n,null,a,p)):yi(i,n,a,p),n.memoizedState=g.state,i=n.child):i=xn(i,n,p),i}function lv(i,n,a,c){return $r(),n.flags|=256,yi(i,n,a,c),n.child}var Pd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(i){return{baseLanes:i,cachePool:Z_()}}function Hd(i,n,a){return i=i!==null?i.childLanes&~a:0,n&&(i|=is),i}function cv(i,n,a){var c=n.pendingProps,p=!1,g=(n.flags&128)!==0,y;if((y=g)||(y=i!==null&&i.memoizedState===null?!1:(Vt.current&2)!==0),y&&(p=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,i===null){if(Je){if(p?Qn(n):Jn(),(i=wt)?(i=_b(i,ps),i=i!==null&&i.data!=="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:qn!==null?{id:Is,overflow:Ps}:null,retryLane:536870912,hydrationErrors:null},a=F_(i),a.return=n,n.child=a,vi=n,wt=null)):i=null,i===null)throw Gn(n);return Ef(i)?n.lanes=32:n.lanes=536870912,null}var E=c.children;return c=c.fallback,p?(Jn(),p=n.mode,E=Jc({mode:"hidden",children:E},p),c=Vr(c,p,a,null),E.return=n,c.return=n,E.sibling=c,n.child=E,c=n.child,c.memoizedState=Ud(a),c.childLanes=Hd(i,y,a),n.memoizedState=Pd,nl(null,c)):(Qn(n),Fd(n,E))}var L=i.memoizedState;if(L!==null&&(E=L.dehydrated,E!==null)){if(g)n.flags&256?(Qn(n),n.flags&=-257,n=Vd(i,n,a)):n.memoizedState!==null?(Jn(),n.child=i.child,n.flags|=128,n=null):(Jn(),E=c.fallback,p=n.mode,c=Jc({mode:"visible",children:c.children},p),E=Vr(E,p,a,null),E.flags|=2,c.return=n,E.return=n,c.sibling=E,n.child=c,Xr(n,i.child,null,a),c=n.child,c.memoizedState=Ud(a),c.childLanes=Hd(i,y,a),n.memoizedState=Pd,n=nl(null,c));else if(Qn(n),Ef(E)){if(y=E.nextSibling&&E.nextSibling.dataset,y)var W=y.dgst;y=W,c=Error(r(419)),c.stack="",c.digest=y,Ko({value:c,source:null,stack:null}),n=Vd(i,n,a)}else if(Xt||Ia(i,n,a,!1),y=(a&i.childLanes)!==0,Xt||y){if(y=_t,y!==null&&(c=Ut(y,a),c!==0&&c!==L.retryLane))throw L.retryLane=c,Fr(i,c),$i(y,i,c),zd;wf(E)||lu(),n=Vd(i,n,a)}else wf(E)?(n.flags|=192,n.child=i.child,n=null):(i=L.treeContext,wt=_s(E.nextSibling),vi=n,Je=!0,Kn=null,ps=!1,i!==null&&q_(n,i),n=Fd(n,c.children),n.flags|=4096);return n}return p?(Jn(),E=c.fallback,p=n.mode,L=i.child,W=L.sibling,c=pn(L,{mode:"hidden",children:c.children}),c.subtreeFlags=L.subtreeFlags&65011712,W!==null?E=pn(W,E):(E=Vr(E,p,a,null),E.flags|=2),E.return=n,c.return=n,c.sibling=E,n.child=c,nl(null,c),c=n.child,E=i.child.memoizedState,E===null?E=Ud(a):(p=E.cachePool,p!==null?(L=Wt._currentValue,p=p.parent!==L?{parent:L,pool:L}:p):p=Z_(),E={baseLanes:E.baseLanes|a,cachePool:p}),c.memoizedState=E,c.childLanes=Hd(i,y,a),n.memoizedState=Pd,nl(i.child,c)):(Qn(n),a=i.child,i=a.sibling,a=pn(a,{mode:"visible",children:c.children}),a.return=n,a.sibling=null,i!==null&&(y=n.deletions,y===null?(n.deletions=[i],n.flags|=16):y.push(i)),n.child=a,n.memoizedState=null,a)}function Fd(i,n){return n=Jc({mode:"visible",children:n},i.mode),n.return=i,i.child=n}function Jc(i,n){return i=Qi(22,i,null,n),i.lanes=0,i}function Vd(i,n,a){return Xr(n,i.child,null,a),i=Fd(n,n.pendingProps.children),i.flags|=2,n.memoizedState=null,i}function uv(i,n,a){i.lanes|=n;var c=i.alternate;c!==null&&(c.lanes|=n),nd(i.return,n,a)}function $d(i,n,a,c,p,g){var y=i.memoizedState;y===null?i.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:p,treeForkCount:g}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=a,y.tailMode=p,y.treeForkCount=g)}function hv(i,n,a){var c=n.pendingProps,p=c.revealOrder,g=c.tail;c=c.children;var y=Vt.current,E=(y&2)!==0;if(E?(y=y&1|2,n.flags|=128):y&=1,ce(Vt,y),yi(i,n,c,a),c=Je?qo:0,!E&&i!==null&&(i.flags&128)!==0)e:for(i=n.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&uv(i,a,n);else if(i.tag===19)uv(i,a,n);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(a=n.child,p=null;a!==null;)i=a.alternate,i!==null&&Hc(i)===null&&(p=a),a=a.sibling;a=p,a===null?(p=n.child,n.child=null):(p=a.sibling,a.sibling=null),$d(n,!1,p,a,g,c);break;case"backwards":case"unstable_legacy-backwards":for(a=null,p=n.child,n.child=null;p!==null;){if(i=p.alternate,i!==null&&Hc(i)===null){n.child=p;break}i=p.sibling,p.sibling=a,a=p,p=i}$d(n,!0,a,null,g,c);break;case"together":$d(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function xn(i,n,a){if(i!==null&&(n.dependencies=i.dependencies),ir|=n.lanes,(a&n.childLanes)===0)if(i!==null){if(Ia(i,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(i!==null&&n.child!==i.child)throw Error(r(153));if(n.child!==null){for(i=n.child,a=pn(i,i.pendingProps),n.child=a,a.return=n;i.sibling!==null;)i=i.sibling,a=a.sibling=pn(i,i.pendingProps),a.return=n;a.sibling=null}return n.child}function qd(i,n){return(i.lanes&n)!==0?!0:(i=i.dependencies,!!(i!==null&&Oc(i)))}function JC(i,n,a){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),Wn(n,Wt,i.memoizedState.cache),$r();break;case 27:case 5:tt(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:Wn(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,gd(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Qn(n),n.flags|=128,null):(a&n.child.childLanes)!==0?cv(i,n,a):(Qn(n),i=xn(i,n,a),i!==null?i.sibling:null);Qn(n);break;case 19:var p=(i.flags&128)!==0;if(c=(a&n.childLanes)!==0,c||(Ia(i,n,a,!1),c=(a&n.childLanes)!==0),p){if(c)return hv(i,n,a);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ce(Vt,Vt.current),c)break;return null;case 22:return n.lanes=0,sv(i,n,a,n.pendingProps);case 24:Wn(n,Wt,i.memoizedState.cache)}return xn(i,n,a)}function dv(i,n,a){if(i!==null)if(i.memoizedProps!==n.pendingProps)Xt=!0;else{if(!qd(i,a)&&(n.flags&128)===0)return Xt=!1,JC(i,n,a);Xt=(i.flags&131072)!==0}else Xt=!1,Je&&(n.flags&1048576)!==0&&$_(n,qo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(i=Wr(n.elementType),n.type=i,typeof i=="function")Xh(i)?(c=Qr(i,c),n.tag=1,n=ov(null,n,i,c,a)):(n.tag=0,n=Id(null,n,i,c,a));else{if(i!=null){var p=i.$$typeof;if(p===D){n.tag=11,n=ev(null,n,i,c,a);break e}else if(p===B){n.tag=14,n=tv(null,n,i,c,a);break e}}throw n=ie(i)||i,Error(r(306,n,""))}}return n;case 0:return Id(i,n,n.type,n.pendingProps,a);case 1:return c=n.type,p=Qr(c,n.pendingProps),ov(i,n,c,p,a);case 3:e:{if(Be(n,n.stateNode.containerInfo),i===null)throw Error(r(387));c=n.pendingProps;var g=n.memoizedState;p=g.element,hd(i,n),Jo(n,c,null,a);var y=n.memoizedState;if(c=y.cache,Wn(n,Wt,c),c!==g.cache&&rd(n,[Wt],a,!0),Qo(),c=y.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){n=lv(i,n,c,a);break e}else if(c!==p){p=ds(Error(r(424)),n),Ko(p),n=lv(i,n,c,a);break e}else for(i=n.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,wt=_s(i.firstChild),vi=n,Je=!0,Kn=null,ps=!0,a=s0(n,null,c,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if($r(),c===p){n=xn(i,n,a);break e}yi(i,n,c,a)}n=n.child}return n;case 26:return Qc(i,n),i===null?(a=wb(n.type,null,n.pendingProps,null))?n.memoizedState=a:Je||(a=n.type,i=n.pendingProps,c=pu(pe.current).createElement(a),c[Ht]=n,c[Ni]=i,xi(c,a,i),Kt(c),n.stateNode=c):n.memoizedState=wb(n.type,i.memoizedProps,n.pendingProps,i.memoizedState),null;case 27:return tt(n),i===null&&Je&&(c=n.stateNode=yb(n.type,n.pendingProps,pe.current),vi=n,ps=!0,p=wt,or(n.type)?(Cf=p,wt=_s(c.firstChild)):wt=p),yi(i,n,n.pendingProps.children,a),Qc(i,n),i===null&&(n.flags|=4194304),n.child;case 5:return i===null&&Je&&((p=c=wt)&&(c=M3(c,n.type,n.pendingProps,ps),c!==null?(n.stateNode=c,vi=n,wt=_s(c.firstChild),ps=!1,p=!0):p=!1),p||Gn(n)),tt(n),p=n.type,g=n.pendingProps,y=i!==null?i.memoizedProps:null,c=g.children,yf(p,g)?c=null:y!==null&&yf(p,y)&&(n.flags|=32),n.memoizedState!==null&&(p=vd(i,n,$C,null,null,a),bl._currentValue=p),Qc(i,n),yi(i,n,c,a),n.child;case 6:return i===null&&Je&&((i=a=wt)&&(a=A3(a,n.pendingProps,ps),a!==null?(n.stateNode=a,vi=n,wt=null,i=!0):i=!1),i||Gn(n)),null;case 13:return cv(i,n,a);case 4:return Be(n,n.stateNode.containerInfo),c=n.pendingProps,i===null?n.child=Xr(n,null,c,a):yi(i,n,c,a),n.child;case 11:return ev(i,n,n.type,n.pendingProps,a);case 7:return yi(i,n,n.pendingProps,a),n.child;case 8:return yi(i,n,n.pendingProps.children,a),n.child;case 12:return yi(i,n,n.pendingProps.children,a),n.child;case 10:return c=n.pendingProps,Wn(n,n.type,c.value),yi(i,n,c.children,a),n.child;case 9:return p=n.type._context,c=n.pendingProps.children,Kr(n),p=bi(p),c=c(p),n.flags|=1,yi(i,n,c,a),n.child;case 14:return tv(i,n,n.type,n.pendingProps,a);case 15:return iv(i,n,n.type,n.pendingProps,a);case 19:return hv(i,n,a);case 31:return QC(i,n,a);case 22:return sv(i,n,a,n.pendingProps);case 24:return Kr(n),c=bi(Wt),i===null?(p=ld(),p===null&&(p=_t,g=ad(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=a),p=g),n.memoizedState={parent:c,cache:p},ud(n),Wn(n,Wt,p)):((i.lanes&a)!==0&&(hd(i,n),Jo(n,null,null,a),Qo()),p=i.memoizedState,g=n.memoizedState,p.parent!==c?(p={parent:c,cache:c},n.memoizedState=p,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=p),Wn(n,Wt,c)):(c=g.cache,Wn(n,Wt,c),c!==p.cache&&rd(n,[Wt],a,!0))),yi(i,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Sn(i){i.flags|=4}function Kd(i,n,a,c,p){if((n=(i.mode&32)!==0)&&(n=!1),n){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(Pv())i.flags|=8192;else throw Yr=zc,cd}else i.flags&=-16777217}function fv(i,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Tb(n))if(Pv())i.flags|=8192;else throw Yr=zc,cd}function eu(i,n){n!==null&&(i.flags|=4),i.flags&16384&&(n=i.tag!==22?ze():536870912,i.lanes|=n,Xa|=n)}function rl(i,n){if(!Je)switch(i.tailMode){case"hidden":n=i.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?n||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function Et(i){var n=i.alternate!==null&&i.alternate.child===i.child,a=0,c=0;if(n)for(var p=i.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=a,n}function e3(i,n,a){var c=n.pendingProps;switch(ed(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(n),null;case 1:return Et(n),null;case 3:return a=n.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),vn(Wt),Ee(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(za(n)?Sn(n):i===null||i.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,id())),Et(n),null;case 26:var p=n.type,g=n.memoizedState;return i===null?(Sn(n),g!==null?(Et(n),fv(n,g)):(Et(n),Kd(n,p,null,c,a))):g?g!==i.memoizedState?(Sn(n),Et(n),fv(n,g)):(Et(n),n.flags&=-16777217):(i=i.memoizedProps,i!==c&&Sn(n),Et(n),Kd(n,p,i,c,a)),null;case 27:if(nt(n),a=pe.current,p=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==c&&Sn(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Et(n),null}i=le.current,za(n)?K_(n):(i=yb(p,c,a),n.stateNode=i,Sn(n))}return Et(n),null;case 5:if(nt(n),p=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==c&&Sn(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Et(n),null}if(g=le.current,za(n))K_(n);else{var y=pu(pe.current);switch(g){case 1:g=y.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=y.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=y.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=y.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=y.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?y.createElement("select",{is:c.is}):y.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?y.createElement(p,{is:c.is}):y.createElement(p)}}g[Ht]=n,g[Ni]=c;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)g.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=g;e:switch(xi(g,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Sn(n)}}return Et(n),Kd(n,n.type,i===null?null:i.memoizedProps,n.pendingProps,a),null;case 6:if(i&&n.stateNode!=null)i.memoizedProps!==c&&Sn(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=pe.current,za(n)){if(i=n.stateNode,a=n.memoizedProps,c=null,p=vi,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Ht]=n,i=!!(i.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||cb(i.nodeValue,a)),i||Gn(n,!0)}else i=pu(i).createTextNode(c),i[Ht]=n,n.stateNode=i}return Et(n),null;case 31:if(a=n.memoizedState,i===null||i.memoizedState!==null){if(c=za(n),a!==null){if(i===null){if(!c)throw Error(r(318));if(i=n.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ht]=n}else $r(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),i=!1}else a=id(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return n.flags&256?(es(n),n):(es(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Et(n),null;case 13:if(c=n.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=za(n),c!==null&&c.dehydrated!==null){if(i===null){if(!p)throw Error(r(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Ht]=n}else $r(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),p=!1}else p=id(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return n.flags&256?(es(n),n):(es(n),null)}return es(n),(n.flags&128)!==0?(n.lanes=a,n):(a=c!==null,i=i!==null&&i.memoizedState!==null,a&&(c=n.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048)),a!==i&&a&&(n.child.flags|=8192),eu(n,n.updateQueue),Et(n),null);case 4:return Ee(),i===null&&pf(n.stateNode.containerInfo),Et(n),null;case 10:return vn(n.type),Et(n),null;case 19:if(te(Vt),c=n.memoizedState,c===null)return Et(n),null;if(p=(n.flags&128)!==0,g=c.rendering,g===null)if(p)rl(c,!1);else{if(jt!==0||i!==null&&(i.flags&128)!==0)for(i=n.child;i!==null;){if(g=Hc(i),g!==null){for(n.flags|=128,rl(c,!1),i=g.updateQueue,n.updateQueue=i,eu(n,i),n.subtreeFlags=0,i=a,a=n.child;a!==null;)H_(a,i),a=a.sibling;return ce(Vt,Vt.current&1|2),Je&&gn(n,c.treeForkCount),n.child}i=i.sibling}c.tail!==null&&At()>ru&&(n.flags|=128,p=!0,rl(c,!1),n.lanes=4194304)}else{if(!p)if(i=Hc(g),i!==null){if(n.flags|=128,p=!0,i=i.updateQueue,n.updateQueue=i,eu(n,i),rl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Je)return Et(n),null}else 2*At()-c.renderingStartTime>ru&&a!==536870912&&(n.flags|=128,p=!0,rl(c,!1),n.lanes=4194304);c.isBackwards?(g.sibling=n.child,n.child=g):(i=c.last,i!==null?i.sibling=g:n.child=g,c.last=g)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=At(),i.sibling=null,a=Vt.current,ce(Vt,p?a&1|2:a&1),Je&&gn(n,c.treeForkCount),i):(Et(n),null);case 22:case 23:return es(n),pd(),c=n.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(a&536870912)!==0&&(n.flags&128)===0&&(Et(n),n.subtreeFlags&6&&(n.flags|=8192)):Et(n),a=n.updateQueue,a!==null&&eu(n,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==a&&(n.flags|=2048),i!==null&&te(Gr),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),vn(Wt),Et(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function t3(i,n){switch(ed(n),n.tag){case 1:return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 3:return vn(Wt),Ee(),i=n.flags,(i&65536)!==0&&(i&128)===0?(n.flags=i&-65537|128,n):null;case 26:case 27:case 5:return nt(n),null;case 31:if(n.memoizedState!==null){if(es(n),n.alternate===null)throw Error(r(340));$r()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 13:if(es(n),i=n.memoizedState,i!==null&&i.dehydrated!==null){if(n.alternate===null)throw Error(r(340));$r()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 19:return te(Vt),null;case 4:return Ee(),null;case 10:return vn(n.type),null;case 22:case 23:return es(n),pd(),i!==null&&te(Gr),i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 24:return vn(Wt),null;case 25:return null;default:return null}}function mv(i,n){switch(ed(n),n.tag){case 3:vn(Wt),Ee();break;case 26:case 27:case 5:nt(n);break;case 4:Ee();break;case 31:n.memoizedState!==null&&es(n);break;case 13:es(n);break;case 19:te(Vt);break;case 10:vn(n.type);break;case 22:case 23:es(n),pd(),i!==null&&te(Gr);break;case 24:vn(Wt)}}function al(i,n){try{var a=n.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var p=c.next;a=p;do{if((a.tag&i)===i){c=void 0;var g=a.create,y=a.inst;c=g(),y.destroy=c}a=a.next}while(a!==p)}}catch(E){ht(n,n.return,E)}}function er(i,n,a){try{var c=n.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&i)===i){var y=c.inst,E=y.destroy;if(E!==void 0){y.destroy=void 0,p=n;var L=a,W=E;try{W()}catch(se){ht(p,L,se)}}}c=c.next}while(c!==g)}}catch(se){ht(n,n.return,se)}}function pv(i){var n=i.updateQueue;if(n!==null){var a=i.stateNode;try{r0(n,a)}catch(c){ht(i,i.return,c)}}}function gv(i,n,a){a.props=Qr(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(c){ht(i,n,c)}}function ol(i,n){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof a=="function"?i.refCleanup=a(c):a.current=c}}catch(p){ht(i,n,p)}}function Us(i,n){var a=i.ref,c=i.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(p){ht(i,n,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){ht(i,n,p)}else a.current=null}function _v(i){var n=i.type,a=i.memoizedProps,c=i.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(p){ht(i,i.return,p)}}function Gd(i,n,a){try{var c=i.stateNode;w3(c,i.type,a,n),c[Ni]=n}catch(p){ht(i,i.return,p)}}function vv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&or(i.type)||i.tag===4}function Wd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||vv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&or(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Yd(i,n,a){var c=i.tag;if(c===5||c===6)i=i.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(i),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=de));else if(c!==4&&(c===27&&or(i.type)&&(a=i.stateNode,n=null),i=i.child,i!==null))for(Yd(i,n,a),i=i.sibling;i!==null;)Yd(i,n,a),i=i.sibling}function tu(i,n,a){var c=i.tag;if(c===5||c===6)i=i.stateNode,n?a.insertBefore(i,n):a.appendChild(i);else if(c!==4&&(c===27&&or(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(tu(i,n,a),i=i.sibling;i!==null;)tu(i,n,a),i=i.sibling}function bv(i){var n=i.stateNode,a=i.memoizedProps;try{for(var c=i.type,p=n.attributes;p.length;)n.removeAttributeNode(p[0]);xi(n,c,a),n[Ht]=i,n[Ni]=a}catch(g){ht(i,i.return,g)}}var wn=!1,Zt=!1,Xd=!1,yv=typeof WeakSet=="function"?WeakSet:Set,ci=null;function i3(i,n){if(i=i.containerInfo,vf=Su,i=D_(i),Vh(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var p=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var y=0,E=-1,L=-1,W=0,se=0,ae=i,X=null;t:for(;;){for(var ee;ae!==a||p!==0&&ae.nodeType!==3||(E=y+p),ae!==g||c!==0&&ae.nodeType!==3||(L=y+c),ae.nodeType===3&&(y+=ae.nodeValue.length),(ee=ae.firstChild)!==null;)X=ae,ae=ee;for(;;){if(ae===i)break t;if(X===a&&++W===p&&(E=y),X===g&&++se===c&&(L=y),(ee=ae.nextSibling)!==null)break;ae=X,X=ae.parentNode}ae=ee}a=E===-1||L===-1?null:{start:E,end:L}}else a=null}a=a||{start:0,end:0}}else a=null;for(bf={focusedElem:i,selectionRange:a},Su=!1,ci=n;ci!==null;)if(n=ci,i=n.child,(n.subtreeFlags&1028)!==0&&i!==null)i.return=n,ci=i;else for(;ci!==null;){switch(n=ci,g=n.alternate,i=n.flags,n.tag){case 0:if((i&4)!==0&&(i=n.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)p=i[a],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&g!==null){i=void 0,a=n,p=g.memoizedProps,g=g.memoizedState,c=a.stateNode;try{var Ce=Qr(a.type,p);i=c.getSnapshotBeforeUpdate(Ce,g),c.__reactInternalSnapshotBeforeUpdate=i}catch(De){ht(a,a.return,De)}}break;case 3:if((i&1024)!==0){if(i=n.stateNode.containerInfo,a=i.nodeType,a===9)Sf(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Sf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=n.sibling,i!==null){i.return=n.return,ci=i;break}ci=n.return}}function xv(i,n,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:Cn(i,a),c&4&&al(5,a);break;case 1:if(Cn(i,a),c&4)if(i=a.stateNode,n===null)try{i.componentDidMount()}catch(y){ht(a,a.return,y)}else{var p=Qr(a.type,n.memoizedProps);n=n.memoizedState;try{i.componentDidUpdate(p,n,i.__reactInternalSnapshotBeforeUpdate)}catch(y){ht(a,a.return,y)}}c&64&&pv(a),c&512&&ol(a,a.return);break;case 3:if(Cn(i,a),c&64&&(i=a.updateQueue,i!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{r0(i,n)}catch(y){ht(a,a.return,y)}}break;case 27:n===null&&c&4&&bv(a);case 26:case 5:Cn(i,a),n===null&&c&4&&_v(a),c&512&&ol(a,a.return);break;case 12:Cn(i,a);break;case 31:Cn(i,a),c&4&&Ev(i,a);break;case 13:Cn(i,a),c&4&&Cv(i,a),c&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=h3.bind(null,a),R3(i,a))));break;case 22:if(c=a.memoizedState!==null||wn,!c){n=n!==null&&n.memoizedState!==null||Zt,p=wn;var g=Zt;wn=c,(Zt=n)&&!g?Nn(i,a,(a.subtreeFlags&8772)!==0):Cn(i,a),wn=p,Zt=g}break;case 30:break;default:Cn(i,a)}}function Sv(i){var n=i.alternate;n!==null&&(i.alternate=null,Sv(n)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(n=i.stateNode,n!==null&&Ro(n)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Tt=null,Ui=!1;function En(i,n,a){for(a=a.child;a!==null;)wv(i,n,a),a=a.sibling}function wv(i,n,a){if(li&&typeof li.onCommitFiberUnmount=="function")try{li.onCommitFiberUnmount(cn,a)}catch{}switch(a.tag){case 26:Zt||Us(a,n),En(i,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Zt||Us(a,n);var c=Tt,p=Ui;or(a.type)&&(Tt=a.stateNode,Ui=!1),En(i,n,a),gl(a.stateNode),Tt=c,Ui=p;break;case 5:Zt||Us(a,n);case 6:if(c=Tt,p=Ui,Tt=null,En(i,n,a),Tt=c,Ui=p,Tt!==null)if(Ui)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(a.stateNode)}catch(g){ht(a,n,g)}else try{Tt.removeChild(a.stateNode)}catch(g){ht(a,n,g)}break;case 18:Tt!==null&&(Ui?(i=Tt,pb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),no(i)):pb(Tt,a.stateNode));break;case 4:c=Tt,p=Ui,Tt=a.stateNode.containerInfo,Ui=!0,En(i,n,a),Tt=c,Ui=p;break;case 0:case 11:case 14:case 15:er(2,a,n),Zt||er(4,a,n),En(i,n,a);break;case 1:Zt||(Us(a,n),c=a.stateNode,typeof c.componentWillUnmount=="function"&&gv(a,n,c)),En(i,n,a);break;case 21:En(i,n,a);break;case 22:Zt=(c=Zt)||a.memoizedState!==null,En(i,n,a),Zt=c;break;default:En(i,n,a)}}function Ev(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{no(i)}catch(a){ht(n,n.return,a)}}}function Cv(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{no(i)}catch(a){ht(n,n.return,a)}}function s3(i){switch(i.tag){case 31:case 13:case 19:var n=i.stateNode;return n===null&&(n=i.stateNode=new yv),n;case 22:return i=i.stateNode,n=i._retryCache,n===null&&(n=i._retryCache=new yv),n;default:throw Error(r(435,i.tag))}}function iu(i,n){var a=s3(i);n.forEach(function(c){if(!a.has(c)){a.add(c);var p=d3.bind(null,i,c);c.then(p,p)}})}function Hi(i,n){var a=n.deletions;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c],g=i,y=n,E=y;e:for(;E!==null;){switch(E.tag){case 27:if(or(E.type)){Tt=E.stateNode,Ui=!1;break e}break;case 5:Tt=E.stateNode,Ui=!1;break e;case 3:case 4:Tt=E.stateNode.containerInfo,Ui=!0;break e}E=E.return}if(Tt===null)throw Error(r(160));wv(g,y,p),Tt=null,Ui=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Nv(n,i),n=n.sibling}var Rs=null;function Nv(i,n){var a=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Hi(n,i),Fi(i),c&4&&(er(3,i,i.return),al(3,i),er(5,i,i.return));break;case 1:Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),c&64&&wn&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?c:a.concat(c))));break;case 26:var p=Rs;if(Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),c&4){var g=a!==null?a.memoizedState:null;if(c=i.memoizedState,a===null)if(c===null)if(i.stateNode===null){e:{c=i.type,a=i.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Br]||g[Ht]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(c),p.head.insertBefore(g,p.querySelector("head > title"))),xi(g,c,a),g[Ht]=i,Kt(g),c=g;break e;case"link":var y=Nb("link","href",p).get(c+(a.href||""));if(y){for(var E=0;E<y.length;E++)if(g=y[E],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(E,1);break t}}g=p.createElement(c),xi(g,c,a),p.head.appendChild(g);break;case"meta":if(y=Nb("meta","content",p).get(c+(a.content||""))){for(E=0;E<y.length;E++)if(g=y[E],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(E,1);break t}}g=p.createElement(c),xi(g,c,a),p.head.appendChild(g);break;default:throw Error(r(468,c))}g[Ht]=i,Kt(g),c=g}i.stateNode=c}else kb(p,i.type,i.stateNode);else i.stateNode=Cb(p,c,i.memoizedProps);else g!==c?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,c===null?kb(p,i.type,i.stateNode):Cb(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Gd(i,i.memoizedProps,a.memoizedProps)}break;case 27:Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),a!==null&&c&4&&Gd(i,i.memoizedProps,a.memoizedProps);break;case 5:if(Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),i.flags&32){p=i.stateNode;try{Oe(p,"")}catch(Ce){ht(i,i.return,Ce)}}c&4&&i.stateNode!=null&&(p=i.memoizedProps,Gd(i,p,a!==null?a.memoizedProps:p)),c&1024&&(Xd=!0);break;case 6:if(Hi(n,i),Fi(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,a=i.stateNode;try{a.nodeValue=c}catch(Ce){ht(i,i.return,Ce)}}break;case 3:if(vu=null,p=Rs,Rs=gu(n.containerInfo),Hi(n,i),Rs=p,Fi(i),c&4&&a!==null&&a.memoizedState.isDehydrated)try{no(n.containerInfo)}catch(Ce){ht(i,i.return,Ce)}Xd&&(Xd=!1,kv(i));break;case 4:c=Rs,Rs=gu(i.stateNode.containerInfo),Hi(n,i),Fi(i),Rs=c;break;case 12:Hi(n,i),Fi(i);break;case 31:Hi(n,i),Fi(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,iu(i,c)));break;case 13:Hi(n,i),Fi(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(nu=At()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,iu(i,c)));break;case 22:p=i.memoizedState!==null;var L=a!==null&&a.memoizedState!==null,W=wn,se=Zt;if(wn=W||p,Zt=se||L,Hi(n,i),Zt=se,wn=W,Fi(i),c&8192)e:for(n=i.stateNode,n._visibility=p?n._visibility&-2:n._visibility|1,p&&(a===null||L||wn||Zt||Jr(i)),a=null,n=i;;){if(n.tag===5||n.tag===26){if(a===null){L=a=n;try{if(g=L.stateNode,p)y=g.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{E=L.stateNode;var ae=L.memoizedProps.style,X=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;E.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Ce){ht(L,L.return,Ce)}}}else if(n.tag===6){if(a===null){L=n;try{L.stateNode.nodeValue=p?"":L.memoizedProps}catch(Ce){ht(L,L.return,Ce)}}}else if(n.tag===18){if(a===null){L=n;try{var ee=L.stateNode;p?gb(ee,!0):gb(L.stateNode,!1)}catch(Ce){ht(L,L.return,Ce)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===i)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=i.updateQueue,c!==null&&(a=c.retryQueue,a!==null&&(c.retryQueue=null,iu(i,a))));break;case 19:Hi(n,i),Fi(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,iu(i,c)));break;case 30:break;case 21:break;default:Hi(n,i),Fi(i)}}function Fi(i){var n=i.flags;if(n&2){try{for(var a,c=i.return;c!==null;){if(vv(c)){a=c;break}c=c.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var p=a.stateNode,g=Wd(i);tu(i,g,p);break;case 5:var y=a.stateNode;a.flags&32&&(Oe(y,""),a.flags&=-33);var E=Wd(i);tu(i,E,y);break;case 3:case 4:var L=a.stateNode.containerInfo,W=Wd(i);Yd(i,W,L);break;default:throw Error(r(161))}}catch(se){ht(i,i.return,se)}i.flags&=-3}n&4096&&(i.flags&=-4097)}function kv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var n=i;kv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),i=i.sibling}}function Cn(i,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)xv(i,n.alternate,n),n=n.sibling}function Jr(i){for(i=i.child;i!==null;){var n=i;switch(n.tag){case 0:case 11:case 14:case 15:er(4,n,n.return),Jr(n);break;case 1:Us(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&gv(n,n.return,a),Jr(n);break;case 27:gl(n.stateNode);case 26:case 5:Us(n,n.return),Jr(n);break;case 22:n.memoizedState===null&&Jr(n);break;case 30:Jr(n);break;default:Jr(n)}i=i.sibling}}function Nn(i,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,p=i,g=n,y=g.flags;switch(g.tag){case 0:case 11:case 15:Nn(p,g,a),al(4,g);break;case 1:if(Nn(p,g,a),c=g,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){ht(c,c.return,W)}if(c=g,p=c.updateQueue,p!==null){var E=c.stateNode;try{var L=p.shared.hiddenCallbacks;if(L!==null)for(p.shared.hiddenCallbacks=null,p=0;p<L.length;p++)n0(L[p],E)}catch(W){ht(c,c.return,W)}}a&&y&64&&pv(g),ol(g,g.return);break;case 27:bv(g);case 26:case 5:Nn(p,g,a),a&&c===null&&y&4&&_v(g),ol(g,g.return);break;case 12:Nn(p,g,a);break;case 31:Nn(p,g,a),a&&y&4&&Ev(p,g);break;case 13:Nn(p,g,a),a&&y&4&&Cv(p,g);break;case 22:g.memoizedState===null&&Nn(p,g,a),ol(g,g.return);break;case 30:break;default:Nn(p,g,a)}n=n.sibling}}function Zd(i,n){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&Go(a))}function Qd(i,n){i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&Go(i))}function Ds(i,n,a,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Tv(i,n,a,c),n=n.sibling}function Tv(i,n,a,c){var p=n.flags;switch(n.tag){case 0:case 11:case 15:Ds(i,n,a,c),p&2048&&al(9,n);break;case 1:Ds(i,n,a,c);break;case 3:Ds(i,n,a,c),p&2048&&(i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&Go(i)));break;case 12:if(p&2048){Ds(i,n,a,c),i=n.stateNode;try{var g=n.memoizedProps,y=g.id,E=g.onPostCommit;typeof E=="function"&&E(y,n.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(L){ht(n,n.return,L)}}else Ds(i,n,a,c);break;case 31:Ds(i,n,a,c);break;case 13:Ds(i,n,a,c);break;case 23:break;case 22:g=n.stateNode,y=n.alternate,n.memoizedState!==null?g._visibility&2?Ds(i,n,a,c):ll(i,n):g._visibility&2?Ds(i,n,a,c):(g._visibility|=2,Ga(i,n,a,c,(n.subtreeFlags&10256)!==0||!1)),p&2048&&Zd(y,n);break;case 24:Ds(i,n,a,c),p&2048&&Qd(n.alternate,n);break;default:Ds(i,n,a,c)}}function Ga(i,n,a,c,p){for(p=p&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var g=i,y=n,E=a,L=c,W=y.flags;switch(y.tag){case 0:case 11:case 15:Ga(g,y,E,L,p),al(8,y);break;case 23:break;case 22:var se=y.stateNode;y.memoizedState!==null?se._visibility&2?Ga(g,y,E,L,p):ll(g,y):(se._visibility|=2,Ga(g,y,E,L,p)),p&&W&2048&&Zd(y.alternate,y);break;case 24:Ga(g,y,E,L,p),p&&W&2048&&Qd(y.alternate,y);break;default:Ga(g,y,E,L,p)}n=n.sibling}}function ll(i,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=i,c=n,p=c.flags;switch(c.tag){case 22:ll(a,c),p&2048&&Zd(c.alternate,c);break;case 24:ll(a,c),p&2048&&Qd(c.alternate,c);break;default:ll(a,c)}n=n.sibling}}var cl=8192;function Wa(i,n,a){if(i.subtreeFlags&cl)for(i=i.child;i!==null;)Mv(i,n,a),i=i.sibling}function Mv(i,n,a){switch(i.tag){case 26:Wa(i,n,a),i.flags&cl&&i.memoizedState!==null&&V3(a,Rs,i.memoizedState,i.memoizedProps);break;case 5:Wa(i,n,a);break;case 3:case 4:var c=Rs;Rs=gu(i.stateNode.containerInfo),Wa(i,n,a),Rs=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=cl,cl=16777216,Wa(i,n,a),cl=c):Wa(i,n,a));break;default:Wa(i,n,a)}}function Av(i){var n=i.alternate;if(n!==null&&(i=n.child,i!==null)){n.child=null;do n=i.sibling,i.sibling=null,i=n;while(i!==null)}}function ul(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];ci=c,Dv(c,i)}Av(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Rv(i),i=i.sibling}function Rv(i){switch(i.tag){case 0:case 11:case 15:ul(i),i.flags&2048&&er(9,i,i.return);break;case 3:ul(i);break;case 12:ul(i);break;case 22:var n=i.stateNode;i.memoizedState!==null&&n._visibility&2&&(i.return===null||i.return.tag!==13)?(n._visibility&=-3,su(i)):ul(i);break;default:ul(i)}}function su(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];ci=c,Dv(c,i)}Av(i)}for(i=i.child;i!==null;){switch(n=i,n.tag){case 0:case 11:case 15:er(8,n,n.return),su(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,su(n));break;default:su(n)}i=i.sibling}}function Dv(i,n){for(;ci!==null;){var a=ci;switch(a.tag){case 0:case 11:case 15:er(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Go(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,ci=c;else e:for(a=i;ci!==null;){c=ci;var p=c.sibling,g=c.return;if(Sv(c),c===a){ci=null;break e}if(p!==null){p.return=g,ci=p;break e}ci=g}}}var n3={getCacheForType:function(i){var n=bi(Wt),a=n.data.get(i);return a===void 0&&(a=i(),n.data.set(i,a)),a},cacheSignal:function(){return bi(Wt).controller.signal}},r3=typeof WeakMap=="function"?WeakMap:Map,at=0,_t=null,We=null,Ze=0,ut=0,ts=null,tr=!1,Ya=!1,Jd=!1,kn=0,jt=0,ir=0,ea=0,ef=0,is=0,Xa=0,hl=null,Vi=null,tf=!1,nu=0,Ov=0,ru=1/0,au=null,sr=null,ii=0,nr=null,Za=null,Tn=0,sf=0,nf=null,Lv=null,dl=0,rf=null;function ss(){return(at&2)!==0&&Ze!==0?Ze&-Ze:A.T!==null?hf():wa()}function jv(){if(is===0)if((Ze&536870912)===0||Je){var i=Ms;Ms<<=1,(Ms&3932160)===0&&(Ms=262144),is=i}else is=536870912;return i=Ji.current,i!==null&&(i.flags|=32),is}function $i(i,n,a){(i===_t&&(ut===2||ut===9)||i.cancelPendingCommit!==null)&&(Qa(i,0),rr(i,Ze,is,!1)),gt(i,a),((at&2)===0||i!==_t)&&(i===_t&&((at&2)===0&&(ea|=a),jt===4&&rr(i,Ze,is,!1)),Hs(i))}function Bv(i,n,a){if((at&6)!==0)throw Error(r(327));var c=!a&&(n&127)===0&&(n&i.expiredLanes)===0||ne(i,n),p=c?l3(i,n):of(i,n,!0),g=c;do{if(p===0){Ya&&!c&&rr(i,n,0,!1);break}else{if(a=i.current.alternate,g&&!a3(a)){p=of(i,n,!1),g=!1;continue}if(p===2){if(g=n,i.errorRecoveryDisabledLanes&g)var y=0;else y=i.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var E=i;p=hl;var L=E.current.memoizedState.isDehydrated;if(L&&(Qa(E,y).flags|=256),y=of(E,y,!1),y!==2){if(Jd&&!L){E.errorRecoveryDisabledLanes|=g,ea|=g,p=4;break e}g=Vi,Vi=p,g!==null&&(Vi===null?Vi=g:Vi.push.apply(Vi,g))}p=y}if(g=!1,p!==2)continue}}if(p===1){Qa(i,0),rr(i,n,0,!0);break}e:{switch(c=i,g=p,g){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:rr(c,n,is,!tr);break e;case 2:Vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(p=nu+300-At(),10<p)){if(rr(c,n,is,!tr),j(c,0,!0)!==0)break e;Tn=n,c.timeoutHandle=fb(zv.bind(null,c,a,Vi,au,tf,n,is,ea,Xa,tr,g,"Throttled",-0,0),p);break e}zv(c,a,Vi,au,tf,n,is,ea,Xa,tr,g,null,-0,0)}}break}while(!0);Hs(i)}function zv(i,n,a,c,p,g,y,E,L,W,se,ae,X,ee){if(i.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:de},Mv(n,g,ae);var Ce=(g&62914560)===g?nu-At():(g&4194048)===g?Ov-At():0;if(Ce=$3(ae,Ce),Ce!==null){Tn=g,i.cancelPendingCommit=Ce(qv.bind(null,i,n,g,a,c,p,y,E,L,se,ae,null,X,ee)),rr(i,g,y,!W);return}}qv(i,n,g,a,c,p,y,E,L)}function a3(i){for(var n=i;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var p=a[c],g=p.getSnapshot;p=p.value;try{if(!Zi(g(),p))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function rr(i,n,a,c){n&=~ef,n&=~ea,i.suspendedLanes|=n,i.pingedLanes&=~n,c&&(i.warmLanes|=n),c=i.expirationTimes;for(var p=n;0<p;){var g=31-gi(p),y=1<<g;c[g]=-1,p&=~y}a!==0&&be(i,a,n)}function ou(){return(at&6)===0?(fl(0),!1):!0}function af(){if(We!==null){if(ut===0)var i=We.return;else i=We,_n=qr=null,xd(i),Fa=null,Yo=0,i=We;for(;i!==null;)mv(i.alternate,i),i=i.return;We=null}}function Qa(i,n){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,N3(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Tn=0,af(),_t=i,We=a=pn(i.current,null),Ze=n,ut=0,ts=null,tr=!1,Ya=ne(i,n),Jd=!1,Xa=is=ef=ea=ir=jt=0,Vi=hl=null,tf=!1,(n&8)!==0&&(n|=n&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=n;0<c;){var p=31-gi(c),g=1<<p;n|=i[p],c&=~g}return kn=n,Tc(),a}function Iv(i,n){He=null,A.H=sl,n===Ha||n===Bc?(n=e0(),ut=3):n===cd?(n=e0(),ut=4):ut=n===zd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ts=n,We===null&&(jt=1,Xc(i,ds(n,i.current)))}function Pv(){var i=Ji.current;return i===null?!0:(Ze&4194048)===Ze?gs===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?i===gs:!1}function Uv(){var i=A.H;return A.H=sl,i===null?sl:i}function Hv(){var i=A.A;return A.A=n3,i}function lu(){jt=4,tr||(Ze&4194048)!==Ze&&Ji.current!==null||(Ya=!0),(ir&134217727)===0&&(ea&134217727)===0||_t===null||rr(_t,Ze,is,!1)}function of(i,n,a){var c=at;at|=2;var p=Uv(),g=Hv();(_t!==i||Ze!==n)&&(au=null,Qa(i,n)),n=!1;var y=jt;e:do try{if(ut!==0&&We!==null){var E=We,L=ts;switch(ut){case 8:af(),y=6;break e;case 3:case 2:case 9:case 6:Ji.current===null&&(n=!0);var W=ut;if(ut=0,ts=null,Ja(i,E,L,W),a&&Ya){y=0;break e}break;default:W=ut,ut=0,ts=null,Ja(i,E,L,W)}}o3(),y=jt;break}catch(se){Iv(i,se)}while(!0);return n&&i.shellSuspendCounter++,_n=qr=null,at=c,A.H=p,A.A=g,We===null&&(_t=null,Ze=0,Tc()),y}function o3(){for(;We!==null;)Fv(We)}function l3(i,n){var a=at;at|=2;var c=Uv(),p=Hv();_t!==i||Ze!==n?(au=null,ru=At()+500,Qa(i,n)):Ya=ne(i,n);e:do try{if(ut!==0&&We!==null){n=We;var g=ts;t:switch(ut){case 1:ut=0,ts=null,Ja(i,n,g,1);break;case 2:case 9:if(Q_(g)){ut=0,ts=null,Vv(n);break}n=function(){ut!==2&&ut!==9||_t!==i||(ut=7),Hs(i)},g.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Q_(g)?(ut=0,ts=null,Vv(n)):(ut=0,ts=null,Ja(i,n,g,7));break;case 5:var y=null;switch(We.tag){case 26:y=We.memoizedState;case 5:case 27:var E=We;if(y?Tb(y):E.stateNode.complete){ut=0,ts=null;var L=E.sibling;if(L!==null)We=L;else{var W=E.return;W!==null?(We=W,cu(W)):We=null}break t}}ut=0,ts=null,Ja(i,n,g,5);break;case 6:ut=0,ts=null,Ja(i,n,g,6);break;case 8:af(),jt=6;break e;default:throw Error(r(462))}}c3();break}catch(se){Iv(i,se)}while(!0);return _n=qr=null,A.H=c,A.A=p,at=a,We!==null?0:(_t=null,Ze=0,Tc(),jt)}function c3(){for(;We!==null&&!ko();)Fv(We)}function Fv(i){var n=dv(i.alternate,i,kn);i.memoizedProps=i.pendingProps,n===null?cu(i):We=n}function Vv(i){var n=i,a=n.alternate;switch(n.tag){case 15:case 0:n=av(a,n,n.pendingProps,n.type,void 0,Ze);break;case 11:n=av(a,n,n.pendingProps,n.type.render,n.ref,Ze);break;case 5:xd(n);default:mv(a,n),n=We=H_(n,kn),n=dv(a,n,kn)}i.memoizedProps=i.pendingProps,n===null?cu(i):We=n}function Ja(i,n,a,c){_n=qr=null,xd(n),Fa=null,Yo=0;var p=n.return;try{if(ZC(i,p,n,a,Ze)){jt=1,Xc(i,ds(a,i.current)),We=null;return}}catch(g){if(p!==null)throw We=p,g;jt=1,Xc(i,ds(a,i.current)),We=null;return}n.flags&32768?(Je||c===1?i=!0:Ya||(Ze&536870912)!==0?i=!1:(tr=i=!0,(c===2||c===9||c===3||c===6)&&(c=Ji.current,c!==null&&c.tag===13&&(c.flags|=16384))),$v(n,i)):cu(n)}function cu(i){var n=i;do{if((n.flags&32768)!==0){$v(n,tr);return}i=n.return;var a=e3(n.alternate,n,kn);if(a!==null){We=a;return}if(n=n.sibling,n!==null){We=n;return}We=n=i}while(n!==null);jt===0&&(jt=5)}function $v(i,n){do{var a=t3(i.alternate,i);if(a!==null){a.flags&=32767,We=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(i=i.sibling,i!==null)){We=i;return}We=i=a}while(i!==null);jt=6,We=null}function qv(i,n,a,c,p,g,y,E,L){i.cancelPendingCommit=null;do uu();while(ii!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===i.current)throw Error(r(177));if(g=n.lanes|n.childLanes,g|=Wh,ke(i,a,g,y,E,L),i===_t&&(We=_t=null,Ze=0),Za=n,nr=i,Tn=a,sf=g,nf=p,Lv=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,f3(ln,function(){return Xv(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=A.T,A.T=null,p=q.p,q.p=2,y=at,at|=4;try{i3(i,n,a)}finally{at=y,q.p=p,A.T=c}}ii=1,Kv(),Gv(),Wv()}}function Kv(){if(ii===1){ii=0;var i=nr,n=Za,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var c=q.p;q.p=2;var p=at;at|=4;try{Nv(n,i);var g=bf,y=D_(i.containerInfo),E=g.focusedElem,L=g.selectionRange;if(y!==E&&E&&E.ownerDocument&&R_(E.ownerDocument.documentElement,E)){if(L!==null&&Vh(E)){var W=L.start,se=L.end;if(se===void 0&&(se=W),"selectionStart"in E)E.selectionStart=W,E.selectionEnd=Math.min(se,E.value.length);else{var ae=E.ownerDocument||document,X=ae&&ae.defaultView||window;if(X.getSelection){var ee=X.getSelection(),Ce=E.textContent.length,De=Math.min(L.start,Ce),mt=L.end===void 0?De:Math.min(L.end,Ce);!ee.extend&&De>mt&&(y=mt,mt=De,De=y);var H=A_(E,De),z=A_(E,mt);if(H&&z&&(ee.rangeCount!==1||ee.anchorNode!==H.node||ee.anchorOffset!==H.offset||ee.focusNode!==z.node||ee.focusOffset!==z.offset)){var K=ae.createRange();K.setStart(H.node,H.offset),ee.removeAllRanges(),De>mt?(ee.addRange(K),ee.extend(z.node,z.offset)):(K.setEnd(z.node,z.offset),ee.addRange(K))}}}}for(ae=[],ee=E;ee=ee.parentNode;)ee.nodeType===1&&ae.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ae.length;E++){var re=ae[E];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Su=!!vf,bf=vf=null}finally{at=p,q.p=c,A.T=a}}i.current=n,ii=2}}function Gv(){if(ii===2){ii=0;var i=nr,n=Za,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var c=q.p;q.p=2;var p=at;at|=4;try{xv(i,n.alternate,n)}finally{at=p,q.p=c,A.T=a}}ii=3}}function Wv(){if(ii===4||ii===3){ii=0,ba();var i=nr,n=Za,a=Tn,c=Lv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ii=5:(ii=0,Za=nr=null,Yv(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(sr=null),un(a),n=n.stateNode,li&&typeof li.onCommitFiberRoot=="function")try{li.onCommitFiberRoot(cn,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=A.T,p=q.p,q.p=2,A.T=null;try{for(var g=i.onRecoverableError,y=0;y<c.length;y++){var E=c[y];g(E.value,{componentStack:E.stack})}}finally{A.T=n,q.p=p}}(Tn&3)!==0&&uu(),Hs(i),p=i.pendingLanes,(a&261930)!==0&&(p&42)!==0?i===rf?dl++:(dl=0,rf=i):dl=0,fl(0)}}function Yv(i,n){(i.pooledCacheLanes&=n)===0&&(n=i.pooledCache,n!=null&&(i.pooledCache=null,Go(n)))}function uu(){return Kv(),Gv(),Wv(),Xv()}function Xv(){if(ii!==5)return!1;var i=nr,n=sf;sf=0;var a=un(Tn),c=A.T,p=q.p;try{q.p=32>a?32:a,A.T=null,a=nf,nf=null;var g=nr,y=Tn;if(ii=0,Za=nr=null,Tn=0,(at&6)!==0)throw Error(r(331));var E=at;if(at|=4,Rv(g.current),Tv(g,g.current,y,a),at=E,fl(0,!1),li&&typeof li.onPostCommitFiberRoot=="function")try{li.onPostCommitFiberRoot(cn,g)}catch{}return!0}finally{q.p=p,A.T=c,Yv(i,n)}}function Zv(i,n,a){n=ds(a,n),n=Bd(i.stateNode,n,2),i=Zn(i,n,2),i!==null&&(gt(i,2),Hs(i))}function ht(i,n,a){if(i.tag===3)Zv(i,i,a);else for(;n!==null;){if(n.tag===3){Zv(n,i,a);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(sr===null||!sr.has(c))){i=ds(a,i),a=Q0(2),c=Zn(n,a,2),c!==null&&(J0(a,c,n,i),gt(c,2),Hs(c));break}}n=n.return}}function lf(i,n,a){var c=i.pingCache;if(c===null){c=i.pingCache=new r3;var p=new Set;c.set(n,p)}else p=c.get(n),p===void 0&&(p=new Set,c.set(n,p));p.has(a)||(Jd=!0,p.add(a),i=u3.bind(null,i,n,a),n.then(i,i))}function u3(i,n,a){var c=i.pingCache;c!==null&&c.delete(n),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,_t===i&&(Ze&a)===a&&(jt===4||jt===3&&(Ze&62914560)===Ze&&300>At()-nu?(at&2)===0&&Qa(i,0):ef|=a,Xa===Ze&&(Xa=0)),Hs(i)}function Qv(i,n){n===0&&(n=ze()),i=Fr(i,n),i!==null&&(gt(i,n),Hs(i))}function h3(i){var n=i.memoizedState,a=0;n!==null&&(a=n.retryLane),Qv(i,a)}function d3(i,n){var a=0;switch(i.tag){case 31:case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(a=p.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(n),Qv(i,a)}function f3(i,n){return zn(i,n)}var hu=null,eo=null,cf=!1,du=!1,uf=!1,ar=0;function Hs(i){i!==eo&&i.next===null&&(eo===null?hu=eo=i:eo=eo.next=i),du=!0,cf||(cf=!0,p3())}function fl(i,n){if(!uf&&du){uf=!0;do for(var a=!1,c=hu;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var g=0;else{var y=c.suspendedLanes,E=c.pingedLanes;g=(1<<31-gi(42|i)+1)-1,g&=p&~(y&~E),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,ib(c,g))}else g=Ze,g=j(c,c===_t?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ne(c,g)||(a=!0,ib(c,g));c=c.next}while(a);uf=!1}}function m3(){Jv()}function Jv(){du=cf=!1;var i=0;ar!==0&&C3()&&(i=ar);for(var n=At(),a=null,c=hu;c!==null;){var p=c.next,g=eb(c,n);g===0?(c.next=null,a===null?hu=p:a.next=p,p===null&&(eo=a)):(a=c,(i!==0||(g&3)!==0)&&(du=!0)),c=p}ii!==0&&ii!==5||fl(i),ar!==0&&(ar=0)}function eb(i,n){for(var a=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var y=31-gi(g),E=1<<y,L=p[y];L===-1?((E&a)===0||(E&c)!==0)&&(p[y]=me(E,n)):L<=n&&(i.expiredLanes|=E),g&=~E}if(n=_t,a=Ze,a=j(i,i===n?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,a===0||i===n&&(ut===2||ut===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&rn(c),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||ne(i,a)){if(n=a&-a,n===i.callbackPriority)return n;switch(c!==null&&rn(c),un(a)){case 2:case 8:a=on;break;case 32:a=ln;break;case 268435456:a=In;break;default:a=ln}return c=tb.bind(null,i),a=zn(a,c),i.callbackPriority=n,i.callbackNode=a,n}return c!==null&&c!==null&&rn(c),i.callbackPriority=2,i.callbackNode=null,2}function tb(i,n){if(ii!==0&&ii!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(uu()&&i.callbackNode!==a)return null;var c=Ze;return c=j(i,i===_t?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(Bv(i,c,n),eb(i,At()),i.callbackNode!=null&&i.callbackNode===a?tb.bind(null,i):null)}function ib(i,n){if(uu())return null;Bv(i,n,!0)}function p3(){k3(function(){(at&6)!==0?zn(pi,m3):Jv()})}function hf(){if(ar===0){var i=Pa;i===0&&(i=et,et<<=1,(et&261888)===0&&(et=256)),ar=i}return ar}function sb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Vn(""+i)}function nb(i,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,i.id&&a.setAttribute("form",i.id),n.parentNode.insertBefore(a,n),i=new FormData(i),a.parentNode.removeChild(a),i}function g3(i,n,a,c,p){if(n==="submit"&&a&&a.stateNode===p){var g=sb((p[Ni]||null).action),y=c.submitter;y&&(n=(n=y[Ni]||null)?sb(n.formAction):y.getAttribute("formAction"),n!==null&&(g=n,y=null));var E=new Ec("action","action",null,c,p);i.push({event:E,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ar!==0){var L=y?nb(p,y):new FormData(p);Ad(a,{pending:!0,data:L,method:p.method,action:g},null,L)}}else typeof g=="function"&&(E.preventDefault(),L=y?nb(p,y):new FormData(p),Ad(a,{pending:!0,data:L,method:p.method,action:g},g,L))},currentTarget:p}]})}}for(var df=0;df<Gh.length;df++){var ff=Gh[df],_3=ff.toLowerCase(),v3=ff[0].toUpperCase()+ff.slice(1);As(_3,"on"+v3)}As(j_,"onAnimationEnd"),As(B_,"onAnimationIteration"),As(z_,"onAnimationStart"),As("dblclick","onDoubleClick"),As("focusin","onFocus"),As("focusout","onBlur"),As(LC,"onTransitionRun"),As(jC,"onTransitionStart"),As(BC,"onTransitionCancel"),As(I_,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="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(" "),b3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ml));function rb(i,n){n=(n&4)!==0;for(var a=0;a<i.length;a++){var c=i[a],p=c.event;c=c.listeners;e:{var g=void 0;if(n)for(var y=c.length-1;0<=y;y--){var E=c[y],L=E.instance,W=E.currentTarget;if(E=E.listener,L!==g&&p.isPropagationStopped())break e;g=E,p.currentTarget=W;try{g(p)}catch(se){kc(se)}p.currentTarget=null,g=L}else for(y=0;y<c.length;y++){if(E=c[y],L=E.instance,W=E.currentTarget,E=E.listener,L!==g&&p.isPropagationStopped())break e;g=E,p.currentTarget=W;try{g(p)}catch(se){kc(se)}p.currentTarget=null,g=L}}}}function Ye(i,n){var a=n[Ao];a===void 0&&(a=n[Ao]=new Set);var c=i+"__bubble";a.has(c)||(ab(n,i,2,!1),a.add(c))}function mf(i,n,a){var c=0;n&&(c|=4),ab(a,i,c,n)}var fu="_reactListening"+Math.random().toString(36).slice(2);function pf(i){if(!i[fu]){i[fu]=!0,gc.forEach(function(a){a!=="selectionchange"&&(b3.has(a)||mf(a,!1,i),mf(a,!0,i))});var n=i.nodeType===9?i:i.ownerDocument;n===null||n[fu]||(n[fu]=!0,mf("selectionchange",!1,n))}}function ab(i,n,a,c){switch(jb(n)){case 2:var p=G3;break;case 8:p=W3;break;default:p=Af}a=p.bind(null,n,a,i),p=void 0,!Lh||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(n,a,{capture:!0,passive:p}):i.addEventListener(n,a,!0):p!==void 0?i.addEventListener(n,a,{passive:p}):i.addEventListener(n,a,!1)}function gf(i,n,a,c,p){var g=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var y=c.tag;if(y===3||y===4){var E=c.stateNode.containerInfo;if(E===p)break;if(y===4)for(y=c.return;y!==null;){var L=y.tag;if((L===3||L===4)&&y.stateNode.containerInfo===p)return;y=y.return}for(;E!==null;){if(y=Ai(E),y===null)return;if(L=y.tag,L===5||L===6||L===26||L===27){c=g=y;continue e}E=E.parentNode}}c=c.return}yc(function(){var W=g,se=Ue(a),ae=[];e:{var X=P_.get(i);if(X!==void 0){var ee=Ec,Ce=i;switch(i){case"keypress":if(Sc(a)===0)break e;case"keydown":case"keyup":ee=dC;break;case"focusin":Ce="focus",ee=Ih;break;case"focusout":Ce="blur",ee=Ih;break;case"beforeblur":case"afterblur":ee=Ih;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=m_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=eC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=pC;break;case j_:case B_:case z_:ee=sC;break;case I_:ee=_C;break;case"scroll":case"scrollend":ee=QE;break;case"wheel":ee=bC;break;case"copy":case"cut":case"paste":ee=rC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=g_;break;case"toggle":case"beforetoggle":ee=xC}var De=(n&4)!==0,mt=!De&&(i==="scroll"||i==="scrollend"),H=De?X!==null?X+"Capture":null:X;De=[];for(var z=W,K;z!==null;){var re=z;if(K=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||K===null||H===null||(re=Bo(z,H),re!=null&&De.push(pl(z,re,K))),mt)break;z=z.return}0<De.length&&(X=new ee(X,Ce,null,a,se),ae.push({event:X,listeners:De}))}}if((n&7)===0){e:{if(X=i==="mouseover"||i==="pointerover",ee=i==="mouseout"||i==="pointerout",X&&a!==Te&&(Ce=a.relatedTarget||a.fromElement)&&(Ai(Ce)||Ce[Pn]))break e;if((ee||X)&&(X=se.window===se?se:(X=se.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(Ce=a.relatedTarget||a.toElement,ee=W,Ce=Ce?Ai(Ce):null,Ce!==null&&(mt=l(Ce),De=Ce.tag,Ce!==mt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(ee=null,Ce=W),ee!==Ce)){if(De=m_,re="onMouseLeave",H="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(De=g_,re="onPointerLeave",H="onPointerEnter",z="pointer"),mt=ee==null?X:Un(ee),K=Ce==null?X:Un(Ce),X=new De(re,z+"leave",ee,a,se),X.target=mt,X.relatedTarget=K,re=null,Ai(se)===W&&(De=new De(H,z+"enter",Ce,a,se),De.target=K,De.relatedTarget=mt,re=De),mt=re,ee&&Ce)t:{for(De=y3,H=ee,z=Ce,K=0,re=H;re;re=De(re))K++;re=0;for(var Re=z;Re;Re=De(Re))re++;for(;0<K-re;)H=De(H),K--;for(;0<re-K;)z=De(z),re--;for(;K--;){if(H===z||z!==null&&H===z.alternate){De=H;break t}H=De(H),z=De(z)}De=null}else De=null;ee!==null&&ob(ae,X,ee,De,!1),Ce!==null&&mt!==null&&ob(ae,mt,Ce,De,!0)}}e:{if(X=W?Un(W):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var it=E_;else if(S_(X))if(C_)it=RC;else{it=MC;var Me=TC}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?W&&Fn(W.elementType)&&(it=E_):it=AC;if(it&&(it=it(i,W))){w_(ae,it,a,se);break e}Me&&Me(i,X,W),i==="focusout"&&W&&X.type==="number"&&W.memoizedProps.value!=null&&Ta(X,"number",X.value)}switch(Me=W?Un(W):window,i){case"focusin":(S_(Me)||Me.contentEditable==="true")&&(Ra=Me,$h=W,$o=null);break;case"focusout":$o=$h=Ra=null;break;case"mousedown":qh=!0;break;case"contextmenu":case"mouseup":case"dragend":qh=!1,O_(ae,a,se);break;case"selectionchange":if(OC)break;case"keydown":case"keyup":O_(ae,a,se)}var Fe;if(Uh)e:{switch(i){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else Aa?y_(i,a)&&(Qe="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Qe="onCompositionStart");Qe&&(__&&a.locale!=="ko"&&(Aa||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&Aa&&(Fe=d_()):($n=se,jh="value"in $n?$n.value:$n.textContent,Aa=!0)),Me=mu(W,Qe),0<Me.length&&(Qe=new p_(Qe,i,null,a,se),ae.push({event:Qe,listeners:Me}),Fe?Qe.data=Fe:(Fe=x_(a),Fe!==null&&(Qe.data=Fe)))),(Fe=wC?EC(i,a):CC(i,a))&&(Qe=mu(W,"onBeforeInput"),0<Qe.length&&(Me=new p_("onBeforeInput","beforeinput",null,a,se),ae.push({event:Me,listeners:Qe}),Me.data=Fe)),g3(ae,i,W,a,se)}rb(ae,n)})}function pl(i,n,a){return{instance:i,listener:n,currentTarget:a}}function mu(i,n){for(var a=n+"Capture",c=[];i!==null;){var p=i,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Bo(i,a),p!=null&&c.unshift(pl(i,p,g)),p=Bo(i,n),p!=null&&c.push(pl(i,p,g))),i.tag===3)return c;i=i.return}return[]}function y3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function ob(i,n,a,c,p){for(var g=n._reactName,y=[];a!==null&&a!==c;){var E=a,L=E.alternate,W=E.stateNode;if(E=E.tag,L!==null&&L===c)break;E!==5&&E!==26&&E!==27||W===null||(L=W,p?(W=Bo(a,g),W!=null&&y.unshift(pl(a,W,L))):p||(W=Bo(a,g),W!=null&&y.push(pl(a,W,L)))),a=a.return}y.length!==0&&i.push({event:n,listeners:y})}var x3=/\r\n?/g,S3=/\u0000|\uFFFD/g;function lb(i){return(typeof i=="string"?i:""+i).replace(x3,`
9
+ `).replace(S3,"")}function cb(i,n){return n=lb(n),lb(i)===n}function ft(i,n,a,c,p,g){switch(a){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||Oe(i,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&Oe(i,""+c);break;case"className":Yi(i,"class",c);break;case"tabIndex":Yi(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(i,a,c);break;case"style":ct(i,c,g);break;case"data":if(n!=="object"){Yi(i,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||a!=="href")){i.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Vn(""+c),i.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(a,"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 g=="function"&&(a==="formAction"?(n!=="input"&&ft(i,n,"name",p.name,p,null),ft(i,n,"formEncType",p.formEncType,p,null),ft(i,n,"formMethod",p.formMethod,p,null),ft(i,n,"formTarget",p.formTarget,p,null)):(ft(i,n,"encType",p.encType,p,null),ft(i,n,"method",p.method,p,null),ft(i,n,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Vn(""+c),i.setAttribute(a,c);break;case"onClick":c!=null&&(i.onclick=de);break;case"onScroll":c!=null&&Ye("scroll",i);break;case"onScrollEnd":c!=null&&Ye("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}a=Vn(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,""+c):i.removeAttribute(a);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":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":c===!0?i.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,c):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(a,c):i.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(a):i.setAttribute(a,c);break;case"popover":Ye("beforetoggle",i),Ye("toggle",i),ki(i,"popover",c);break;case"xlinkActuate":zi(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":zi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":zi(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":zi(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":zi(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":zi(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":zi(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":zi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":zi(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ki(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=fn.get(a)||a,ki(i,a,c))}}function _f(i,n,a,c,p,g){switch(a){case"style":ct(i,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"children":typeof c=="string"?Oe(i,c):(typeof c=="number"||typeof c=="bigint")&&Oe(i,""+c);break;case"onScroll":c!=null&&Ye("scroll",i);break;case"onScrollEnd":c!=null&&Ye("scrollend",i);break;case"onClick":c!=null&&(i.onclick=de);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),n=a.slice(2,p?a.length-7:void 0),g=i[Ni]||null,g=g!=null?g[a]:null,typeof g=="function"&&i.removeEventListener(n,g,p),typeof c=="function")){typeof g!="function"&&g!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(n,c,p);break e}a in i?i[a]=c:c===!0?i.setAttribute(a,""):ki(i,a,c)}}}function xi(i,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",i),Ye("load",i);var c=!1,p=!1,g;for(g in a)if(a.hasOwnProperty(g)){var y=a[g];if(y!=null)switch(g){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(i,n,g,y,a,null)}}p&&ft(i,n,"srcSet",a.srcSet,a,null),c&&ft(i,n,"src",a.src,a,null);return;case"input":Ye("invalid",i);var E=g=y=p=null,L=null,W=null;for(c in a)if(a.hasOwnProperty(c)){var se=a[c];if(se!=null)switch(c){case"name":p=se;break;case"type":y=se;break;case"checked":L=se;break;case"defaultChecked":W=se;break;case"value":g=se;break;case"defaultValue":E=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,n));break;default:ft(i,n,c,se,a,null)}}Ir(i,g,E,L,W,y,p,!1);return;case"select":Ye("invalid",i),c=y=g=null;for(p in a)if(a.hasOwnProperty(p)&&(E=a[p],E!=null))switch(p){case"value":g=E;break;case"defaultValue":y=E;break;case"multiple":c=E;default:ft(i,n,p,E,a,null)}n=g,a=y,i.multiple=!!c,n!=null?_i(i,!!c,n,!1):a!=null&&_i(i,!!c,a,!0);return;case"textarea":Ye("invalid",i),g=p=c=null;for(y in a)if(a.hasOwnProperty(y)&&(E=a[y],E!=null))switch(y){case"value":c=E;break;case"defaultValue":p=E;break;case"children":g=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:ft(i,n,y,E,a,null)}Ma(i,c,p,g);return;case"option":for(L in a)a.hasOwnProperty(L)&&(c=a[L],c!=null)&&(L==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":ft(i,n,L,c,a,null));return;case"dialog":Ye("beforetoggle",i),Ye("toggle",i),Ye("cancel",i),Ye("close",i);break;case"iframe":case"object":Ye("load",i);break;case"video":case"audio":for(c=0;c<ml.length;c++)Ye(ml[c],i);break;case"image":Ye("error",i),Ye("load",i);break;case"details":Ye("toggle",i);break;case"embed":case"source":case"link":Ye("error",i),Ye("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in a)if(a.hasOwnProperty(W)&&(c=a[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(i,n,W,c,a,null)}return;default:if(Fn(n)){for(se in a)a.hasOwnProperty(se)&&(c=a[se],c!==void 0&&_f(i,n,se,c,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(c=a[E],c!=null&&ft(i,n,E,c,a,null))}function w3(i,n,a,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,y=null,E=null,L=null,W=null,se=null;for(ee in a){var ae=a[ee];if(a.hasOwnProperty(ee)&&ae!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":L=ae;default:c.hasOwnProperty(ee)||ft(i,n,ee,null,c,ae)}}for(var X in c){var ee=c[X];if(ae=a[X],c.hasOwnProperty(X)&&(ee!=null||ae!=null))switch(X){case"type":g=ee;break;case"name":p=ee;break;case"checked":W=ee;break;case"defaultChecked":se=ee;break;case"value":y=ee;break;case"defaultValue":E=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:ee!==ae&&ft(i,n,X,ee,c,ae)}}Oo(i,y,E,L,W,se,g,p);return;case"select":ee=y=E=X=null;for(g in a)if(L=a[g],a.hasOwnProperty(g)&&L!=null)switch(g){case"value":break;case"multiple":ee=L;default:c.hasOwnProperty(g)||ft(i,n,g,null,c,L)}for(p in c)if(g=c[p],L=a[p],c.hasOwnProperty(p)&&(g!=null||L!=null))switch(p){case"value":X=g;break;case"defaultValue":E=g;break;case"multiple":y=g;default:g!==L&&ft(i,n,p,g,c,L)}n=E,a=y,c=ee,X!=null?_i(i,!!a,X,!1):!!c!=!!a&&(n!=null?_i(i,!!a,n,!0):_i(i,!!a,a?[]:"",!1));return;case"textarea":ee=X=null;for(E in a)if(p=a[E],a.hasOwnProperty(E)&&p!=null&&!c.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ft(i,n,E,null,c,p)}for(y in c)if(p=c[y],g=a[y],c.hasOwnProperty(y)&&(p!=null||g!=null))switch(y){case"value":X=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==g&&ft(i,n,y,p,c,g)}vc(i,X,ee);return;case"option":for(var Ce in a)X=a[Ce],a.hasOwnProperty(Ce)&&X!=null&&!c.hasOwnProperty(Ce)&&(Ce==="selected"?i.selected=!1:ft(i,n,Ce,null,c,X));for(L in c)X=c[L],ee=a[L],c.hasOwnProperty(L)&&X!==ee&&(X!=null||ee!=null)&&(L==="selected"?i.selected=X&&typeof X!="function"&&typeof X!="symbol":ft(i,n,L,X,c,ee));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 De in a)X=a[De],a.hasOwnProperty(De)&&X!=null&&!c.hasOwnProperty(De)&&ft(i,n,De,null,c,X);for(W in c)if(X=c[W],ee=a[W],c.hasOwnProperty(W)&&X!==ee&&(X!=null||ee!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,n));break;default:ft(i,n,W,X,c,ee)}return;default:if(Fn(n)){for(var mt in a)X=a[mt],a.hasOwnProperty(mt)&&X!==void 0&&!c.hasOwnProperty(mt)&&_f(i,n,mt,void 0,c,X);for(se in c)X=c[se],ee=a[se],!c.hasOwnProperty(se)||X===ee||X===void 0&&ee===void 0||_f(i,n,se,X,c,ee);return}}for(var H in a)X=a[H],a.hasOwnProperty(H)&&X!=null&&!c.hasOwnProperty(H)&&ft(i,n,H,null,c,X);for(ae in c)X=c[ae],ee=a[ae],!c.hasOwnProperty(ae)||X===ee||X==null&&ee==null||ft(i,n,ae,X,c,ee)}function ub(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function E3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,n=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var p=a[c],g=p.transferSize,y=p.initiatorType,E=p.duration;if(g&&E&&ub(y)){for(y=0,E=p.responseEnd,c+=1;c<a.length;c++){var L=a[c],W=L.startTime;if(W>E)break;var se=L.transferSize,ae=L.initiatorType;se&&ub(ae)&&(L=L.responseEnd,y+=se*(L<E?1:(E-W)/(L-W)))}if(--c,n+=8*(g+y)/(p.duration/1e3),i++,10<i)break}}if(0<i)return n/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var vf=null,bf=null;function pu(i){return i.nodeType===9?i:i.ownerDocument}function hb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function db(i,n){if(i===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&n==="foreignObject"?0:i}function yf(i,n){return i==="textarea"||i==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var xf=null;function C3(){var i=window.event;return i&&i.type==="popstate"?i===xf?!1:(xf=i,!0):(xf=null,!1)}var fb=typeof setTimeout=="function"?setTimeout:void 0,N3=typeof clearTimeout=="function"?clearTimeout:void 0,mb=typeof Promise=="function"?Promise:void 0,k3=typeof queueMicrotask=="function"?queueMicrotask:typeof mb<"u"?function(i){return mb.resolve(null).then(i).catch(T3)}:fb;function T3(i){setTimeout(function(){throw i})}function or(i){return i==="head"}function pb(i,n){var a=n,c=0;do{var p=a.nextSibling;if(i.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(c===0){i.removeChild(p),no(n);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")gl(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,gl(a);for(var g=a.firstChild;g;){var y=g.nextSibling,E=g.nodeName;g[Br]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=y}}else a==="body"&&gl(i.ownerDocument.body);a=p}while(a);no(n)}function gb(i,n){var a=i;i=0;do{var c=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=c}while(a)}function Sf(i){var n=i.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Sf(a),Ro(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function M3(i,n,a,c){for(;i.nodeType===1;){var p=a;if(i.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Br])switch(n){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(g=i.getAttribute("rel"),g==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(g!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(g=i.getAttribute("src"),(g!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(n==="input"&&i.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===g)return i}else return i;if(i=_s(i.nextSibling),i===null)break}return null}function A3(i,n,a){if(n==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=_s(i.nextSibling),i===null))return null;return i}function _b(i,n){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!n||(i=_s(i.nextSibling),i===null))return null;return i}function wf(i){return i.data==="$?"||i.data==="$~"}function Ef(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function R3(i,n){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=n;else if(i.data!=="$?"||a.readyState!=="loading")n();else{var c=function(){n(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function _s(i){for(;i!=null;i=i.nextSibling){var n=i.nodeType;if(n===1||n===3)break;if(n===8){if(n=i.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return i}var Cf=null;function vb(i){i=i.nextSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(n===0)return _s(i.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}i=i.nextSibling}return null}function bb(i){i=i.previousSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return i;n--}else a!=="/$"&&a!=="/&"||n++}i=i.previousSibling}return null}function yb(i,n,a){switch(n=pu(a),i){case"html":if(i=n.documentElement,!i)throw Error(r(452));return i;case"head":if(i=n.head,!i)throw Error(r(453));return i;case"body":if(i=n.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function gl(i){for(var n=i.attributes;n.length;)i.removeAttributeNode(n[0]);Ro(i)}var vs=new Map,xb=new Set;function gu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Mn=q.d;q.d={f:D3,r:O3,D:L3,C:j3,L:B3,m:z3,X:P3,S:I3,M:U3};function D3(){var i=Mn.f(),n=ou();return i||n}function O3(i){var n=hn(i);n!==null&&n.tag===5&&n.type==="form"?I0(n):Mn.r(i)}var to=typeof document>"u"?null:document;function Sb(i,n,a){var c=to;if(c&&typeof n=="string"&&n){var p=Ii(n);p='link[rel="'+i+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),xb.has(p)||(xb.add(p),i={rel:i,crossOrigin:a,href:n},c.querySelector(p)===null&&(n=c.createElement("link"),xi(n,"link",i),Kt(n),c.head.appendChild(n)))}}function L3(i){Mn.D(i),Sb("dns-prefetch",i,null)}function j3(i,n){Mn.C(i,n),Sb("preconnect",i,n)}function B3(i,n,a){Mn.L(i,n,a);var c=to;if(c&&i&&n){var p='link[rel="preload"][as="'+Ii(n)+'"]';n==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+Ii(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+Ii(a.imageSizes)+'"]')):p+='[href="'+Ii(i)+'"]';var g=p;switch(n){case"style":g=io(i);break;case"script":g=so(i)}vs.has(g)||(i=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:i,as:n},a),vs.set(g,i),c.querySelector(p)!==null||n==="style"&&c.querySelector(_l(g))||n==="script"&&c.querySelector(vl(g))||(n=c.createElement("link"),xi(n,"link",i),Kt(n),c.head.appendChild(n)))}}function z3(i,n){Mn.m(i,n);var a=to;if(a&&i){var c=n&&typeof n.as=="string"?n.as:"script",p='link[rel="modulepreload"][as="'+Ii(c)+'"][href="'+Ii(i)+'"]',g=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=so(i)}if(!vs.has(g)&&(i=v({rel:"modulepreload",href:i},n),vs.set(g,i),a.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(vl(g)))return}c=a.createElement("link"),xi(c,"link",i),Kt(c),a.head.appendChild(c)}}}function I3(i,n,a){Mn.S(i,n,a);var c=to;if(c&&i){var p=Hn(c).hoistableStyles,g=io(i);n=n||"default";var y=p.get(g);if(!y){var E={loading:0,preload:null};if(y=c.querySelector(_l(g)))E.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":n},a),(a=vs.get(g))&&Nf(i,a);var L=y=c.createElement("link");Kt(L),xi(L,"link",i),L._p=new Promise(function(W,se){L.onload=W,L.onerror=se}),L.addEventListener("load",function(){E.loading|=1}),L.addEventListener("error",function(){E.loading|=2}),E.loading|=4,_u(y,n,c)}y={type:"stylesheet",instance:y,count:1,state:E},p.set(g,y)}}}function P3(i,n){Mn.X(i,n);var a=to;if(a&&i){var c=Hn(a).hoistableScripts,p=so(i),g=c.get(p);g||(g=a.querySelector(vl(p)),g||(i=v({src:i,async:!0},n),(n=vs.get(p))&&kf(i,n),g=a.createElement("script"),Kt(g),xi(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function U3(i,n){Mn.M(i,n);var a=to;if(a&&i){var c=Hn(a).hoistableScripts,p=so(i),g=c.get(p);g||(g=a.querySelector(vl(p)),g||(i=v({src:i,async:!0,type:"module"},n),(n=vs.get(p))&&kf(i,n),g=a.createElement("script"),Kt(g),xi(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function wb(i,n,a,c){var p=(p=pe.current)?gu(p):null;if(!p)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=io(a.href),a=Hn(p).hoistableStyles,c=a.get(n),c||(c={type:"style",instance:null,count:0,state:null},a.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=io(a.href);var g=Hn(p).hoistableStyles,y=g.get(i);if(y||(p=p.ownerDocument||p,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,y),(g=p.querySelector(_l(i)))&&!g._p&&(y.instance=g,y.state.loading=5),vs.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vs.set(i,a),g||H3(p,i,a,y.state))),n&&c===null)throw Error(r(528,""));return y}if(n&&c!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=so(a),a=Hn(p).hoistableScripts,c=a.get(n),c||(c={type:"script",instance:null,count:0,state:null},a.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function io(i){return'href="'+Ii(i)+'"'}function _l(i){return'link[rel="stylesheet"]['+i+"]"}function Eb(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function H3(i,n,a,c){i.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=i.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),xi(n,"link",a),Kt(n),i.head.appendChild(n))}function so(i){return'[src="'+Ii(i)+'"]'}function vl(i){return"script[async]"+i}function Cb(i,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var c=i.querySelector('style[data-href~="'+Ii(a.href)+'"]');if(c)return n.instance=c,Kt(c),c;var p=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),Kt(c),xi(c,"style",p),_u(c,a.precedence,i),n.instance=c;case"stylesheet":p=io(a.href);var g=i.querySelector(_l(p));if(g)return n.state.loading|=4,n.instance=g,Kt(g),g;c=Eb(a),(p=vs.get(p))&&Nf(c,p),g=(i.ownerDocument||i).createElement("link"),Kt(g);var y=g;return y._p=new Promise(function(E,L){y.onload=E,y.onerror=L}),xi(g,"link",c),n.state.loading|=4,_u(g,a.precedence,i),n.instance=g;case"script":return g=so(a.src),(p=i.querySelector(vl(g)))?(n.instance=p,Kt(p),p):(c=a,(p=vs.get(g))&&(c=v({},a),kf(c,p)),i=i.ownerDocument||i,p=i.createElement("script"),Kt(p),xi(p,"link",c),i.head.appendChild(p),n.instance=p);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,_u(c,a.precedence,i));return n.instance}function _u(i,n,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,g=p,y=0;y<c.length;y++){var E=c[y];if(E.dataset.precedence===n)g=E;else if(g!==p)break}g?g.parentNode.insertBefore(i,g.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(i,n.firstChild))}function Nf(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.title==null&&(i.title=n.title)}function kf(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.integrity==null&&(i.integrity=n.integrity)}var vu=null;function Nb(i,n,a){if(vu===null){var c=new Map,p=vu=new Map;p.set(a,c)}else p=vu,c=p.get(a),c||(c=new Map,p.set(a,c));if(c.has(i))return c;for(c.set(i,null),a=a.getElementsByTagName(i),p=0;p<a.length;p++){var g=a[p];if(!(g[Br]||g[Ht]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var y=g.getAttribute(n)||"";y=i+y;var E=c.get(y);E?E.push(g):c.set(y,[g])}}return c}function kb(i,n,a){i=i.ownerDocument||i,i.head.insertBefore(a,n==="title"?i.querySelector("head > title"):null)}function F3(i,n,a){if(a===1||n.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(i=n.disabled,typeof n.precedence=="string"&&i==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Tb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function V3(i,n,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=io(c.href),g=n.querySelector(_l(p));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(i.count++,i=bu.bind(i),n.then(i,i)),a.state.loading|=4,a.instance=g,Kt(g);return}g=n.ownerDocument||n,c=Eb(c),(p=vs.get(p))&&Nf(c,p),g=g.createElement("link"),Kt(g);var y=g;y._p=new Promise(function(E,L){y.onload=E,y.onerror=L}),xi(g,"link",c),a.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=bu.bind(i),n.addEventListener("load",a),n.addEventListener("error",a))}}var Tf=0;function $3(i,n){return i.stylesheets&&i.count===0&&xu(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var c=setTimeout(function(){if(i.stylesheets&&xu(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+n);0<i.imgBytes&&Tf===0&&(Tf=62500*E3());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&xu(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>Tf?50:800)+n);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var yu=null;function xu(i,n){i.stylesheets=null,i.unsuspend!==null&&(i.count++,yu=new Map,n.forEach(q3,i),yu=null,bu.call(i))}function q3(i,n){if(!(n.state.loading&4)){var a=yu.get(i);if(a)var c=a.get(null);else{a=new Map,yu.set(i,a);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var y=p[g];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),c=y)}c&&a.set(null,c)}p=n.instance,y=p.getAttribute("data-precedence"),g=a.get(y)||c,g===c&&a.set(null,p),a.set(y,p),this.count++,c=bu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),g?g.parentNode.insertBefore(p,g.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),n.state.loading|=4}}var bl={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function K3(i,n,a,c,p,g,y,E,L){this.tag=1,this.containerInfo=i,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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function Mb(i,n,a,c,p,g,y,E,L,W,se,ae){return i=new K3(i,n,a,y,L,W,se,ae,E),n=1,g===!0&&(n|=24),g=Qi(3,null,null,n),i.current=g,g.stateNode=i,n=ad(),n.refCount++,i.pooledCache=n,n.refCount++,g.memoizedState={element:c,isDehydrated:a,cache:n},ud(g),i}function Ab(i){return i?(i=La,i):La}function Rb(i,n,a,c,p,g){p=Ab(p),c.context===null?c.context=p:c.pendingContext=p,c=Xn(n),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=Zn(i,c,n),a!==null&&($i(a,i,n),Zo(a,i,n))}function Db(i,n){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<n?a:n}}function Mf(i,n){Db(i,n),(i=i.alternate)&&Db(i,n)}function Ob(i){if(i.tag===13||i.tag===31){var n=Fr(i,67108864);n!==null&&$i(n,i,67108864),Mf(i,67108864)}}function Lb(i){if(i.tag===13||i.tag===31){var n=ss();n=kt(n);var a=Fr(i,n);a!==null&&$i(a,i,n),Mf(i,n)}}var Su=!0;function G3(i,n,a,c){var p=A.T;A.T=null;var g=q.p;try{q.p=2,Af(i,n,a,c)}finally{q.p=g,A.T=p}}function W3(i,n,a,c){var p=A.T;A.T=null;var g=q.p;try{q.p=8,Af(i,n,a,c)}finally{q.p=g,A.T=p}}function Af(i,n,a,c){if(Su){var p=Rf(c);if(p===null)gf(i,n,c,wu,a),Bb(i,c);else if(X3(p,i,n,a,c))c.stopPropagation();else if(Bb(i,c),n&4&&-1<Y3.indexOf(i)){for(;p!==null;){var g=hn(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var y=Ci(g.pendingLanes);if(y!==0){var E=g;for(E.pendingLanes|=2,E.entangledLanes|=2;y;){var L=1<<31-gi(y);E.entanglements[1]|=L,y&=~L}Hs(g),(at&6)===0&&(ru=At()+500,fl(0))}}break;case 31:case 13:E=Fr(g,2),E!==null&&$i(E,g,2),ou(),Mf(g,2)}if(g=Rf(c),g===null&&gf(i,n,c,wu,a),g===p)break;p=g}p!==null&&c.stopPropagation()}else gf(i,n,c,null,a)}}function Rf(i){return i=Ue(i),Df(i)}var wu=null;function Df(i){if(wu=null,i=Ai(i),i!==null){var n=l(i);if(n===null)i=null;else{var a=n.tag;if(a===13){if(i=h(n),i!==null)return i;i=null}else if(a===31){if(i=f(n),i!==null)return i;i=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;i=null}else n!==i&&(i=null)}}return wu=i,null}function jb(i){switch(i){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(an()){case pi:return 2;case on:return 8;case ln:case ya:return 32;case In:return 268435456;default:return 32}default:return 32}}var Of=!1,lr=null,cr=null,ur=null,yl=new Map,xl=new Map,hr=[],Y3="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 Bb(i,n){switch(i){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":cr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":yl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":xl.delete(n.pointerId)}}function Sl(i,n,a,c,p,g){return i===null||i.nativeEvent!==g?(i={blockedOn:n,domEventName:a,eventSystemFlags:c,nativeEvent:g,targetContainers:[p]},n!==null&&(n=hn(n),n!==null&&Ob(n)),i):(i.eventSystemFlags|=c,n=i.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),i)}function X3(i,n,a,c,p){switch(n){case"focusin":return lr=Sl(lr,i,n,a,c,p),!0;case"dragenter":return cr=Sl(cr,i,n,a,c,p),!0;case"mouseover":return ur=Sl(ur,i,n,a,c,p),!0;case"pointerover":var g=p.pointerId;return yl.set(g,Sl(yl.get(g)||null,i,n,a,c,p)),!0;case"gotpointercapture":return g=p.pointerId,xl.set(g,Sl(xl.get(g)||null,i,n,a,c,p)),!0}return!1}function zb(i){var n=Ai(i.target);if(n!==null){var a=l(n);if(a!==null){if(n=a.tag,n===13){if(n=h(a),n!==null){i.blockedOn=n,Ea(i.priority,function(){Lb(a)});return}}else if(n===31){if(n=f(a),n!==null){i.blockedOn=n,Ea(i.priority,function(){Lb(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Eu(i){if(i.blockedOn!==null)return!1;for(var n=i.targetContainers;0<n.length;){var a=Rf(i.nativeEvent);if(a===null){a=i.nativeEvent;var c=new a.constructor(a.type,a);Te=c,a.target.dispatchEvent(c),Te=null}else return n=hn(a),n!==null&&Ob(n),i.blockedOn=a,!1;n.shift()}return!0}function Ib(i,n,a){Eu(i)&&a.delete(n)}function Z3(){Of=!1,lr!==null&&Eu(lr)&&(lr=null),cr!==null&&Eu(cr)&&(cr=null),ur!==null&&Eu(ur)&&(ur=null),yl.forEach(Ib),xl.forEach(Ib)}function Cu(i,n){i.blockedOn===n&&(i.blockedOn=null,Of||(Of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Z3)))}var Nu=null;function Pb(i){Nu!==i&&(Nu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Nu===i&&(Nu=null);for(var n=0;n<i.length;n+=3){var a=i[n],c=i[n+1],p=i[n+2];if(typeof c!="function"){if(Df(c||a)===null)continue;break}var g=hn(a);g!==null&&(i.splice(n,3),n-=3,Ad(g,{pending:!0,data:p,method:a.method,action:c},c,p))}}))}function no(i){function n(L){return Cu(L,i)}lr!==null&&Cu(lr,i),cr!==null&&Cu(cr,i),ur!==null&&Cu(ur,i),yl.forEach(n),xl.forEach(n);for(var a=0;a<hr.length;a++){var c=hr[a];c.blockedOn===i&&(c.blockedOn=null)}for(;0<hr.length&&(a=hr[0],a.blockedOn===null);)zb(a),a.blockedOn===null&&hr.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var p=a[c],g=a[c+1],y=p[Ni]||null;if(typeof g=="function")y||Pb(a);else if(y){var E=null;if(g&&g.hasAttribute("formAction")){if(p=g,y=g[Ni]||null)E=y.formAction;else if(Df(p)!==null)continue}else E=y.action;typeof E=="function"?a[c+1]=E:(a.splice(c,3),c-=3),Pb(a)}}}function Ub(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(y){return p=y})},focusReset:"manual",scroll:"manual"})}function n(){p!==null&&(p(),p=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),p!==null&&(p(),p=null)}}}function Lf(i){this._internalRoot=i}ku.prototype.render=Lf.prototype.render=function(i){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,c=ss();Rb(a,c,i,n,null,null)},ku.prototype.unmount=Lf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var n=i.containerInfo;Rb(i.current,2,null,i,null,null),ou(),n[Pn]=null}};function ku(i){this._internalRoot=i}ku.prototype.unstable_scheduleHydration=function(i){if(i){var n=wa();i={blockedOn:null,target:i,priority:n};for(var a=0;a<hr.length&&n!==0&&n<hr[a].priority;a++);hr.splice(a,0,i),a===0&&zb(i)}};var Hb=t.version;if(Hb!=="19.2.6")throw Error(r(527,Hb,"19.2.6"));q.findDOMNode=function(i){var n=i._reactInternals;if(n===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(n),i=i!==null?_(i):null,i=i===null?null:i.stateNode,i};var Q3={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{cn=Tu.inject(Q3),li=Tu}catch{}}return El.createRoot=function(i,n){if(!o(i))throw Error(r(299));var a=!1,c="",p=W0,g=Y0,y=X0;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(p=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Mb(i,1,!1,null,null,a,c,null,p,g,y,Ub),i[Pn]=n.current,pf(i),new Lf(n)},El.hydrateRoot=function(i,n,a){if(!o(i))throw Error(r(299));var c=!1,p="",g=W0,y=Y0,E=X0,L=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(L=a.formState)),n=Mb(i,1,!0,n,a??null,c,p,L,g,y,E,Ub),n.context=Ab(null),a=n.current,c=ss(),c=kt(c),p=Xn(c),p.callback=null,Zn(a,p,c),a=c,n.current.lanes=a,gt(n,a),Hs(n),i[Pn]=n.current,pf(i),new ku(n)},El.version="19.2.6",El}var Zb;function lN(){if(Zb)return zf.exports;Zb=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(),zf.exports=oN(),zf.exports}var ES=lN();const CS=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();const cN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const uN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase());const Qb=e=>{const t=uN(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Hf={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 hN=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},dN=N.createContext({}),fN=()=>N.useContext(dN),mN=N.forwardRef(({color:e,size:t,strokeWidth:s,absoluteStrokeWidth:r,className:o="",children:l,iconNode:h,...f},m)=>{const{size:d=24,strokeWidth:_=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:S=""}=fN()??{},x=r??v?Number(s??_)*24/Number(t??d):s??_;return N.createElement("svg",{ref:m,...Hf,width:t??d??Hf.width,height:t??d??Hf.height,stroke:e??b,strokeWidth:x,className:CS("lucide",S,o),...!l&&!hN(f)&&{"aria-hidden":"true"},...f},[...h.map(([w,C])=>N.createElement(w,C)),...Array.isArray(l)?l:[l]])});const xe=(e,t)=>{const s=N.forwardRef(({className:r,...o},l)=>N.createElement(mN,{ref:l,iconNode:t,className:CS(`lucide-${cN(Qb(e))}`,`lucide-${e}`,r),...o}));return s.displayName=Qb(e),s};const pN=[["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"}]],mo=xe("activity",pN);const gN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_N=xe("arrow-down",gN);const vN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],bN=xe("arrow-up",vN);const yN=[["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"}]],Yl=xe("bot",yN);const xN=[["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"}]],Jb=xe("box",xN);const SN=[["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"}]],op=xe("brain",SN);const wN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sh=xe("check",wN);const EN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Tr=xe("chevron-down",EN);const CN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],NN=xe("chevron-left",CN);const kN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pa=xe("chevron-right",kN);const TN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],NS=xe("chevron-up",TN);const MN=[["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"}]],AN=xe("clipboard-copy",MN);const RN=[["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"}]],kS=xe("copy",RN);const DN=[["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"}]],ON=xe("cpu",DN);const LN=[["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"}]],yo=xe("database",LN);const jN=[["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"}]],BN=xe("earth",jN);const zN=[["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"}]],TS=xe("external-link",zN);const IN=[["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"}]],MS=xe("eye-off",IN);const PN=[["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"}]],AS=xe("eye",PN);const UN=[["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"}]],RS=xe("file-code-corner",UN);const HN=[["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"}]],FN=xe("file-exclamation-point",HN);const VN=[["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"}]],DS=xe("file-text",VN);const $N=[["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"}]],bg=xe("file",$N);const qN=[["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"}]],OS=xe("flask-conical",qN);const KN=[["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"}]],wh=xe("folder-open",KN);const GN=[["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"}]],WN=xe("folder-plus",GN);const YN=[["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"}]],xo=xe("folder",YN);const XN=[["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"}]],ZN=xe("funnel",XN);const QN=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],LS=xe("gauge",QN);const JN=[["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"}]],Xl=xe("git-branch",JN);const ek=[["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"}]],tk=xe("git-pull-request-create",ek);const ik=[["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"}]],sk=xe("heart",ik);const nk=[["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"}]],jS=xe("image",nk);const rk=[["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"}]],lp=xe("inbox",rk);const ak=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ok=xe("key-round",ak);const lk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],po=xe("loader-circle",lk);const ck=[["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"}]],BS=xe("lock-keyhole",ck);const uk=[["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"}]],hk=xe("maximize-2",uk);const dk=[["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"}]],fk=xe("memory-stick",dk);const mk=[["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"}]],pk=xe("minimize-2",mk);const gk=[["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"}]],_k=xe("network",gk);const vk=[["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"}]],bk=xe("package",vk);const yk=[["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"}]],zS=xe("palette",yk);const xk=[["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"}]],Sk=xe("panel-left-close",xk);const wk=[["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"}]],Ek=xe("panel-left-open",wk);const Ck=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Nk=xe("panel-left",Ck);const kk=[["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"}]],Tk=xe("pencil",kk);const Mk=[["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"}]],yg=xe("play",Mk);const Ak=[["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"}]],cp=xe("plug",Ak);const Rk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],js=xe("plus",Rk);const Dk=[["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"}]],Ok=xe("radio",Dk);const Lk=[["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"}]],IS=xe("refresh-cw",Lk);const jk=[["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"}]],PS=xe("rotate-ccw",jk);const Bk=[["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"}]],US=xe("save",Bk);const zk=[["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"}]],HS=xe("scroll-text",zk);const Ik=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pk=xe("search",Ik);const Uk=[["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"}]],Hk=xe("server",Uk);const Fk=[["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"}]],FS=xe("settings-2",Fk);const Vk=[["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"}]],$k=xe("sparkles",Vk);const qk=[["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"}]],Kk=xe("square-terminal",qk);const Gk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Eh=xe("square",Gk);const Wk=[["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"}]],Yk=xe("table-2",Wk);const Xk=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],VS=xe("terminal",Xk);const Zk=[["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"}]],xg=xe("trash-2",Zk);const Qk=[["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"}]],Jk=xe("wand-sparkles",Qk);const e5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mr=xe("x",e5);const t5=[["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"}]],i5=xe("zap",t5),s5="/assets/nomoreide-logo-B2E14b65.png";class $S extends Error{conflict;constructor(t,s){super(t),this.name="PortConflictResponseError",this.conflict=s}}async function ot(e,t){const s=await fetch(e,t),r=await s.json().catch(()=>{});if(!s.ok)throw s.status===409&&r?.conflict?.code==="PORT_IN_USE"?new $S(r?.error||"Port already in use",r.conflict):new Error(r?.error||s.statusText);return r}async function os(e,t){const s=new URLSearchParams;for(const[r,o]of Object.entries(t))o!==void 0&&String(o).trim()&&s.set(r,String(o));await ot(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function rc(e,t){const s=new URLSearchParams;for(const[r,o]of Object.entries(t))o!==void 0&&String(o).trim()&&s.set(r,String(o));return ot(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function n5(){return(await ot("/api/agent")).agent}async function r5(){return(await ot("/api/agent/usage")).usage}async function a5(){return(await ot("/api/databases")).connections}async function o5(){return(await ot("/api/databases/detect")).detected}async function l5(e){await rc("/api/databases",e)}async function c5(e){return rc("/api/databases/test",e)}async function u5(e){await ot(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function h5(e){return(await ot(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function d5(e,t,s=100){return ot(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${s}`)}function f5(e,t,s,r,o){const l=r.map(h=>`- ${h.name}: ${h.dataType}${h.primaryKey?" (PK)":""}${h.nullable?"":" NOT NULL"}`).join(`
10
+ `);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${s.qualifiedName}\`).`,"","## Table schema",l,"","## Row","```json",JSON.stringify(o,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
11
+ `)}async function m5(e=100){return(await ot(`/api/errors?limit=${e}`)).incidents}async function p5(e){return ot(`/api/errors/${e}/prompt`)}async function g5(e,t=!1){return ot(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function _5(e=200){return(await ot(`/api/git/graph?limit=${e}`)).commits}async function v5(e,t){const s=new URLSearchParams({hash:e});t&&s.set("file",t);const r=await fetch(`/api/git/commit?${s.toString()}`);if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Unable to load commit diff")}return r.text()}async function b5(e){return(await ot(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function y5(){return(await ot("/api/git/files")).files}async function x5(e){const t=await ot(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function S5(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const s=await t.json().catch(()=>({error:t.statusText}));throw new Error(s.error||"Unable to load diff")}return t.text()}async function w5(e){await ot(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function E5(){return(await ot("/api/log-sources")).sources}async function C5(e){return(await rc("/api/log-sources",e)).sources}async function qS(e,t={}){const s=new URLSearchParams;return s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before),(await ot(`/api/log-sources/${encodeURIComponent(e)}/logs?${s.toString()}`)).logs}async function N5(){return ot("/api/dashboard")}async function k5(e){return ot(`/api/fs/directories?path=${encodeURIComponent(e)}`)}async function KS(e,t={}){const s=new URLSearchParams;s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before);const r=await ot(`/api/services/${encodeURIComponent(e)}/logs?${s.toString()}`);return{logs:r.logs,queryable:!!r.queryable}}async function T5(e,t){const s=t?`?path=${encodeURIComponent(t)}`:"";return ot(`/api/services/${encodeURIComponent(e)}/config-browse${s}`)}async function M5(e){const t=await ot(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function e1(e,t){return ot(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function A5(e,t,s){return ot(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:s})})}async function R5(e,t,s){return ot(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:s})})}async function D5(e){return rc("/api/services/test",e)}async function O5(e,t){return rc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function L5(){return(await ot("/api/terminal/sessions")).sessions}async function Ff(){return(await ot("/api/terminal/sessions",{method:"POST"})).session}async function j5(e){await ot(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function GS(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=GS(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function Zl(){for(var e,t,s=0,r="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=GS(e))&&(r&&(r+=" "),r+=t);return r}const t1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,i1=Zl,WS=(e,t)=>s=>{var r;if(t?.variants==null)return i1(e,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,h=Object.keys(o).map(d=>{const _=s?.[d],v=l?.[d];if(_===null)return null;const b=t1(_)||t1(v);return o[d][b]}),f=s&&Object.entries(s).reduce((d,_)=>{let[v,b]=_;return b===void 0||(d[v]=b),d},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,_)=>{let{class:v,className:b,...S}=_;return Object.entries(S).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...l,...f}[w]):{...l,...f}[w]===C})?[...d,v,b]:d},[]);return i1(e,h,m,s?.class,s?.className)},B5=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},z5=(e,t)=>({classGroupId:e,validator:t}),YS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),sh="-",s1=[],I5="arbitrary..",P5=e=>{const t=H5(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return U5(h);const f=h.split(sh),m=f[0]===""&&f.length>1?1:0;return XS(f,m,t)},getConflictingClassGroupIds:(h,f)=>{if(f){const m=r[h],d=s[h];return m?d?B5(d,m):m:d||s1}return s[h]||s1}}},XS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],l=s.nextPart.get(o);if(l){const d=XS(e,t+1,l);if(d)return d}const h=s.validators;if(h===null)return;const f=t===0?e.join(sh):e.slice(t).join(sh),m=h.length;for(let d=0;d<m;d++){const _=h[d];if(_.validator(f))return _.classGroupId}},U5=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?I5+r:void 0})(),H5=e=>{const{theme:t,classGroups:s}=e;return F5(s,t)},F5=(e,t)=>{const s=YS();for(const r in e){const o=e[r];Sg(o,s,r,t)}return s},Sg=(e,t,s,r)=>{const o=e.length;for(let l=0;l<o;l++){const h=e[l];V5(h,t,s,r)}},V5=(e,t,s,r)=>{if(typeof e=="string"){$5(e,t,s);return}if(typeof e=="function"){q5(e,t,s,r);return}K5(e,t,s,r)},$5=(e,t,s)=>{const r=e===""?t:ZS(t,e);r.classGroupId=s},q5=(e,t,s,r)=>{if(G5(e)){Sg(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(z5(s,e))},K5=(e,t,s,r)=>{const o=Object.entries(e),l=o.length;for(let h=0;h<l;h++){const[f,m]=o[h];Sg(m,ZS(t,f),s,r)}},ZS=(e,t)=>{let s=e;const r=t.split(sh),o=r.length;for(let l=0;l<o;l++){const h=r[l];let f=s.nextPart.get(h);f||(f=YS(),s.nextPart.set(h,f)),s=f}return s},G5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,W5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(l,h)=>{s[l]=h,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(l){let h=s[l];if(h!==void 0)return h;if((h=r[l])!==void 0)return o(l,h),h},set(l,h){l in s?s[l]=h:o(l,h)}}},up="!",n1=":",Y5=[],r1=(e,t,s,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),X5=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=o=>{const l=[];let h=0,f=0,m=0,d;const _=o.length;for(let w=0;w<_;w++){const C=o[w];if(h===0&&f===0){if(C===n1){l.push(o.slice(m,w)),m=w+1;continue}if(C==="/"){d=w;continue}}C==="["?h++:C==="]"?h--:C==="("?f++:C===")"&&f--}const v=l.length===0?o:o.slice(m);let b=v,S=!1;v.endsWith(up)?(b=v.slice(0,-1),S=!0):v.startsWith(up)&&(b=v.slice(1),S=!0);const x=d&&d>m?d-m:void 0;return r1(l,S,b,x)};if(t){const o=t+n1,l=r;r=h=>h.startsWith(o)?l(h.slice(o.length)):r1(Y5,!1,h,void 0,!0)}if(s){const o=r;r=l=>s({className:l,parseClassName:o})}return r},Z5=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let l=0;l<s.length;l++){const h=s[l],f=h[0]==="[",m=t.has(h);f||m?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(h)):o.push(h)}return o.length>0&&(o.sort(),r.push(...o)),r}},Q5=e=>({cache:W5(e.cacheSize),parseClassName:X5(e),sortModifiers:Z5(e),postfixLookupClassGroupIds:J5(e),...P5(e)}),J5=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let r=0;r<s.length;r++)t[s[r]]=!0;return t},eT=/\s+/,tT=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:h}=t,f=[],m=e.trim().split(eT);let d="";for(let _=m.length-1;_>=0;_-=1){const v=m[_],{isExternal:b,modifiers:S,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:C}=s(v);if(b){d=v+(d.length>0?" "+d:d);continue}let T=!!C,O;if(T){const B=w.substring(0,C);O=r(B);const M=O&&h[O]?r(w):void 0;M&&M!==O&&(O=M,T=!1)}else O=r(w);if(!O){if(!T){d=v+(d.length>0?" "+d:d);continue}if(O=r(w),!O){d=v+(d.length>0?" "+d:d);continue}T=!1}const k=S.length===0?"":S.length===1?S[0]:l(S).join(":"),D=x?k+up:k,U=D+O;if(f.indexOf(U)>-1)continue;f.push(U);const P=o(O,T);for(let B=0;B<P.length;++B){const M=P[B];f.push(D+M)}d=v+(d.length>0?" "+d:d)}return d},iT=(...e)=>{let t=0,s,r,o="";for(;t<e.length;)(s=e[t++])&&(r=QS(s))&&(o&&(o+=" "),o+=r);return o},QS=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=QS(e[r]))&&(s&&(s+=" "),s+=t);return s},sT=(e,...t)=>{let s,r,o,l;const h=m=>{const d=t.reduce((_,v)=>v(_),e());return s=Q5(d),r=s.cache.get,o=s.cache.set,l=f,f(m)},f=m=>{const d=r(m);if(d)return d;const _=tT(m,s);return o(m,_),_};return l=h,(...m)=>l(iT(...m))},nT=[],si=e=>{const t=s=>s[e]||nT;return t.isThemeGetter=!0,t},JS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oT=/\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$/,lT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=e=>rT.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Fs=e=>!!e&&Number.isInteger(Number(e)),Vf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),An=e=>aT.test(e),t2=()=>!0,hT=e=>oT.test(e)&&!lT.test(e),wg=()=>!1,dT=e=>cT.test(e),fT=e=>uT.test(e),mT=e=>!ye(e)&&!we(e),pT=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)),gT=e=>Ar(e,n2,wg),ye=e=>JS.test(e),ta=e=>Ar(e,r2,hT),a1=e=>Ar(e,ET,qe),_T=e=>Ar(e,o2,t2),vT=e=>Ar(e,a2,wg),o1=e=>Ar(e,i2,wg),bT=e=>Ar(e,s2,fT),Mu=e=>Ar(e,l2,dT),we=e=>e2.test(e),Cl=e=>ga(e,r2),yT=e=>ga(e,a2),l1=e=>ga(e,i2),xT=e=>ga(e,n2),ST=e=>ga(e,s2),Au=e=>ga(e,l2,!0),wT=e=>ga(e,o2,!0),Ar=(e,t,s)=>{const r=JS.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},ga=(e,t,s=!1)=>{const r=e2.exec(e);return r?r[1]?t(r[1]):s:!1},i2=e=>e==="position"||e==="percentage",s2=e=>e==="image"||e==="url",n2=e=>e==="length"||e==="size"||e==="bg-size",r2=e=>e==="length",ET=e=>e==="number",a2=e=>e==="family-name",o2=e=>e==="number"||e==="weight",l2=e=>e==="shadow",CT=()=>{const e=si("color"),t=si("font"),s=si("text"),r=si("font-weight"),o=si("tracking"),l=si("leading"),h=si("breakpoint"),f=si("container"),m=si("spacing"),d=si("radius"),_=si("shadow"),v=si("inset-shadow"),b=si("text-shadow"),S=si("drop-shadow"),x=si("blur"),w=si("perspective"),C=si("aspect"),T=si("ease"),O=si("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...D(),we,ye],P=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],M=()=>[we,ye,m],F=()=>[fr,"full","auto",...M()],Y=()=>[Fs,"none","subgrid",we,ye],$=()=>["auto",{span:["full",Fs,we,ye]},Fs,we,ye],G=()=>[Fs,"auto",we,ye],I=()=>["auto","min","max","fr",we,ye],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...M()],q=()=>[fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],V=()=>[fr,"screen","full","dvw","lvw","svw","min","max","fit",...M()],Z=()=>[fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],Q=()=>[e,we,ye],R=()=>[...D(),l1,o1,{position:[we,ye]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",xT,gT,{size:[we,ye]}],le=()=>[Vf,Cl,ta],fe=()=>["","none","full",d,we,ye],pe=()=>["",qe,Cl,ta],Se=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[qe,Vf,l1,o1],tt=()=>["","none",x,we,ye],nt=()=>["none",qe,we,ye],rt=()=>["none",qe,we,ye],je=()=>[qe,we,ye],Pt=()=>[fr,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[An],breakpoint:[An],color:[t2],container:[An],"drop-shadow":[An],ease:["in","out","in-out"],font:[mT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[An],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[An],shadow:[An],spacing:["px",qe],text:[An],"text-shadow":[An],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fr,ye,we,C]}],container:["container"],"container-type":[{"@container":["","normal","size",we,ye]}],"container-named":[pT],columns:[{columns:[qe,ye,we,f]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:U()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Fs,"auto",we,ye]}],basis:[{basis:[fr,"full","auto",f,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,fr,"auto","initial","none",ye]}],grow:[{grow:["",qe,we,ye]}],shrink:[{shrink:["",qe,we,ye]}],order:[{order:[Fs,"first","last","none",we,ye]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[f,"screen",...q()]}],"min-w":[{"min-w":[f,"screen","none",...q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[h]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",s,Cl,ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wT,_T]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vf,ye]}],"font-family":[{font:[yT,vT,t]}],"font-features":[{"font-features":[ye]}],"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:[o,we,ye]}],"line-clamp":[{"line-clamp":[qe,"none",we,a1]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",we,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,ta]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[qe,"auto",we,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[Fs,we,ye]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,ye]}],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,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fs,we,ye],radial:["",we,ye],conic:[Fs,we,ye]},ST,bT]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,ye]}],"outline-w":[{outline:["",qe,Cl,ta]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",_,Au,Mu]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",v,Au,Mu]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[qe,ta]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",b,Au,Mu]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[qe,we,ye]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"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":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"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":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"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":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"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":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"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":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"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":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[we,ye]}],"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":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"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":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,ye]}],filter:[{filter:["","none",we,ye]}],blur:[{blur:tt()}],brightness:[{brightness:[qe,we,ye]}],contrast:[{contrast:[qe,we,ye]}],"drop-shadow":[{"drop-shadow":["","none",S,Au,Mu]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",qe,we,ye]}],"hue-rotate":[{"hue-rotate":[qe,we,ye]}],invert:[{invert:["",qe,we,ye]}],saturate:[{saturate:[qe,we,ye]}],sepia:[{sepia:["",qe,we,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",we,ye]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,ye]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,ye]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,ye]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,ye]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,ye]}],ease:[{ease:["linear","initial",T,we,ye]}],delay:[{delay:[qe,we,ye]}],animate:[{animate:["none",O,we,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,we,ye]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:nt()}],"rotate-x":[{"rotate-x":nt()}],"rotate-y":[{"rotate-y":nt()}],"rotate-z":[{"rotate-z":nt()}],scale:[{scale:rt()}],"scale-x":[{"scale-x":rt()}],"scale-y":[{"scale-y":rt()}],"scale-z":[{"scale-z":rt()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[we,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pt()}],"translate-x":[{"translate-x":Pt()}],"translate-y":[{"translate-y":Pt()}],"translate-z":[{"translate-z":Pt()}],"translate-none":["translate-none"],zoom:[{zoom:[Fs,we,ye]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"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,ye]}],"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":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,ye]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[qe,Cl,ta,a1]}],stroke:[{stroke:["none",...Q()]}],"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"]}},NT=sT(CT);function ge(...e){return NT(Zl(e))}const kT=WS("inline-flex h-9 shrink-0 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 _e({className:e,variant:t,size:s,...r}){return u.jsx("button",{className:ge(kT({variant:t,size:s,className:e})),...r})}const c2=N.createContext({});function TT(e){const t=N.useRef(null);return t.current===null&&(t.current=e()),t.current}const MT=typeof window<"u",AT=MT?N.useLayoutEffect:N.useEffect,Eg=N.createContext(null);function Cg(e,t){e.indexOf(t)===-1&&e.push(t)}function nh(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Zs=(e,t,s)=>s>t?t:s<e?e:s;let Ng=()=>{};const Er={},u2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function h2(e){return typeof e=="object"&&e!==null}const d2=e=>/^0[^.\s]+$/u.test(e);function f2(e){let t;return()=>(t===void 0&&(t=e()),t)}const Es=e=>e,RT=(e,t)=>s=>t(e(s)),ac=(...e)=>e.reduce(RT),Ql=(e,t,s)=>{const r=t-e;return r===0?1:(s-e)/r};class kg{constructor(){this.subscriptions=[]}add(t){return Cg(this.subscriptions,t),()=>nh(this.subscriptions,t)}notify(t,s,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,r);else for(let l=0;l<o;l++){const h=this.subscriptions[l];h&&h(t,s,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ls=e=>e*1e3,ws=e=>e/1e3;function m2(e,t){return t?e*(1e3/t):0}const p2=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,DT=1e-7,OT=12;function LT(e,t,s,r,o){let l,h,f=0;do h=t+(s-t)/2,l=p2(h,r,o)-e,l>0?s=h:t=h;while(Math.abs(l)>DT&&++f<OT);return h}function oc(e,t,s,r){if(e===t&&s===r)return Es;const o=l=>LT(l,0,1,e,s);return l=>l===0||l===1?l:p2(o(l),t,r)}const g2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_2=e=>t=>1-e(1-t),v2=oc(.33,1.53,.69,.99),Tg=_2(v2),b2=g2(Tg),y2=e=>e>=1?1:(e*=2)<1?.5*Tg(e):.5*(2-Math.pow(2,-10*(e-1))),Mg=e=>1-Math.sin(Math.acos(e)),x2=_2(Mg),S2=g2(Mg),jT=oc(.42,0,1,1),BT=oc(0,0,.58,1),w2=oc(.42,0,.58,1),zT=e=>Array.isArray(e)&&typeof e[0]!="number",E2=e=>Array.isArray(e)&&typeof e[0]=="number",IT={linear:Es,easeIn:jT,easeInOut:w2,easeOut:BT,circIn:Mg,circInOut:S2,circOut:x2,backIn:Tg,backInOut:b2,backOut:v2,anticipate:y2},PT=e=>typeof e=="string",c1=e=>{if(E2(e)){Ng(e.length===4);const[t,s,r,o]=e;return oc(t,s,r,o)}else if(PT(e))return IT[e];return e},Ru=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function UT(e,t){let s=new Set,r=new Set,o=!1,l=!1;const h=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function m(_){h.has(_)&&(d.schedule(_),e()),_(f)}const d={schedule:(_,v=!1,b=!1)=>{const x=b&&o?s:r;return v&&h.add(_),x.add(_),_},cancel:_=>{r.delete(_),h.delete(_)},process:_=>{if(f=_,o){l=!0;return}o=!0;const v=s;s=r,r=v,s.forEach(m),s.clear(),o=!1,l&&(l=!1,d.process(_))}};return d}const HT=40;function C2(e,t){let s=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>s=!0,h=Ru.reduce((k,D)=>(k[D]=UT(l),k),{}),{setup:f,read:m,resolveKeyframes:d,preUpdate:_,update:v,preRender:b,render:S,postRender:x}=h,w=()=>{const k=Er.useManualTiming,D=k?o.timestamp:performance.now();s=!1,k||(o.delta=r?1e3/60:Math.max(Math.min(D-o.timestamp,HT),1)),o.timestamp=D,o.isProcessing=!0,f.process(o),m.process(o),d.process(o),_.process(o),v.process(o),b.process(o),S.process(o),x.process(o),o.isProcessing=!1,s&&t&&(r=!1,e(w))},C=()=>{s=!0,r=!0,o.isProcessing||e(w)};return{schedule:Ru.reduce((k,D)=>{const U=h[D];return k[D]=(P,B=!1,M=!1)=>(s||C(),U.schedule(P,B,M)),k},{}),cancel:k=>{for(let D=0;D<Ru.length;D++)h[Ru[D]].cancel(k)},state:o,steps:h}}const{schedule:bt,cancel:Cr,state:Si,steps:$f}=C2(typeof requestAnimationFrame<"u"?requestAnimationFrame:Es,!0);let Vu;function FT(){Vu=void 0}const Oi={now:()=>(Vu===void 0&&Oi.set(Si.isProcessing||Er.useManualTiming?Si.timestamp:performance.now()),Vu),set:e=>{Vu=e,queueMicrotask(FT)}},N2=e=>t=>typeof t=="string"&&t.startsWith(e),k2=N2("--"),VT=N2("var(--"),Ag=e=>VT(e)?$T.test(e.split("/*")[0].trim()):!1,$T=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function u1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const So={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Jl={...So,transform:e=>Zs(0,1,e)},Du={...So,default:1},$l=e=>Math.round(e*1e5)/1e5,Rg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qT(e){return e==null}const KT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dg=(e,t)=>s=>!!(typeof s=="string"&&KT.test(s)&&s.startsWith(e)||t&&!qT(s)&&Object.prototype.hasOwnProperty.call(s,t)),T2=(e,t,s)=>r=>{if(typeof r!="string")return r;const[o,l,h,f]=r.match(Rg);return{[e]:parseFloat(o),[t]:parseFloat(l),[s]:parseFloat(h),alpha:f!==void 0?parseFloat(f):1}},GT=e=>Zs(0,255,e),qf={...So,transform:e=>Math.round(GT(e))},oa={test:Dg("rgb","red"),parse:T2("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+qf.transform(e)+", "+qf.transform(t)+", "+qf.transform(s)+", "+$l(Jl.transform(r))+")"};function WT(e){let t="",s="",r="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const hp={test:Dg("#"),parse:WT,transform:oa.transform},lc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vr=lc("deg"),Ys=lc("%"),Ne=lc("px"),YT=lc("vh"),XT=lc("vw"),h1={...Ys,parse:e=>Ys.parse(e)/100,transform:e=>Ys.transform(e*100)},co={test:Dg("hsl","hue"),parse:T2("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ys.transform($l(t))+", "+Ys.transform($l(s))+", "+$l(Jl.transform(r))+")"},Jt={test:e=>oa.test(e)||hp.test(e)||co.test(e),parse:e=>oa.test(e)?oa.parse(e):co.test(e)?co.parse(e):hp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?oa.transform(e):co.transform(e),getAnimatableNone:e=>{const t=Jt.parse(e);return t.alpha=0,Jt.transform(t)}},ZT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function QT(e){return isNaN(e)&&typeof e=="string"&&(e.match(Rg)?.length||0)+(e.match(ZT)?.length||0)>0}const M2="number",A2="color",JT="var",e4="var(",d1="${}",t4=/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 go(e){const t=e.toString(),s=[],r={color:[],number:[],var:[]},o=[];let l=0;const f=t.replace(t4,m=>(Jt.test(m)?(r.color.push(l),o.push(A2),s.push(Jt.parse(m))):m.startsWith(e4)?(r.var.push(l),o.push(JT),s.push(m)):(r.number.push(l),o.push(M2),s.push(parseFloat(m))),++l,d1)).split(d1);return{values:s,split:f,indexes:r,types:o}}function i4(e){return go(e).values}function R2({split:e,types:t}){const s=e.length;return r=>{let o="";for(let l=0;l<s;l++)if(o+=e[l],r[l]!==void 0){const h=t[l];h===M2?o+=$l(r[l]):h===A2?o+=Jt.transform(r[l]):o+=r[l]}return o}}function s4(e){return R2(go(e))}const n4=e=>typeof e=="number"?0:Jt.test(e)?Jt.getAnimatableNone(e):e,r4=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:n4(e);function a4(e){const t=go(e);return R2(t)(t.values.map((r,o)=>r4(r,t.split[o])))}const Bs={test:QT,parse:i4,createTransformer:s4,getAnimatableNone:a4};function Kf(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function o4({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,t/=100,s/=100;let o=0,l=0,h=0;if(!t)o=l=h=s;else{const f=s<.5?s*(1+t):s+t-s*t,m=2*s-f;o=Kf(m,f,e+1/3),l=Kf(m,f,e),h=Kf(m,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(h*255),alpha:r}}function rh(e,t){return s=>s>0?t:e}const Nt=(e,t,s)=>e+(t-e)*s,Gf=(e,t,s)=>{const r=e*e,o=s*(t*t-r)+r;return o<0?0:Math.sqrt(o)},l4=[hp,oa,co],c4=e=>l4.find(t=>t.test(e));function f1(e){const t=c4(e);if(!t)return!1;let s=t.parse(e);return t===co&&(s=o4(s)),s}const m1=(e,t)=>{const s=f1(e),r=f1(t);if(!s||!r)return rh(e,t);const o={...s};return l=>(o.red=Gf(s.red,r.red,l),o.green=Gf(s.green,r.green,l),o.blue=Gf(s.blue,r.blue,l),o.alpha=Nt(s.alpha,r.alpha,l),oa.transform(o))},dp=new Set(["none","hidden"]);function u4(e,t){return dp.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function h4(e,t){return s=>Nt(e,t,s)}function Og(e){return typeof e=="number"?h4:typeof e=="string"?Ag(e)?rh:Jt.test(e)?m1:m4:Array.isArray(e)?D2:typeof e=="object"?Jt.test(e)?m1:d4:rh}function D2(e,t){const s=[...e],r=s.length,o=e.map((l,h)=>Og(l)(l,t[h]));return l=>{for(let h=0;h<r;h++)s[h]=o[h](l);return s}}function d4(e,t){const s={...e,...t},r={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Og(e[o])(e[o],t[o]));return o=>{for(const l in r)s[l]=r[l](o);return s}}function f4(e,t){const s=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],h=e.indexes[l][r[l]],f=e.values[h]??0;s[o]=f,r[l]++}return s}const m4=(e,t)=>{const s=Bs.createTransformer(t),r=go(e),o=go(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?dp.has(e)&&!o.values.length||dp.has(t)&&!r.values.length?u4(e,t):ac(D2(f4(r,o),o.values),s):rh(e,t)};function O2(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?Nt(e,t,s):Og(e)(e,t)}const p4=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>bt.update(t,s),stop:()=>Cr(t),now:()=>Si.isProcessing?Si.timestamp:Oi.now()}},L2=(e,t,s=10)=>{let r="";const o=Math.max(Math.round(t/s),2);for(let l=0;l<o;l++)r+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ah=2e4;function Lg(e){let t=0;const s=50;let r=e.next(t);for(;!r.done&&t<ah;)t+=s,r=e.next(t);return t>=ah?1/0:t}function g4(e,t=100,s){const r=s({...e,keyframes:[0,t]}),o=Math.min(Lg(r),ah);return{type:"keyframes",ease:l=>r.next(o*l).value/t,duration:ws(o)}}const Bt={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 fp(e,t){return e*Math.sqrt(1-t*t)}const _4=12;function v4(e,t,s){let r=s;for(let o=1;o<_4;o++)r=r-e(r)/t(r);return r}const Wf=.001;function b4({duration:e=Bt.duration,bounce:t=Bt.bounce,velocity:s=Bt.velocity,mass:r=Bt.mass}){let o,l,h=1-t;h=Zs(Bt.minDamping,Bt.maxDamping,h),e=Zs(Bt.minDuration,Bt.maxDuration,ws(e)),h<1?(o=d=>{const _=d*h,v=_*e,b=_-s,S=fp(d,h),x=Math.exp(-v);return Wf-b/S*x},l=d=>{const v=d*h*e,b=v*s+s,S=Math.pow(h,2)*Math.pow(d,2)*e,x=Math.exp(-v),w=fp(Math.pow(d,2),h);return(-o(d)+Wf>0?-1:1)*((b-S)*x)/w}):(o=d=>{const _=Math.exp(-d*e),v=(d-s)*e+1;return-Wf+_*v},l=d=>{const _=Math.exp(-d*e),v=(s-d)*(e*e);return _*v});const f=5/e,m=v4(o,l,f);if(e=ls(e),isNaN(m))return{stiffness:Bt.stiffness,damping:Bt.damping,duration:e};{const d=Math.pow(m,2)*r;return{stiffness:d,damping:h*2*Math.sqrt(r*d),duration:e}}}const y4=["duration","bounce"],x4=["stiffness","damping","mass"];function p1(e,t){return t.some(s=>e[s]!==void 0)}function S4(e){let t={velocity:Bt.velocity,stiffness:Bt.stiffness,damping:Bt.damping,mass:Bt.mass,isResolvedFromDuration:!1,...e};if(!p1(e,x4)&&p1(e,y4))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,r=2*Math.PI/(s*1.2),o=r*r,l=2*Zs(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Bt.mass,stiffness:o,damping:l}}else{const s=b4({...e,velocity:0});t={...t,...s,mass:Bt.mass},t.isResolvedFromDuration=!0}return t}function oh(e=Bt.visualDuration,t=Bt.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=s;const l=s.keyframes[0],h=s.keyframes[s.keyframes.length-1],f={done:!1,value:l},{stiffness:m,damping:d,mass:_,duration:v,velocity:b,isResolvedFromDuration:S}=S4({...s,velocity:-ws(s.velocity||0)}),x=b||0,w=d/(2*Math.sqrt(m*_)),C=h-l,T=ws(Math.sqrt(m/_)),O=Math.abs(C)<5;r||(r=O?Bt.restSpeed.granular:Bt.restSpeed.default),o||(o=O?Bt.restDelta.granular:Bt.restDelta.default);let k,D,U,P,B,M;if(w<1)U=fp(T,w),P=(x+w*T*C)/U,k=Y=>{const $=Math.exp(-w*T*Y);return h-$*(P*Math.sin(U*Y)+C*Math.cos(U*Y))},B=w*T*P+C*U,M=w*T*C-P*U,D=Y=>Math.exp(-w*T*Y)*(B*Math.sin(U*Y)+M*Math.cos(U*Y));else if(w===1){k=$=>h-Math.exp(-T*$)*(C+(x+T*C)*$);const Y=x+T*C;D=$=>Math.exp(-T*$)*(T*Y*$-x)}else{const Y=T*Math.sqrt(w*w-1);k=ie=>{const J=Math.exp(-w*T*ie),A=Math.min(Y*ie,300);return h-J*((x+w*T*C)*Math.sinh(A)+Y*C*Math.cosh(A))/Y};const $=(x+w*T*C)/Y,G=w*T*$-C*Y,I=w*T*C-$*Y;D=ie=>{const J=Math.exp(-w*T*ie),A=Math.min(Y*ie,300);return J*(G*Math.sinh(A)+I*Math.cosh(A))}}const F={calculatedDuration:S&&v||null,velocity:Y=>ls(D(Y)),next:Y=>{if(!S&&w<1){const G=Math.exp(-w*T*Y),I=Math.sin(U*Y),ie=Math.cos(U*Y),J=h-G*(P*I+C*ie),A=ls(G*(B*I+M*ie));return f.done=Math.abs(A)<=r&&Math.abs(h-J)<=o,f.value=f.done?h:J,f}const $=k(Y);if(S)f.done=Y>=v;else{const G=ls(D(Y));f.done=Math.abs(G)<=r&&Math.abs(h-$)<=o}return f.value=f.done?h:$,f},toString:()=>{const Y=Math.min(Lg(F),ah),$=L2(G=>F.next(Y*G).value,Y,30);return Y+"ms "+$},toTransition:()=>{}};return F}oh.applyToOptions=e=>{const t=g4(e,100,oh);return e.ease=t.ease,e.duration=ls(t.duration),e.type="keyframes",e};const w4=5;function j2(e,t,s){const r=Math.max(t-w4,0);return m2(s-e(r),t-r)}function mp({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:h,min:f,max:m,restDelta:d=.5,restSpeed:_}){const v=e[0],b={done:!1,value:v},S=M=>f!==void 0&&M<f||m!==void 0&&M>m,x=M=>f===void 0?m:m===void 0||Math.abs(f-M)<Math.abs(m-M)?f:m;let w=s*t;const C=v+w,T=h===void 0?C:h(C);T!==C&&(w=T-v);const O=M=>-w*Math.exp(-M/r),k=M=>T+O(M),D=M=>{const F=O(M),Y=k(M);b.done=Math.abs(F)<=d,b.value=b.done?T:Y};let U,P;const B=M=>{S(b.value)&&(U=M,P=oh({keyframes:[b.value,x(b.value)],velocity:j2(k,M,b.value),damping:o,stiffness:l,restDelta:d,restSpeed:_}))};return B(0),{calculatedDuration:null,next:M=>{let F=!1;return!P&&U===void 0&&(F=!0,D(M),B(M)),U!==void 0&&M>=U?P.next(M-U):(!F&&D(M),b)}}}function E4(e,t,s){const r=[],o=s||Er.mix||O2,l=e.length-1;for(let h=0;h<l;h++){let f=o(e[h],e[h+1]);if(t){const m=Array.isArray(t)?t[h]||Es:t;f=ac(m,f)}r.push(f)}return r}function C4(e,t,{clamp:s=!0,ease:r,mixer:o}={}){const l=e.length;if(Ng(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const h=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=E4(t,r,o),m=f.length,d=_=>{if(h&&_<e[0])return t[0];let v=0;if(m>1)for(;v<e.length-2&&!(_<e[v+1]);v++);const b=Ql(e[v],e[v+1],_);return f[v](b)};return s?_=>d(Zs(e[0],e[l-1],_)):d}function N4(e,t){const s=e[e.length-1];for(let r=1;r<=t;r++){const o=Ql(0,t,r);e.push(Nt(s,1,o))}}function k4(e){const t=[0];return N4(t,e.length-1),t}function T4(e,t){return e.map(s=>s*t)}function M4(e,t){return e.map(()=>t||w2).splice(0,e.length-1)}function ql({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){const o=zT(r)?r.map(c1):c1(r),l={done:!1,value:t[0]},h=T4(s&&s.length===t.length?s:k4(t),e),f=C4(h,t,{ease:Array.isArray(o)?o:M4(t,o)});return{calculatedDuration:e,next:m=>(l.value=f(m),l.done=m>=e,l)}}const A4=e=>e!==null;function Ch(e,{repeat:t,repeatType:s="loop"},r,o=1){const l=e.filter(A4),f=o<0||t&&s!=="loop"&&t%2===1?0:l.length-1;return!f||r===void 0?l[f]:r}const R4={decay:mp,inertia:mp,tween:ql,keyframes:ql,spring:oh};function B2(e){typeof e.type=="string"&&(e.type=R4[e.type])}class jg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const D4=e=>e/100;class lh extends jg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==Oi.now()&&this.tick(Oi.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;B2(t);const{type:s=ql,repeat:r=0,repeatDelay:o=0,repeatType:l,velocity:h=0}=t;let{keyframes:f}=t;const m=s||ql;m!==ql&&typeof f[0]!="number"&&(this.mixKeyframes=ac(D4,O2(f[0],f[1])),f=[0,100]);const d=m({...t,keyframes:f});l==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...f].reverse(),velocity:-h})),d.calculatedDuration===null&&(d.calculatedDuration=Lg(d));const{calculatedDuration:_}=d;this.calculatedDuration=_,this.resolvedDuration=_+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=d}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:r,totalDuration:o,mixKeyframes:l,mirroredGenerator:h,resolvedDuration:f,calculatedDuration:m}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:_,repeat:v,repeatType:b,repeatDelay:S,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const T=this.currentTime-d*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?T<0:T>o;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let k=this.currentTime,D=r;if(v){const M=Math.min(this.currentTime,o)/f;let F=Math.floor(M),Y=M%1;!Y&&M>=1&&(Y=1),Y===1&&F--,F=Math.min(F,v+1),F%2&&(b==="reverse"?(Y=1-Y,S&&(Y-=S/f)):b==="mirror"&&(D=h)),k=Zs(0,1,Y)*f}let U;O?(this.delayState.value=_[0],U=this.delayState):U=D.next(k),l&&!O&&(U.value=l(U.value));let{done:P}=U;!O&&m!==null&&(P=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return B&&x!==mp&&(U.value=Ch(_,this.options,C,this.speed)),w&&w(U.value),B&&this.finish(),U}then(t,s){return this.finished.then(t,s)}get duration(){return ws(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ws(t)}get time(){return ws(this.currentTime)}set time(t){t=ls(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return j2(r=>this.generator.next(r).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Oi.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=ws(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=p4,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),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(Oi.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 O4(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const la=e=>e*180/Math.PI,pp=e=>{const t=la(Math.atan2(e[1],e[0]));return gp(t)},L4={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:pp,rotateZ:pp,skewX:e=>la(Math.atan(e[1])),skewY:e=>la(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},gp=e=>(e=e%360,e<0&&(e+=360),e),g1=pp,_1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),v1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),j4={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_1,scaleY:v1,scale:e=>(_1(e)+v1(e))/2,rotateX:e=>gp(la(Math.atan2(e[6],e[5]))),rotateY:e=>gp(la(Math.atan2(-e[2],e[0]))),rotateZ:g1,rotate:g1,skewX:e=>la(Math.atan(e[4])),skewY:e=>la(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _p(e){return e.includes("scale")?1:0}function vp(e,t){if(!e||e==="none")return _p(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(s)r=j4,o=s;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=L4,o=f}if(!o)return _p(t);const l=r[t],h=o[1].split(",").map(z4);return typeof l=="function"?l(h):h[l]}const B4=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return vp(s,t)};function z4(e){return parseFloat(e.trim())}const wo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eo=new Set(wo),b1=e=>e===So||e===Ne,I4=new Set(["x","y","z"]),P4=wo.filter(e=>!I4.has(e));function U4(e){const t=[];return P4.forEach(s=>{const r=e.getValue(s);r!==void 0&&(t.push([s,r.get()]),r.set(s.startsWith("scale")?1:0))}),t}const xr={width:({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},height:({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>vp(t,"x"),y:(e,{transform:t})=>vp(t,"y")};xr.translateX=xr.x;xr.translateY=xr.y;const ua=new Set;let bp=!1,yp=!1,xp=!1;function z2(){if(yp){const e=Array.from(ua).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),s=new Map;t.forEach(r=>{const o=U4(r);o.length&&(s.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=s.get(r);o&&o.forEach(([l,h])=>{r.getValue(l)?.set(h)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yp=!1,bp=!1,ua.forEach(e=>e.complete(xp)),ua.clear()}function I2(){ua.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yp=!0)})}function H4(){xp=!0,I2(),z2(),xp=!1}class Bg{constructor(t,s,r,o,l,h=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=r,this.motionValue=o,this.element=l,this.isAsync=h}scheduleResolve(){this.state="scheduled",this.isAsync?(ua.add(this),bp||(bp=!0,bt.read(I2),bt.resolveKeyframes(z2))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:r,motionValue:o}=this;if(t[0]===null){const l=o?.get(),h=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&s){const f=r.readValue(s,h);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=h),o&&l===void 0&&o.set(t[0])}O4(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ua.delete(this)}cancel(){this.state==="scheduled"&&(ua.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const F4=e=>e.startsWith("--");function P2(e,t,s){F4(t)?e.style.setProperty(t,s):e.style[t]=s}const V4={};function U2(e,t){const s=f2(e);return()=>V4[t]??s()}const $4=U2(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),H2=U2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zl=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,y1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zl([0,.65,.55,1]),circOut:zl([.55,0,1,.45]),backIn:zl([.31,.01,.66,-.59]),backOut:zl([.33,1.53,.69,.99])};function F2(e,t){if(e)return typeof e=="function"?H2()?L2(e,t):"ease-out":E2(e)?zl(e):Array.isArray(e)?e.map(s=>F2(s,t)||y1.easeOut):y1[e]}function q4(e,t,s,{delay:r=0,duration:o=300,repeat:l=0,repeatType:h="loop",ease:f="easeOut",times:m}={},d=void 0){const _={[t]:s};m&&(_.offset=m);const v=F2(f,o);Array.isArray(v)&&(_.easing=v);const b={delay:r,duration:o,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:l+1,direction:h==="reverse"?"alternate":"normal"};return d&&(b.pseudoElement=d),e.animate(_,b)}function V2(e){return typeof e=="function"&&"applyToOptions"in e}function K4({type:e,...t}){return V2(e)&&H2()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class $2 extends jg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:o,pseudoElement:l,allowFlatten:h=!1,finalKeyframe:f,onComplete:m}=t;this.isPseudoElement=!!l,this.allowFlatten=h,this.options=t,Ng(typeof t.type!="string");const d=K4(t);this.animation=q4(s,r,o,d,l),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const _=Ch(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(_),P2(s,r,_),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 ws(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ws(t)}get time(){return ws(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ls(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&$4()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),r&&(this.animation.rangeEnd=r),Es):o(this)}}const q2={anticipate:y2,backInOut:b2,circInOut:S2};function G4(e){return e in q2}function W4(e){typeof e.ease=="string"&&G4(e.ease)&&(e.ease=q2[e.ease])}const Yf=10;class Y4 extends $2{constructor(t){W4(t),B2(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:r,onComplete:o,element:l,...h}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const f=new lh({...h,autoplay:!1}),m=Math.max(Yf,Oi.now()-this.startTime),d=Zs(0,Yf,m-Yf),_=f.sample(m).value,{name:v}=this.options;l&&v&&P2(l,v,_),s.setWithVelocity(f.sample(Math.max(0,m-d)).value,_,d),f.stop()}}const x1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Bs.test(e)||e==="0")&&!e.startsWith("url("));function X4(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function Z4(e,t,s,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],h=x1(o,t),f=x1(l,t);return!h||!f?!1:X4(e)||(s==="spring"||V2(s))&&r}function Sp(e){e.duration=0,e.type="keyframes"}const K2=new Set(["opacity","clipPath","filter","transform"]),Q4=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function J4(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Q4.test(e[t]))return!0;return!1}const eM=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),tM=f2(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function iM(e){const{motionValue:t,name:s,repeatDelay:r,repeatType:o,damping:l,type:h,keyframes:f}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:_}=t.owner.getProps();return tM()&&s&&(K2.has(s)||eM.has(s)&&J4(f))&&(s!=="transform"||!_)&&!d&&!r&&o!=="mirror"&&l!==0&&h!=="inertia"}const sM=40;class nM extends jg{constructor({autoplay:t=!0,delay:s=0,type:r="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:h="loop",keyframes:f,name:m,motionValue:d,element:_,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Oi.now();const b={autoplay:t,delay:s,type:r,repeat:o,repeatDelay:l,repeatType:h,name:m,motionValue:d,element:_,...v},S=_?.KeyframeResolver||Bg;this.keyframeResolver=new S(f,(x,w,C)=>this.onKeyframesResolved(x,w,b,!C),m,d,_),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,r,o){this.keyframeResolver=void 0;const{name:l,type:h,velocity:f,delay:m,isHandoff:d,onUpdate:_}=r;this.resolvedAt=Oi.now();let v=!0;Z4(t,l,h,f)||(v=!1,(Er.instantAnimations||!m)&&_?.(Ch(t,r,s)),t[0]=t[t.length-1],Sp(r),r.repeat=0);const S={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>sM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...r,keyframes:t},x=v&&!d&&iM(S),w=S.motionValue?.owner?.current;let C;if(x)try{C=new Y4({...S,element:w})}catch{C=new lh(S)}else C=new lh(S);C.finished.then(()=>{this.notifyFinished()}).catch(Es),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),H4()),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 G2(e,t,s,r=0,o=1){const l=Array.from(e).sort((d,_)=>d.sortNodePosition(_)).indexOf(t),h=e.size,f=(h-1)*r;return typeof s=="function"?s(l,h):o===1?l*r:f-l*r}const rM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function aM(e){const t=rM.exec(e);if(!t)return[,];const[,s,r,o]=t;return[`--${s??r}`,o]}function W2(e,t,s=1){const[r,o]=aM(e);if(!r)return;const l=window.getComputedStyle(t).getPropertyValue(r);if(l){const h=l.trim();return u2(h)?parseFloat(h):h}return Ag(o)?W2(o,t,s+1):o}const oM={type:"spring",stiffness:500,damping:25,restSpeed:10},lM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cM={type:"keyframes",duration:.8},uM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hM=(e,{keyframes:t})=>t.length>2?cM:Eo.has(e)?e.startsWith("scale")?lM(t[1]):oM:uM;function Y2(e,t){if(e?.inherit&&t){const{inherit:s,...r}=e;return{...t,...r}}return e}function zg(e,t){const s=e?.[t]??e?.default??e;return s!==e?Y2(s,e):s}const dM=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function fM(e){for(const t in e)if(!dM.has(t))return!0;return!1}const Ig=(e,t,s,r={},o,l)=>h=>{const f=zg(r,e)||{},m=f.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ls(m);const _={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-d,onUpdate:b=>{t.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{h(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:l?void 0:o};fM(f)||Object.assign(_,hM(e,_)),_.duration&&(_.duration=ls(_.duration)),_.repeatDelay&&(_.repeatDelay=ls(_.repeatDelay)),_.from!==void 0&&(_.keyframes[0]=_.from);let v=!1;if((_.type===!1||_.duration===0&&!_.repeatDelay)&&(Sp(_),_.delay===0&&(v=!0)),(Er.instantAnimations||Er.skipAnimations||o?.shouldSkipAnimations)&&(v=!0,Sp(_),_.delay=0),_.allowFlatten=!f.type&&!f.ease,v&&!l&&t.get()!==void 0){const b=Ch(_.keyframes,f);if(b!==void 0){bt.update(()=>{_.onUpdate(b),_.onComplete()});return}}return f.isSync?new lh(_):new nM(_)};function S1(e){const t=[{},{}];return e?.values.forEach((s,r)=>{t[0][r]=s.get(),t[1][r]=s.getVelocity()}),t}function Pg(e,t,s,r){if(typeof t=="function"){const[o,l]=S1(r);t=t(s!==void 0?s:e.custom,o,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,l]=S1(r);t=t(s!==void 0?s:e.custom,o,l)}return t}function ha(e,t,s){const r=e.getProps();return Pg(r,t,s!==void 0?s:r.custom,e)}const X2=new Set(["width","height","top","left","right","bottom",...wo]),w1=30,mM=e=>!isNaN(parseFloat(e));class pM{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Oi.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),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=s.owner}setCurrent(t){this.current=t,this.updatedAt=Oi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=mM(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new kg);const r=this.events[t].add(s);return t==="change"?()=>{r(),bt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Oi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>w1)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,w1);return m2(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _o(e,t){return new pM(e,t)}const wp=e=>Array.isArray(e);function gM(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,_o(s))}function _M(e){return wp(e)?e[e.length-1]||0:e}function vM(e,t){const s=ha(e,t);let{transitionEnd:r={},transition:o={},...l}=s||{};l={...l,...r};for(const h in l){const f=_M(l[h]);gM(e,h,f)}}const Ei=e=>!!(e&&e.getVelocity);function bM(e){return!!(Ei(e)&&e.add)}function Ep(e,t){const s=e.getValue("willChange");if(bM(s))return s.add(t);if(!s&&Er.WillChange){const r=new Er.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ug(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const yM="framerAppearId",Z2="data-"+Ug(yM);function Q2(e){return e.props[Z2]}function xM({protectedKeys:e,needsAnimating:t},s){const r=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,r}function J2(e,t,{delay:s=0,transitionOverride:r,type:o}={}){let{transition:l,transitionEnd:h,...f}=t;const m=e.getDefaultTransition();l=l?Y2(l,m):m;const d=l?.reduceMotion;r&&(l=r);const _=[],v=o&&e.animationState&&e.animationState.getState()[o];for(const b in f){const S=e.getValue(b,e.latestValues[b]??null),x=f[b];if(x===void 0||v&&xM(v,b))continue;const w={delay:s,...zg(l||{},b)},C=S.get();if(C!==void 0&&!S.isAnimating()&&!Array.isArray(x)&&x===C&&!w.velocity){bt.update(()=>S.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){const D=Q2(e);if(D){const U=window.MotionHandoffAnimation(D,b,bt);U!==null&&(w.startTime=U,T=!0)}}Ep(e,b);const O=d??e.shouldReduceMotion;S.start(Ig(b,S,x,O&&X2.has(b)?{type:!1}:w,e,T));const k=S.animation;k&&_.push(k)}if(h){const b=()=>bt.update(()=>{h&&vM(e,h)});_.length?Promise.all(_).then(b):b()}return _}function Cp(e,t,s={}){const r=ha(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(o=s.transitionOverride);const l=r?()=>Promise.all(J2(e,r,s)):()=>Promise.resolve(),h=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:d=0,staggerChildren:_,staggerDirection:v}=o;return SM(e,t,m,d,_,v,s)}:()=>Promise.resolve(),{when:f}=o;if(f){const[m,d]=f==="beforeChildren"?[l,h]:[h,l];return m().then(()=>d())}else return Promise.all([l(),h(s.delay)])}function SM(e,t,s=0,r=0,o=0,l=1,h){const f=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),f.push(Cp(m,t,{...h,delay:s+(typeof r=="function"?0:r)+G2(e.variantChildren,m,r,o,l)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(f)}function wM(e,t,s={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(l=>Cp(e,l,s));r=Promise.all(o)}else if(typeof t=="string")r=Cp(e,t,s);else{const o=typeof t=="function"?ha(e,t,s.custom):t;r=Promise.all(J2(e,o,s))}return r.then(()=>{e.notify("AnimationComplete",t)})}const EM={test:e=>e==="auto",parse:e=>e},ew=e=>t=>t.test(e),tw=[So,Ne,Ys,vr,XT,YT,EM],E1=e=>tw.find(ew(e));function CM(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||d2(e):!0}const NM=new Set(["brightness","contrast","saturate","opacity"]);function kM(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=s.match(Rg)||[];if(!r)return e;const o=s.replace(r,"");let l=NM.has(t)?1:0;return r!==s&&(l*=100),t+"("+l+o+")"}const TM=/\b([a-z-]*)\(.*?\)/gu,Np={...Bs,getAnimatableNone:e=>{const t=e.match(TM);return t?t.map(kM).join(" "):e}},kp={...Bs,getAnimatableNone:e=>{const t=Bs.parse(e);return Bs.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},C1={...So,transform:Math.round},MM={rotate:vr,rotateX:vr,rotateY:vr,rotateZ:vr,scale:Du,scaleX:Du,scaleY:Du,scaleZ:Du,skew:vr,skewX:vr,skewY:vr,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Jl,originX:h1,originY:h1,originZ:Ne},Hg={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...MM,zIndex:C1,fillOpacity:Jl,strokeOpacity:Jl,numOctaves:C1},AM={...Hg,color:Jt,backgroundColor:Jt,outlineColor:Jt,fill:Jt,stroke:Jt,borderColor:Jt,borderTopColor:Jt,borderRightColor:Jt,borderBottomColor:Jt,borderLeftColor:Jt,filter:Np,WebkitFilter:Np,mask:kp,WebkitMask:kp},iw=e=>AM[e],RM=new Set([Np,kp]);function sw(e,t){let s=iw(e);return RM.has(s)||(s=Bs),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const DM=new Set(["auto","none","0"]);function OM(e,t,s){let r=0,o;for(;r<e.length&&!o;){const l=e[r];typeof l=="string"&&!DM.has(l)&&go(l).values.length&&(o=e[r]),r++}if(o&&s)for(const l of t)e[l]=sw(s,o)}class LM extends Bg{constructor(t,s,r,o,l){super(t,s,r,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:r}=this;if(!s||!s.current)return;super.readKeyframes();for(let _=0;_<t.length;_++){let v=t[_];if(typeof v=="string"&&(v=v.trim(),Ag(v))){const b=W2(v,s.current);b!==void 0&&(t[_]=b),_===t.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!X2.has(r)||t.length!==2)return;const[o,l]=t,h=E1(o),f=E1(l),m=u1(o),d=u1(l);if(m!==d&&xr[r]){this.needsMeasurement=!0;return}if(h!==f)if(b1(h)&&b1(f))for(let _=0;_<t.length;_++){const v=t[_];typeof v=="string"&&(t[_]=parseFloat(v))}else xr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||CM(t[o]))&&r.push(o);r.length&&OM(t,r,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const l=r.length-1,h=r[l];r[l]=xr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),h!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=h),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,m])=>{t.getValue(f).set(m)}),this.resolveNoneKeyframes()}}function nw(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=s?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const rw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jM(e){return h2(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Fg}=C2(queueMicrotask,!1),Ls={x:!1,y:!1};function aw(){return Ls.x||Ls.y}function BM(e){return e==="x"||e==="y"?Ls[e]?null:(Ls[e]=!0,()=>{Ls[e]=!1}):Ls.x||Ls.y?null:(Ls.x=Ls.y=!0,()=>{Ls.x=Ls.y=!1})}function ow(e,t){const s=nw(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[s,o,()=>r.abort()]}function zM(e){return!(e.pointerType==="touch"||aw())}function IM(e,t,s={}){const[r,o,l]=ow(e,s);return r.forEach(h=>{let f=!1,m=!1,d;const _=()=>{h.removeEventListener("pointerleave",x)},v=C=>{d&&(d(C),d=void 0),_()},b=C=>{f=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),m&&(m=!1,v(C))},S=()=>{f=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},x=C=>{if(C.pointerType!=="touch"){if(f){m=!0;return}v(C)}},w=C=>{if(!zM(C))return;m=!1;const T=t(h,C);typeof T=="function"&&(d=T,h.addEventListener("pointerleave",x,o))};h.addEventListener("pointerenter",w,o),h.addEventListener("pointerdown",S,o)}),l}const lw=(e,t)=>t?e===t?!0:lw(e,t.parentElement):!1,Vg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function UM(e){return PM.has(e.tagName)||e.isContentEditable===!0}const HM=new Set(["INPUT","SELECT","TEXTAREA"]);function FM(e){return HM.has(e.tagName)||e.isContentEditable===!0}const $u=new WeakSet;function N1(e){return t=>{t.key==="Enter"&&e(t)}}function Xf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VM=(e,t)=>{const s=e.currentTarget;if(!s)return;const r=N1(()=>{if($u.has(s))return;Xf(s,"down");const o=N1(()=>{Xf(s,"up")}),l=()=>Xf(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",l,t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)};function k1(e){return Vg(e)&&!aw()}const T1=new WeakSet;function $M(e,t,s={}){const[r,o,l]=ow(e,s),h=f=>{const m=f.currentTarget;if(!k1(f)||T1.has(f))return;$u.add(m),s.stopPropagation&&T1.add(f);const d=t(m,f),_=(S,x)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),$u.has(m)&&$u.delete(m),k1(S)&&typeof d=="function"&&d(S,{success:x})},v=S=>{_(S,m===window||m===document||s.useGlobalTarget||lw(m,S.target))},b=S=>{_(S,!1)};window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",b,o)};return r.forEach(f=>{(s.useGlobalTarget?window:f).addEventListener("pointerdown",h,o),jM(f)&&(f.addEventListener("focus",d=>VM(d,o)),!UM(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),l}function $g(e){return h2(e)&&"ownerSVGElement"in e}const qu=new WeakMap;let Ku;const cw=(e,t,s)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:$g(r)&&"getBBox"in r?r.getBBox()[t]:r[s],qM=cw("inline","width","offsetWidth"),KM=cw("block","height","offsetHeight");function GM({target:e,borderBoxSize:t}){qu.get(e)?.forEach(s=>{s(e,{get width(){return qM(e,t)},get height(){return KM(e,t)}})})}function WM(e){e.forEach(GM)}function YM(){typeof ResizeObserver>"u"||(Ku=new ResizeObserver(WM))}function XM(e,t){Ku||YM();const s=nw(e);return s.forEach(r=>{let o=qu.get(r);o||(o=new Set,qu.set(r,o)),o.add(t),Ku?.observe(r)}),()=>{s.forEach(r=>{const o=qu.get(r);o?.delete(t),o?.size||Ku?.unobserve(r)})}}const Gu=new Set;let uo;function ZM(){uo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gu.forEach(t=>t(e))},window.addEventListener("resize",uo)}function QM(e){return Gu.add(e),uo||ZM(),()=>{Gu.delete(e),!Gu.size&&typeof uo=="function"&&(window.removeEventListener("resize",uo),uo=void 0)}}function M1(e,t){return typeof e=="function"?QM(e):XM(e,t)}function JM(e){return $g(e)&&e.tagName==="svg"}const e6=[...tw,Jt,Bs],t6=e=>e6.find(ew(e)),A1=()=>({translate:0,scale:1,origin:0,originPoint:0}),ho=()=>({x:A1(),y:A1()}),R1=()=>({min:0,max:0}),ai=()=>({x:R1(),y:R1()}),i6=new WeakMap;function Nh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ec(e){return typeof e=="string"||Array.isArray(e)}const qg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kg=["initial",...qg];function kh(e){return Nh(e.animate)||Kg.some(t=>ec(e[t]))}function uw(e){return!!(kh(e)||e.variants)}function s6(e,t,s){for(const r in t){const o=t[r],l=s[r];if(Ei(o))e.addValue(r,o);else if(Ei(l))e.addValue(r,_o(o,{owner:e}));else if(l!==o)if(e.hasValue(r)){const h=e.getValue(r);h.liveStyle===!0?h.jump(o):h.hasAnimated||h.set(o)}else{const h=e.getStaticValue(r);e.addValue(r,_o(h!==void 0?h:o,{owner:e}))}}for(const r in s)t[r]===void 0&&e.removeValue(r);return t}const Tp={current:null},hw={current:!1},n6=typeof window<"u";function r6(){if(hw.current=!0,!!n6)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Tp.current=e.matches;e.addEventListener("change",t),t()}else Tp.current=!1}const D1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ch={};function dw(e){ch=e}function a6(){return ch}class o6{scrapeMotionValuesFromProps(t,s,r){return{}}constructor({parent:t,props:s,presenceContext:r,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:h,visualState:f},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=Bg,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 S=Oi.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,bt.render(this.render,!1,!0))};const{latestValues:d,renderState:_}=f;this.latestValues=d,this.baseTarget={...d},this.initialValues=s.initial?{...d}:{},this.renderState=_,this.parent=t,this.props=s,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=m,this.blockInitialAnimation=!!h,this.isControllingVariants=kh(s),this.isVariantNode=uw(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:v,...b}=this.scrapeMotionValuesFromProps(s,{},this);for(const S in b){const x=b[S];d[S]!==void 0&&Ei(x)&&x.set(d[S])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,i6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hw.current||r6(),this.shouldReduceMotion=Tp.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(),Cr(this.notifyUpdate),Cr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&K2.has(t)&&this.current instanceof HTMLElement){const{factory:h,keyframes:f,times:m,ease:d,duration:_}=s.accelerate,v=new $2({element:this.current,name:t,keyframes:f,times:m,ease:d,duration:ls(_)}),b=h(v);this.valueSubscriptions.set(t,()=>{b(),v.cancel()});return}const r=Eo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",h=>{this.latestValues[t]=h,this.props.onUpdate&&bt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),l&&l(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ch){const s=ch[t];if(!s)continue;const{isEnabled:r,Feature:o}=s;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(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):ai()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let r=0;r<D1.length;r++){const o=D1[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,h=t[l];h&&(this.propEventSubscriptions[o]=this.on(o,h))}this.prevMotionValues=s6(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const r=this.values.get(t);s!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&s!==void 0&&(r=_o(s===null?void 0:s,{owner:this}),this.addValue(t,r)),r}readValue(t,s){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(u2(r)||d2(r))?r=parseFloat(r):!t6(r)&&Bs.test(s)&&(r=sw(t,s)),this.setBaseTarget(t,Ei(r)?r.get():r)),Ei(r)?r.get():r}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let r;if(typeof s=="string"||typeof s=="object"){const l=Pg(this.props,s,this.presenceContext?.custom);l&&(r=l[t])}if(s&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Ei(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new kg),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Fg.render(this.render)}}class fw extends o6{constructor(){super(...arguments),this.KeyframeResolver=LM}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const r=t.style;return r?r[s]:void 0}removeValueFromRenderState(t,{vars:s,style:r}){delete s[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ei(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Rr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function mw({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function l6({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function c6(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}function Zf(e){return e===void 0||e===1}function Mp({scale:e,scaleX:t,scaleY:s}){return!Zf(e)||!Zf(t)||!Zf(s)}function na(e){return Mp(e)||pw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function pw(e){return O1(e.x)||O1(e.y)}function O1(e){return e&&e!=="0%"}function uh(e,t,s){const r=e-s,o=t*r;return s+o}function L1(e,t,s,r,o){return o!==void 0&&(e=uh(e,o,r)),uh(e,s,r)+t}function Ap(e,t=0,s=1,r,o){e.min=L1(e.min,t,s,r,o),e.max=L1(e.max,t,s,r,o)}function gw(e,{x:t,y:s}){Ap(e.x,t.translate,t.scale,t.originPoint),Ap(e.y,s.translate,s.scale,s.originPoint)}const j1=.999999999999,B1=1.0000000000001;function u6(e,t,s,r=!1){const o=s.length;if(!o)return;t.x=t.y=1;let l,h;for(let f=0;f<o;f++){l=s[f],h=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Gs(e.x,-l.scroll.offset.x),Gs(e.y,-l.scroll.offset.y)),h&&(t.x*=h.x.scale,t.y*=h.y.scale,gw(e,h)),r&&na(l.latestValues)&&Wu(e,l.latestValues,l.layout?.layoutBox))}t.x<B1&&t.x>j1&&(t.x=1),t.y<B1&&t.y>j1&&(t.y=1)}function Gs(e,t){e.min+=t,e.max+=t}function z1(e,t,s,r,o=.5){const l=Nt(e.min,e.max,o);Ap(e,t,s,l,r)}function I1(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Wu(e,t,s){const r=s??e;z1(e.x,I1(t.x,r.x),t.scaleX,t.scale,t.originX),z1(e.y,I1(t.y,r.y),t.scaleY,t.scale,t.originY)}function _w(e,t){return mw(c6(e.getBoundingClientRect(),t))}function h6(e,t,s){const r=_w(e,s),{scroll:o}=t;return o&&(Gs(r.x,o.offset.x),Gs(r.y,o.offset.y)),r}const d6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},f6=wo.length;function m6(e,t,s){let r="",o=!0;for(let l=0;l<f6;l++){const h=wo[l],f=e[h];if(f===void 0)continue;let m=!0;if(typeof f=="number")m=f===(h.startsWith("scale")?1:0);else{const d=parseFloat(f);m=h.startsWith("scale")?d===1:d===0}if(!m||s){const d=rw(f,Hg[h]);if(!m){o=!1;const _=d6[h]||h;r+=`${_}(${d}) `}s&&(t[h]=d)}}return r=r.trim(),s?r=s(t,o?"":r):o&&(r="none"),r}function Gg(e,t,s){const{style:r,vars:o,transformOrigin:l}=e;let h=!1,f=!1;for(const m in t){const d=t[m];if(Eo.has(m)){h=!0;continue}else if(k2(m)){o[m]=d;continue}else{const _=rw(d,Hg[m]);m.startsWith("origin")?(f=!0,l[m]=_):r[m]=_}}if(t.transform||(h||s?r.transform=m6(t,e.transform,s):r.transform&&(r.transform="none")),f){const{originX:m="50%",originY:d="50%",originZ:_=0}=l;r.transformOrigin=`${m} ${d} ${_}`}}function vw(e,{style:t,vars:s},r,o){const l=e.style;let h;for(h in t)l[h]=t[h];o?.applyProjectionStyles(l,r);for(h in s)l.setProperty(h,s[h])}function P1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Nl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const s=P1(e,t.target.x),r=P1(e,t.target.y);return`${s}% ${r}%`}},p6={correct:(e,{treeScale:t,projectionDelta:s})=>{const r=e,o=Bs.parse(e);if(o.length>5)return r;const l=Bs.createTransformer(e),h=typeof o[0]!="number"?1:0,f=s.x.scale*t.x,m=s.y.scale*t.y;o[0+h]/=f,o[1+h]/=m;const d=Nt(f,m,.5);return typeof o[2+h]=="number"&&(o[2+h]/=d),typeof o[3+h]=="number"&&(o[3+h]/=d),l(o)}},Rp={borderRadius:{...Nl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Nl,borderTopRightRadius:Nl,borderBottomLeftRadius:Nl,borderBottomRightRadius:Nl,boxShadow:p6};function bw(e,{layout:t,layoutId:s}){return Eo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Rp[e]||e==="opacity")}function Wg(e,t,s){const r=e.style,o=t?.style,l={};if(!r)return l;for(const h in r)(Ei(r[h])||o&&Ei(o[h])||bw(h,e)||s?.getValue(h)?.liveStyle!==void 0)&&(l[h]=r[h]);return l}function g6(e){return window.getComputedStyle(e)}class _6 extends fw{constructor(){super(...arguments),this.type="html",this.renderInstance=vw}readValueFromInstance(t,s){if(Eo.has(s))return this.projection?.isProjecting?_p(s):B4(t,s);{const r=g6(t),o=(k2(s)?r.getPropertyValue(s):r[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return _w(t,s)}build(t,s,r){Gg(t,s,r.transformTemplate)}scrapeMotionValuesFromProps(t,s,r){return Wg(t,s,r)}}const v6={offset:"stroke-dashoffset",array:"stroke-dasharray"},b6={offset:"strokeDashoffset",array:"strokeDasharray"};function y6(e,t,s=1,r=0,o=!0){e.pathLength=1;const l=o?v6:b6;e[l.offset]=`${-r}`,e[l.array]=`${t} ${s}`}const x6=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function yw(e,{attrX:t,attrY:s,attrScale:r,pathLength:o,pathSpacing:l=1,pathOffset:h=0,...f},m,d,_){if(Gg(e,f,d),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:b}=e;v.transform&&(b.transform=v.transform,delete v.transform),(b.transform||v.transformOrigin)&&(b.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),b.transform&&(b.transformBox=_?.transformBox??"fill-box",delete v.transformBox);for(const S of x6)v[S]!==void 0&&(b[S]=v[S],delete v[S]);t!==void 0&&(v.x=t),s!==void 0&&(v.y=s),r!==void 0&&(v.scale=r),o!==void 0&&y6(v,o,l,h,!1)}const xw=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"]),Sw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function S6(e,t,s,r){vw(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(xw.has(o)?o:Ug(o),t.attrs[o])}function ww(e,t,s){const r=Wg(e,t,s);for(const o in e)if(Ei(e[o])||Ei(t[o])){const l=wo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[l]=e[o]}return r}class w6 extends fw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ai}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Eo.has(s)){const r=iw(s);return r&&r.default||0}return s=xw.has(s)?s:Ug(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,r){return ww(t,s,r)}build(t,s,r){yw(t,s,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,s,r,o){S6(t,s,r,o)}mount(t){this.isSVGTag=Sw(t.tagName),super.mount(t)}}const E6=Kg.length;function Ew(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?Ew(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<E6;s++){const r=Kg[s],o=e.props[r];(ec(o)||o===!1)&&(t[r]=o)}return t}function Cw(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}const C6=[...qg].reverse(),N6=qg.length;function k6(e){return t=>Promise.all(t.map(({animation:s,options:r})=>wM(e,s,r)))}function T6(e){let t=k6(e),s=U1(),r=!0,o=!1;const l=d=>(_,v)=>{const b=ha(e,v,d==="exit"?e.presenceContext?.custom:void 0);if(b){const{transition:S,transitionEnd:x,...w}=b;_={..._,...w,...x}}return _};function h(d){t=d(e)}function f(d){const{props:_}=e,v=Ew(e.parent)||{},b=[],S=new Set;let x={},w=1/0;for(let T=0;T<N6;T++){const O=C6[T],k=s[O],D=_[O]!==void 0?_[O]:v[O],U=ec(D),P=O===d?k.isActive:null;P===!1&&(w=T);let B=D===v[O]&&D!==_[O]&&U;if(B&&(r||o)&&e.manuallyAnimateOnMount&&(B=!1),k.protectedKeys={...x},!k.isActive&&P===null||!D&&!k.prevProp||Nh(D)||typeof D=="boolean")continue;if(O==="exit"&&k.isActive&&P!==!0){k.prevResolvedValues&&(x={...x,...k.prevResolvedValues});continue}const M=M6(k.prevProp,D);let F=M||O===d&&k.isActive&&!B&&U||T>w&&U,Y=!1;const $=Array.isArray(D)?D:[D];let G=$.reduce(l(O),{});P===!1&&(G={});const{prevResolvedValues:I={}}=k,ie={...I,...G},J=V=>{F=!0,S.has(V)&&(Y=!0,S.delete(V)),k.needsAnimating[V]=!0;const Z=e.getValue(V);Z&&(Z.liveStyle=!1)};for(const V in ie){const Z=G[V],Q=I[V];if(x.hasOwnProperty(V))continue;let R=!1;wp(Z)&&wp(Q)?R=!Cw(Z,Q):R=Z!==Q,R?Z!=null?J(V):S.add(V):Z!==void 0&&S.has(V)?J(V):k.protectedKeys[V]=!0}k.prevProp=D,k.prevResolvedValues=G,k.isActive&&(x={...x,...G}),(r||o)&&e.blockInitialAnimation&&(F=!1);const A=B&&M;F&&(!A||Y)&&b.push(...$.map(V=>{const Z={type:O};if(typeof V=="string"&&(r||o)&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:Q}=e,R=ha(Q,V);if(Q.enteringChildren&&R){const{delayChildren:te}=R.transition||{};Z.delay=G2(Q.enteringChildren,e,te)}}return{animation:V,options:Z}}))}if(S.size){const T={};if(typeof _.initial!="boolean"){const O=ha(e,Array.isArray(_.initial)?_.initial[0]:_.initial);O&&O.transition&&(T.transition=O.transition)}S.forEach(O=>{const k=e.getBaseTarget(O),D=e.getValue(O);D&&(D.liveStyle=!0),T[O]=k??null}),b.push({animation:T})}let C=!!b.length;return r&&(_.initial===!1||_.initial===_.animate)&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,o=!1,C?t(b):Promise.resolve()}function m(d,_){if(s[d].isActive===_)return Promise.resolve();e.variantChildren?.forEach(b=>b.animationState?.setActive(d,_)),s[d].isActive=_;const v=f(d);for(const b in s)s[b].protectedKeys={};return v}return{animateChanges:f,setActive:m,setAnimateFunction:h,getState:()=>s,reset:()=>{s=U1(),o=!0}}}function M6(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Cw(t,e):!1}function ia(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function U1(){return{animate:ia(!0),whileInView:ia(),whileHover:ia(),whileTap:ia(),whileDrag:ia(),whileFocus:ia(),exit:ia()}}function Dp(e,t){e.min=t.min,e.max=t.max}function Os(e,t){Dp(e.x,t.x),Dp(e.y,t.y)}function H1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Nw=1e-4,A6=1-Nw,R6=1+Nw,kw=.01,D6=0-kw,O6=0+kw;function Li(e){return e.max-e.min}function L6(e,t,s){return Math.abs(e-t)<=s}function F1(e,t,s,r=.5){e.origin=r,e.originPoint=Nt(t.min,t.max,e.origin),e.scale=Li(s)/Li(t),e.translate=Nt(s.min,s.max,e.origin)-e.originPoint,(e.scale>=A6&&e.scale<=R6||isNaN(e.scale))&&(e.scale=1),(e.translate>=D6&&e.translate<=O6||isNaN(e.translate))&&(e.translate=0)}function Kl(e,t,s,r){F1(e.x,t.x,s.x,r?r.originX:void 0),F1(e.y,t.y,s.y,r?r.originY:void 0)}function V1(e,t,s,r=0){const o=r?Nt(s.min,s.max,r):s.min;e.min=o+t.min,e.max=e.min+Li(t)}function j6(e,t,s,r){V1(e.x,t.x,s.x,r?.x),V1(e.y,t.y,s.y,r?.y)}function $1(e,t,s,r=0){const o=r?Nt(s.min,s.max,r):s.min;e.min=t.min-o,e.max=e.min+Li(t)}function hh(e,t,s,r){$1(e.x,t.x,s.x,r?.x),$1(e.y,t.y,s.y,r?.y)}function q1(e,t,s,r,o){return e-=t,e=uh(e,1/s,r),o!==void 0&&(e=uh(e,1/o,r)),e}function B6(e,t=0,s=1,r=.5,o,l=e,h=e){if(Ys.test(t)&&(t=parseFloat(t),t=Nt(h.min,h.max,t/100)-h.min),typeof t!="number")return;let f=Nt(l.min,l.max,r);e===l&&(f-=t),e.min=q1(e.min,t,s,f,o),e.max=q1(e.max,t,s,f,o)}function K1(e,t,[s,r,o],l,h){B6(e,t[s],t[r],t[o],t.scale,l,h)}const z6=["x","scaleX","originX"],I6=["y","scaleY","originY"];function G1(e,t,s,r){K1(e.x,t,z6,s?s.x:void 0,r?r.x:void 0),K1(e.y,t,I6,s?s.y:void 0,r?r.y:void 0)}function W1(e){return e.translate===0&&e.scale===1}function Tw(e){return W1(e.x)&&W1(e.y)}function Y1(e,t){return e.min===t.min&&e.max===t.max}function P6(e,t){return Y1(e.x,t.x)&&Y1(e.y,t.y)}function X1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Mw(e,t){return X1(e.x,t.x)&&X1(e.y,t.y)}function Z1(e){return Li(e.x)/Li(e.y)}function Q1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ks(e){return[e("x"),e("y")]}function U6(e,t,s){let r="";const o=e.x.translate/t.x,l=e.y.translate/t.y,h=s?.z||0;if((o||l||h)&&(r=`translate3d(${o}px, ${l}px, ${h}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:d,rotate:_,rotateX:v,rotateY:b,skewX:S,skewY:x}=s;d&&(r=`perspective(${d}px) ${r}`),_&&(r+=`rotate(${_}deg) `),v&&(r+=`rotateX(${v}deg) `),b&&(r+=`rotateY(${b}deg) `),S&&(r+=`skewX(${S}deg) `),x&&(r+=`skewY(${x}deg) `)}const f=e.x.scale*t.x,m=e.y.scale*t.y;return(f!==1||m!==1)&&(r+=`scale(${f}, ${m})`),r||"none"}const Aw=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],H6=Aw.length,J1=e=>typeof e=="string"?parseFloat(e):e,ey=e=>typeof e=="number"||Ne.test(e);function F6(e,t,s,r,o,l){o?(e.opacity=Nt(0,s.opacity??1,V6(r)),e.opacityExit=Nt(t.opacity??1,0,$6(r))):l&&(e.opacity=Nt(t.opacity??1,s.opacity??1,r));for(let h=0;h<H6;h++){const f=Aw[h];let m=ty(t,f),d=ty(s,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||ey(m)===ey(d)?(e[f]=Math.max(Nt(J1(m),J1(d),r),0),(Ys.test(d)||Ys.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||s.rotate)&&(e.rotate=Nt(t.rotate||0,s.rotate||0,r))}function ty(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const V6=Rw(0,.5,x2),$6=Rw(.5,.95,Es);function Rw(e,t,s){return r=>r<e?0:r>t?1:s(Ql(e,t,r))}function q6(e,t,s){const r=Ei(e)?e:_o(e);return r.start(Ig("",r,t,s)),r.animation}function tc(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}const K6=(e,t)=>e.depth-t.depth;class G6{constructor(){this.children=[],this.isDirty=!1}add(t){Cg(this.children,t),this.isDirty=!0}remove(t){nh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(K6),this.isDirty=!1,this.children.forEach(t)}}function W6(e,t){const s=Oi.now(),r=({timestamp:o})=>{const l=o-s;l>=t&&(Cr(r),e(l-t))};return bt.setup(r,!0),()=>Cr(r)}function Yu(e){return Ei(e)?e.get():e}class Y6{constructor(){this.members=[]}add(t){Cg(this.members,t);for(let s=this.members.length-1;s>=0;s--){const r=this.members[s];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(nh(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(nh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,s){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:l}=t.options;(o===void 0||o!==l)&&(t.resumeFrom=r,s&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.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 Xu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qf=["","X","Y","Z"],X6=1e3;let Z6=0;function Jf(e,t,s,r){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Dw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=Q2(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",bt,!(o||l))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Dw(r)}function Ow({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(h={},f=t?.()){this.id=Z6++,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(eA),this.nodes.forEach(aA),this.nodes.forEach(oA),this.nodes.forEach(tA)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new G6)}addEventListener(h,f){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new kg),this.eventHandlers.get(h).add(f)}notifyListeners(h,...f){const m=this.eventHandlers.get(h);m&&m.notify(...f)}hasListeners(h){return this.eventHandlers.has(h)}mount(h){if(this.instance)return;this.isSVG=$g(h)&&!JM(h),this.instance=h;const{layoutId:f,layout:m,visualElement:d}=this.options;if(d&&!d.current&&d.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||f)&&(this.isLayoutDirty=!0),e){let _,v=0;const b=()=>this.root.updateBlockedByResize=!1;bt.read(()=>{v=window.innerWidth}),e(h,()=>{const S=window.innerWidth;S!==v&&(v=S,this.root.updateBlockedByResize=!0,_&&_(),_=W6(b,250),Xu.hasAnimatedSinceResize&&(Xu.hasAnimatedSinceResize=!1,this.nodes.forEach(ny)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&d&&(f||m)&&this.addEventListener("didUpdate",({delta:_,hasLayoutChanged:v,hasRelativeLayoutChanged:b,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||dA,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=d.getProps(),T=!this.targetLayout||!Mw(this.targetLayout,S),O=!v&&b;if(this.options.layoutRoot||this.resumeFrom||O||v&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...zg(x,"layout"),onPlay:w,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(_,O)}else v||ny(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cr(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(lA),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Dw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let _=0;_<this.path.length;_++){const v=this.path[_];v.shouldResetTransform=!0,(typeof v.latestValues.x=="string"||typeof v.latestValues.y=="string")&&(v.isLayoutDirty=!0),v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:f,layout:m}=this.options;if(f===void 0&&!m)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),h&&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(sA),this.nodes.forEach(iy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(sy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nA),this.nodes.forEach(rA),this.nodes.forEach(Q6),this.nodes.forEach(J6)):this.nodes.forEach(sy),this.clearAllSnapshots();const f=Oi.now();Si.delta=Zs(0,1e3/60,f-Si.timestamp),Si.timestamp=f,Si.isProcessing=!0,$f.update.process(Si),$f.preRender.process(Si),$f.render.process(Si),Si.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iA),this.sharedNodes.forEach(cA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Li(this.snapshot.measuredBox.x)&&!Li(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 h=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ai()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(f=!1),f&&this.instance){const m=r(this.instance);this.scroll={animationId:this.root.animationId,phase:h,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!o)return;const h=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!Tw(this.projectionDelta),m=this.getTransformTemplate(),d=m?m(this.latestValues,""):void 0,_=d!==this.prevTransformTemplateValue;h&&this.instance&&(f||na(this.latestValues)||_)&&(o(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const f=this.measurePageBox();let m=this.removeElementScroll(f);return h&&(m=this.removeTransform(m)),fA(m),{animationId:this.root.animationId,measuredBox:f,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:h}=this.options;if(!h)return ai();const f=h.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(mA))){const{scroll:d}=this.root;d&&(Gs(f.x,d.offset.x),Gs(f.y,d.offset.y))}return f}removeElementScroll(h){const f=ai();if(Os(f,h),this.scroll?.wasRoot)return f;for(let m=0;m<this.path.length;m++){const d=this.path[m],{scroll:_,options:v}=d;d!==this.root&&_&&v.layoutScroll&&(_.wasRoot&&Os(f,h),Gs(f.x,_.offset.x),Gs(f.y,_.offset.y))}return f}applyTransform(h,f=!1,m){const d=m||ai();Os(d,h);for(let _=0;_<this.path.length;_++){const v=this.path[_];!f&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Gs(d.x,-v.scroll.offset.x),Gs(d.y,-v.scroll.offset.y)),na(v.latestValues)&&Wu(d,v.latestValues,v.layout?.layoutBox)}return na(this.latestValues)&&Wu(d,this.latestValues,this.layout?.layoutBox),d}removeTransform(h){const f=ai();Os(f,h);for(let m=0;m<this.path.length;m++){const d=this.path[m];if(!na(d.latestValues))continue;let _;d.instance&&(Mp(d.latestValues)&&d.updateSnapshot(),_=ai(),Os(_,d.measurePageBox())),G1(f,d.latestValues,d.snapshot?.layoutBox,_)}return na(this.latestValues)&&G1(f,this.latestValues),f}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.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!==Si.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==f;if(!(h||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:_,layoutId:v}=this.options;if(!this.layout||!(_||v))return;this.resolvedRelativeTargetAt=Si.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ai(),this.targetWithTransforms=ai()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),j6(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Os(this.target,this.layout.layoutBox),gw(this.target,this.targetDelta)):Os(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Mp(this.parent.latestValues)||pw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(h,f,m){this.relativeParent=h,this.linkedParentVersion=h.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ai(),this.relativeTargetOrigin=ai(),hh(this.relativeTargetOrigin,f,m,this.options.layoutAnchor||void 0),Os(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const h=this.getLead(),f=!!this.resumingFrom||this!==h;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Si.timestamp&&(m=!1),m)return;const{layout:d,layoutId:_}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||_))return;Os(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,b=this.treeScale.y;u6(this.layoutCorrected,this.treeScale,this.path,f),h.layout&&!h.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(h.target=h.layout.layoutBox,h.targetWithTransforms=ai());const{target:S}=h;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(H1(this.prevProjectionDelta.x,this.projectionDelta.x),H1(this.prevProjectionDelta.y,this.projectionDelta.y)),Kl(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==b||!Q1(this.projectionDelta.x,this.prevProjectionDelta.x)||!Q1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){if(this.options.visualElement?.scheduleRender(),h){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ho(),this.projectionDelta=ho(),this.projectionDeltaWithTransform=ho()}setAnimationOrigin(h,f=!1){const m=this.snapshot,d=m?m.latestValues:{},_={...this.latestValues},v=ho();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const b=ai(),S=m?m.source:void 0,x=this.layout?this.layout.source:void 0,w=S!==x,C=this.getStack(),T=!C||C.members.length<=1,O=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(hA));this.animationProgress=0;let k;this.mixTargetDelta=D=>{const U=D/1e3;ry(v.x,h.x,U),ry(v.y,h.y,U),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hh(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),uA(this.relativeTarget,this.relativeTargetOrigin,b,U),k&&P6(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=ai()),Os(k,this.relativeTarget)),w&&(this.animationValues=_,F6(_,d,this.latestValues,U,O,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Cr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=bt.update(()=>{Xu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_o(0)),this.motionValue.jump(0,!1),this.currentAnimation=q6(this.motionValue,[0,1e3],{...h,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),h.onUpdate&&h.onUpdate(f)},onStop:()=>{},onComplete:()=>{h.onComplete&&h.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 h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(X6),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:f,target:m,layout:d,latestValues:_}=h;if(!(!f||!m||!d)){if(this!==h&&this.layout&&d&&Lw(this.options.animationType,this.layout.layoutBox,d.layoutBox)){m=this.target||ai();const v=Li(this.layout.layoutBox.x);m.x.min=h.target.x.min,m.x.max=m.x.min+v;const b=Li(this.layout.layoutBox.y);m.y.min=h.target.y.min,m.y.max=m.y.min+b}Os(f,m),Wu(f,_),Kl(this.projectionDeltaWithTransform,this.layoutCorrected,f,_)}}registerSharedNode(h,f){this.sharedNodes.has(h)||this.sharedNodes.set(h,new Y6),this.sharedNodes.get(h).add(f);const d=f.options.initialPromotionConfig;f.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(f):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){const{layoutId:h}=this.options;return h?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:h}=this.options;return h?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:f,preserveFollowOpacity:m}={}){const d=this.getStack();d&&d.promote(this,m),h&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let f=!1;const{latestValues:m}=h;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(f=!0),!f)return;const d={};m.z&&Jf("z",h,d,this.animationValues);for(let _=0;_<Qf.length;_++)Jf(`rotate${Qf[_]}`,h,d,this.animationValues),Jf(`skew${Qf[_]}`,h,d,this.animationValues);h.render();for(const _ in d)h.setStaticValue(_,d[_]),this.animationValues&&(this.animationValues[_]=d[_]);h.scheduleRender()}applyProjectionStyles(h,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){h.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,h.visibility="",h.opacity="",h.pointerEvents=Yu(f?.pointerEvents)||"",h.transform=m?m(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Yu(f?.pointerEvents)||""),this.hasProjected&&!na(this.latestValues)&&(h.transform=m?m({},""):"none",this.hasProjected=!1);return}h.visibility="";const _=d.animationValues||d.latestValues;this.applyTransformsToTarget();let v=U6(this.projectionDeltaWithTransform,this.treeScale,_);m&&(v=m(_,v)),h.transform=v;const{x:b,y:S}=this.projectionDelta;h.transformOrigin=`${b.origin*100}% ${S.origin*100}% 0`,d.animationValues?h.opacity=d===this?_.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:h.opacity=d===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const x in Rp){if(_[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:T}=Rp[x],O=v==="none"?_[x]:w(_[x],d);if(C){const k=C.length;for(let D=0;D<k;D++)h[C[D]]=O}else T?this.options.visualElement.renderState.vars[x]=O:h[x]=O}this.options.layoutId&&(h.pointerEvents=d===this?Yu(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>h.currentAnimation?.stop()),this.root.nodes.forEach(iy),this.root.sharedNodes.clear()}}}function Q6(e){e.updateLayout()}function J6(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,l=t.source!==e.layout.source;if(o==="size")Ks(_=>{const v=l?t.measuredBox[_]:t.layoutBox[_],b=Li(v);v.min=s[_].min,v.max=v.min+b});else if(o==="x"||o==="y"){const _=o==="x"?"y":"x";Dp(l?t.measuredBox[_]:t.layoutBox[_],s[_])}else Lw(o,t.layoutBox,s)&&Ks(_=>{const v=l?t.measuredBox[_]:t.layoutBox[_],b=Li(s[_]);v.max=v.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[_].max=e.relativeTarget[_].min+b)});const h=ho();Kl(h,s,t.layoutBox);const f=ho();l?Kl(f,e.applyTransform(r,!0),t.measuredBox):Kl(f,s,t.layoutBox);const m=!Tw(h);let d=!1;if(!e.resumeFrom){const _=e.getClosestProjectingParent();if(_&&!_.resumeFrom){const{snapshot:v,layout:b}=_;if(v&&b){const S=e.options.layoutAnchor||void 0,x=ai();hh(x,t.layoutBox,v.layoutBox,S);const w=ai();hh(w,s,b.layoutBox,S),Mw(x,w)||(d=!0),_.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=_)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:f,layoutDelta:h,hasLayoutChanged:m,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function eA(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 tA(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iA(e){e.clearSnapshot()}function iy(e){e.clearMeasurements()}function sA(e){e.isLayoutDirty=!0,e.updateLayout()}function sy(e){e.isLayoutDirty=!1}function nA(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ny(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function aA(e){e.resolveTargetDelta()}function oA(e){e.calcProjection()}function lA(e){e.resetSkewAndRotation()}function cA(e){e.removeLeadSnapshot()}function ry(e,t,s){e.translate=Nt(t.translate,0,s),e.scale=Nt(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function ay(e,t,s,r){e.min=Nt(t.min,s.min,r),e.max=Nt(t.max,s.max,r)}function uA(e,t,s,r){ay(e.x,t.x,s.x,r),ay(e.y,t.y,s.y,r)}function hA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const dA={duration:.45,ease:[.4,0,.1,1]},oy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ly=oy("applewebkit/")&&!oy("chrome/")?Math.round:Es;function cy(e){e.min=ly(e.min),e.max=ly(e.max)}function fA(e){cy(e.x),cy(e.y)}function Lw(e,t,s){return e==="position"||e==="preserve-aspect"&&!L6(Z1(t),Z1(s),.2)}function mA(e){return e!==e.root&&e.scroll?.wasRoot}const pA=Ow({attachResizeListener:(e,t)=>tc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),em={current:void 0},jw=Ow({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!em.current){const e=new pA({});e.mount(window),e.setOptions({layoutScroll:!0}),em.current=e}return em.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Bw=N.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function gA(e=!0){const t=N.useContext(Eg);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:r,register:o}=t,l=N.useId();N.useEffect(()=>{if(e)return o(l)},[e]);const h=N.useCallback(()=>e&&r&&r(l),[l,r,e]);return!s&&r?[!1,h]:[!0]}const zw=N.createContext({strict:!1}),uy={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 hy=!1;function _A(){if(hy)return;const e={};for(const t in uy)e[t]={isEnabled:s=>uy[t].some(r=>!!s[r])};dw(e),hy=!0}function Iw(){return _A(),a6()}function vA(e){const t=Iw();for(const s in e)t[s]={...t[s],...e[s]};dw(t)}const bA=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 dh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bA.has(e)}let Pw=e=>!dh(e);function yA(e){typeof e=="function"&&(Pw=t=>t.startsWith("on")?!dh(t):e(t))}try{yA(require("@emotion/is-prop-valid").default)}catch{}function xA(e,t,s){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Ei(e[o])||(Pw(o)||s===!0&&dh(o)||!t&&!dh(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Th=N.createContext({});function SA(e,t){if(kh(e)){const{initial:s,animate:r}=e;return{initial:s===!1||ec(s)?s:void 0,animate:ec(r)?r:void 0}}return e.inherit!==!1?t:{}}function wA(e){const{initial:t,animate:s}=SA(e,N.useContext(Th));return N.useMemo(()=>({initial:t,animate:s}),[dy(t),dy(s)])}function dy(e){return Array.isArray(e)?e.join(" "):e}const Yg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uw(e,t,s){for(const r in t)!Ei(t[r])&&!bw(r,s)&&(e[r]=t[r])}function EA({transformTemplate:e},t){return N.useMemo(()=>{const s=Yg();return Gg(s,t,e),Object.assign({},s.vars,s.style)},[t])}function CA(e,t){const s=e.style||{},r={};return Uw(r,s,e),Object.assign(r,EA(e,t)),r}function NA(e,t){const s={},r=CA(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=r,s}const Hw=()=>({...Yg(),attrs:{}});function kA(e,t,s,r){const o=N.useMemo(()=>{const l=Hw();return yw(l,t,Sw(r),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};Uw(l,e.style,e),o.style={...l,...o.style}}return o}const TA=["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 Xg(e){return typeof e!="string"||e.includes("-")?!1:!!(TA.indexOf(e)>-1||/[A-Z]/u.test(e))}function MA(e,t,s,{latestValues:r},o,l=!1,h){const m=(h??Xg(e)?kA:NA)(t,r,o,e),d=xA(t,typeof e=="string",l),_=e!==N.Fragment?{...d,...m,ref:s}:{},{children:v}=t,b=N.useMemo(()=>Ei(v)?v.get():v,[v]);return N.createElement(e,{..._,children:b})}function AA({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,o){return{latestValues:RA(s,r,o,e),renderState:t()}}function RA(e,t,s,r){const o={},l=r(e,{});for(const b in l)o[b]=Yu(l[b]);let{initial:h,animate:f}=e;const m=kh(e),d=uw(e);t&&d&&!m&&e.inherit!==!1&&(h===void 0&&(h=t.initial),f===void 0&&(f=t.animate));let _=s?s.initial===!1:!1;_=_||h===!1;const v=_?f:h;if(v&&typeof v!="boolean"&&!Nh(v)){const b=Array.isArray(v)?v:[v];for(let S=0;S<b.length;S++){const x=Pg(e,b[S]);if(x){const{transitionEnd:w,transition:C,...T}=x;for(const O in T){let k=T[O];if(Array.isArray(k)){const D=_?k.length-1:0;k=k[D]}k!==null&&(o[O]=k)}for(const O in w)o[O]=w[O]}}}return o}const Fw=e=>(t,s)=>{const r=N.useContext(Th),o=N.useContext(Eg),l=()=>AA(e,t,r,o);return s?l():TT(l)},DA=Fw({scrapeMotionValuesFromProps:Wg,createRenderState:Yg}),OA=Fw({scrapeMotionValuesFromProps:ww,createRenderState:Hw}),LA=Symbol.for("motionComponentSymbol");function jA(e,t,s){const r=N.useRef(s);N.useInsertionEffect(()=>{r.current=s});const o=N.useRef(null);return N.useCallback(l=>{l&&e.onMount?.(l);const h=r.current;if(typeof h=="function")if(l){const f=h(l);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):h(l);else h&&(h.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const Vw=N.createContext({});function lo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function BA(e,t,s,r,o,l){const{visualElement:h}=N.useContext(Th),f=N.useContext(zw),m=N.useContext(Eg),d=N.useContext(Bw),_=d.reducedMotion,v=d.skipAnimations,b=N.useRef(null),S=N.useRef(!1);r=r||f.renderer,!b.current&&r&&(b.current=r(e,{visualState:t,parent:h,props:s,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:_,skipAnimations:v,isSVG:l}),S.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const x=b.current,w=N.useContext(Vw);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&zA(b.current,s,o,w);const C=N.useRef(!1);N.useInsertionEffect(()=>{x&&C.current&&x.update(s,m)});const T=s[Z2],O=N.useRef(!!T&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return AT(()=>{S.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),O.current&&x.animationState&&x.animationState.animateChanges())}),N.useEffect(()=>{x&&(!O.current&&x.animationState&&x.animationState.animateChanges(),O.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),O.current=!1),x.enteringChildren=void 0)}),x}function zA(e,t,s,r){const{layoutId:o,layout:l,drag:h,dragConstraints:f,layoutScroll:m,layoutRoot:d,layoutAnchor:_,layoutCrossfade:v}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:$w(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!h||f&&lo(f),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:v,layoutScroll:m,layoutRoot:d,layoutAnchor:_})}function $w(e){if(e)return e.options.allowProjection!==!1?e.projection:$w(e.parent)}function tm(e,{forwardMotionProps:t=!1,type:s}={},r,o){r&&vA(r);const l=s?s==="svg":Xg(e),h=l?OA:DA;function f(d,_){let v;const b={...N.useContext(Bw),...d,layoutId:IA(d)},{isStatic:S}=b,x=wA(d),w=h(d,S);if(!S&&typeof window<"u"){PA();const C=UA(b);v=C.MeasureLayout,x.visualElement=BA(e,w,b,o,C.ProjectionNode,l)}return u.jsxs(Th.Provider,{value:x,children:[v&&x.visualElement?u.jsx(v,{visualElement:x.visualElement,...b}):null,MA(e,d,jA(w,x.visualElement,_),w,S,t,l)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=N.forwardRef(f);return m[LA]=e,m}function IA({layoutId:e}){const t=N.useContext(c2).id;return t&&e!==void 0?t+"-"+e:e}function PA(e,t){N.useContext(zw).strict}function UA(e){const t=Iw(),{drag:s,layout:r}=t;if(!s&&!r)return{};const o={...s,...r};return{MeasureLayout:s?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function HA(e,t){if(typeof Proxy>"u")return tm;const s=new Map,r=(l,h)=>tm(l,h,e,t),o=(l,h)=>r(l,h);return new Proxy(o,{get:(l,h)=>h==="create"?r:(s.has(h)||s.set(h,tm(h,void 0,e,t)),s.get(h))})}const FA=(e,t)=>t.isSVG??Xg(e)?new w6(t):new _6(t,{allowProjection:e!==N.Fragment});class VA extends Rr{constructor(t){super(t),t.animationState||(t.animationState=T6(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Nh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let $A=0;class qA extends Rr{constructor(){super(...arguments),this.id=$A++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:l,custom:h}=this.node.getProps();if(typeof l=="string"){const f=ha(this.node,l,h);if(f){const{transition:m,transitionEnd:d,..._}=f;for(const v in _)this.node.getValue(v)?.jump(_[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);s&&!t&&o.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const KA={animation:{Feature:VA},exit:{Feature:qA}};function cc(e){return{point:{x:e.pageX,y:e.pageY}}}const GA=e=>t=>Vg(t)&&e(t,cc(t));function Gl(e,t,s,r){return tc(e,t,GA(s),r)}const qw=({current:e})=>e?e.ownerDocument.defaultView:null,fy=(e,t)=>Math.abs(e-t);function WA(e,t){const s=fy(e.x,t.x),r=fy(e.y,t.y);return Math.sqrt(s**2+r**2)}const my=new Set(["auto","scroll"]);class Kw{constructor(t,s,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:h=3,element:f}={}){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=S=>{this.handleScroll(S.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ou(this.lastRawMoveEventInfo,this.transformPagePoint));const S=im(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=WA(S.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:C}=S,{timestamp:T}=Si;this.history.push({...C,timestamp:T});const{onStart:O,onMove:k}=this.handlers;x||(O&&O(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,S)},this.handlePointerMove=(S,x)=>{this.lastMoveEvent=S,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Ou(x,this.transformPagePoint),bt.update(this.updatePoint,!0)},this.handlePointerUp=(S,x)=>{this.end();const{onEnd:w,onSessionEnd:C,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=im(S.type==="pointercancel"?this.lastMoveEventInfo:Ou(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(S,O),C&&C(S,O)},!Vg(t))return;this.dragSnapToOrigin=l,this.handlers=s,this.transformPagePoint=r,this.distanceThreshold=h,this.contextWindow=o||window;const m=cc(t),d=Ou(m,this.transformPagePoint),{point:_}=d,{timestamp:v}=Si;this.history=[{..._,timestamp:v}];const{onSessionStart:b}=s;b&&b(t,im(d,this.history)),this.removeListeners=ac(Gl(this.contextWindow,"pointermove",this.handlePointerMove),Gl(this.contextWindow,"pointerup",this.handlePointerUp),Gl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let s=t.parentElement;for(;s;){const r=getComputedStyle(s);(my.has(r.overflowX)||my.has(r.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:o.x-s.x,y:o.y-s.y};l.x===0&&l.y===0||(r?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,o),bt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cr(this.updatePoint)}}function Ou(e,t){return t?{point:t(e.point)}:e}function py(e,t){return{x:e.x-t.x,y:e.y-t.y}}function im({point:e},t){return{point:e,delta:py(e,Gw(t)),offset:py(e,YA(t)),velocity:XA(t,.1)}}function YA(e){return e[0]}function Gw(e){return e[e.length-1]}function XA(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null;const o=Gw(e);for(;s>=0&&(r=e[s],!(o.timestamp-r.timestamp>ls(t)));)s--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>ls(t)*2&&(r=e[1]);const l=ws(o.timestamp-r.timestamp);if(l===0)return{x:0,y:0};const h={x:(o.x-r.x)/l,y:(o.y-r.y)/l};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function ZA(e,{min:t,max:s},r){return t!==void 0&&e<t?e=r?Nt(t,e,r.min):Math.max(e,t):s!==void 0&&e>s&&(e=r?Nt(s,e,r.max):Math.min(e,s)),e}function gy(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function QA(e,{top:t,left:s,bottom:r,right:o}){return{x:gy(e.x,s,o),y:gy(e.y,t,r)}}function _y(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function JA(e,t){return{x:_y(e.x,t.x),y:_y(e.y,t.y)}}function eR(e,t){let s=.5;const r=Li(e),o=Li(t);return o>r?s=Ql(t.min,t.max-r,e.min):r>o&&(s=Ql(e.min,e.max-o,t.min)),Zs(0,1,s)}function tR(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Op=.35;function iR(e=Op){return e===!1?e=0:e===!0&&(e=Op),{x:vy(e,"left","right"),y:vy(e,"top","bottom")}}function vy(e,t,s){return{min:by(e,t),max:by(e,s)}}function by(e,t){return typeof e=="number"?e:e[t]||0}const sR=new WeakMap;class nR{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=ai(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=v=>{s&&this.snapToCursor(cc(v).point),this.stopAnimation()},h=(v,b)=>{const{drag:S,dragPropagation:x,onDragStart:w}=this.getProps();if(S&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=BM(S),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ks(T=>{let O=this.getAxisMotionValue(T).get()||0;if(Ys.test(O)){const{projection:k}=this.visualElement;if(k&&k.layout){const D=k.layout.layoutBox[T];D&&(O=Li(D)*(parseFloat(O)/100))}}this.originPoint[T]=O}),w&&bt.update(()=>w(v,b),!1,!0),Ep(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(v,b)=>{this.latestPointerEvent=v,this.latestPanInfo=b;const{dragPropagation:S,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:T}=b;if(x&&this.currentDirection===null){this.currentDirection=aR(T),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",b.point,T),this.updateAxis("y",b.point,T),this.visualElement.render(),C&&bt.update(()=>C(v,b),!1,!0)},m=(v,b)=>{this.latestPointerEvent=v,this.latestPanInfo=b,this.stop(v,b),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:_}=this.getProps();this.panSession=new Kw(t,{onSessionStart:l,onStart:h,onMove:f,onSessionEnd:m,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:_,distanceThreshold:r,contextWindow:qw(this.visualElement),element:this.visualElement.current})}stop(t,s){const r=t||this.latestPointerEvent,o=s||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!r)return;const{velocity:h}=o;this.startAnimation(h);const{onDragEnd:f}=this.getProps();f&&bt.postRender(()=>f(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,r){const{drag:o}=this.getProps();if(!r||!Lu(t,o,this.currentDirection))return;const l=this.getAxisMotionValue(t);let h=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(h=ZA(h,this.constraints[t],this.elastic[t])),l.set(h)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&lo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=QA(r.layoutBox,t):this.constraints=!1,this.elastic=iR(s),o!==this.constraints&&!lo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ks(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=tR(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!lo(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=h6(r,o.root,this.visualElement.getTransformPagePoint());let h=JA(o.layout.layoutBox,l);if(s){const f=s(l6(h));this.hasMutatedConstraints=!!f,f&&(h=mw(f))}return h}startAnimation(t){const{drag:s,dragMomentum:r,dragElastic:o,dragTransition:l,dragSnapToOrigin:h,onDragTransitionEnd:f}=this.getProps(),m=this.constraints||{},d=Ks(_=>{if(!Lu(_,s,this.currentDirection))return;let v=m&&m[_]||{};(h===!0||h===_)&&(v={min:0,max:0});const b=o?200:1e6,S=o?40:1e7,x={type:"inertia",velocity:r?t[_]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...l,...v};return this.startAxisValueAnimation(_,x)});return Promise.all(d).then(f)}startAxisValueAnimation(t,s){const r=this.getAxisMotionValue(t);return Ep(this.visualElement,t),r.start(Ig(t,r,0,s,this.visualElement,!1))}stopAnimation(){Ks(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[s];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ks(s=>{const{drag:r}=this.getProps();if(!Lu(s,r,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(s);if(o&&o.layout){const{min:h,max:f}=o.layout.layoutBox[s],m=l.get()||0;l.set(t[s]-Nt(h,f,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:r}=this.visualElement;if(!lo(s)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ks(h=>{const f=this.getAxisMotionValue(h);if(f&&this.constraints!==!1){const m=f.get();o[h]=eR({min:m,max:m},this.constraints[h])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ks(h=>{if(!Lu(h,t,null))return;const f=this.getAxisMotionValue(h),{min:m,max:d}=this.constraints[h];f.set(Nt(m,d,o[h]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;sR.set(this.visualElement,this);const t=this.visualElement.current,s=Gl(t,"pointerdown",d=>{const{drag:_,dragListener:v=!0}=this.getProps(),b=d.target,S=b!==t&&FM(b);_&&v&&!S&&this.start(d)});let r;const o=()=>{const{dragConstraints:d}=this.getProps();lo(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=rR(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,h=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),bt.read(o);const f=tc(window,"resize",()=>this.scalePositionWithinConstraints()),m=l.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:_})=>{this.isDragging&&_&&(Ks(v=>{const b=this.getAxisMotionValue(v);b&&(this.originPoint[v]+=d[v].translate,b.set(b.get()+d[v].translate))}),this.visualElement.render())}));return()=>{f(),s(),h(),m&&m(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:h=Op,dragMomentum:f=!0}=t;return{...t,drag:s,dragDirectionLock:r,dragPropagation:o,dragConstraints:l,dragElastic:h,dragMomentum:f}}}function yy(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function rR(e,t,s){const r=M1(e,yy(s)),o=M1(t,yy(s));return()=>{r(),o()}}function Lu(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function aR(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class oR extends Rr{constructor(t){super(t),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new nR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Es}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const sm=e=>(t,s)=>{e&&bt.update(()=>e(t,s),!1,!0)};class lR extends Rr{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(t){this.session=new Kw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qw(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:sm(t),onStart:sm(s),onMove:sm(r),onEnd:(l,h)=>{delete this.session,o&&bt.postRender(()=>o(l,h))}}}mount(){this.removePointerDownListener=Gl(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 nm=!1;class cR extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r,layoutId:o}=this.props,{projection:l}=t;l&&(s.group&&s.group.add(l),r&&r.register&&o&&r.register(l),nm&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:r,drag:o,isPresent:l}=this.props,{projection:h}=r;return h&&(h.isPresent=l,t.layoutDependency!==s&&h.setOptions({...h.options,layoutDependency:s}),nm=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==l?h.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?h.promote():h.relegate()||bt.postRender(()=>{const f=h.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=s,r.root.didUpdate(),Fg.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r}=this.props,{projection:o}=t;nm=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ww(e){const[t,s]=gA(),r=N.useContext(c2);return u.jsx(cR,{...e,layoutGroup:r,switchLayoutGroup:N.useContext(Vw),isPresent:t,safeToRemove:s})}const uR={pan:{Feature:lR},drag:{Feature:oR,ProjectionNode:jw,MeasureLayout:Ww}};function xy(e,t,s){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,l=r[o];l&&bt.postRender(()=>l(t,cc(t)))}class hR extends Rr{mount(){const{current:t}=this.node;t&&(this.unmount=IM(t,(s,r)=>(xy(this.node,r,"Start"),o=>xy(this.node,o,"End"))))}unmount(){}}class dR extends Rr{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=ac(tc(this.node.current,"focus",()=>this.onFocus()),tc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Sy(e,t,s){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),l=r[o];l&&bt.postRender(()=>l(t,cc(t)))}class fR extends Rr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:r}=this.node.props;this.unmount=$M(t,(o,l)=>(Sy(this.node,l,"Start"),(h,{success:f})=>Sy(this.node,h,f?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:r?.tap===!1})}unmount(){}}const Lp=new WeakMap,rm=new WeakMap,mR=e=>{const t=Lp.get(e.target);t&&t(e)},pR=e=>{e.forEach(mR)};function gR({root:e,...t}){const s=e||document;rm.has(s)||rm.set(s,{});const r=rm.get(s),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(pR,{root:e,...t})),r[o]}function _R(e,t,s){const r=gR(t);return Lp.set(e,s),r.observe(e),()=>{Lp.delete(e),r.unobserve(e)}}const vR={some:0,all:1};class bR extends Rr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:r,amount:o="some",once:l}=t,h={root:s?s.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:vR[o]},f=m=>{const{isIntersecting:d}=m;if(this.isInView===d||(this.isInView=d,l&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:_,onViewportLeave:v}=this.node.getProps(),b=d?_:v;b&&b(m)};this.stopObserver=_R(this.node.current,h,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(yR(t,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function yR({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const xR={inView:{Feature:bR},tap:{Feature:fR},focus:{Feature:dR},hover:{Feature:hR}},SR={layout:{ProjectionNode:jw,MeasureLayout:Ww}},wR={...KA,...xR,...uR,...SR},am=HA(wR,FA),Ve=({label:e,children:t,variant:s="primary",size:r="medium",icon:o,onClick:l,removable:h=!1,className:f,maxWidth:m,appearance:d,onRemove:_,isLoading:v=!1})=>{const b=ER(s),S=d??(s==="outline"?"outline":"solid"),x=e??t,w=!!l,C={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"}},T={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},O=D=>{D.stopPropagation(),l?.()},k=D=>{D.stopPropagation(),_?.()};return u.jsxs(am.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&&b==="primary"?"#111111d1":void 0,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:O,style:{maxWidth:m},className:ge("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",C[b][S],T[r],w&&"cursor-pointer",f),children:[v?u.jsx(am.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:u.jsx(po,{className:"size-3.5"})}):o&&u.jsx("span",{className:"flex-shrink-0",children:o}),u.jsx("span",{className:"min-w-0 truncate",children:x}),h&&u.jsx(am.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:k,type:"button",children:u.jsx(Mr,{className:"size-3.5"})})]})};function ER(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const CR=WS("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 yt({className:e,variant:t,...s}){return u.jsx("div",{className:ge(CR({variant:t,className:e})),...s})}function Qs({className:e,...t}){return u.jsx("div",{className:ge("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function Js({className:e,...t}){return u.jsx("div",{className:ge("grid gap-1.5 p-4",e),...t})}function en({className:e,...t}){return u.jsx("h3",{className:ge("text-sm font-semibold tracking-tight",e),...t})}function Nr({className:e,...t}){return u.jsx("p",{className:ge("text-sm text-muted-foreground",e),...t})}function tn({className:e,...t}){return u.jsx("div",{className:ge("p-4 pt-0",e),...t})}const wy=100;function NR(){const[e,t]=N.useState([]),[s,r]=N.useState(!1),o=N.useRef(new Set);N.useEffect(()=>{const h=new EventSource("/api/agent/tool-calls/stream");return h.addEventListener("open",()=>r(!0)),h.addEventListener("error",()=>r(!1)),h.addEventListener("tool-call",f=>{try{const m=JSON.parse(f.data);t(d=>{if(o.current.has(m.id))return d;o.current.add(m.id);const _=[...d,m];return _.length>wy&&_.splice(0,_.length-wy),_})}catch{}}),()=>{h.close()}},[]);const l=[...e].reverse();return u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mo,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:"Live MCP Tool Calls"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ve,{variant:"outline",size:"small",icon:u.jsx("span",{className:ge("inline-block size-1.5 rounded-full",s?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:s?"live":"reconnecting…"})]}),u.jsx(Nr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),u.jsx(tn,{className:"p-0",children:l.length?u.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:l.map(h=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:h.tool}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[u.jsxs("span",{children:[h.durationMs," ms"]}),u.jsx(Ve,{variant:h.status==="ok"?"success":"error",appearance:"outline",size:"small",children:h.status})]})]}),h.args?u.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:h.args}):null,h.error?u.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:h.error}):null,u.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(h.startedAt).toLocaleTimeString()})]},h.id))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No tool calls yet. Invoke a NoMoreIDE MCP tool from your agent and it will appear here."})})]})}function kR({agent:e,agentId:t}){return u.jsxs(u.Fragment,{children:[u.jsx(NR,{}),t!=="claude-code"?null:u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(wh,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:"Recent Projects"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.projects.length})]}),u.jsx(Nr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),u.jsx(tn,{className:"p-0",children:e.projects.length?u.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(s=>u.jsxs("li",{className:ge("flex items-start justify-between gap-3 px-3 py-2",s.current&&"bg-primary/5"),children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.path}),s.current?u.jsx(Ve,{variant:"outline",size:"small",children:"current"}):null]}),s.lastSessionFirstPrompt?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:s.lastSessionFirstPrompt}):null]}),u.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[s.mcpServerCount?u.jsxs("div",{children:[s.mcpServerCount," mcp"]}):null,s.lastSessionModified?u.jsx("div",{children:TR(s.lastSessionModified)}):null]})]},s.path))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function TR(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function Zg({className:e}){return u.jsx("svg",{className:ge("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})})}function Qg({className:e}){return u.jsx("svg",{className:ge("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z"})})}function Yw({icon:e,title:t,children:s}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-16 text-center",children:[u.jsx("div",{className:"text-muted-foreground/70",children:e}),u.jsx("p",{className:"text-sm font-medium text-foreground",children:t}),s?u.jsx("p",{className:"max-w-sm text-xs text-muted-foreground",children:s}):null]})}function MR({agent:e,agentId:t}){return t==="codex"?u.jsxs(Yw,{icon:u.jsx(op,{className:"size-8"}),title:"No memory introspection for Codex yet",children:["Project memory and ",u.jsx("code",{className:"font-mono",children:"CLAUDE.md"})," reading are Claude-specific. Codex memory support isn't wired up."]}):u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(op,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:"Project Memory"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.project.memoryFiles.length+(e.project.claudeMdPath?1:0)})]}),u.jsx(Nr,{className:"truncate text-xs",children:e.project.memoryDir??"No memory directory found for this project."})]}),u.jsxs(tn,{className:"space-y-2 p-3",children:[e.project.claudeMdPath?u.jsx(Ey,{title:"CLAUDE.md",preview:e.project.claudeMdPreview,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(s=>u.jsx(Ey,{title:s.name,subtitle:`${s.size} B`,preview:s.preview,defaultOpen:s.name==="MEMORY.md"},s.path)):e.project.claudeMdPath?null:u.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function Ey({title:e,subtitle:t,preview:s,defaultOpen:r=!1}){const[o,l]=N.useState(r);return u.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[u.jsxs("button",{type:"button",onClick:()=>l(!o),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[u.jsx(pa,{className:ge("size-3.5 text-muted-foreground transition-transform",o&&"rotate-90")}),u.jsx("span",{children:e}),t?u.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),o&&s?u.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap border-t border-border px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground",children:s}):null]})}function AR({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,s=t>0?e.cacheReadInputTokens/t*100:0;return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Zg,{className:"size-3.5 text-amber-700"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),u.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[u.jsx(mr,{label:"Input",value:kl(e.inputTokens)}),u.jsx(mr,{label:"Output",value:kl(e.outputTokens)}),u.jsx(mr,{label:"Cache read",value:kl(e.cacheReadInputTokens)}),u.jsx(mr,{label:"Cache create",value:kl(e.cacheCreationInputTokens)}),u.jsx(mr,{label:"Lines +",value:String(e.linesAdded)}),u.jsx(mr,{label:"Lines −",value:String(e.linesRemoved)}),u.jsx(mr,{label:"Wall",value:Cy(e.durationMs)}),u.jsx(mr,{label:"API",value:Cy(e.apiDurationMs)})]}),u.jsxs("div",{className:"border-t border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:"Cache read share of input"}),u.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,s).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?u.jsx(fh,{label:"5h block",window:e.fiveHour}):null,e.weekly?u.jsx(fh,{label:"This week",window:e.weekly}):null]}):null,e.models.length?u.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(r=>u.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[u.jsx("span",{className:"truncate",children:r.model}),u.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[kl(r.inputTokens+r.outputTokens)," tok ·"," ",u.jsxs("span",{className:"text-emerald-700",children:["$",r.costUSD.toFixed(4)]})]})]},r.model))]}):null]})}function RR({usage:e}){return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Qg,{className:"size-3.5 text-foreground"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · rate limits"})]}),e.timestamp?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),u.jsxs("div",{className:"space-y-2 px-3 py-2",children:[e.primary?u.jsx(fh,{label:"5h window",window:e.primary}):null,e.secondary?u.jsx(fh,{label:"Weekly window",window:e.secondary}):null]})]})}function fh({label:e,window:t}){const s=Math.min(100,Math.max(0,t.usedPercent)),r=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,o=s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500";return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:ge("h-full",o),style:{width:`${s.toFixed(2)}%`}})}),r?u.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",r]}):null]})}function mr({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),u.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function kl(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Cy(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const s=Math.floor(t/60),r=Math.round(t-s*60);return`${s}m ${r}s`}function DR(e=1e4){const[t,s]=N.useState(null),[r,o]=N.useState(null);return N.useEffect(()=>{let l=!0;const h=()=>{r5().then(m=>{l&&(s(m),o(null))}).catch(m=>{l&&o(m instanceof Error?m.message:String(m))})};h();const f=window.setInterval(h,e);return()=>{l=!1,window.clearInterval(f)}},[e]),{usage:t,error:r}}const OR={"claude-code":{label:"Claude Code",icon:u.jsx(Zg,{})},codex:{label:"Codex",icon:u.jsx(Qg,{})}};function LR({agent:e,agentId:t}){const{usage:s,error:r}=DR(),o=e.detected.name===t,l=OR[t],h=t==="codex";return u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(LS,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:h?"Rate Limits":"Token & Cost Usage"}),u.jsx(Ve,{variant:"outline",size:"small",icon:l.icon,children:l.label}),o?u.jsx(Ve,{variant:"outline",size:"small",children:"active session"}):u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"})]}),u.jsxs(Nr,{className:"truncate text-xs",children:[h?u.jsxs(u.Fragment,{children:["Rate-limit windows from ",u.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):u.jsxs(u.Fragment,{children:["Last-session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",u.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),u.jsxs(tn,{className:"p-3",children:[r?u.jsx("p",{className:"text-xs text-destructive",children:r}):null,h?s?.codex?u.jsx(RR,{usage:s.codex}):r?null:u.jsx(Ny,{agent:"Codex CLI"}):s?.claude?u.jsx(AR,{usage:s.claude}):r?null:u.jsx(Ny,{agent:"Claude Code"})]})]})}function Ny({agent:e}){return u.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function jR({agent:e,agentId:t}){return t==="codex"?u.jsxs(Yw,{icon:u.jsx(cp,{className:"size-8"}),title:"No skill/MCP discovery for Codex yet",children:["Skills and MCP servers are read from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"}),". Codex config introspection isn't wired up."]}):u.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx($k,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:"Skills"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.skills.length})]}),u.jsx(Nr,{className:"text-xs",children:"User, project, and plugin skills discovered for the active agent."})]}),u.jsx(tn,{className:"p-0",children:e.skills.length?u.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(s=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.name}),u.jsx(Ve,{variant:"outline",size:"small",children:s.scope})]}),s.description?u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:s.description}):null]},`${s.scope}:${s.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(cp,{className:"size-4 text-muted-foreground"}),u.jsx(en,{children:"MCP Servers"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.mcpServers.length})]}),u.jsxs(Nr,{className:"text-xs",children:["From ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})," (user + project scopes)."]})]}),u.jsx(tn,{className:"p-0",children:e.mcpServers.length?u.jsx("ul",{className:"divide-y divide-border",children:e.mcpServers.map(s=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.name}),u.jsx(Ve,{variant:"outline",size:"small",children:s.scope})]}),u.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:s.command??s.url??s.type??"—"})]},`${s.scope}:${s.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})]})}const BR=[{id:"claude-code",label:"Claude Code",icon:u.jsx(Zg,{className:"size-4"})},{id:"codex",label:"Codex",icon:u.jsx(Qg,{className:"size-4"})}],zR=[{id:"overview",label:"Overview",icon:u.jsx(LS,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:u.jsx(op,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:u.jsx(cp,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:u.jsx(mo,{className:"size-3.5"})}];function IR(){const[e,t]=N.useState(null),[s,r]=N.useState(null),[o,l]=N.useState("claude-code"),[h,f]=N.useState("overview");return N.useEffect(()=>{let m=!0;return n5().then(d=>{m&&(t(d),d.detected.name==="codex"&&l("codex"))}).catch(d=>{m&&r(d instanceof Error?d.message:String(d))}),()=>{m=!1}},[]),s?u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsxs(yt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",s]})}):e?u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:BR.map(m=>{const d=o===m.id,_=e.detected.name===m.id;return u.jsxs("button",{type:"button",onClick:()=>l(m.id),className:ge("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",d?"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,_?u.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},m.id)})}),u.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:zR.map(m=>u.jsxs("button",{type:"button",onClick:()=>f(m.id),className:ge("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",h===m.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[m.icon,m.label,h===m.id?u.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},m.id))}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[h==="overview"?u.jsx(LR,{agent:e,agentId:o}):null,h==="memory"?u.jsx(MR,{agent:e,agentId:o}):null,h==="tools"?u.jsx(jR,{agent:e,agentId:o}):null,h==="activity"?u.jsx(kR,{agent:e,agentId:o}):null]})]}):u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsx(yt,{variant:"muted",children:"Loading agent info…"})})}const PR=[{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%)"}],UR=({size:e=20,color:t="#8f8f8f"})=>u.jsx("div",{style:{width:e,height:e},children:u.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:PR.map(s=>u.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...s}},s.transform))})}),HR=[{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"}],FR={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"},VR={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]"}},ju=({size:e="medium",type:t="primary",variant:s="styled",shape:r="square",svgOnly:o=!1,children:l,prefix:h,suffix:f,shadow:m=!1,loading:d=!1,disabled:_=!1,fullWidth:v=!1,className:b,...S})=>u.jsxs("button",{disabled:_,tabIndex:0,className:Zl("flex items-center justify-center gap-0.5 duration-150",HR[+o][e],_||d?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":FR[t],VR[r][e],m&&"shadow-border-small border-none",v&&"w-full",s==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",b),type:"button",...S,children:[d?u.jsx(UR,{size:e==="large"?24:16}):h,u.jsx("span",{className:Zl("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&s!=="unstyled"&&"px-1.5"),children:l}),!d&&f]}),$R=({className:e})=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z"})}),qR=()=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z"})});let om=null,KR=0;const ei={toasts:[],listeners:new Set,add(e,t,s,r,o,l){const h=KR++,f={id:h,text:e,preserve:s,action:r,onAction:o,onUndoAction:l,type:t};if(!f.preserve){f.remaining=3e3,f.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(d=>d.id!==h),this.notify()};f.timeout=setTimeout(m,f.remaining),f.pause=()=>{f.timeout&&(clearTimeout(f.timeout),f.timeout=void 0,f.remaining-=Date.now()-f.start)},f.resume=()=>{f.timeout||(f.start=Date.now(),f.timeout=setTimeout(m,f.remaining))}}this.toasts.push(f),this.notify()},remove(e){ei.toasts=ei.toasts.filter(t=>t.id!==e),ei.notify()},subscribe(e){return ei.listeners.add(e),()=>{ei.listeners.delete(e)}},notify(){ei.listeners.forEach(e=>{e()})}},GR=()=>{const[e,t]=N.useState([]),[s,r]=N.useState([]),[o,l]=N.useState(!1),h=x=>w=>{w&&x.measuredHeight==null&&(x.measuredHeight=w.getBoundingClientRect().height,ei.notify())};N.useEffect(()=>(t([...ei.toasts]),ei.subscribe(()=>{t([...ei.toasts])})),[]),N.useEffect(()=>{const x=e.filter(w=>!s.includes(w.id)).map(w=>w.id);x.length>0&&requestAnimationFrame(()=>{r(w=>[...w,...x])})},[s,e]);const m=Math.max(0,e.length-3),d=(x,w)=>{if(x===w-1)return"none";const C=w-1-x;let T=e[w-1]?.measuredHeight||63;for(let D=w-1;D>x;D--)o?T+=(e[D-1]?.measuredHeight||63)+10:T+=20;const O=-C,k=o?1:1-.05*C;return`translate3d(0, calc(100% - ${T}px), ${O}px) scale(${k})`},_=()=>{l(!0),ei.toasts.forEach(x=>{x.pause?.()})},v=()=>{l(!1),ei.toasts.forEach(x=>{x.resume?.()})},S=e.slice(m).reduce((x,w)=>x+(w.measuredHeight??63),0);return u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:S},children:u.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:S},onMouseEnter:_,onMouseLeave:v,children:e.map((x,w)=>{const C=w>=m;return u.jsx("div",{ref:h(x),className:Zl("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],C?"opacity-100":"opacity-0",w<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:s.includes(x.id)?d(w,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:u.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[u.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[u.jsx("span",{children:x.text}),!x.action&&u.jsxs("div",{className:"flex gap-1",children:[x.onUndoAction&&u.jsx(ju,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{x.onUndoAction?.(),ei.remove(x.id)},children:u.jsx(qR,{})}),u.jsx(ju,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ei.remove(x.id),children:u.jsx($R,{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&&u.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[u.jsx(ju,{type:"tertiary",size:"small",onClick:()=>ei.remove(x.id),children:"Dismiss"}),u.jsx(ju,{type:"primary",size:"small",onClick:()=>{x.onAction?.(),ei.remove(x.id)},children:x.action})]})]})},x.id)})})})},Bu=()=>{if(om)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),om=ES.createRoot(e),om.render(u.jsx(GR,{}))},Gi=()=>({message:N.useCallback(({text:e,preserve:t,action:s,onAction:r,onUndoAction:o})=>{Bu(),ei.add(e,"message",t,s,r,o)},[]),success:N.useCallback(e=>{Bu(),ei.add(e,"success")},[]),warning:N.useCallback(e=>{Bu(),ei.add(e,"warning")},[]),error:N.useCallback(e=>{Bu(),ei.add(e,"error")},[])});function vt({className:e,type:t,...s}){return u.jsx("input",{type:t,className:ge("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s})}var Jg=wS();function kr({children:e,icon:t,onClose:s,title:r,size:o="md"}){return N.useEffect(()=>{function l(h){h.key==="Escape"&&s()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),Jg.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:s,children:u.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(760px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${o==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:l=>l.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:r}),u.jsx(_e,{"aria-label":"Close dialog",onClick:s,size:"icon",type:"button",variant:"ghost",children:u.jsx(Mr,{})})]}),u.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const WR=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function YR({onClose:e,onSaved:t}){const{error:s,success:r}=Gi(),[o,l]=N.useState("postgres"),[h,f]=N.useState(""),[m,d]=N.useState(""),[_,v]=N.useState([]),[b,S]=N.useState({status:"idle"}),[x,w]=N.useState(!1),[C,T]=N.useState(!1);N.useEffect(()=>{o5().then(v).catch(()=>v([]))},[]);function O(P){l(P.engine),d(P.url),S({status:"idle"}),h.trim()||f(XR(P))}async function k(){if(m.trim()){w(!0),S({status:"idle"});try{const P=await c5({engine:o,url:m.trim()});S(P.ok?{status:"ok",message:"Connected"}:{status:"fail",message:P.error??"Connection failed"})}catch(P){S({status:"fail",message:P instanceof Error?P.message:String(P)})}finally{w(!1)}}}async function D(){if(!h.trim()||!m.trim()){s("Name and connection are both required.");return}T(!0);try{await l5({name:h.trim(),engine:o,url:m.trim()}),r(`Saved connection "${h.trim()}".`),t(),e()}catch(P){s(P instanceof Error?P.message:String(P))}finally{T(!1)}}const U=o==="sqlite";return u.jsx(kr,{icon:u.jsx(yo,{}),onClose:e,title:"Add database connection",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[_.length>0?u.jsxs("section",{children:[u.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[u.jsx(Jk,{className:"size-3.5"}),"Found in your services"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.map(P=>u.jsxs("button",{type:"button",onClick:()=>O(P),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:P.maskedUrl,children:[u.jsx(Ve,{variant:"outline",size:"small",children:P.engine}),u.jsx("span",{className:"font-mono",children:P.service}),u.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",P.key]})]},`${P.service}:${P.key}`))})]}):null,u.jsxs("section",{children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),u.jsx("div",{className:"flex gap-1.5",children:WR.map(P=>u.jsx(_e,{size:"sm",variant:o===P.value?"default":"outline",onClick:()=>{l(P.value),S({status:"idle"})},type:"button",children:P.label},P.value))})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),u.jsx(vt,{value:h,onChange:P=>f(P.target.value),placeholder:"e.g. shop-db"})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:U?"Database file path":"Connection URL"}),u.jsx(vt,{value:m,onChange:P=>{d(P.target.value),S({status:"idle"})},placeholder:U?"/abs/path/to/app.db":o==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Read-only. The connection string is stored like a secret and masked in the UI and API."})]}),b.status!=="idle"?u.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${b.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[b.status==="ok"?u.jsx(Sh,{className:"size-3.5"}):u.jsx(Mr,{className:"size-3.5"}),u.jsx("span",{className:"break-all font-mono",children:b.message})]}):null,u.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[u.jsxs(_e,{variant:"outline",size:"sm",onClick:()=>{k()},disabled:x||!m.trim(),type:"button",children:[x?u.jsx(po,{className:"animate-spin"}):null,"Test connection"]}),u.jsxs(_e,{size:"sm",onClick:()=>{D()},disabled:C,type:"button",children:[C?u.jsx(po,{className:"animate-spin"}):null,"Save"]})]})]})})}function XR(e){try{const s=new URL(e.url).pathname.replace(/^\//,"");if(s)return`${e.service}-${s}`}catch{}return`${e.service}-${e.engine}`}function ZR({connection:e,sample:t}){const{success:s,error:r}=Gi();async function o(l){try{const h=f5(e,t.engine,t.table,t.columns,l);await navigator.clipboard.writeText(h),s("Copied row + schema prompt to clipboard.")}catch(h){r(h instanceof Error?h.message:String(h))}}return t.columns.length===0?u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsxs("table",{className:"w-full border-collapse text-left font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:u.jsxs("tr",{className:"border-b border-border",children:[u.jsx("th",{className:"w-10 px-2 py-2"}),t.columns.map(l=>u.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[l.primaryKey?u.jsx(ok,{className:"size-3 text-amber-500"}):null,l.name]}),u.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:l.dataType})]},l.name))]})}),u.jsxs("tbody",{children:[t.rows.map((l,h)=>u.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[u.jsx("td",{className:"px-2 py-1 align-top",children:u.jsx(_e,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:"Explain this row to the agent",onClick:()=>{o(l)},type:"button",children:u.jsx(Yl,{className:"size-3.5"})})}),t.columns.map(f=>u.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:ky(l[f.name]),children:ky(l[f.name])},f.name))]},h)),t.rows.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function ky(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function QR(){const[e,t]=N.useState([]),[s,r]=N.useState(!0),[o,l]=N.useState(null),h=N.useCallback(async()=>{r(!0),l(null);try{t(await a5())}catch(f){l(f instanceof Error?f.message:String(f))}finally{r(!1)}},[]);return N.useEffect(()=>{h()},[h]),{connections:e,loading:s,error:o,refresh:h}}function JR(e){const[t,s]=N.useState([]),[r,o]=N.useState(null),[l,h]=N.useState(null),[f,m]=N.useState(null),[d,_]=N.useState(null),[v,b]=N.useState(!1),[S,x]=N.useState(!1);return N.useEffect(()=>{if(s([]),o(null),h(null),m(null),_(null),!e)return;let w=!1;return b(!0),h5(e).then(C=>{w||(s(C),o(C[0]?.qualifiedName??null))}).catch(C=>{w||m(C instanceof Error?C.message:String(C))}).finally(()=>{w||b(!1)}),()=>{w=!0}},[e]),N.useEffect(()=>{if(h(null),_(null),!e||!r)return;let w=!1;return x(!0),d5(e,r,100).then(C=>{w||h(C)}).catch(C=>{w||_(C instanceof Error?C.message:String(C))}).finally(()=>{w||x(!1)}),()=>{w=!0}},[e,r]),{tables:t,selectedTable:r,setSelectedTable:o,sample:l,tablesError:f,rowsError:d,loadingTables:v,loadingRows:S}}function e8(){const{connections:e,loading:t,error:s,refresh:r}=QR(),{error:o,success:l}=Gi(),[h,f]=N.useState(null),[m,d]=N.useState(!1);N.useEffect(()=>{if(e.length===0){f(null);return}f(v=>v&&e.some(b=>b.name===v)?v:e[0].name)},[e]);async function _(v){try{await u5(v),l(`Removed connection "${v}".`),await r()}catch(b){o(b instanceof Error?b.message:String(b))}}return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(yo,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Connections"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsxs(_e,{size:"sm",variant:"outline",onClick:()=>d(!0),type:"button",children:[u.jsx(js,{}),"Add"]})]}),u.jsx("ul",{className:"min-h-0 flex-1 overflow-auto",children:e.map(v=>u.jsx("li",{children:u.jsxs("div",{className:ge("group flex w-full items-center gap-2 px-3 py-2 transition-colors hover:bg-muted/50",v.name===h&&"bg-muted/70"),children:[u.jsxs("button",{type:"button",onClick:()=>f(v.name),className:"flex min-w-0 flex-1 flex-col text-left",children:[u.jsx("span",{className:"truncate text-xs font-semibold",children:v.name}),u.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:v.url})]}),u.jsx(Ve,{variant:"outline",size:"small",children:v.engine}),u.jsx(_e,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:`Remove ${v.name}`,onClick:()=>{_(v.name)},type:"button",children:u.jsx(xg,{className:"size-3.5 text-destructive"})})]})},v.name))}),t&&e.length===0?u.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading…"}):null]}),u.jsx("div",{className:"min-h-0 flex-1",children:s?u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-destructive/40 text-destructive",children:s})}):h?u.jsx(t8,{connection:h}):u.jsx(i8,{onAdd:()=>d(!0)})}),m?u.jsx(YR,{onClose:()=>d(!1),onSaved:r}):null]})}function t8({connection:e}){const{tables:t,selectedTable:s,setSelectedTable:r,sample:o,tablesError:l,rowsError:h,loadingTables:f,loadingRows:m}=JR(e);return u.jsxs("div",{className:"flex h-full min-h-0",children:[u.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(Yk,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),u.jsx(Ve,{variant:"outline",size:"small",children:t.length}),f?u.jsx(po,{className:"size-3.5 animate-spin"}):null]}),l?u.jsx("div",{className:"p-3",children:u.jsx(yt,{variant:"muted",className:"border-destructive/40 text-destructive",children:l})}):u.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(d=>u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>r(d.qualifiedName),className:ge("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",d.qualifiedName===s&&"bg-muted/70 font-semibold"),children:d.qualifiedName})},d.qualifiedName)),!f&&t.length===0?u.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s??"Select a table"}),o?u.jsxs(Ve,{variant:"outline",size:"small",children:[o.rowCount," rows"]}):null]}),h?u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-destructive/40 text-destructive",children:h})}):m?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(po,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):o?u.jsx(ZR,{connection:e,sample:o}):u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function i8({onAdd:e}){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(yo,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Add a read-only Postgres, MySQL, or SQLite connection to browse tables and sample rows. NoMoreIDE can auto-detect connection strings from your services' ",u.jsx("code",{children:".env"})," files."]}),u.jsxs(_e,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[u.jsx(js,{}),"Add connection"]})]})})}function s8({incident:e}){const{error:t,success:s}=Gi(),[r,o]=N.useState(!1),[l,h]=N.useState(!1),[f,m]=N.useState(!1);async function d(){o(!0);try{const{prompt:v}=await p5(e.id);await navigator.clipboard.writeText(v),h(!0),s("Copied debugging prompt to clipboard."),window.setTimeout(()=>h(!1),2e3)}catch(v){t(v instanceof Error?v.message:String(v))}finally{o(!1)}}async function _(){m(!0);try{const{markdown:v}=await g5(e.id);await navigator.clipboard.writeText(v),s("Copied repro bundle to clipboard.")}catch(v){t(v instanceof Error?v.message:String(v))}finally{m(!1)}}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ve,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?u.jsxs(Ve,{variant:"outline",size:"small",children:["×",e.count]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(_e,{onClick:()=>{_()},disabled:f,size:"sm",variant:"outline",children:[u.jsx(bk,{}),f?"Bundling…":"Copy repro bundle"]}),u.jsxs(_e,{onClick:()=>{d()},disabled:r,size:"sm",children:[l?u.jsx(Sh,{}):u.jsx(AN,{}),l?"Copied":"Copy to agent"]})]})]}),u.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?u.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[u.jsx(FN,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,u.jsxs("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/80",children:["first ",new Date(e.firstSeen).toLocaleString()," · last"," ",new Date(e.lastSeen).toLocaleTimeString()]})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),u.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-[11px] leading-relaxed",children:e.logExcerpt.join(`
12
+ `)}),u.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:'"Copy to agent" bundles this excerpt with the affected file\'s diff and the last 40 log lines. "Copy repro bundle" adds the service\'s runtime state and masked `.env` for sharing.'})]})]})}function Ty(e){return[...e].sort((t,s)=>t.lastSeen<s.lastSeen?1:t.lastSeen>s.lastSeen?-1:s.id-t.id)}function n8(){const[e,t]=N.useState([]),[s,r]=N.useState(!1),[o,l]=N.useState(null),h=N.useCallback(f=>{t(m=>Ty([...m.filter(d=>d.id!==f.id),f]))},[]);return N.useEffect(()=>{let f=!0;m5().then(d=>{f&&t(Ty(d))}).catch(d=>{f&&l(d instanceof Error?d.message:String(d))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>r(!0)),m.addEventListener("error",()=>r(!1)),m.addEventListener("incident",d=>{try{const _=JSON.parse(d.data);h(_)}catch{}}),()=>{f=!1,m.close()}},[h]),{incidents:e,connected:s,error:o}}function r8(){const{incidents:e,connected:t,error:s}=n8(),[r,o]=N.useState(null);N.useEffect(()=>{if(e.length===0){o(null);return}o(h=>h!==null&&e.some(f=>f.id===h)?h:e[0].id)},[e]);const l=N.useMemo(()=>e.find(h=>h.id===r)??null,[e,r]);return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(lp,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ve,{variant:"outline",size:"small",icon:u.jsx("span",{className:ge("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(h=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>o(h.id),className:ge("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",h.id===r&&"bg-muted/70"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:h.service}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[h.count>1?u.jsxs(Ve,{variant:"outline",size:"small",children:["×",h.count]}):null,u.jsx(Ve,{variant:h.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:h.level})]})]}),u.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:h.title}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(h.lastSeen).toLocaleTimeString()})]})},h.id))})]}),u.jsx("div",{className:"min-h-0 flex-1",children:s?u.jsx("div",{className:"p-4",children:u.jsxs(yt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",s]})}):l?u.jsx(s8,{incident:l}):u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(lp,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Errors and stack traces from your running services land here automatically. Each one becomes a one-click prompt for your agent."})]})})})]})}const a8={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 yr({label:e,children:t,side:s="bottom",className:r}){return u.jsxs("span",{className:ge("group/tt relative inline-flex",r),children:[t,u.jsx("span",{role:"tooltip",className:ge("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",a8[s]),children:e})]})}function o8({context:e}){const[t,s]=N.useState(!1);if(!e)return u.jsx("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"No agent context available yet."});async function r(){try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1500)}catch{s(!1)}}return u.jsxs("section",{"aria-label":"Agent context",className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"agent-context-panel",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-medium",children:[u.jsx(Yl,{className:"size-3.5"}),"Agent context"]}),u.jsxs(_e,{onClick:r,size:"sm",type:"button",variant:"outline",children:[t?u.jsx(Sh,{className:"size-3.5"}):u.jsx(kS,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),u.jsx("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded bg-background p-3 font-mono text-[11px] leading-relaxed",children:e})]})}function ys({className:e,...t}){return u.jsx("label",{className:ge("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const Ns='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',ks='</title><path d="',Ts='"/></svg>',l8={title:".NET",slug:"dotnet",get svg(){return Ns+".NET"+ks+this.path+Ts},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"}},c8={title:"Bun",slug:"bun",get svg(){return Ns+"Bun"+ks+this.path+Ts},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"},u8={title:"Deno",slug:"deno",get svg(){return Ns+"Deno"+ks+this.path+Ts},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"}},h8={title:"Docker",slug:"docker",get svg(){return Ns+"Docker"+ks+this.path+Ts},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"},d8={title:"Go",slug:"go",get svg(){return Ns+"Go"+ks+this.path+Ts},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"},f8={title:"Node.js",slug:"nodedotjs",get svg(){return Ns+"Node.js"+ks+this.path+Ts},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"},m8={title:"npm",slug:"npm",get svg(){return Ns+"npm"+ks+this.path+Ts},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"},p8={title:"pnpm",slug:"pnpm",get svg(){return Ns+"pnpm"+ks+this.path+Ts},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"},g8={title:"Python",slug:"python",get svg(){return Ns+"Python"+ks+this.path+Ts},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/"},My={title:"Rust",slug:"rust",get svg(){return Ns+"Rust"+ks+this.path+Ts},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"}},_8={title:"Vite",slug:"vite",get svg(){return Ns+"Vite"+ks+this.path+Ts},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"},v8={title:"Yarn",slug:"yarn",get svg(){return Ns+"Yarn"+ks+this.path+Ts},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 b8(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?qi.vite:/\bcargo\s+/.test(t)?qi.cargo:/\brustc\b/.test(t)?qi.rust:/\bdotnet\b/.test(t)?qi.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?qi.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?qi.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?qi.go:/\bbun\b/.test(t)?qi.bun:/\bdeno\b/.test(t)?qi.deno:/\bpnpm\b/.test(t)?qi.pnpm:/\byarn\b/.test(t)?qi.yarn:/\bnpm\b/.test(t)?qi.npm:/\bnode\b/.test(t)?qi.node:qi.generic}const qi={bun:{kind:"bun",label:"Bun"},cargo:{kind:"cargo",label:"Cargo"},deno:{kind:"deno",label:"Deno"},dotnet:{kind:"dotnet",label:".NET"},docker:{kind:"docker",label:"Docker"},generic:{kind:"generic",label:"Process"},go:{kind:"go",label:"Go"},node:{kind:"node",label:"Node"},npm:{kind:"npm",label:"npm"},pnpm:{kind:"pnpm",label:"pnpm"},python:{kind:"python",label:"Python"},rust:{kind:"rust",label:"Rust"},vite:{kind:"vite",label:"Vite"},yarn:{kind:"yarn",label:"Yarn"}};function e_({command:e,compact:t}){const s=b8(e),r=y8[s.kind];return u.jsx("span",{"aria-label":`${s.label} process`,className:ge("inline-flex shrink-0 items-center justify-center rounded-md border bg-white shadow-sm",t?"size-6":"size-7",r?"border-zinc-200":"border-zinc-300 bg-zinc-100 text-zinc-700"),style:r?{color:`#${r.hex}`}:void 0,title:s.label,children:r?u.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:r.path})}):u.jsx(VS,{className:t?"size-3.5":"size-4"})})}const y8={bun:c8,cargo:My,deno:u8,dotnet:l8,docker:h8,generic:null,go:d8,node:f8,npm:m8,pnpm:p8,python:g8,rust:My,vite:_8,yarn:v8},x8=[{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"}],Ay=[{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 S8({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return u.jsxs(yt,{variant:e.ok?"default":"destructive",children:[u.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),u.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?u.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-md bg-background/80 p-2 font-mono text-[11px] leading-4",children:t.join(`
13
+ `)}):null]})}function Xw({active:e,baseUrl:t,compact:s=!1,onRefresh:r,restartAction:o,targetLabel:l}){return e?u.jsxs(u.Fragment,{children:[u.jsx(lm,{compact:s,intent:"restart",icon:u.jsx(PS,{}),label:"Restart",action:o,targetLabel:l,url:`${t}/restart`,onRefresh:r}),u.jsx(lm,{compact:s,intent:"stop",icon:u.jsx(Eh,{}),label:"Stop",targetLabel:l,url:`${t}/stop`,onRefresh:r})]}):u.jsx(lm,{compact:s,intent:"start",icon:u.jsx(yg,{}),label:"Start",targetLabel:l,url:`${t}/start`,onRefresh:r})}function vo(e,t,s){const r=s instanceof Error?s.message:String(s);return`${e} failed for ${t}: ${r}`}function lm({action:e,compact:t=!1,intent:s="neutral",icon:r,label:o,targetLabel:l,url:h,onRefresh:f}){const[m,d]=N.useState(!1),[_,v]=N.useState(null),{error:b,success:S}=Gi();async function x(C={}){d(!0);try{e?await e():await os(h,C),S(`${o} requested for ${l}.`),await f(),v(null)}catch(T){T instanceof $S?v(T.conflict):b(vo(o,l,T))}finally{d(!1)}}const w=u.jsxs(_e,{"aria-label":o,className:`${E8[s]} ${t?"size-7":""}`.trim(),disabled:m,onClick:()=>x(),size:t?"icon":"sm",variant:"outline",children:[r,t?null:o]});return u.jsxs(u.Fragment,{children:[t?u.jsx(yr,{label:o,children:w}):w,_?u.jsx(w8,{busy:m,conflict:_,onCancel:()=>v(null),onKillAndStart:()=>x({strategy:"killHolder"}),targetLabel:l}):null]})}function w8({busy:e,conflict:t,onCancel:s,onKillAndStart:r,targetLabel:o}){const l=t.holder,h=`http://localhost:${t.port}/`;return u.jsx(kr,{icon:u.jsx(i5,{}),onClose:e?()=>{}:s,title:`Port ${t.port} is already in use`,children:u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:o})," wants port"," ",u.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:l?`pid ${l.pid}${l.pgid?` (pgid ${l.pgid})`:""}
14
+ ${l.command}`:"unknown process"}),u.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[u.jsx(_e,{onClick:s,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),u.jsxs(_e,{onClick:()=>window.open(h,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[u.jsx(TS,{}),"Open in browser"]}),u.jsx(_e,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!l,onClick:r,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const E8={neutral:"",restart:"border-amber-600 bg-amber-600 text-white hover:bg-amber-700",start:"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 C8({cwd:e,onRefresh:t,onSaved:s}){const{error:r,success:o}=Gi(),[l,h]=N.useState("local"),[f,m]=N.useState(""),[d,_]=N.useState(""),[v,b]=N.useState(e),[S,x]=N.useState(""),[w,C]=N.useState(""),[T,O]=N.useState(""),[k,D]=N.useState(""),[U,P]=N.useState(""),[B,M]=N.useState(null),[F,Y]=N.useState(!1);N.useEffect(()=>{M(null)},[d,v,S,l]);function $(){m(""),_(""),b(e),x(""),C(""),O(""),D(""),P(""),M(null)}async function G(ie){ie.preventDefault();try{const J={name:f,kind:l,cwd:v,port:S,description:w};(l==="local"||l==="ssh")&&(J.command=d),l==="docker-compose"&&(J.composeFile=T,J.composeService=k),l==="ssh"&&(J.host=U),await os("/api/services",J),$(),o(`${f} added.`),await t(),s?.()}catch(J){r(vo("Add service",f||"service",J))}}async function I(){if(!d.trim()){r("Test command failed for service: command is required.");return}Y(!0);try{M(await D5({command:d,cwd:v,port:S}))}catch(ie){r(vo("Test command",f||"service",ie))}finally{Y(!1)}}return{kind:l,setKind:h,name:f,setName:m,command:d,setCommand:_,formCwd:v,setFormCwd:b,port:S,setPort:x,description:w,setDescription:C,composeFile:T,setComposeFile:O,composeService:k,setComposeService:D,host:U,setHost:P,testResult:B,testing:F,submit:G,testCommand:I}}function N8({cwd:e,onRefresh:t,onSaved:s}){const{kind:r,setKind:o,name:l,setName:h,command:f,setCommand:m,formCwd:d,setFormCwd:_,port:v,setPort:b,description:S,setDescription:x,composeFile:w,setComposeFile:C,composeService:T,setComposeService:O,host:k,setHost:D,testResult:U,testing:P,submit:B,testCommand:M}=C8({cwd:e,onRefresh:t,onSaved:s}),F=Ay.find(I=>I.value===r),Y=r==="local"&&f.trim().length>0&&d.trim().length>0,$="grid gap-2 rounded-md border border-border bg-muted/30 p-3",G="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return u.jsxs("form",{className:"grid gap-3",onSubmit:B,children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("fieldset",{className:`${$} sm:col-span-2`,children:[u.jsx("legend",{className:G,children:"Step 1 · Service kind"}),u.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:Ay.map(I=>u.jsx(_e,{className:"justify-center",onClick:()=>o(I.value),size:"sm",type:"button",variant:r===I.value?"default":"outline",children:I.label},I.value))}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:F.hint})]}),u.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[u.jsxs("fieldset",{className:$,children:[u.jsx("legend",{className:G,children:"Step 2 · Identity"}),u.jsxs(ys,{children:["Name",u.jsx(vt,{className:"h-8 text-sm",name:"name",onChange:I=>h(I.target.value),placeholder:"backend",required:!0,value:l})]}),u.jsxs(ys,{children:["Description",u.jsx(vt,{className:"h-8 text-sm",name:"description",onChange:I=>x(I.target.value),placeholder:"API server",value:S})]})]}),u.jsxs("fieldset",{className:$,children:[u.jsx("legend",{className:G,children:"Step 4 · Networking (optional)"}),u.jsxs(ys,{children:["Port",u.jsx(vt,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:I=>b(I.target.value),placeholder:"3001",value:v})]})]})]}),r==="local"?u.jsxs("fieldset",{className:`${$} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:G,children:"Step 3 · Local command"}),u.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:x8.map(I=>u.jsxs(_e,{className:"justify-start gap-1.5",onClick:()=>{m(I.command),x(I.description)},size:"sm",type:"button",variant:"outline",children:[u.jsx(e_,{command:I.badgeCommand??I.command,compact:!0}),u.jsx("span",{className:"truncate",children:I.label})]},I.label))}),u.jsxs(ys,{children:["Command",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"command",onChange:I=>m(I.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(ys,{children:["Working Directory",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:I=>_(I.target.value),required:!0,value:d})]})]}):null,r==="docker-compose"?u.jsxs("fieldset",{className:`${$} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:G,children:"Step 3 · Docker Compose target"}),u.jsxs(ys,{children:["Compose Service",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"composeService",onChange:I=>O(I.target.value),placeholder:"api",required:!0,value:T})]}),u.jsxs(ys,{children:["Compose File (optional)",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:I=>C(I.target.value),placeholder:"docker-compose.yml",value:w})]}),u.jsxs(ys,{children:["Working Directory (where compose file lives)",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:I=>_(I.target.value),required:!0,value:d})]})]}):null,r==="ssh"?u.jsxs("fieldset",{className:`${$} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:G,children:"Step 3 · SSH connection"}),u.jsxs(ys,{children:["SSH Host (alias from ~/.ssh/config)",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"host",onChange:I=>D(I.target.value),placeholder:"devbox",required:!0,value:k})]}),u.jsxs(ys,{children:["Remote Command",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"command",onChange:I=>m(I.target.value),placeholder:"npm run dev",required:!0,value:f})]}),u.jsxs(ys,{children:["Remote Working Directory",u.jsx(vt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:I=>_(I.target.value),placeholder:"/srv/app",required:!0,value:d})]}),u.jsxs(yt,{variant:"muted",children:[u.jsx("div",{className:"font-medium",children:"SSH key handling"}),u.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",u.jsxs("code",{children:["Host ",k||"&lt;alias&gt;"]})," entry to",u.jsx("code",{children:" ~/.ssh/config"})," with ",u.jsx("code",{children:"HostName"}),", ",u.jsx("code",{children:"User"}),", and"," ",u.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",u.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",u.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",u.jsxs("code",{children:["ssh ",k||"&lt;alias&gt;"]})," using that config."]})]})]}):null]}),U?u.jsx(S8,{result:U}):null,u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[r==="local"?u.jsxs(_e,{disabled:P||!Y,onClick:M,type:"button",variant:"outline",children:[u.jsx(VS,{}),P?"Testing...":"Test Command"]}):null,u.jsx(_e,{type:"submit",children:"Add Service"})]})]})}function Zw({initialName:e="",initialServices:t=[],onSaved:s,onRefresh:r,originalName:o,services:l,submitLabel:h="Save Group"}){const{error:f,success:m}=Gi();async function d(_){_.preventDefault();const v=_.currentTarget,b=new FormData(v),S=String(b.get("name")??""),x=b.getAll("services").map(w=>String(w)).filter(Boolean);try{await os("/api/bundles",{name:S,originalName:o,services:x.join(",")}),v.reset(),m(`${S} group saved.`),await r(),s?.()}catch(w){f(vo("Save group",S||"group",w))}}return u.jsxs("form",{className:"grid gap-2.5",onSubmit:d,children:[u.jsxs(ys,{children:["Group name",u.jsx(vt,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),u.jsxs("fieldset",{className:"grid gap-1.5",children:[u.jsx("legend",{className:"text-xs font-medium",children:"Services"}),l.length?l.map(_=>u.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[u.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(_.name),name:"services",type:"checkbox",value:_.name}),u.jsx(e_,{command:_.command??"",compact:!0}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate text-sm font-medium",children:_.name}),u.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:_.command??_.kind??""})]})]},_.name)):u.jsx(yt,{variant:"muted",children:"All services are already grouped, or none registered."})]}),u.jsx(_e,{className:"h-8",disabled:!l.length,type:"submit",children:h})]})}function mh({label:e}){return u.jsx(yt,{variant:"muted",className:"m-4 text-center",children:e})}const k8=900*1e3,Il=12,cm=200;function T8({events:e}){const[t,s]=N.useState(null),[r,o]=N.useState(null),{rows:l,windowStart:h,windowEnd:f}=N.useMemo(()=>M8(e),[e]),m=t?l.find(d=>d.service===t)??null:null;return u.jsxs(u.Fragment,{children:[u.jsxs(Qs,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs(en,{className:"flex items-center gap-2",children:[u.jsx(mo,{className:"size-3.5"}),"Runtime Monitor"]}),u.jsx(Nr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),u.jsx(tn,{className:"p-0",children:l.length===0?u.jsx(mh,{label:"No runtime timeline events yet."}):u.jsxs("div",{className:"divide-y divide-border",children:[l.map(d=>u.jsx(R8,{onClick:()=>s(d.service),row:d,windowEnd:f,windowStart:h},d.service)),u.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[u.jsx("span",{children:ph(h)}),u.jsx("span",{children:"now"})]})]})})]}),m?u.jsx(kr,{icon:u.jsx(mo,{}),onClose:()=>s(null),title:m.service,children:u.jsx(O8,{onSelect:o,row:m})}):null,r?u.jsx(kr,{icon:u.jsx(mo,{}),onClose:()=>o(null),title:r.title,children:u.jsx(L8,{event:r})}):null]})}function M8(e){const t=Date.now(),s=t,r=t-k8;let o=e.filter(m=>{if(m.kind==="service.http")return!1;const d=new Date(m.timestamp).getTime();return!Number.isNaN(d)&&d>=r});o.length===0&&e.length>0?o=e.slice(-cm):o.length>cm&&(o=o.slice(-cm));const l=new Map;for(const m of o){const d=m.service||"·system",_=l.get(d)??[];_.push(m),l.set(d,_)}const h=Math.max(s-r,1);return{rows:Array.from(l.entries()).map(([m,d])=>{const _=[...d].sort((O,k)=>O.timestamp.localeCompare(k.timestamp)),v=new Array(Il).fill(0),b=new Array(Il).fill(null);for(const O of _){const k=new Date(O.timestamp).getTime(),D=Math.max(r,Math.min(s,k)),U=Math.min(Il-1,Math.floor((D-r)/h*Il));v[U]+=1;const P=b[U];b[U]=A8(P,O.severity)}const S=_.filter(O=>O.severity==="error").length,x=_.filter(O=>O.severity==="warning").length,w=_.length-S-x,C=[..._].reverse().find(O=>O.severity!=="info")??null,T=S>0?"error":x>0?"warning":"info";return{service:m,events:_,errors:S,warnings:x,infos:w,buckets:v,bucketSeverity:b,lastNotable:C,worstSeverity:T}}).sort((m,d)=>{const _=b=>b.errors*1e3+b.warnings,v=_(d)-_(m);return v!==0?v:m.service.localeCompare(d.service)}),windowStart:r,windowEnd:s}}function A8(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function R8({onClick:e,row:t,windowEnd:s,windowStart:r}){const o=Math.max(1,...t.buckets);return u.jsxs("button",{className:"timeline-service-row block w-full px-3 py-2 text-left transition-colors hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40","data-testid":"timeline-service-row",onClick:e,type:"button",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:ge("size-2 shrink-0 rounded-full",Qw(t.worstSeverity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:u.jsx("bdi",{children:t.service})}),t.errors>0?u.jsxs("span",{className:"rounded bg-red-500/15 px-1 font-mono text-[10px] text-red-500",children:[t.errors,"E"]}):null,t.warnings>0?u.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,u.jsx(pa,{className:"size-3 text-muted-foreground"})]}),u.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${Il}, minmax(0, 1fr))`},children:t.buckets.map((l,h)=>u.jsx(D8,{count:l,max:o,severity:t.bucketSeverity[h]},h))}),t.lastNotable?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):u.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),u.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[u.jsx("span",{children:ph(r)}),u.jsx("span",{children:ph(s)})]})]})}function D8({count:e,max:t,severity:s}){if(e===0)return u.jsx("span",{className:"rounded-sm bg-border/60"});const r=Math.min(1,.35+e/t*.65);return u.jsx("span",{className:ge("rounded-sm",j8(s)),style:{opacity:r},title:`${e} event${e===1?"":"s"}`})}function O8({onSelect:e,row:t}){const s=[...t.events].sort((r,o)=>o.timestamp.localeCompare(r.timestamp));return u.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[t.events.length," events"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),u.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:s.map(r=>u.jsx("li",{children:u.jsxs("button",{className:"block w-full px-4 py-2 text-left hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40",onClick:()=>e(r),type:"button",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:ge("size-2 shrink-0 rounded-full",Qw(r.severity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:r.title}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:ph(r.timestamp)})]}),r.detail?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:r.detail}):null]})},r.id))})]})}function L8({event:e}){const t=new Date(e.timestamp);return u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:ge("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",B8(e.severity)),children:e.severity}),u.jsx("span",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.kind}),e.service?u.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.service}):null]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),u.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),u.jsx("pre",{className:"mt-1 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:e.detail})]}):null]})}function Qw(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function j8(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function B8(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function ph(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 z8({health:e}){if(!e)return null;const t=e.processTree,s=e.status==="healthy"||e.status==="unknown"?void 0:H8(e.summary);return u.jsxs("div",{className:"mt-1.5 grid min-w-0 gap-2 text-[11px] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsxs("span",{className:ge("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",I8(e.status)),children:[u.jsx("span",{className:"inline-flex shrink-0",children:u.jsx(mo,{className:"size-3"})}),u.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),s?u.jsx("span",{className:"min-w-0 truncate",children:s}):null]}),t?u.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(ON,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),u.jsxs("span",{children:[U8(t.cpuPercent)," CPU"]}),u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(fk,{className:"size-3"}),P8(t.rssMb)," RAM"]})]}):null]})}function I8(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 P8(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function U8(e){return`${e.toFixed(1)}%`}function H8(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function F8({ports:e}){const t=e.filter(r=>r.state==="occupied").length,s=e.filter(r=>r.state==="managed").length;return u.jsxs(Qs,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(Js,{className:"border-b border-border px-3 py-2",children:[u.jsxs(en,{className:"flex items-center gap-2",children:[u.jsx(_k,{className:"size-3.5"}),"Ports"]}),u.jsxs(Nr,{className:"text-xs",children:[s," managed, ",t," occupied by other"]})]}),u.jsx(tn,{className:"p-0",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(r=>u.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"font-mono text-xs",children:[":",r.port]}),u.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:r.services.join(", ")||"Unassigned"}),r.urls[0]?u.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:r.urls[0]}):null]}),u.jsx(V8,{port:r})]},r.port))}):u.jsx(mh,{label:"No configured ports yet."})})]})}function V8({compact:e,port:t}){const s=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",r=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return u.jsx(Ve,{className:ge(e&&"max-w-36 truncate"),variant:r,children:s})}function $8({onChange:e,value:t}){return u.jsxs("label",{className:"relative block",children:[u.jsx(Pk,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),u.jsx(vt,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:s=>e(s.target.value),placeholder:"Search logs",value:t})]})}function q8({className:e,containerRef:t,emptyText:s,logs:r,query:o}){return u.jsx("div",{className:ge("h-full max-w-full overflow-auto font-mono text-[11px] leading-5",e),ref:t,role:"log",children:r.length?r.map((l,h)=>u.jsxs("div",{className:ge("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:[u.jsx("span",{className:"text-muted-foreground",children:l.timestamp}),u.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[l.stream==="stderr"?u.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700",children:"stderr"}):null,G8(l.text,o)]})]},`${l.timestamp}-${l.stream}-${h}`)):u.jsx("div",{className:"p-3 text-muted-foreground",children:s})})}function K8(e){return`${e.timestamp} ${e.stream} ${e.text}`}function G8(e,t){const s=t.trim();if(!s)return e;const r=e.toLowerCase(),o=s.toLowerCase(),l=[];let h=0,f=r.indexOf(o);for(;f!==-1;){f>h&&l.push(e.slice(h,f));const m=f+s.length;l.push(u.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950",children:e.slice(f,m)},`${f}-${m}`)),h=m,f=r.indexOf(o,h)}return h<e.length&&l.push(e.slice(h)),l}function Ry(e){return`${e.kind}:${e.name}`}function W8(e,t=!1,s={}){const[r,o]=N.useState(),[l,h]=N.useState(),[f,m]=N.useState(e.kind==="source"),d=JSON.stringify(s);return N.useEffect(()=>{o(void 0),h(void 0);let _=!1;const v=async()=>{try{if(e.kind==="service"){const S=await KS(e.name,s);_||(o(S.logs),m(S.queryable),h(void 0))}else{const S=await qS(e.name,s);_||(o(S),m(!0),h(void 0))}}catch(S){_||h(S instanceof Error?S.message:String(S))}};v();const b=window.setInterval(v,t?1e3:2e3);return()=>{_=!0,window.clearInterval(b)}},[e.kind,e.name,t,d]),{logs:r,error:l,queryable:f}}const Y8=[{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 Jw({target:e,query:t,setQuery:s,streaming:r,setStreaming:o,hideStdout:l,setHideStdout:h,fill:f=!1,leading:m,trailing:d}){const _=e.kind==="source",[v,b]=N.useState(""),[S,x]=N.useState(""),[w,C]=N.useState(t);N.useEffect(()=>{const Z=window.setTimeout(()=>C(t),300);return()=>window.clearTimeout(Z)},[t]);const T=N.useMemo(()=>{const Z={};v&&(Z.since=v),S&&(Z.level=S);const Q=w.trim();return Q&&(Z.grep=Q),Z},[v,S,w]),{logs:O,error:k,queryable:D}=W8(e,r,T),U=_||D,P=N.useRef(null),B=N.useRef(!0),[M,F]=N.useState([]),[Y,$]=N.useState(!1),G=JSON.stringify(T);N.useEffect(()=>{F([])},[G,e.kind,e.name]);const I=N.useMemo(()=>{const Z=O??[];if(M.length===0)return Z;const Q=new Set(M.map(R=>R.cursor).filter(Boolean));return[...M,...Z.filter(R=>!R.cursor||!Q.has(R.cursor))]},[O,M]),ie=(M[0]??(O??[])[0])?.cursor;async function J(){if(!(!U||!ie||Y)){$(!0),B.current=!1;try{const Z={...T,before:ie,lines:200},Q=e.kind==="source"?await qS(e.name,Z):(await KS(e.name,Z)).logs;Q.length&&F(R=>{const te=new Set(R.map(le=>le.cursor).filter(Boolean));return[...Q.filter(le=>!le.cursor||!te.has(le.cursor)),...R]})}finally{$(!1)}}}const A=t.trim().toLowerCase(),q=N.useMemo(()=>{let Z=I;return l&&(Z=Z.filter(Q=>Q.stream==="stderr")),A&&(Z=Z.filter(Q=>K8(Q).toLowerCase().includes(A))),Z},[I,l,A]);N.useEffect(()=>{const Z=P.current;if(!Z)return;const Q=()=>{const R=Z.scrollHeight-Z.scrollTop-Z.clientHeight;B.current=R<40};return Q(),Z.addEventListener("scroll",Q,{passive:!0}),()=>Z.removeEventListener("scroll",Q)},[]),N.useEffect(()=>{if(!r||!B.current||q.length===0)return;const Z=P.current;Z&&(Z.scrollTop=Z.scrollHeight)},[r,q]);const V=O?A?`No log lines match "${t.trim()}".`:l?"No stderr output captured.":"No log entries.":"Loading…";return u.jsxs("div",{className:f?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,u.jsx($8,{onChange:s,value:t}),U?u.jsxs(u.Fragment,{children:[u.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:Z=>b(Z.target.value),value:v,children:Y8.map(Z=>u.jsx("option",{value:Z.value,children:Z.label},Z.label))}),u.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:S,children:[u.jsx("option",{value:"",children:"All levels"}),u.jsx("option",{value:"warn",children:"Warnings+"}),u.jsx("option",{value:"error",children:"Errors"})]})]}):u.jsxs(Dy,{active:l,activeClassName:"border-amber-600 bg-amber-50 text-amber-700",onClick:()=>h(!l),children:[u.jsx(ZN,{}),"Errors only"]}),u.jsxs(Dy,{active:r,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700",onClick:()=>o(!r),children:[u.jsx(Ok,{}),r?"Streaming":"Stream"]}),U&&ie?u.jsxs(_e,{disabled:Y,onClick:()=>{J()},size:"sm",type:"button",variant:"outline",children:[u.jsx(NS,{}),Y?"Loading…":"Load older"]}):null,d?u.jsx("div",{className:"ml-auto flex items-center gap-2",children:d}):null]}),k?u.jsx("div",{className:"text-red-600",children:k}):null,u.jsx(q8,{className:ge("rounded border border-border/60",f?"min-h-0 flex-1":"max-h-80"),containerRef:P,emptyText:V,logs:q,query:t})]})}function Dy({active:e,activeClassName:t,children:s,onClick:r}){return u.jsx(_e,{"aria-pressed":e,className:e?t:void 0,onClick:r,size:"sm",type:"button",variant:"outline",children:s})}function X8(e,t){return e.kind===t.kind&&e.name===t.name}function Z8({options:e,target:t,onChange:s,className:r}){const o=e.findIndex(h=>X8(h.target,t)),l=[...new Set(e.map(h=>h.group))];return u.jsx("select",{"aria-label":"Log source",className:r??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:h=>s(e[Number(h.target.value)].target),value:String(o),children:l.map(h=>u.jsx("optgroup",{label:h,children:e.map((f,m)=>f.group===h?u.jsx("option",{value:String(m),children:f.label},`${f.group}:${f.label}`):null)},h))})}function Q8({serviceName:e}){const[t,s]=N.useState(""),[r,o]=N.useState(!1),[l,h]=N.useState(!1),[f,m]=N.useState(!1),d=u.jsx(Jw,{fill:!0,hideStdout:l,query:t,setHideStdout:h,setQuery:s,setStreaming:o,streaming:r,target:{kind:"service",name:e},trailing:u.jsxs(_e,{onClick:()=>m(_=>!_),size:"sm",type:"button",variant:"outline",children:[f?u.jsx(pk,{}):u.jsx(hk,{}),f?"Exit":"Expand"]})});return f?u.jsx(eE,{onClose:()=>m(!1),title:`Logs — ${e}`,children:d}):u.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:d})}function eE({title:e,onClose:t,children:s,maxWidthClass:r="max-w-6xl"}){return N.useEffect(()=>{function o(l){l.key==="Escape"&&t()}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),Jg.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:u.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${r} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:o=>o.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),u.jsx(_e,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(Mr,{})})]}),u.jsx("div",{className:"min-h-0 flex-1 p-3",children:s})]})}),document.body)}const J8={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 eD({onClose:e,onAdded:t}){const[s,r]=N.useState(""),[o,l]=N.useState("journald"),[h,f]=N.useState(""),[m,d]=N.useState(""),[_,v]=N.useState(""),[b,S]=N.useState(""),[x,w]=N.useState(""),[C,T]=N.useState(""),[O,k]=N.useState(),[D,U]=N.useState(!1);async function P(){U(!0),k(void 0);try{const B={name:s.trim(),kind:"command"};o==="file"?(B.kind="file",B.path=m.trim()):o==="ssh"?(B.kind="ssh",B.host=h.trim(),B.path=m.trim()):o==="command"?(B.kind="command",B.command=_.trim(),b.trim()&&(B.cwd=b.trim())):o==="journald"?(B.driver="journald",B.unit=x.trim(),h.trim()&&(B.host=h.trim())):o==="docker"&&(B.driver="docker",B.container=C.trim(),h.trim()&&(B.host=h.trim()));const M=await C5(B);t(M,B.name),e()}catch(B){k(B instanceof Error?B.message:String(B))}finally{U(!1)}}return u.jsx(kr,{icon:u.jsx(HS,{}),onClose:e,size:"md",title:"Add log source",children:u.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:B=>{B.preventDefault(),P()},children:[u.jsx(Rn,{label:"Name",children:u.jsx(vt,{autoFocus:!0,onChange:B=>r(B.target.value),placeholder:"PROD",value:s})}),u.jsxs(Rn,{label:"Type",children:[u.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:B=>l(B.target.value),value:o,children:[u.jsx("option",{value:"journald",children:"systemd journal (journald)"}),u.jsx("option",{value:"docker",children:"Docker container"}),u.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),u.jsx("option",{value:"file",children:"Local file"}),u.jsx("option",{value:"command",children:"Command"})]}),u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:J8[o]})]}),o==="journald"||o==="docker"?u.jsx(Rn,{label:"Host (optional — leave blank to run locally)",children:u.jsx(vt,{onChange:B=>f(B.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:h})}):null,o==="journald"?u.jsx(Rn,{label:"Unit",children:u.jsx(vt,{onChange:B=>w(B.target.value),placeholder:"jobjourney",value:x})}):null,o==="docker"?u.jsx(Rn,{label:"Container",children:u.jsx(vt,{onChange:B=>T(B.target.value),placeholder:"brainctl-api",value:C})}):null,o==="ssh"?u.jsx(Rn,{label:"Host",children:u.jsx(vt,{onChange:B=>f(B.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:h})}):null,o==="file"||o==="ssh"?u.jsx(Rn,{label:o==="ssh"?"Remote path":"File path",children:u.jsx(vt,{onChange:B=>d(B.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,o==="command"?u.jsxs(u.Fragment,{children:[u.jsx(Rn,{label:"Command",children:u.jsx(vt,{onChange:B=>v(B.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:_})}),u.jsx(Rn,{label:"Working directory (optional)",children:u.jsx(vt,{onChange:B=>S(B.target.value),placeholder:"/srv/app",value:b})})]}):null,O?u.jsx("div",{className:"text-red-600",children:O}):null,u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx(_e,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),u.jsx(_e,{disabled:D||!s.trim(),size:"sm",type:"submit",children:D?"Saving…":"Add source"})]})]})})}function Rn({label:e,children:t}){return u.jsxs("label",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const Oy=4;function tD({services:e,initialService:t,onClose:s}){const[r,o]=N.useState([]),[l,h]=N.useState(!1),[f,m]=N.useState(()=>[0]),[d,_]=N.useState(()=>{const k=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return k?{0:k}:{}}),v=N.useRef(1);N.useEffect(()=>{let k=!1;return E5().then(D=>{k||o(D)}),()=>{k=!0}},[]);const b=[...e.map(k=>({target:{kind:"service",name:k},label:k,group:"Services"})),...r.map(k=>({target:{kind:"source",name:k.name},label:k.name,group:"Log sources"}))],S=b.map(k=>k.target);function x(){if(f.length>=Oy||S.length===0)return;const k=v.current++,D=new Set(Object.values(d).map(Ry)),U=S.find(P=>!D.has(Ry(P)))??S[0];m(P=>[...P,k]),_(P=>({...P,[k]:U}))}function w(k){m(D=>D.filter(U=>U!==k)),_(D=>{const U={...D};return delete U[k],U})}function C(k,D){_(U=>({...U,[k]:D}))}function T(k,D){o(k);const U=f[0];U!==void 0&&C(U,{kind:"source",name:D})}const O=u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:"Logs"}),u.jsxs(_e,{onClick:()=>h(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(js,{}),"Add source"]}),u.jsxs(_e,{disabled:f.length>=Oy||S.length===0,onClick:x,size:"sm",type:"button",variant:"outline",children:[u.jsx(js,{}),"Add pane"]})]});return u.jsxs(u.Fragment,{children:[u.jsx(eE,{maxWidthClass:"max-w-[1500px]",onClose:s,title:O,children:S.length===0?u.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:u.jsxs("div",{children:[u.jsx("p",{children:"No services or log sources yet."}),u.jsxs(_e,{className:"mt-2",onClick:()=>h(!0),size:"sm",type:"button",children:[u.jsx(js,{}),"Add a log source"]})]})}):u.jsx("div",{className:ge("grid h-full min-h-0 gap-3",f.length>1?"lg:grid-cols-2":"grid-cols-1",f.length>2?"lg:grid-rows-2":"grid-rows-1"),children:f.map(k=>u.jsx(iD,{onChangeTarget:D=>C(k,D),onRemove:f.length>1?()=>w(k):void 0,options:b,target:d[k]??S[0]},k))})}),l?u.jsx(eD,{onAdded:T,onClose:()=>h(!1)}):null]})}function iD({options:e,target:t,onChangeTarget:s,onRemove:r}){const[o,l]=N.useState(""),[h,f]=N.useState(!0),[m,d]=N.useState(!1);return u.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:u.jsx(Jw,{fill:!0,hideStdout:m,leading:u.jsx(Z8,{onChange:s,options:e,target:t}),query:o,setHideStdout:d,setQuery:l,setStreaming:f,streaming:h,target:t,trailing:r?u.jsx(_e,{"aria-label":"Remove pane",onClick:r,size:"icon",type:"button",variant:"ghost",children:u.jsx(Mr,{})}):void 0})})}function sD({rows:e,revealAll:t,onAdd:s,onRemove:r,onUpdate:o}){return e.length===0?u.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",u.jsx("button",{className:"underline",onClick:s,type:"button",children:"Add one"}),"."]}):u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Key"}),u.jsx("th",{className:"py-1 pr-3",children:"Value"}),u.jsx("th",{className:"py-1 w-8"})]})}),u.jsx("tbody",{children:e.map((l,h)=>{const f=!l.reveal&&!t;return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>o(h,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:l.key})}),u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>o(h,{value:m.target.value}),spellCheck:!1,type:f?"password":"text",value:l.value}),u.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>o(h,{reveal:!l.reveal}),title:l.reveal||t?"Hide":"Reveal",type:"button",children:l.reveal||t?u.jsx(MS,{size:14}):u.jsx(AS,{size:14})})]})}),u.jsx("td",{className:"py-1 align-top",children:u.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>r(h),type:"button",children:u.jsx(xg,{size:14})})})]},h)})})]})})}function nD({serviceName:e,onClose:t,onPick:s}){const[r,o]=N.useState(),[l,h]=N.useState(),[f,m]=N.useState(!0),[d,_]=N.useState();N.useEffect(()=>{let S=!1;return m(!0),h(void 0),(async()=>{try{const x=await T5(e,d);S||o(x)}catch(x){S||h(x instanceof Error?x.message:String(x))}finally{S||m(!1)}})(),()=>{S=!0}},[e,d]);function v(S){if(S.kind==="directory"){_(S.relativePath);return}S.supported&&s(S.relativePath)}function b(){if(!r||r.isRoot)return;const S=r.relativePath,x=S.includes("/")?S.slice(0,S.lastIndexOf("/")):"";_(x||void 0)}return u.jsx(kr,{icon:u.jsx(wh,{}),onClose:t,size:"lg",title:"Pick a config file",children:u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsxs(_e,{disabled:!r||r.isRoot,onClick:b,size:"sm",type:"button",variant:"outline",children:[u.jsx(NS,{})," Up"]}),u.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:r?.relativePath||"./"})]}),l?u.jsx("div",{className:"text-red-600",children:l}):f?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!r||r.entries.length===0?u.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):u.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:u.jsx("ul",{className:"divide-y divide-border/40",children:r.entries.map(S=>{const x=S.kind==="directory",w=x||S.supported;return u.jsx("li",{children:u.jsxs("button",{className:ge("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:()=>v(S),type:"button",children:[x?u.jsx(xo,{size:14}):u.jsx(bg,{size:14}),u.jsx("span",{className:"flex-1 truncate font-mono",children:S.name}),!x&&S.format?u.jsx(Ve,{size:"small",variant:"secondary",children:S.format}):null]})},S.relativePath)})})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",u.jsx("code",{children:".env*"}),", ",u.jsx("code",{children:"appsettings*.json"}),", and"," ",u.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function tE(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function rD(e){const{error:t,success:s}=Gi(),[r,o]=N.useState([]),[l,h]=N.useState(),[f,m]=N.useState(),[d,_]=N.useState(!0),[v,b]=N.useState(!1),[S,x]=N.useState(!1),[w,C]=N.useState(!1),[T,O]=N.useState();N.useEffect(()=>{let Y=!1;return _(!0),O(void 0),(async()=>{try{const $=await M5(e);if(Y)return;o($.files),$.files.length>0?h(G=>G??$.files[0].path):(h(void 0),m(void 0))}catch($){Y||O($ instanceof Error?$.message:String($))}finally{Y||_(!1)}})(),()=>{Y=!0}},[e]);const k=N.useCallback(async Y=>{b(!0),O(void 0);try{const $=await e1(e,Y),G={path:$.path,relativePath:$.relativePath,format:$.format};$.format==="env"?m({info:G,exists:$.exists,rows:$.entries.map(I=>({...I,reveal:!1}))}):m({info:G,exists:$.exists,text:$.format==="json"?tE($.content):$.content}),C(!1)}catch($){O($ instanceof Error?$.message:String($))}finally{b(!1)}},[e]);N.useEffect(()=>{l&&k(l)},[l,k]);function D(Y,$){m(G=>{if(!G?.rows)return G;const I=G.rows.map((ie,J)=>J===Y?{...ie,...$}:ie);return{...G,rows:I}}),C(!0)}function U(){m(Y=>Y?.rows?{...Y,rows:[...Y.rows,{key:"",value:"",secret:!1,reveal:!0}]}:Y),C(!0)}function P(Y){m($=>$?.rows?{...$,rows:$.rows.filter((G,I)=>I!==Y)}:$),C(!0)}function B(Y){m($=>$&&{...$,text:Y}),C(!0)}async function M(){if(f){x(!0);try{if(f.info.format==="env"&&f.rows){const Y=await A5(e,f.info.path,f.rows.map($=>({key:$.key.trim(),value:$.value})));m({info:{path:Y.path,relativePath:Y.relativePath,format:Y.format},exists:Y.exists,rows:Y.entries.map($=>({...$,reveal:!1}))}),s(`Saved ${Y.entries.length} entries to ${Y.relativePath}.`)}else if(f.text!==void 0){const Y=await R5(e,f.info.path,f.text);m({info:{path:Y.path,relativePath:Y.relativePath,format:Y.format},exists:Y.exists,text:Y.content}),s(`Saved ${Y.relativePath}.`)}C(!1)}catch(Y){t(Y instanceof Error?Y.message:String(Y))}finally{x(!1)}}}async function F(Y){try{const $=await e1(e,Y),G={path:$.path,relativePath:$.relativePath,format:$.format};return o(I=>I.some(ie=>ie.path===G.path)?I:[...I,G]),h(G.path),s(`Loaded ${G.relativePath}.`),!0}catch($){return t($ instanceof Error?$.message:String($)),!1}}return{files:r,selectedPath:l,setSelectedPath:h,loaded:f,loadingList:d,loadingFile:v,saving:S,dirty:w,error:T,addRow:U,removeRow:P,updateRow:D,updateText:B,save:M,pickFile:F}}function aD({serviceName:e}){const{files:t,selectedPath:s,setSelectedPath:r,loaded:o,loadingList:l,loadingFile:h,saving:f,dirty:m,error:d,addRow:_,removeRow:v,updateRow:b,updateText:S,save:x,pickFile:w}=rD(e),[C,T]=N.useState(!1),[O,k]=N.useState(!1);return l?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):d&&!o?u.jsx("div",{className:"text-red-600",children:d}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?u.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:D=>r(D.target.value),value:s??"",children:t.map(D=>u.jsxs("option",{value:D.path,children:[D.relativePath," [",D.format,"]"]},D.path))}):u.jsx("span",{className:"text-muted-foreground",children:"none detected"}),u.jsxs(_e,{onClick:()=>k(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(wh,{})," Browse files"]}),o?u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:o.info.path}):null]}),u.jsxs("div",{className:"flex items-center gap-1",children:[o?.info.format==="env"?u.jsxs(u.Fragment,{children:[u.jsxs(_e,{onClick:()=>T(D=>!D),size:"sm",type:"button",variant:"outline",children:[C?u.jsx(MS,{}):u.jsx(AS,{}),C?"Hide secrets":"Reveal secrets"]}),u.jsxs(_e,{onClick:_,size:"sm",type:"button",variant:"outline",children:[u.jsx(js,{})," Add"]})]}):null,u.jsxs(_e,{disabled:!m||f||!o,onClick:x,size:"sm",type:"button",children:[u.jsx(US,{})," ",f?"Saving…":"Save"]})]})]}),d&&!o?u.jsx("div",{className:"text-red-600",children:d}):o?.info.format==="env"&&o.rows?u.jsx("div",{className:ge(h&&"opacity-60 transition-opacity"),children:u.jsx(sD,{revealAll:C,rows:o.rows,onAdd:_,onRemove:v,onUpdate:b})}):o?.text!==void 0?u.jsxs("div",{className:ge("space-y-1",h&&"opacity-60 transition-opacity"),children:[o.info.format==="json"?u.jsx("div",{className:"flex justify-end",children:u.jsx(_e,{onClick:()=>S(tE(o.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,u.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:D=>S(D.target.value),spellCheck:!1,value:o.text})]}):h?u.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,o?u.jsxs("p",{className:"text-muted-foreground",children:[o.info.format==="env"?"Comments and blank lines are preserved.":o.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,O?u.jsx(nD,{onClose:()=>k(!1),onPick:D=>{w(D).then(U=>{U&&k(!1)})},serviceName:e}):null]})}function oD({serviceName:e,status:t,timeline:s,onRefresh:r}){const{error:o,success:l}=Gi(),[h,f]=N.useState(!1),m=t?.inspector,d=t?.state==="running",_=N.useMemo(()=>s.filter(S=>S.kind==="service.http"&&S.service===e).map(S=>{const x=S.data??{};return{id:x.id??S.id,startedAt:S.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(),[s,e]);async function v(S){f(!0);try{await os(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:S?"true":"false"}),await r(),l(S?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(x){o(x instanceof Error?x.message:String(x))}finally{f(!1)}}if(!d)return u.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"text-muted-foreground",children:"The HTTP inspector starts a local proxy that forwards traffic to this service and records every request. Hit the inspect URL instead of the original port to see requests appear here. The service itself is not touched."}),u.jsxs(_e,{disabled:h,onClick:()=>v(!0),size:"sm",type:"button",children:[u.jsx(yg,{})," Start HTTP inspector"]})]});const b=m.port?`http://127.0.0.1:${m.port}`:void 0;return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),b?u.jsxs(u.Fragment,{children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:b}),u.jsxs(_e,{onClick:()=>{navigator.clipboard.writeText(b),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[u.jsx(kS,{})," Copy"]}),u.jsx(_e,{onClick:()=>window.open(b,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):u.jsx("span",{className:"text-muted-foreground",children:"starting…"}),u.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),u.jsxs(_e,{disabled:h,onClick:()=>v(!1),size:"sm",type:"button",variant:"outline",children:[u.jsx(Eh,{})," Stop"]})]}),_.length===0?u.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):u.jsx("div",{className:"max-h-80 overflow-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Time"}),u.jsx("th",{className:"py-1 pr-3",children:"Method"}),u.jsx("th",{className:"py-1 pr-3",children:"Path"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),u.jsx("tbody",{children:_.map(S=>u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(S.startedAt).toLocaleTimeString()}),u.jsx("td",{className:"py-1 pr-3",children:S.method}),u.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:S.path}),u.jsx("td",{className:ge("py-1 pr-3 text-right",lD(S.status)),children:S.status}),u.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:cD(S.resBytes)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:S.durationMs.toFixed(1)})]},S.id))})]})})]})}function lD(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 cD(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function uD({rows:e}){if(e.length===0)return u.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((r,o)=>o.cpuPercent-r.cpuPercent),s=new Set(e.map(r=>r.pid));return u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"PID"}),u.jsx("th",{className:"py-1 pr-3",children:"PPID"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),u.jsx("th",{className:"py-1",children:"Command"})]})}),u.jsx("tbody",{children:t.map(r=>{const o=s.has(r.ppid);return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3",children:r.pid}),u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:r.ppid}),u.jsx("td",{className:"py-1 pr-3 text-right",children:r.cpuPercent.toFixed(1)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:r.rssMb.toFixed(1)}),u.jsx("td",{className:ge("py-1 truncate max-w-[60ch]",o&&"pl-4"),children:r.command})]},r.pid)})})]})})}const hD=500;function dD(e){const[t,s]=N.useState(),[r,o]=N.useState([]),[l,h]=N.useState(),[f,m]=N.useState(!1),d=N.useRef();N.useEffect(()=>{d.current=void 0,s(void 0),o([]);const v=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),b=S=>{try{const x=JSON.parse(S.data);x.run.id!==d.current&&(d.current=x.run.id,o([])),s(x.run),x.line&&o(w=>[...w,x.line].slice(-hD))}catch{}};return v.addEventListener("status",b),v.addEventListener("output",b),()=>v.close()},[e]);const _=N.useCallback(async v=>{m(!0),h(void 0);try{await O5(e,v)}catch(b){h(b instanceof Error?b.message:String(b))}finally{m(!1)}},[e]);return{run:t,lines:r,error:l,starting:f,start:_}}const fD={running:"secondary",passed:"success",failed:"error",error:"error"},mD={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function pD({serviceName:e}){const{run:t,lines:s,error:r,starting:o,start:l}=dD(e),[h,f]=N.useState(""),m=t?.status==="running"||o,d=t?.status==="failed"||t?.status==="error";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("form",{className:"flex items-center gap-2",onSubmit:_=>{_.preventDefault(),m||l(h.trim()||void 0)},children:[u.jsx(vt,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:_=>f(_.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:h}),u.jsx(_e,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),r?u.jsx("div",{className:"text-red-600",children:r}):null,t?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[u.jsx(Ve,{size:"small",variant:fD[t.status],children:mD[t.status]}),u.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?u.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?u.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):u.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),s.length>0?u.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:s.map((_,v)=>u.jsx("div",{className:ge(_.stream==="stderr"&&"text-red-500"),children:_.text},v))}):null,d?u.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",u.jsx("a",{className:"font-medium underline",href:"/errors",children:"Error Inbox"})," ","— open an incident there to copy a debugging prompt for your agent."]}):null]})}function gD({serviceName:e,status:t,health:s,timeline:r,onRefresh:o}){const[l,h]=N.useState("processes"),f=s?.processTree?.processes??[];return u.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"mb-2 flex gap-1",children:[u.jsxs(Tl,{active:l==="processes",onClick:()=>h("processes"),children:["Processes ",f.length?u.jsx(Ve,{variant:"secondary",size:"small",children:f.length}):null]}),u.jsxs(Tl,{active:l==="http",onClick:()=>h("http"),children:["HTTP",t?.inspector?.enabled?u.jsx(Ve,{variant:"success",size:"small",children:"on"}):null]}),u.jsx(Tl,{active:l==="env",onClick:()=>h("env"),children:"Env"}),u.jsx(Tl,{active:l==="tests",onClick:()=>h("tests"),children:"Tests"}),u.jsx(Tl,{active:l==="logs",onClick:()=>h("logs"),children:"Logs"})]}),l==="processes"?u.jsx(uD,{rows:f}):null,l==="http"?u.jsx(oD,{serviceName:e,status:t,timeline:r,onRefresh:o}):null,l==="env"?u.jsx(aD,{serviceName:e}):null,l==="tests"?u.jsx(pD,{serviceName:e}):null,l==="logs"?u.jsx(Q8,{serviceName:e}):null]})}function Tl({active:e,onClick:t,children:s}){return u.jsx("button",{className:ge("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:s})}function _D({allServices:e,group:t,onRefresh:s,ports:r,services:o,health:l,statuses:h,timeline:f,selectedService:m,onSelectService:d}){const[_,v]=N.useState(!1),[b,S]=N.useState(!1),x=o.some(w=>t_(h[w.name]?.state));return u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[u.jsxs("button",{"aria-expanded":!b,className:"flex min-w-0 flex-1 items-center gap-1.5 text-left",onClick:()=>S(w=>!w),type:"button",children:[u.jsx(Tr,{className:ge("size-3.5 shrink-0 text-muted-foreground transition-transform",b&&"-rotate-90")}),u.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),u.jsx(Ve,{size:"small",variant:"secondary",children:t.services.length})]}),u.jsx(yr,{label:"Edit group",children:u.jsx(_e,{"aria-expanded":_,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>v(w=>!w),size:"icon",type:"button",variant:"ghost",children:u.jsx(Tk,{})})}),u.jsx(Xw,{active:x,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await os(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await os(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},targetLabel:`group ${t.name}`,onRefresh:s})]}),_?u.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:u.jsx(Zw,{initialName:t.name,initialServices:t.services,onRefresh:s,onSaved:()=>v(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,b?null:u.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:o.length?o.map(w=>u.jsx(iE,{service:w,status:h[w.name],health:l[w.name],ports:r,onRefresh:s,timeline:f,selected:m===w.name,onSelect:()=>d(w.name)},w.name)):u.jsx(yt,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function iE({service:e,status:t,onRefresh:s,selected:r=!1,onSelect:o}){const l=t?.state??"stopped",h=t_(l),[f,m]=N.useState(!1),{error:d}=Gi();async function _(v){v.stopPropagation(),m(!0);try{const b=h?"stop":"start";await os(`/api/services/${encodeURIComponent(e.name)}/${b}`,{}),await s()}catch(b){d(vo(h?"Stop":"Start",e.name,b))}finally{m(!1)}}return u.jsxs("div",{"aria-selected":r,className:ge("flex cursor-pointer items-center gap-2 px-3 py-1.5 transition-colors",r?"border-l-2 border-primary bg-muted/70":"border-l-2 border-transparent hover:bg-muted/30"),onClick:o,role:"option",children:[u.jsx(e_,{command:e.command??""}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),e.port?u.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[":",e.port]}):null]}),u.jsx(sE,{state:l}),u.jsx(yr,{label:h?"Stop":"Start",side:"left",children:u.jsx(_e,{"aria-label":h?`Stop ${e.name}`:`Start ${e.name}`,className:"size-7",disabled:f,onClick:_,size:"icon",type:"button",variant:"outline",children:h?u.jsx(Eh,{}):u.jsx(yg,{})})})]})}function t_(e){return e==="running"||e==="starting"}function vD({service:e,onRefresh:t}){const[s,r]=N.useState(e.port?String(e.port):""),[o,l]=N.useState(!1),{error:h,success:f}=Gi(),m=s.trim()!==(e.port?String(e.port):"");N.useEffect(()=>{r(e.port?String(e.port):"")},[e.port]);async function d(_){_.preventDefault(),l(!0);try{await os("/api/services",{name:e.name,command:e.command??"",cwd:e.cwd??"",port:s,description:e.description}),f(`Port saved for ${e.name}.`),await t()}catch(v){h(vo("Save port",e.name,v))}finally{l(!1)}}return u.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:d,children:[u.jsx(vt,{"aria-label":`Port for ${e.name}`,className:"h-8 w-20 font-mono text-xs",inputMode:"numeric",min:1,max:65535,onChange:_=>r(_.target.value),placeholder:"port",type:"number",value:s}),u.jsx(_e,{"aria-label":`Save port for ${e.name}`,disabled:o||!m,className:"size-8",size:"icon",title:"Save port",type:"submit",variant:"outline",children:u.jsx(US,{})})]})}function bD(e){return`http://127.0.0.1:${e}`}function sE({state:e}){return u.jsx(Ve,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:ge(e==="running"&&"font-mono"),children:e})}function yD({data:e,onRefresh:t}){const s=e.config.services[0]?.name??"",[r,o]=N.useState(s),[l,h]=N.useState(null),[f,m]=N.useState(!1),[d,_]=N.useState(!0),[v,b]=N.useState(!1),S=N.useRef({}),{error:x,message:w,success:C}=Gi(),T=N.useMemo(()=>new Set(e.config.bundles.flatMap(F=>F.services)),[e.config.bundles]),O=N.useMemo(()=>{const F=new Map;for(const Y of e.config.bundles)for(const $ of Y.services)F.has($)||F.set($,Y.name);return F},[e.config.bundles]),k=N.useMemo(()=>e.config.services.filter(F=>!T.has(F.name)),[e.config.services,T]),D=e.health??{},U=e.config.bundles.length>0||k.length>0;N.useEffect(()=>{!e.config.services.some(Y=>Y.name===r)&&s&&o(s)},[e.config.services,s,r]);const P=N.useMemo(()=>e.config.services.find(F=>F.name===r),[e.config.services,r]),B=r?e.runtime.services[r]:void 0,M=r?D[r]:void 0;return N.useEffect(()=>{const F=Object.fromEntries(e.config.services.map($=>[$.name,e.runtime.services[$.name]?.state??"stopped"])),Y=S.current;if(Object.keys(Y).length){const $=new Map,G=new Map;for(const I of e.config.services){const ie=F[I.name],J=Y[I.name];if(!J||J===ie)continue;const A=e.runtime.services[I.name],q=O.get(I.name);if(q){const V=$.get(q)??new Map;if(V.set(ie,(V.get(ie)??0)+1),$.set(q,V),ie==="exited"){const Z=G.get(q)??[];Z.push(A?.exitCode),G.set(q,Z)}continue}if(ie==="running")C(`${I.name} is running.`);else if(ie==="stopped")w({text:`${I.name} stopped.`});else if(ie==="starting")w({text:`${I.name} is starting.`});else if(ie==="exited"){const V=A?.exitCode===void 0||A.exitCode===null?"":` with code ${A.exitCode}`;x(`${I.name} exited${V}.`)}}for(const[I,ie]of $)xD({exitCodes:G.get(I)??[],groupName:I,showErrorToast:x,showMessageToast:w,showSuccessToast:C,transitions:ie})}S.current=F},[e.config.services,e.runtime.services,O,x,w,C]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:ge("grid h-full min-h-0 overflow-hidden bg-card/85",d?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:u.jsxs(Qs,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsx(Js,{className:"border-b border-border px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(en,{className:"text-sm",children:"Services"}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(_e,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>m(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(HS,{className:"size-3.5"}),"Logs"]}),u.jsx(yr,{label:"Add service",side:"bottom",children:u.jsx(_e,{"aria-haspopup":"dialog","aria-label":"Add service",className:"size-7",onClick:()=>h("service"),size:"icon",type:"button",variant:"ghost",children:u.jsx(js,{})})}),u.jsx(yr,{label:"Create group",side:"left",children:u.jsx(_e,{"aria-haspopup":"dialog","aria-label":"Create group",className:"size-7",onClick:()=>h("group"),size:"icon",type:"button",variant:"ghost",children:u.jsx(Jb,{})})})]})]})}),u.jsx(tn,{className:"p-0",children:U?u.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(F=>u.jsx(_D,{group:F,onRefresh:t,ports:e.ports,allServices:e.config.services,health:D,services:e.config.services.filter(Y=>F.services.includes(Y.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:r,onSelectService:o},F.name)),k.length?[{key:"local",label:"Local Services"},{key:"docker-compose",label:"Docker Compose"},{key:"ssh",label:"Remote (SSH)"}].map(({key:F,label:Y})=>{const $=k.filter(G=>(G.kind??"local")===F);return $.length===0?null:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 bg-muted/55 px-3 py-1 text-[10px] font-semibold uppercase text-muted-foreground",children:[u.jsx("span",{children:Y}),u.jsx("span",{className:"text-muted-foreground/80",children:$.length})]}),u.jsx("div",{className:"divide-y divide-border",children:$.map(G=>u.jsx(iE,{service:G,status:e.runtime.services[G.name],health:D[G.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:r===G.name,onSelect:()=>o(G.name)},G.name))})]},F)}):null]}):u.jsx(mh,{label:"No services registered yet."})})]})}),u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:P?u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:P.name}),u.jsx(sE,{state:B?.state??"stopped"}),P.kind&&P.kind!=="local"?u.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 text-[10px] uppercase text-muted-foreground",children:P.kind}):null,u.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[u.jsx(vD,{service:P,onRefresh:t}),(()=>{const F=B?.url??(P.port?bD(P.port):void 0);return F?u.jsx(yr,{label:`Open ${F}`,children:u.jsx(_e,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(F,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:u.jsx(TS,{})})}):null})(),M?.agentContext?u.jsx(yr,{label:"Copy debug context for an AI agent",children:u.jsx(_e,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>b(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Yl,{})})}):null,u.jsx(Xw,{active:t_(B?.state),baseUrl:`/api/services/${encodeURIComponent(P.name)}`,compact:!0,targetLabel:P.name,onRefresh:t}),u.jsx(yr,{label:d?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:u.jsx(_e,{"aria-label":d?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>_(F=>!F),size:"icon",type:"button",variant:"ghost",children:d?u.jsx(NN,{}):u.jsx(pa,{})})})]})]}),P.command?u.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:P.command,children:["$ ",P.command]}):null,P.cwd?u.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:P.cwd,children:P.cwd}):null,u.jsx(z8,{health:M})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsx(gD,{serviceName:P.name,status:B,health:M,timeline:e.timeline??[],onRefresh:t})})]}):u.jsx(mh,{label:"Select a service to see details."})}),d?null:u.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[u.jsx(F8,{ports:e.ports}),u.jsx(T8,{events:e.timeline??[]})]})]}),v&&P&&M?.agentContext?u.jsx(kr,{icon:u.jsx(Yl,{}),onClose:()=>b(!1),title:`Agent context — ${P.name}`,children:u.jsx("div",{className:"p-4",children:u.jsx(o8,{context:M.agentContext})})}):null,l?u.jsx(kr,{icon:l==="service"?u.jsx(js,{}):u.jsx(Jb,{}),onClose:()=>h(null),size:l==="service"?"lg":"md",title:l==="service"?"Add Service":"Create Group",children:l==="service"?u.jsx(N8,{cwd:e.cwd,onRefresh:t,onSaved:()=>h(null)}):u.jsx(Zw,{services:k,onRefresh:t,onSaved:()=>h(null)})}):null,f?u.jsx(tD,{initialService:r||void 0,onClose:()=>m(!1),services:e.config.services.map(F=>F.name)}):null]})}function xD({exitCodes:e,groupName:t,showErrorToast:s,showMessageToast:r,showSuccessToast:o,transitions:l}){if(l.size===1){const[m]=l.keys();if(m==="running")o(`${t} group is running.`);else if(m==="stopped")r({text:`${t} group stopped.`});else if(m==="starting")r({text:`${t} group is starting.`});else if(m==="exited"){const d=e.filter(v=>v!=null),_=d.length?` with code ${d.join(", ")}`:"";s(`${t} group exited${_}.`)}return}const h=[...l.entries()].map(([m,d])=>`${d} ${m}`).join(", "),f=`${t} group updated: ${h}.`;l.has("exited")?s(f):r({text:f})}var SD=2,wD=1,ED=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,s=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(s.getPropertyValue("height")),o=Math.max(0,parseInt(s.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),h={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},f=h.top+h.bottom,m=h.right+h.left,d=r-f,_=o-m-t;return{cols:Math.max(SD,Math.floor(_/e.css.cell.width)),rows:Math.max(wD,Math.floor(d/e.css.cell.height))}}};var nE=Object.defineProperty,CD=Object.getOwnPropertyDescriptor,ND=(e,t)=>{for(var s in t)nE(e,s,{get:t[s],enumerable:!0})},It=(e,t,s,r)=>{for(var o=r>1?void 0:r?CD(t,s):t,l=e.length-1,h;l>=0;l--)(h=e[l])&&(o=(r?h(t,s,o):h(o))||o);return r&&o&&nE(t,s,o),o},ve=(e,t)=>(s,r)=>t(s,r,e),Ly="Terminal input",jp={get:()=>Ly,set:e=>Ly=e},jy="Too much output to announce, navigate to rows manually to read",Bp={get:()=>jy,set:e=>jy=e};function kD(e){return e.replace(/\r?\n/g,"\r")}function TD(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function MD(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function AD(e,t,s,r){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");rE(o,t,s,r)}}function rE(e,t,s,r){e=kD(e),e=TD(e,s.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function aE(e,t,s){let r=s.getBoundingClientRect(),o=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function By(e,t,s,r,o){aE(e,t,s),o&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function br(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Mh(e,t=0,s=e.length){let r="";for(let o=t;o<s;++o){let l=e[o];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var RD=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o=0;if(this._interim){let l=e.charCodeAt(o++);56320<=l&&l<=57343?t[r++]=(this._interim-55296)*1024+l-56320+65536:(t[r++]=this._interim,t[r++]=l),this._interim=0}for(let l=o;l<s;++l){let h=e.charCodeAt(l);if(55296<=h&&h<=56319){if(++l>=s)return this._interim=h,r;let f=e.charCodeAt(l);56320<=f&&f<=57343?t[r++]=(h-55296)*1024+f-56320+65536:(t[r++]=h,t[r++]=f);continue}h!==65279&&(t[r++]=h)}return r}},DD=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o,l,h,f,m=0,d=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(S&224)===192?31:(S&240)===224?15:7;let x=0,w;for(;(w=this.interim[++x]&63)&&x<4;)S<<=6,S|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,T=C-x;for(;d<T;){if(d>=s)return 0;if(w=e[d++],(w&192)!==128){d--,b=!0;break}else this.interim[x++]=w,S<<=6,S|=w&63}b||(C===2?S<128?d--:t[r++]=S:C===3?S<2048||S>=55296&&S<=57343||S===65279||(t[r++]=S):S<65536||S>1114111||(t[r++]=S)),this.interim.fill(0)}let _=s-4,v=d;for(;v<s;){for(;v<_&&!((o=e[v])&128)&&!((l=e[v+1])&128)&&!((h=e[v+2])&128)&&!((f=e[v+3])&128);)t[r++]=o,t[r++]=l,t[r++]=h,t[r++]=f,v+=4;if(o=e[v++],o<128)t[r++]=o;else if((o&224)===192){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(m=(o&31)<<6|l&63,m<128){v--;continue}t[r++]=m}else if((o&240)===224){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(h=e[v++],(h&192)!==128){v--;continue}if(m=(o&15)<<12|(l&63)<<6|h&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[r++]=m}else if((o&248)===240){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(h=e[v++],(h&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,this.interim[2]=h,r;if(f=e[v++],(f&192)!==128){v--;continue}if(m=(o&7)<<18|(l&63)<<12|(h&63)<<6|f&63,m<65536||m>1114111)continue;t[r++]=m}}return r}},oE="",Sr=" ",uc=class lE{constructor(){this.fg=0,this.bg=0,this.extended=new gh}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 lE;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}},gh=class cE{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new cE(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Cs=class uE extends uc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new gh,this.combinedData=""}static fromCharData(t){let s=new uE;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?br(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(r-55296)*1024+o-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},zy="di$target",zp="di$dependencies",um=new Map;function OD(e){return e[zp]||[]}function mi(e){if(um.has(e))return um.get(e);let t=function(s,r,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");LD(t,s,o)};return t._id=e,um.set(e,t),t}function LD(e,t,s){t[zy]===t?t[zp].push({id:e,index:s}):(t[zp]=[{id:e,index:s}],t[zy]=t)}var ji=mi("BufferService"),hE=mi("CoreMouseService"),_a=mi("CoreService"),jD=mi("CharsetService"),i_=mi("InstantiationService"),dE=mi("LogService"),Bi=mi("OptionsService"),fE=mi("OscLinkService"),BD=mi("UnicodeService"),hc=mi("DecorationService"),Ip=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let r=[],o=this._optionsService.rawOptions.linkHandler,l=new Cs,h=s.getTrimmedLength(),f=-1,m=-1,d=!1;for(let _=0;_<h;_++)if(!(m===-1&&!s.hasContent(_))){if(s.loadCell(_,l),l.hasExtendedAttrs()&&l.extended.urlId)if(m===-1){m=_,f=l.extended.urlId;continue}else d=l.extended.urlId!==f;else m!==-1&&(d=!0);if(d||m!==-1&&_===h-1){let v=this._oscLinkService.getLinkData(f)?.uri;if(v){let b={start:{x:m+1,y:e},end:{x:_+(!d&&_===h-1?1:0),y:e}},S=!1;if(!o?.allowNonHttpProtocols)try{let x=new URL(v);["http:","https:"].includes(x.protocol)||(S=!0)}catch{S=!0}S||r.push({text:v,range:b,activate:(x,w)=>o?o.activate(x,w,b):zD(x,w),hover:(x,w)=>o?.hover?.(x,w,b),leave:(x,w)=>o?.leave?.(x,w,b)})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=_,f=l.extended.urlId):(m=-1,f=-1)}}t(r)}};Ip=It([ve(0,ji),ve(1,Bi),ve(2,fE)],Ip);function zD(e,t){if(confirm(`Do you want to navigate to ${t}?
15
+
16
+ WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ah=mi("CharSizeService"),jn=mi("CoreBrowserService"),s_=mi("MouseService"),Bn=mi("RenderService"),ID=mi("SelectionService"),mE=mi("CharacterJoinerService"),Co=mi("ThemeService"),pE=mi("LinkProviderService"),PD=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Iy.isErrorNoTelemetry(e)?new Iy(e.message+`
17
+
18
+ `+e.stack):new Error(e.message+`
19
+
20
+ `+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)}},UD=new PD;function Zu(e){HD(e)||UD.onUnexpectedError(e)}var Pp="Canceled";function HD(e){return e instanceof FD?!0:e instanceof Error&&e.name===Pp&&e.message===Pp}var FD=class extends Error{constructor(){super(Pp),this.name=this.message}};function VD(e){return new Error(`Illegal argument: ${e}`)}var Iy=class Up extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Up)return t;let s=new Up;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Hp=class gE extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,gE.prototype)}};function ns(e,t=0){return e[e.length-(1+t)]}var $D;(e=>{function t(l){return l<0}e.isLessThan=t;function s(l){return l<=0}e.isLessThanOrEqual=s;function r(l){return l>0}e.isGreaterThan=r;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})($D||={});function qD(e,t){let s=this,r=!1,o;return function(){return r||(r=!0,t||(o=e.apply(s,arguments))),o}}var _E;(e=>{function t(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function r(){return s}e.empty=r;function*o(D){yield D}e.single=o;function l(D){return t(D)?D:o(D)}e.wrap=l;function h(D){return D||s}e.from=h;function*f(D){for(let U=D.length-1;U>=0;U--)yield D[U]}e.reverse=f;function m(D){return!D||D[Symbol.iterator]().next().done===!0}e.isEmpty=m;function d(D){return D[Symbol.iterator]().next().value}e.first=d;function _(D,U){let P=0;for(let B of D)if(U(B,P++))return!0;return!1}e.some=_;function v(D,U){for(let P of D)if(U(P))return P}e.find=v;function*b(D,U){for(let P of D)U(P)&&(yield P)}e.filter=b;function*S(D,U){let P=0;for(let B of D)yield U(B,P++)}e.map=S;function*x(D,U){let P=0;for(let B of D)yield*U(B,P++)}e.flatMap=x;function*w(...D){for(let U of D)yield*U}e.concat=w;function C(D,U,P){let B=P;for(let M of D)B=U(B,M);return B}e.reduce=C;function*T(D,U,P=D.length){for(U<0&&(U+=D.length),P<0?P+=D.length:P>D.length&&(P=D.length);U<P;U++)yield D[U]}e.slice=T;function O(D,U=Number.POSITIVE_INFINITY){let P=[];if(U===0)return[P,D];let B=D[Symbol.iterator]();for(let M=0;M<U;M++){let F=B.next();if(F.done)return[P,e.empty()];P.push(F.value)}return[P,{[Symbol.iterator](){return B}}]}e.consume=O;async function k(D){let U=[];for await(let P of D)U.push(P);return Promise.resolve(U)}e.asyncToArray=k})(_E||={});function fa(e){if(_E.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(r){t.push(r)}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 KD(...e){return Mt(()=>fa(e))}function Mt(e){return{dispose:qD(()=>{e()})}}var vE=class bE{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{fa(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?bE.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)}};vE.DISABLE_DISPOSED_WARNING=!1;var wr=vE,Ke=class{constructor(){this._store=new wr,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ke.None=Object.freeze({dispose(){}});var bo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Ln=typeof window=="object"?window:globalThis,Fp=class Vp{constructor(t){this.element=t,this.next=Vp.Undefined,this.prev=Vp.Undefined}};Fp.Undefined=new Fp(void 0);var Dt=Fp,Py=class{constructor(){this._first=Dt.Undefined,this._last=Dt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Dt.Undefined}clear(){let e=this._first;for(;e!==Dt.Undefined;){let t=e.next;e.prev=Dt.Undefined,e.next=Dt.Undefined,e=t}this._first=Dt.Undefined,this._last=Dt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new Dt(e);if(this._first===Dt.Undefined)this._first=s,this._last=s;else if(t){let o=this._last;this._last=s,s.prev=o,o.next=s}else{let o=this._first;this._first=s,s.next=o,o.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==Dt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Dt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Dt.Undefined&&e.next!==Dt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Dt.Undefined&&e.next===Dt.Undefined?(this._first=Dt.Undefined,this._last=Dt.Undefined):e.next===Dt.Undefined?(this._last=this._last.prev,this._last.next=Dt.Undefined):e.prev===Dt.Undefined&&(this._first=this._first.next,this._first.prev=Dt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Dt.Undefined;)yield e.element,e=e.next}},GD=globalThis.performance&&typeof globalThis.performance.now=="function",WD=class yE{static create(t){return new yE(t)}constructor(t){this._now=GD&&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}},wi;(e=>{e.None=()=>Ke.None;function t(G,I){return v(G,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function s(G){return(I,ie=null,J)=>{let A=!1,q;return q=G(V=>{if(!A)return q?q.dispose():A=!0,I.call(ie,V)},null,J),A&&q.dispose(),q}}e.once=s;function r(G,I,ie){return d((J,A=null,q)=>G(V=>J.call(A,I(V)),null,q),ie)}e.map=r;function o(G,I,ie){return d((J,A=null,q)=>G(V=>{I(V),J.call(A,V)},null,q),ie)}e.forEach=o;function l(G,I,ie){return d((J,A=null,q)=>G(V=>I(V)&&J.call(A,V),null,q),ie)}e.filter=l;function h(G){return G}e.signal=h;function f(...G){return(I,ie=null,J)=>{let A=KD(...G.map(q=>q(V=>I.call(ie,V))));return _(A,J)}}e.any=f;function m(G,I,ie,J){let A=ie;return r(G,q=>(A=I(A,q),A),J)}e.reduce=m;function d(G,I){let ie,J={onWillAddFirstListener(){ie=G(A.fire,A)},onDidRemoveLastListener(){ie?.dispose()}},A=new he(J);return I?.add(A),A.event}function _(G,I){return I instanceof Array?I.push(G):I&&I.add(G),G}function v(G,I,ie=100,J=!1,A=!1,q,V){let Z,Q,R,te=0,ce,le={leakWarningThreshold:q,onWillAddFirstListener(){Z=G(pe=>{te++,Q=I(Q,pe),J&&!R&&(fe.fire(Q),Q=void 0),ce=()=>{let Se=Q;Q=void 0,R=void 0,(!J||te>1)&&fe.fire(Se),te=0},typeof ie=="number"?(clearTimeout(R),R=setTimeout(ce,ie)):R===void 0&&(R=0,queueMicrotask(ce))})},onWillRemoveListener(){A&&te>0&&ce?.()},onDidRemoveLastListener(){ce=void 0,Z.dispose()}},fe=new he(le);return V?.add(fe),fe.event}e.debounce=v;function b(G,I=0,ie){return e.debounce(G,(J,A)=>J?(J.push(A),J):[A],I,void 0,!0,void 0,ie)}e.accumulate=b;function S(G,I=(J,A)=>J===A,ie){let J=!0,A;return l(G,q=>{let V=J||!I(q,A);return J=!1,A=q,V},ie)}e.latch=S;function x(G,I,ie){return[e.filter(G,I,ie),e.filter(G,J=>!I(J),ie)]}e.split=x;function w(G,I=!1,ie=[],J){let A=ie.slice(),q=G(Q=>{A?A.push(Q):Z.fire(Q)});J&&J.add(q);let V=()=>{A?.forEach(Q=>Z.fire(Q)),A=null},Z=new he({onWillAddFirstListener(){q||(q=G(Q=>Z.fire(Q)),J&&J.add(q))},onDidAddFirstListener(){A&&(I?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return J&&J.add(Z),Z.event}e.buffer=w;function C(G,I){return(ie,J,A)=>{let q=I(new O);return G(function(V){let Z=q.evaluate(V);Z!==T&&ie.call(J,Z)},void 0,A)}}e.chain=C;let T=Symbol("HaltChainable");class O{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(ie=>(I(ie),ie)),this}filter(I){return this.steps.push(ie=>I(ie)?ie:T),this}reduce(I,ie){let J=ie;return this.steps.push(A=>(J=I(J,A),J)),this}latch(I=(ie,J)=>ie===J){let ie=!0,J;return this.steps.push(A=>{let q=ie||!I(A,J);return ie=!1,J=A,q?A:T}),this}evaluate(I){for(let ie of this.steps)if(I=ie(I),I===T)break;return I}}function k(G,I,ie=J=>J){let J=(...Z)=>V.fire(ie(...Z)),A=()=>G.on(I,J),q=()=>G.removeListener(I,J),V=new he({onWillAddFirstListener:A,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=k;function D(G,I,ie=J=>J){let J=(...Z)=>V.fire(ie(...Z)),A=()=>G.addEventListener(I,J),q=()=>G.removeEventListener(I,J),V=new he({onWillAddFirstListener:A,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=D;function U(G){return new Promise(I=>s(G)(I))}e.toPromise=U;function P(G){let I=new he;return G.then(ie=>{I.fire(ie)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=P;function B(G,I){return G(ie=>I.fire(ie))}e.forward=B;function M(G,I,ie){return I(ie),G(J=>I(J))}e.runAndSubscribe=M;class F{constructor(I,ie){this._observable=I,this._counter=0,this._hasChanged=!1;let J={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new he(J),ie&&ie.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,ie){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Y(G,I){return new F(G,I).emitter.event}e.fromObservable=Y;function $(G){return(I,ie,J)=>{let A=0,q=!1,V={beginUpdate(){A++},endUpdate(){A--,A===0&&(G.reportChanges(),q&&(q=!1,I.call(ie)))},handlePossibleChange(){},handleChange(){q=!0}};G.addObserver(V),G.reportChanges();let Z={dispose(){G.removeObserver(V)}};return J instanceof wr?J.add(Z):Array.isArray(J)&&J.push(Z),Z}}e.fromObservableLight=$})(wi||={});var $p=class qp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${qp._idPool++}`,qp.all.add(this)}start(t){this._stopWatch=new WD,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}}};$p.all=new Set,$p._idPool=0;var YD=$p,XD=-1,xE=class SE{constructor(t,s,r=(SE._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,s){let r=this.threshold;if(r<=0||s<r)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[l,h]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${h}):`;console.warn(f),console.warn(l);let m=new JD(f,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,s=0;for(let[r,o]of this._stacks)(!t||s<o)&&(t=[r,o],s=o);return t}};xE._idPool=1;var ZD=xE,QD=class wE{constructor(t){this.value=t}static create(){let t=new Error;return new wE(t.stack??"")}print(){console.warn(this.value.split(`
21
+ `).slice(2).join(`
22
+ `))}},JD=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},e7=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},t7=0,hm=class{constructor(e){this.value=e,this.id=t7++}},i7=2,s7,he=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new ZD(e?.onListenerError??Zu,this._options?.leakWarningThreshold??XD):void 0,this._perfMon=this._options?._profName?new YD(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new e7(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||Zu)(m),Ke.None}if(this._disposed)return Ke.None;t&&(e=e.bind(t));let r=new hm(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=QD.create(),o=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof hm?(this._deliveryQueue??=new n7,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=Mt(()=>{o?.(),this._removeListener(r)});return s instanceof wr?s.add(l):Array.isArray(s)&&s.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,s=t.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*i7<=t.length){let o=0;for(let l=0;l<t.length;l++)t[l]?t[o++]=t[l]:r&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=o}}_deliver(e,t){if(!e)return;let s=this._options?.onListenerError||Zu;if(!s){e.value(t);return}try{e.value(t)}catch(r){s(r)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof hm)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},n7=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Kp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new he,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new he,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Kp.INSTANCE=new Kp;var n_=Kp;function r7(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}n_.INSTANCE.onDidChangeZoomLevel;function a7(e){return n_.INSTANCE.getZoomFactor(e)}n_.INSTANCE.onDidChangeFullscreen;var No=typeof navigator=="object"?navigator.userAgent:"",Gp=No.indexOf("Firefox")>=0,o7=No.indexOf("AppleWebKit")>=0,r_=No.indexOf("Chrome")>=0,l7=!r_&&No.indexOf("Safari")>=0;No.indexOf("Electron/")>=0;No.indexOf("Android")>=0;var dm=!1;if(typeof Ln.matchMedia=="function"){let e=Ln.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ln.matchMedia("(display-mode: fullscreen)");dm=e.matches,r7(Ln,e,({matches:s})=>{dm&&t.matches||(dm=s)})}var fo="en",Wp=!1,Yp=!1,Qu=!1,EE=!1,zu,Ju=fo,Uy=fo,c7,On,da=globalThis,as;typeof da.vscode<"u"&&typeof da.vscode.process<"u"?as=da.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(as=process);var u7=typeof as?.versions?.electron=="string",h7=u7&&as?.type==="renderer";if(typeof as=="object"){Wp=as.platform==="win32",Yp=as.platform==="darwin",Qu=as.platform==="linux",Qu&&as.env.SNAP&&as.env.SNAP_REVISION,as.env.CI||as.env.BUILD_ARTIFACTSTAGINGDIRECTORY,zu=fo,Ju=fo;let e=as.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);zu=t.userLocale,Uy=t.osLocale,Ju=t.resolvedLanguage||fo,c7=t.languagePack?.translationsConfigFile}catch{}EE=!0}else typeof navigator=="object"&&!h7?(On=navigator.userAgent,Wp=On.indexOf("Windows")>=0,Yp=On.indexOf("Macintosh")>=0,(On.indexOf("Macintosh")>=0||On.indexOf("iPad")>=0||On.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Qu=On.indexOf("Linux")>=0,On?.indexOf("Mobi")>=0,Ju=globalThis._VSCODE_NLS_LANGUAGE||fo,zu=navigator.language.toLowerCase(),Uy=zu):console.error("Unable to resolve platform.");var CE=Wp,Xs=Yp,d7=Qu,Hy=EE,sn=On,pr=Ju,f7;(e=>{function t(){return pr}e.value=t;function s(){return pr.length===2?pr==="en":pr.length>=3?pr[0]==="e"&&pr[1]==="n"&&pr[2]==="-":!1}e.isDefaultVariant=s;function r(){return pr==="en"}e.isDefault=r})(f7||={});var m7=typeof da.postMessage=="function"&&!da.importScripts;(()=>{if(m7){let e=[];da.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let r=0,o=e.length;r<o;r++){let l=e[r];if(l.id===s.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return s=>{let r=++t;e.push({id:r,callback:s}),da.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var p7=!!(sn&&sn.indexOf("Chrome")>=0);sn&&sn.indexOf("Firefox")>=0;!p7&&sn&&sn.indexOf("Safari")>=0;sn&&sn.indexOf("Edg/")>=0;sn&&sn.indexOf("Android")>=0;var ro=typeof navigator=="object"?navigator:{};Hy||document.queryCommandSupported&&document.queryCommandSupported("copy")||ro&&ro.clipboard&&ro.clipboard.writeText,Hy||ro&&ro.clipboard&&ro.clipboard.readText;var a_=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}},fm=new a_,Fy=new a_,Vy=new a_,g7=new Array(230),NE;(e=>{function t(f){return fm.keyCodeToStr(f)}e.toString=t;function s(f){return fm.strToKeyCode(f)}e.fromString=s;function r(f){return Fy.keyCodeToStr(f)}e.toUserSettingsUS=r;function o(f){return Vy.keyCodeToStr(f)}e.toUserSettingsGeneral=o;function l(f){return Fy.strToKeyCode(f)||Vy.strToKeyCode(f)}e.fromUserSettings=l;function h(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return fm.keyCodeToStr(f)}e.toElectronAccelerator=h})(NE||={});var _7=class kE{constructor(t,s,r,o,l){this.ctrlKey=t,this.shiftKey=s,this.altKey=r,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof kE&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",s=this.shiftKey?"1":"0",r=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${s}${r}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new v7([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},v7=class{constructor(e){if(e.length===0)throw VD("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function b7(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return NE.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(Gp)switch(t){case 59:return 85;case 60:if(d7)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Xs)return 57;break}else if(o7&&(Xs&&t===93||!Xs&&t===92))return 57;return g7[t]||0}var y7=Xs?256:2048,x7=512,S7=1024,w7=Xs?2048:256,$y=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=b7(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|=y7),this.altKey&&(t|=x7),this.shiftKey&&(t|=S7),this.metaKey&&(t|=w7),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new _7(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},qy=new WeakMap;function E7(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var C7=class{static getSameOriginWindowChain(e){let t=qy.get(e);if(!t){t=[],qy.set(e,t);let s=e,r;do r=E7(s),r?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=r;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,r=0,o=this.getSameOriginWindowChain(e);for(let l of o){let h=l.window.deref();if(s+=h?.scrollY??0,r+=h?.scrollX??0,h===t||!l.iframeElement)break;let f=l.iframeElement.getBoundingClientRect();s+=f.top,r+=f.left}return{top:s,left:r}}},Iu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=C7.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ky=class{constructor(e,t=0,s=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let r=!1;if(r_){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,h=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*h):this.deltaY=o.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 f=e;f.deltaMode===f.DOM_DELTA_LINE?Gp&&!Xs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")l7&&CE?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*h):this.deltaX=o.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 f=e;f.deltaMode===f.DOM_DELTA_LINE?Gp&&!Xs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},TE=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),N7;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof k7?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:wi.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:TE})})(N7||={});var k7=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?TE:(this._emitter||(this._emitter=new he),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},o_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Hp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Hp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},T7=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new Hp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=s.setInterval(()=>{e()},t);this.disposable=Mt(()=>{s.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},M7;(e=>{async function t(r){let o,l=await Promise.all(r.map(h=>h.then(f=>f,f=>{o||(o=f)})));if(typeof o<"u")throw o;return l}e.settled=t;function s(r){return new Promise(async(o,l)=>{try{await r(o,l)}catch(h){l(h)}})}e.withAsyncBody=s})(M7||={});var Gy=class xs{static fromArray(t){return new xs(s=>{s.emitMany(t)})}static fromPromise(t){return new xs(async s=>{s.emitMany(await t)})}static fromPromises(t){return new xs(async s=>{await Promise.all(t.map(async r=>s.emitOne(await r)))})}static merge(t){return new xs(async s=>{await Promise.all(t.map(async r=>{for await(let o of r)s.emitOne(o)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new he,queueMicrotask(async()=>{let r={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(r)),this.resolve()}catch(o){this.reject(o)}finally{r.emitOne=void 0,r.emitMany=void 0,r.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 wi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,s){return new xs(async r=>{for await(let o of t)r.emitOne(s(o))})}map(t){return xs.map(this,t)}static filter(t,s){return new xs(async r=>{for await(let o of t)s(o)&&r.emitOne(o)})}filter(t){return xs.filter(this,t)}static coalesce(t){return xs.filter(t,s=>!!s)}coalesce(){return xs.coalesce(this)}static async toPromise(t){let s=[];for await(let r of t)s.push(r);return s}toPromise(){return xs.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())}};Gy.EMPTY=Gy.fromArray([]);var{getWindow:Ws,getWindowId:A7,onDidRegisterWindow:R7}=(function(){let e=new Map,t={window:Ln,disposables:new wr};e.set(Ln.vscodeWindowId,t);let s=new he,r=new he,o=new he;function l(h,f){return(typeof h=="number"?e.get(h):void 0)??(f?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:r.event,registerWindow(h){if(e.has(h.vscodeWindowId))return Ke.None;let f=new wr,m={window:h,disposables:f.add(new wr)};return e.set(h.vscodeWindowId,m),f.add(Mt(()=>{e.delete(h.vscodeWindowId),r.fire(h)})),f.add(Ie(h,ui.BEFORE_UNLOAD,()=>{o.fire(h)})),s.fire(m),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(h){return h.vscodeWindowId},hasWindow(h){return e.has(h)},getWindowById:l,getWindow(h){let f=h;if(f?.ownerDocument?.defaultView)return f.ownerDocument.defaultView.window;let m=h;return m?.view?m.view.window:Ln},getDocument(h){return Ws(h).document}}})(),D7=class{constructor(e,t,s,r){this._node=e,this._type=t,this._handler=s,this._options=r||!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 Ie(e,t,s,r){return new D7(e,t,s,r)}var Wy=function(e,t,s,r){return Ie(e,t,s,r)},l_,O7=class extends T7{constructor(e){super(),this.defaultTarget=e&&Ws(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},Yy=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){Zu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,r=new Map,o=l=>{s.set(l,!1);let h=e.get(l)??[];for(t.set(l,h),e.set(l,[]),r.set(l,!0);h.length>0;)h.sort(Yy.sort),h.shift().execute();r.set(l,!1)};l_=(l,h,f=0)=>{let m=A7(l),d=new Yy(h,f),_=e.get(m);return _||(_=[],e.set(m,_)),_.push(d),s.get(m)||(s.set(m,!0),l.requestAnimationFrame(()=>o(m))),d}})();function L7(e){let t=e.getBoundingClientRect(),s=Ws(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var ui={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"},j7=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=Ki(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ki(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ki(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ki(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ki(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ki(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ki(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ki(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ki(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ki(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ki(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=Ki(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=Ki(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ki(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 Ki(e){return typeof e=="number"?`${e}px`:e}function Wl(e){return new j7(e)}var ME=class{constructor(){this._hooks=new wr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(Mt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=Ws(e)}this._hooks.add(Ie(l,ui.POINTER_MOVE,h=>{if(h.buttons!==s){this.stopMonitoring(!0);return}h.preventDefault(),this._pointerMoveCallback(h)})),this._hooks.add(Ie(l,ui.POINTER_UP,h=>this.stopMonitoring(!0)))}};function B7(e,t,s){let r=null,o=null;if(typeof s.value=="function"?(r="value",o=s.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(r="get",o=s.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;s[r]=function(...h){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,h)}),this[l]}}var qs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(qs||={});var Pl=class Mi extends Ke{constructor(){super(),this.dispatched=!1,this.targets=new Py,this.ignoreTargets=new Py,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(wi.runAndSubscribe(R7,({window:t,disposables:s})=>{s.add(Ie(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),s.add(Ie(t.document,"touchend",r=>this.onTouchEnd(t,r))),s.add(Ie(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Ln,disposables:this._store}))}static addTarget(t){if(!Mi.isTouchDevice())return Ke.None;Mi.INSTANCE||(Mi.INSTANCE=new Mi);let s=Mi.INSTANCE.targets.push(t);return Mt(s)}static ignoreTarget(t){if(!Mi.isTouchDevice())return Ke.None;Mi.INSTANCE||(Mi.INSTANCE=new Mi);let s=Mi.INSTANCE.ignoreTargets.push(t);return Mt(s)}static isTouchDevice(){return"ontouchstart"in Ln||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,o=t.targetTouches.length;r<o;r++){let l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:s,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[s],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let h=this.newGestureEvent(qs.Start,l.target);h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let r=Date.now(),o=Object.keys(this.activeTouches).length;for(let l=0,h=s.changedTouches.length;l<h;l++){let f=s.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let m=this.activeTouches[f.identifier],d=Date.now()-m.initialTimeStamp;if(d<Mi.HOLD_DELAY&&Math.abs(m.initialPageX-ns(m.rollingPageX))<30&&Math.abs(m.initialPageY-ns(m.rollingPageY))<30){let _=this.newGestureEvent(qs.Tap,m.initialTarget);_.pageX=ns(m.rollingPageX),_.pageY=ns(m.rollingPageY),this.dispatchEvent(_)}else if(d>=Mi.HOLD_DELAY&&Math.abs(m.initialPageX-ns(m.rollingPageX))<30&&Math.abs(m.initialPageY-ns(m.rollingPageY))<30){let _=this.newGestureEvent(qs.Contextmenu,m.initialTarget);_.pageX=ns(m.rollingPageX),_.pageY=ns(m.rollingPageY),this.dispatchEvent(_)}else if(o===1){let _=ns(m.rollingPageX),v=ns(m.rollingPageY),b=ns(m.rollingTimestamps)-m.rollingTimestamps[0],S=_-m.rollingPageX[0],x=v-m.rollingPageY[0],w=[...this.targets].filter(C=>m.initialTarget instanceof Node&&C.contains(m.initialTarget));this.inertia(t,w,r,Math.abs(S)/b,S>0?1:-1,_,Math.abs(x)/b,x>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(qs.End,m.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=s,r.tapCount=0,r}dispatchEvent(t){if(t.type===qs.Tap){let s=new Date().getTime(),r=0;s-this._lastSetTapCountTime>Mi.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=s,t.tapCount=r}else(t.type===qs.Change||t.type===qs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let s=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==r;)o++,l=l.parentElement;s.push([o,r])}s.sort((r,o)=>r[0]-o[0]);for(let[r,o]of s)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,r,o,l,h,f,m,d){this.handle=l_(t,()=>{let _=Date.now(),v=_-r,b=0,S=0,x=!0;o+=Mi.SCROLL_FRICTION*v,f+=Mi.SCROLL_FRICTION*v,o>0&&(x=!1,b=l*o*v),f>0&&(x=!1,S=m*f*v);let w=this.newGestureEvent(qs.Change);w.translationX=b,w.translationY=S,s.forEach(C=>C.dispatchEvent(w)),x||this.inertia(t,s,_,o,l,h+b,f,m,d+S)})}onTouchMove(t){let s=Date.now();for(let r=0,o=t.changedTouches.length;r<o;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let h=this.activeTouches[l.identifier],f=this.newGestureEvent(qs.Change,h.initialTarget);f.translationX=l.pageX-ns(h.rollingPageX),f.translationY=l.pageY-ns(h.rollingPageY),f.pageX=l.pageX,f.pageY=l.pageY,this.dispatchEvent(f),h.rollingPageX.length>3&&(h.rollingPageX.shift(),h.rollingPageY.shift(),h.rollingTimestamps.shift()),h.rollingPageX.push(l.pageX),h.rollingPageY.push(l.pageY),h.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Pl.SCROLL_FRICTION=-.005,Pl.HOLD_DELAY=700,Pl.CLEAR_TAP_COUNT_TIME=400,It([B7],Pl,"isTouchDevice",1);var z7=Pl,c_=class extends Ke{onclick(e,t){this._register(Ie(e,ui.CLICK,s=>t(new Iu(Ws(e),s))))}onmousedown(e,t){this._register(Ie(e,ui.MOUSE_DOWN,s=>t(new Iu(Ws(e),s))))}onmouseover(e,t){this._register(Ie(e,ui.MOUSE_OVER,s=>t(new Iu(Ws(e),s))))}onmouseleave(e,t){this._register(Ie(e,ui.MOUSE_LEAVE,s=>t(new Iu(Ws(e),s))))}onkeydown(e,t){this._register(Ie(e,ui.KEY_DOWN,s=>t(new $y(s))))}onkeyup(e,t){this._register(Ie(e,ui.KEY_UP,s=>t(new $y(s))))}oninput(e,t){this._register(Ie(e,ui.INPUT,t))}onblur(e,t){this._register(Ie(e,ui.BLUR,t))}onfocus(e,t){this._register(Ie(e,ui.FOCUS,t))}onchange(e,t){this._register(Ie(e,ui.CHANGE,t))}ignoreGesture(e){return z7.ignoreTarget(e)}},Xy=11,I7=class extends c_{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=Xy+"px",this.domNode.style.height=Xy+"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 ME),this._register(Wy(this.bgDomNode,ui.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Wy(this.domNode,ui.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new O7),this._pointerdownScheduleRepeatTimer=this._register(new o_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ws(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},P7=class Xp{constructor(t,s,r,o,l,h,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,r=r|0,o=o|0,l=l|0,h=h|0,f=f|0),this.rawScrollLeft=o,this.rawScrollTop=f,s<0&&(s=0),o+s>r&&(o=r-s),o<0&&(o=0),l<0&&(l=0),f+l>h&&(f=h-l),f<0&&(f=0),this.width=s,this.scrollWidth=r,this.scrollLeft=o,this.height=l,this.scrollHeight=h,this.scrollTop=f}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,s){return new Xp(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Xp(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,s){let r=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,h=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:o,scrollLeftChanged:l,heightChanged:h,scrollHeightChanged:f,scrollTopChanged:m}}},U7=class extends Ke{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new P7(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let r;t?r=new Qy(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=Qy.start(this._state,s,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},Zy=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function mm(e,t){let s=t-e;return function(r){return e+s*V7(r)}}function H7(e,t,s){return function(r){return r<s?e(r/s):t((r-s)/(1-s))}}var Qy=class Zp{constructor(t,s,r,o){this.from=t,this.to=s,this.duration=o,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,s,r){if(Math.abs(t-s)>2.5*r){let o,l;return t<s?(o=t+.75*r,l=s-.75*r):(o=t-.75*r,l=s+.75*r),H7(mm(t,o),mm(l,s),.33)}return mm(t,s)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let s=(t-this.startTime)/this.duration;if(s<1){let r=this.scrollLeft(s),o=this.scrollTop(s);return new Zy(r,o,!1)}return new Zy(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,r){return Zp.start(t,s,r)}static start(t,s,r){r=r+10;let o=Date.now()-10;return new Zp(t,s,o,r)}};function F7(e){return Math.pow(e,3)}function V7(e){return 1-F7(1-e)}var $7=class extends Ke{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new o_)}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":"")))}},q7=140,AE=class extends c_{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 $7(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ME),this._shouldRender=!0,this.domNode=Wl(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(Ie(this.domNode.domNode,ui.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new I7(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,r){this.slider=Wl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ie(this.slider.domNode,ui.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,s=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);s<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let o=L7(this.domNode.domNode);t=e.pageX-o.left,s=e.pageY-o.top}let r=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let l=this._sliderOrthogonalPointerPosition(o),h=Math.abs(l-s);if(CE&&h>q7){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let f=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(f))},()=>{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()}},RE=class Qp{constructor(t,s,r,o,l,h){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=l,this._scrollPosition=h,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Qp(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,r,o,l){let h=Math.max(0,r-t),f=Math.max(0,h-2*s),m=o>0&&o>r;if(!m)return{computedAvailableSize:Math.round(h),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*f/o))),_=(f-d)/(o-r),v=l*_;return{computedAvailableSize:Math.round(h),computedIsNeeded:m,computedSliderSize:Math.round(d),computedSliderRatio:_,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=Qp._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,r=this._scrollPosition;return s<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},K7=class extends AE{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new RE(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.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}},G7=class extends AE{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new RE(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.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}},W7=500,Jy=50,Y7=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},Jp=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,s=0,r=1,o=this._rear;do{let l=o===this._front?t:Math.pow(2,-r);if(t-=l,s+=this._memory[o].score*l,o===this._front)break;o=(this._capacity+o-1)%this._capacity,r++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(r_){let s=Ws(t.browserEvent),r=a7(s);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,r){let o=null,l=new Y7(t,s,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(o=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,o)}_computeScore(t,s){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),s){let o=Math.abs(t.deltaX),l=Math.abs(t.deltaY),h=Math.abs(s.deltaX),f=Math.abs(s.deltaY),m=Math.max(Math.min(o,h),1),d=Math.max(Math.min(l,f),1),_=Math.max(o,h),v=Math.max(l,f);_%m===0&&v%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Jp.INSTANCE=new Jp;var X7=Jp,Z7=class extends c_{constructor(e,t,s){super(),this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new he),this.onWillScroll=this._onWillScroll.event,this._options=J7(t),this._scrollable=s,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new G7(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new K7(this._scrollable,this._options,r)),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=Wl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Wl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Wl(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new o_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=fa(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,Xs&&(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 Ky(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=fa(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new Ky(s))};this._mouseWheelToDispose.push(Ie(this._listenOnDomNode,ui.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=X7.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let h=!Xs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||h)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),m={};if(o){let d=Jy*o,_=f.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(m,_)}if(l){let d=Jy*l,_=f.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(m,_)}m=this._scrollable.validateScrollPosition(m),(f.scrollLeft!==m.scrollLeft||f.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),s=!0)}let r=s;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,s=e.scrollLeft>0,r=s?" left":"",o=t?" top":"",l=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${r}`)}}_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(),W7)}},Q7=class extends Z7{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function J7(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,Xs&&(t.className+=" mac"),t}var eg=class extends Ke{constructor(e,t,s,r,o,l,h,f){super(),this._bufferService=s,this._optionsService=h,this._renderService=f,this._onRequestScrollLines=this._register(new he),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new U7({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>l_(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Q7(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(o.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(wi.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Mt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Mt(()=>this._styleElement.remove())),this._register(wi.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(`
23
+ `)})),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(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};eg=It([ve(2,ji),ve(3,jn),ve(4,hE),ve(5,Co),ve(6,Bi),ve(7,Bn)],eg);var tg=class extends Ke{constructor(e,t,s,r,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=r,this._renderService=o,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(Mt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};tg=It([ve(1,ji),ve(2,jn),ve(3,hc),ve(4,Bn)],tg);var eO=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Vs={full:0,left:0,center:0,right:0},gr={full:0,left:0,center:0,right:0},Ml={full:0,left:0,center:0,right:0},_h=class extends Ke{constructor(e,t,s,r,o,l,h,f){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=r,this._renderService=o,this._optionsService=l,this._themeService=h,this._coreBrowserService=f,this._colorZoneStore=new eO,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(Mt(()=>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);gr.full=this._canvas.width,gr.left=e,gr.center=t,gr.right=e,this._refreshDrawHeightConstants(),Ml.full=1,Ml.left=1,Ml.center=1+gr.left,Ml.right=1+gr.left+gr.center}_refreshDrawHeightConstants(){Vs.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);Vs.left=t,Vs.center=t,Vs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.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(Ml[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Vs[e.position||"full"]/2),gr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Vs[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}))}};_h=It([ve(2,ji),ve(3,hc),ve(4,Bn),ve(5,Bi),ve(6,Co),ve(7,jn)],_h);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=`
24
+ `,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 eh;(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="Ÿ"))(eh||={});var DE;(e=>e.ST=`${oe.ESC}\\`)(DE||={});var ig=class{constructor(e,t,s,r,o,l){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=r,this._coreService=o,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 s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${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),s=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let l=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=r+"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)}}};ig=It([ve(2,ji),ve(3,Bi),ve(4,_a),ve(5,Bn)],ig);var hi=0,di=0,fi=0,zt=0,ex={css:"#00000000",rgba:0},ti;(e=>{function t(o,l,h,f){return f!==void 0?`#${sa(o)}${sa(l)}${sa(h)}${sa(f)}`:`#${sa(o)}${sa(l)}${sa(h)}`}e.toCss=t;function s(o,l,h,f=255){return(o<<24|l<<16|h<<8|f)>>>0}e.toRgba=s;function r(o,l,h,f){return{css:e.toCss(o,l,h,f),rgba:e.toRgba(o,l,h,f)}}e.toColor=r})(ti||={});var Ct;(e=>{function t(m,d){if(zt=(d.rgba&255)/255,zt===1)return{css:d.css,rgba:d.rgba};let _=d.rgba>>24&255,v=d.rgba>>16&255,b=d.rgba>>8&255,S=m.rgba>>24&255,x=m.rgba>>16&255,w=m.rgba>>8&255;hi=S+Math.round((_-S)*zt),di=x+Math.round((v-x)*zt),fi=w+Math.round((b-w)*zt);let C=ti.toCss(hi,di,fi),T=ti.toRgba(hi,di,fi);return{css:C,rgba:T}}e.blend=t;function s(m){return(m.rgba&255)===255}e.isOpaque=s;function r(m,d,_){let v=th.ensureContrastRatio(m.rgba,d.rgba,_);if(v)return ti.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=r;function o(m){let d=(m.rgba|255)>>>0;return[hi,di,fi]=th.toChannels(d),{css:ti.toCss(hi,di,fi),rgba:d}}e.opaque=o;function l(m,d){return zt=Math.round(d*255),[hi,di,fi]=th.toChannels(m.rgba),{css:ti.toCss(hi,di,fi,zt),rgba:ti.toRgba(hi,di,fi,zt)}}e.opacity=l;function h(m,d){return zt=m.rgba&255,l(m,zt*d/255)}e.multiplyOpacity=h;function f(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=f})(Ct||={});var Ot;(e=>{let t,s;try{let o=document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function r(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return hi=parseInt(o.slice(1,2).repeat(2),16),di=parseInt(o.slice(2,3).repeat(2),16),fi=parseInt(o.slice(3,4).repeat(2),16),ti.toColor(hi,di,fi);case 5:return hi=parseInt(o.slice(1,2).repeat(2),16),di=parseInt(o.slice(2,3).repeat(2),16),fi=parseInt(o.slice(3,4).repeat(2),16),zt=parseInt(o.slice(4,5).repeat(2),16),ti.toColor(hi,di,fi,zt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let l=o.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 hi=parseInt(l[1]),di=parseInt(l[2]),fi=parseInt(l[3]),zt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),ti.toColor(hi,di,fi,zt);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[hi,di,fi,zt]=t.getImageData(0,0,1,1).data,zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ti.toRgba(hi,di,fi,zt),css:o}}e.toColor=r})(Ot||={});var Di;(e=>{function t(r){return s(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function s(r,o,l){let h=r/255,f=o/255,m=l/255,d=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),_=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),v=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return d*.2126+_*.7152+v*.0722}e.relativeLuminance2=s})(Di||={});var th;(e=>{function t(h,f){if(zt=(f&255)/255,zt===1)return f;let m=f>>24&255,d=f>>16&255,_=f>>8&255,v=h>>24&255,b=h>>16&255,S=h>>8&255;return hi=v+Math.round((m-v)*zt),di=b+Math.round((d-b)*zt),fi=S+Math.round((_-S)*zt),ti.toRgba(hi,di,fi)}e.blend=t;function s(h,f,m){let d=Di.relativeLuminance(h>>8),_=Di.relativeLuminance(f>>8);if(Dn(d,_)<m){if(_<d){let S=r(h,f,m),x=Dn(d,Di.relativeLuminance(S>>8));if(x<m){let w=o(h,f,m),C=Dn(d,Di.relativeLuminance(w>>8));return x>C?S:w}return S}let v=o(h,f,m),b=Dn(d,Di.relativeLuminance(v>>8));if(b<m){let S=r(h,f,m),x=Dn(d,Di.relativeLuminance(S>>8));return b>x?v:S}return v}}e.ensureContrastRatio=s;function r(h,f,m){let d=h>>24&255,_=h>>16&255,v=h>>8&255,b=f>>24&255,S=f>>16&255,x=f>>8&255,w=Dn(Di.relativeLuminance2(b,S,x),Di.relativeLuminance2(d,_,v));for(;w<m&&(b>0||S>0||x>0);)b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),x-=Math.max(0,Math.ceil(x*.1)),w=Dn(Di.relativeLuminance2(b,S,x),Di.relativeLuminance2(d,_,v));return(b<<24|S<<16|x<<8|255)>>>0}e.reduceLuminance=r;function o(h,f,m){let d=h>>24&255,_=h>>16&255,v=h>>8&255,b=f>>24&255,S=f>>16&255,x=f>>8&255,w=Dn(Di.relativeLuminance2(b,S,x),Di.relativeLuminance2(d,_,v));for(;w<m&&(b<255||S<255||x<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),w=Dn(Di.relativeLuminance2(b,S,x),Di.relativeLuminance2(d,_,v));return(b<<24|S<<16|x<<8|255)>>>0}e.increaseLuminance=o;function l(h){return[h>>24&255,h>>16&255,h>>8&255,h&255]}e.toChannels=l})(th||={});function sa(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Dn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var tO=class extends uc{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},vh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Cs}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let s=[],r=t.translateToString(!0),o=0,l=0,h=0,f=t.getFg(0),m=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==m){if(d-o>1){let _=this._getJoinedRanges(r,h,l,t,o);for(let v=0;v<_.length;v++)s.push(_[v])}o=d,h=l,f=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||Sr.length}if(this._bufferService.cols-o>1){let d=this._getJoinedRanges(r,h,l,t,o);for(let _=0;_<d.length;_++)s.push(d[_])}return s}_getJoinedRanges(e,t,s,r,o){let l=e.substring(t,s),h=[];try{h=this._characterJoiners[0].handler(l)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let m=this._characterJoiners[f].handler(l);for(let d=0;d<m.length;d++)vh._mergeRanges(h,m[d])}catch(m){console.error(m)}return this._stringRangesToCellRanges(h,r,o),h}_stringRangesToCellRanges(e,t,s){let r=0,o=!1,l=0,h=e[r];if(h){for(let f=s;f<this._bufferService.cols;f++){let m=t.getWidth(f),d=t.getString(f).length||Sr.length;if(m!==0){if(!o&&h[0]<=l&&(h[0]=f,o=!0),h[1]<=l){if(h[1]=f,h=e[++r],!h)break;h[0]<=l?(h[0]=f,o=!0):o=!1}l+=d}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let r=0;r<e.length;r++){let o=e[r];if(s){if(t[1]<=o[0])return e[r-1][1]=t[1],e;if(t[1]<=o[1])return e[r-1][1]=Math.max(t[1],o[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=o[0])return e.splice(r,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};vh=It([ve(0,ji)],vh);function iO(e){return 57508<=e&&e<=57558}function sO(e){return 9472<=e&&e<=9631}function nO(e){return iO(e)||sO(e)}function rO(){return{css:{canvas:Pu(),cell:Pu()},device:{canvas:Pu(),cell:Pu(),char:{width:0,height:0,left:0,top:0}}}}function Pu(){return{width:0,height:0}}var sg=class{constructor(e,t,s,r,o,l,h){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=r,this._coreService=o,this._decorationService=l,this._themeService=h,this._workCell=new Cs,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,r,o,l,h,f,m,d,_){let v=[],b=this._characterJoinerService.getJoinedCharacters(t),S=this._themeService.colors,x=e.getNoBgTrimmedLength();s&&x<l+1&&(x=l+1);let w,C=0,T="",O=0,k=0,D=0,U=0,P=!1,B=0,M=!1,F=0,Y=0,$=[],G=d!==-1&&_!==-1;for(let I=0;I<x;I++){e.loadCell(I,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let J=!1,A=I>=Y,q=I,V=this._workCell;if(b.length>0&&I===b[0][0]&&A){let je=b.shift(),Pt=this._isCellInSelection(je[0],t);for(O=je[0]+1;O<je[1];O++)A&&=Pt===this._isCellInSelection(O,t);A&&=!s||l<je[0]||l>=je[1],A?(J=!0,V=new tO(this._workCell,e.translateToString(!0,je[0],je[1]),je[1]-je[0]),q=je[1]-1,ie=V.getWidth()):Y=je[1]}let Z=this._isCellInSelection(I,t),Q=s&&I===l,R=G&&I>=d&&I<=_,te=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,je=>{te=!0});let ce=V.getChars()||Sr;if(ce===" "&&(V.isUnderline()||V.isOverline())&&(ce=" "),F=ie*f-m.get(ce,V.isBold(),V.isItalic()),!w)w=this._document.createElement("span");else if(C&&(Z&&M||!Z&&!M&&V.bg===k)&&(Z&&M&&S.selectionForeground||V.fg===D)&&V.extended.ext===U&&R===P&&F===B&&!Q&&!J&&!te&&A){V.isInvisible()?T+=Sr:T+=ce,C++;continue}else C&&(w.textContent=T),w=this._document.createElement("span"),C=0,T="";if(k=V.bg,D=V.fg,U=V.extended.ext,P=R,B=F,M=Z,J&&l>=I&&l<=q&&(l=I),!this._coreService.isCursorHidden&&Q&&this._coreService.isCursorInitialized){if($.push("xterm-cursor"),this._coreBrowserService.isFocused)h&&$.push("xterm-cursor-blink"),$.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":$.push("xterm-cursor-outline");break;case"block":$.push("xterm-cursor-block");break;case"bar":$.push("xterm-cursor-bar");break;case"underline":$.push("xterm-cursor-underline");break}}if(V.isBold()&&$.push("xterm-bold"),V.isItalic()&&$.push("xterm-italic"),V.isDim()&&$.push("xterm-dim"),V.isInvisible()?T=Sr:T=V.getChars()||Sr,V.isUnderline()&&($.push(`xterm-underline-${V.extended.underlineStyle}`),T===" "&&(T=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${uc.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let je=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&je<8&&(je+=8),w.style.textDecorationColor=S.ansi[je].css}V.isOverline()&&($.push("xterm-overline"),T===" "&&(T=" ")),V.isStrikethrough()&&$.push("xterm-strikethrough"),R&&(w.style.textDecoration="underline");let le=V.getFgColor(),fe=V.getFgColorMode(),pe=V.getBgColor(),Se=V.getBgColorMode(),Be=!!V.isInverse();if(Be){let je=le;le=pe,pe=je;let Pt=fe;fe=Se,Se=Pt}let Ee,tt,nt=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,je=>{je.options.layer!=="top"&&nt||(je.backgroundColorRGB&&(Se=50331648,pe=je.backgroundColorRGB.rgba>>8&16777215,Ee=je.backgroundColorRGB),je.foregroundColorRGB&&(fe=50331648,le=je.foregroundColorRGB.rgba>>8&16777215,tt=je.foregroundColorRGB),nt=je.options.layer==="top")}),!nt&&Z&&(Ee=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,pe=Ee.rgba>>8&16777215,Se=50331648,nt=!0,S.selectionForeground&&(fe=50331648,le=S.selectionForeground.rgba>>8&16777215,tt=S.selectionForeground)),nt&&$.push("xterm-decoration-top");let rt;switch(Se){case 16777216:case 33554432:rt=S.ansi[pe],$.push(`xterm-bg-${pe}`);break;case 50331648:rt=ti.toColor(pe>>16,pe>>8&255,pe&255),this._addStyle(w,`background-color:#${tx((pe>>>0).toString(16),"0",6)}`);break;default:Be?(rt=S.foreground,$.push("xterm-bg-257")):rt=S.background}switch(Ee||V.isDim()&&(Ee=Ct.multiplyOpacity(rt,.5)),fe){case 16777216:case 33554432:V.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(w,rt,S.ansi[le],V,Ee,void 0)||$.push(`xterm-fg-${le}`);break;case 50331648:let je=ti.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(w,rt,je,V,Ee,tt)||this._addStyle(w,`color:#${tx(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,rt,S.foreground,V,Ee,tt)||Be&&$.push("xterm-fg-257")}$.length&&(w.className=$.join(" "),$.length=0),!Q&&!J&&!te&&A?C++:w.textContent=T,F!==this.defaultSpacing&&(w.style.letterSpacing=`${F}px`),v.push(w),I=q}return w&&C&&(w.textContent=T),v}_applyMinimumContrast(e,t,s,r,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||nO(r.getCode()))return!1;let h=this._getContrastCache(r),f;if(!o&&!l&&(f=h.getColor(t.rgba,s.rgba)),f===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);f=Ct.ensureContrastRatio(o||t,l||s,m),h.setColor((o||t).rgba,(l||s).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let s=this._selectionStart,r=this._selectionEnd;return!s||!r?!1:this._columnSelectMode?s[0]<=r[0]?e>=s[0]&&t>=s[1]&&e<r[0]&&t<=r[1]:e<s[0]&&t>=s[1]&&e>=r[0]&&t<=r[1]:t>s[1]&&t<r[1]||s[1]===r[1]&&t===s[1]&&e>=s[0]&&e<r[0]||s[1]<r[1]&&t===r[1]&&e<r[0]||s[1]<r[1]&&t===s[1]&&e>=s[0]}};sg=It([ve(1,mE),ve(2,Bi),ve(3,jn),ve(4,_a),ve(5,hc),ve(6,Co)],sg);function tx(e,t,s){for(;e.length<s;)e=t+e;return e}var aO=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let s=e.createElement("span");s.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.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=[s,r,o,l],this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(o),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,s,r){e===this._font&&t===this._fontSize&&s===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,s){let r=0;if(!t&&!s&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let h=this._measure(e,0);return h>0&&(this._flat[r]=h),h}let o=e;t&&(o+="B"),s&&(o+="I");let l=this._holey.get(o);if(l===void 0){let h=0;t&&(h|=1),s&&(h|=2),l=this._measure(e,h),l>0&&this._holey.set(o,l)}return l}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},oO=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,s,r=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let o=e.buffers.active.ydisp,l=t[1]-o,h=s[1]-o,f=Math.max(l,0),m=Math.min(h,e.rows-1);if(f>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function lO(){return new oO}var pm="xterm-dom-renderer-owner-",bs="xterm-rows",Uu="xterm-fg-",ix="xterm-bg-",Al="xterm-focus",Hu="xterm-selection",cO=1,ng=class extends Ke{constructor(e,t,s,r,o,l,h,f,m,d,_,v,b,S){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=r,this._viewportElement=o,this._helperContainer=l,this._linkifier2=h,this._charSizeService=m,this._optionsService=d,this._bufferService=_,this._coreService=v,this._coreBrowserService=b,this._themeService=S,this._terminalClass=cO++,this._rowElements=[],this._selectionRenderModel=lO(),this.onRequestRedraw=this._register(new he).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(bs),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(Hu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=rO(),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=f.createInstance(sg,document),this._element.classList.add(pm+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(Mt(()=>{this._element.classList.remove(pm+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new aO(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${bs} 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} .${bs} { 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} .${bs} .xterm-dim { color: ${Ct.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let s=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${bs}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${bs}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${bs}.${Al} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Hu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Hu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Hu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,h]of e.ansi.entries())t+=`${this._terminalSelector} .${Uu}${l} { color: ${h.css}; }${this._terminalSelector} .${Uu}${l}.xterm-dim { color: ${Ct.multiplyOpacity(h,.5).css}; }${this._terminalSelector} .${ix}${l} { background-color: ${h.css}; }`;t+=`${this._terminalSelector} .${Uu}257 { color: ${Ct.opaque(e.background).css}; }${this._terminalSelector} .${Uu}257.xterm-dim { color: ${Ct.multiplyOpacity(Ct.opaque(e.background),.5).css}; }${this._terminalSelector} .${ix}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let s=this._rowElements.length;s<=t;s++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}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(Al),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Al),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,h=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(s){let m=e[0]>t[0];f.appendChild(this._createSelectionElement(l,m?t[0]:e[0],m?e[0]:t[0],h-l+1))}else{let m=r===l?e[0]:0,d=l===o?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(l,m,d));let _=h-l-1;if(f.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,_)),l!==h){let v=o===h?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(h,0,v))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,s,r=1){let o=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,h=this.dimensions.css.cell.width*(s-t);return l+h>this.dimensions.css.canvas.width&&(h=this.dimensions.css.canvas.width-l),o.style.height=`${r*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${h}px`,o}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let s=this._bufferService.buffer,r=s.ybase+s.y,o=Math.min(s.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,h=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let d=m+s.ydisp,_=this._rowElements[m],v=s.lines.get(d);if(!_||!v)break;_.replaceChildren(...this._rowFactory.createRow(v,d,d===r,h,f,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${pm}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,s,r,o,l){s<0&&(e=0),r<0&&(t=0);let h=this._bufferService.rows-1;s=Math.max(Math.min(s,h),0),r=Math.max(Math.min(r,h),0),o=Math.min(o,this._bufferService.cols);let f=this._bufferService.buffer,m=f.ybase+f.y,d=Math.min(f.x,o-1),_=this._optionsService.rawOptions.cursorBlink,v=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let S=s;S<=r;++S){let x=S+f.ydisp,w=this._rowElements[S],C=f.lines.get(x);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,x,x===m,v,b,d,_,this.dimensions.css.cell.width,this._widthCache,l?S===s?e:0:-1,l?(S===r?t:o)-1:-1))}}};ng=It([ve(7,i_),ve(8,Ah),ve(9,Bi),ve(10,ji),ve(11,_a),ve(12,jn),ve(13,Co)],ng);var rg=class extends Ke{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new he),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new hO(this._optionsService))}catch{this._measureStrategy=this._register(new uO(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())}};rg=It([ve(2,Bi)],rg);var OE=class extends Ke{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)}},uO=class extends OE{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},hO=class extends OE{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}},dO=class extends Ke{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new fO(this._window)),this._onDprChange=this._register(new he),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new he),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(wi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ie(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ie(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}},fO=class extends Ke{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new bo),this._onDprChange=this._register(new he),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Mt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ie(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)}},mO=class extends Ke{constructor(){super(),this.linkProviders=[],this._register(Mt(()=>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 u_(e,t,s){let r=s.getBoundingClientRect(),o=e.getComputedStyle(s),l=parseInt(o.getPropertyValue("padding-left")),h=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-h]}function pO(e,t,s,r,o,l,h,f,m){if(!l)return;let d=u_(e,t,s);if(d)return d[0]=Math.ceil((d[0]+(m?h/2:0))/h),d[1]=Math.ceil(d[1]/f),d[0]=Math.min(Math.max(d[0],1),r+(m?1:0)),d[1]=Math.min(Math.max(d[1],1),o),d}var ag=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,r,o){return pO(window,e,t,s,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let s=u_(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};ag=It([ve(0,Bn),ve(1,Ah)],ag);var gO=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},LE={};ND(LE,{getSafariVersion:()=>vO,isChromeOS:()=>IE,isFirefox:()=>jE,isIpad:()=>bO,isIphone:()=>yO,isLegacyEdge:()=>_O,isLinux:()=>h_,isMac:()=>bh,isNode:()=>Rh,isSafari:()=>BE,isWindows:()=>zE});var Rh=typeof process<"u"&&"title"in process,dc=Rh?"node":navigator.userAgent,fc=Rh?"node":navigator.platform,jE=dc.includes("Firefox"),_O=dc.includes("Edge"),BE=/^((?!chrome|android).)*safari/i.test(dc);function vO(){if(!BE)return 0;let e=dc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var bh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(fc),bO=fc==="iPad",yO=fc==="iPhone",zE=["Windows","Win16","Win32","WinCE"].includes(fc),h_=fc.indexOf("Linux")>=0,IE=/\bCrOS\b/.test(dc),PE=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,s=0,r=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),o=e.timeRemaining(),s*1.5>o){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=o}this.clear()}},xO=class extends PE{_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())}}},SO=class extends PE{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},yh=!Rh&&"requestIdleCallback"in window?SO:xO,wO=class{constructor(){this._queue=new yh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},og=class extends Ke{constructor(e,t,s,r,o,l,h,f,m){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=r,this._coreService=o,this._coreBrowserService=f,this._renderer=this._register(new bo),this._pausedResizeTask=new wO,this._observerDisposable=this._register(new bo),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 he),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new he),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new he),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new he),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new gO((d,_)=>this._renderRows(d,_),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new EO(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Mt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(h.onResize(()=>this._fullRefresh())),this._register(h.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(h.cols,h.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(h.buffer.y,h.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=Mt(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,s){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,this._renderer.value?.handleSelectionChanged(e,t,s)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};og=It([ve(2,Bi),ve(3,Ah),ve(4,_a),ve(5,hc),ve(6,ji),ve(7,jn),ve(8,Co)],og);var EO=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function CO(e,t,s,r){let o=s.buffer.x,l=s.buffer.y;if(!s.buffer.hasScrollback)return TO(o,l,e,t,s,r)+Dh(l,t,s,r)+MO(o,l,e,t,s,r);let h;if(l===t)return h=o>e?"D":"C",sc(Math.abs(o-e),ic(h,r));h=l>t?"D":"C";let f=Math.abs(l-t),m=kO(l>t?e:o,s)+(f-1)*s.cols+1+NO(l>t?o:e);return sc(m,ic(h,r))}function NO(e,t){return e-1}function kO(e,t){return t.cols-e}function TO(e,t,s,r,o,l){return Dh(t,r,o,l).length===0?"":sc(HE(e,t,e,t-ma(t,o),!1,o).length,ic("D",l))}function Dh(e,t,s,r){let o=e-ma(e,s),l=t-ma(t,s),h=Math.abs(o-l)-AO(e,t,s);return sc(h,ic(UE(e,t),r))}function MO(e,t,s,r,o,l){let h;Dh(t,r,o,l).length>0?h=r-ma(r,o):h=t;let f=r,m=RO(e,t,s,r,o,l);return sc(HE(e,h,s,f,m==="C",o).length,ic(m,l))}function AO(e,t,s){let r=0,o=e-ma(e,s),l=t-ma(t,s);for(let h=0;h<Math.abs(o-l);h++){let f=UE(e,t)==="A"?-1:1;s.buffer.lines.get(o+f*h)?.isWrapped&&r++}return r}function ma(e,t){let s=0,r=t.buffer.lines.get(e),o=r?.isWrapped;for(;o&&e>=0&&e<t.rows;)s++,r=t.buffer.lines.get(--e),o=r?.isWrapped;return s}function RO(e,t,s,r,o,l){let h;return Dh(s,r,o,l).length>0?h=r-ma(r,o):h=t,e<s&&h<=r||e>=s&&h<r?"C":"D"}function UE(e,t){return e>t?"A":"B"}function HE(e,t,s,r,o,l){let h=e,f=t,m="";for(;(h!==s||f!==r)&&f>=0&&f<l.buffer.lines.length;)h+=o?1:-1,o&&h>l.cols-1?(m+=l.buffer.translateBufferLineToString(f,!1,e,h),h=0,e=0,f++):!o&&h<0&&(m+=l.buffer.translateBufferLineToString(f,!1,0,e+1),h=l.cols-1,e=h,f--);return m+l.buffer.translateBufferLineToString(f,!1,e,h)}function ic(e,t){let s=t?"O":"[";return oe.ESC+s+e}function sc(e,t){e=Math.floor(e);let s="";for(let r=0;r<e;r++)s+=t;return s}var DO=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 sx(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 gm=50,OO=15,LO=50,jO=500,BO=" ",zO=new RegExp(BO,"g"),lg=class extends Ke{constructor(e,t,s,r,o,l,h,f,m){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=r,this._coreService=o,this._mouseService=l,this._optionsService=h,this._renderService=f,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Cs,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new he),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new he),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new he),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new he),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new DO(this._bufferService),this._activeSelectionMode=0,this._register(Mt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let s=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let h=e[1];h<=t[1];h++){let f=s.translateBufferLineToString(h,!0,o,l);r.push(f)}}else{let o=e[1]===t[1]?t[0]:void 0;r.push(s.translateBufferLineToString(e[1],!0,e[0],o));for(let l=e[1]+1;l<=t[1]-1;l++){let h=s.lines.get(l),f=s.translateBufferLineToString(l,!0);h?.isWrapped?r[r.length-1]+=f:r.push(f)}if(e[1]!==t[1]){let l=s.lines.get(t[1]),h=s.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=h:r.push(h)}}return r.map(o=>o.replace(zO," ")).join(zE?`\r
25
+ `:`
26
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h_&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!t?!1:this._areCoordsInSelection(t,s,r)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,t],s,r)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=sx(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,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=u_(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-gm),gm),t/=gm,t/Math.abs(t)+Math.round(t*(OO-1)))}shouldForceSelection(e){return bh?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(),LO)}_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&&!(bh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let r=s.lines.get(this._model.selectionEnd[1]);r&&r.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<jO&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let r=CO(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let r=0;t>=r;r++){let o=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:o>1&&t!==r&&(s+=o-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let h=o.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(l,e[0]),m=f,d=e[0]-f,_=0,v=0,b=0,S=0;if(h.charAt(f)===" "){for(;f>0&&h.charAt(f-1)===" ";)f--;for(;m<h.length&&h.charAt(m+1)===" ";)m++}else{let C=e[0],T=e[0];l.getWidth(C)===0&&(_++,C--),l.getWidth(T)===2&&(v++,T++);let O=l.getString(T).length;for(O>1&&(S+=O-1,m+=O-1);C>0&&f>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.loadCell(C-1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===0?(_++,C--):k>1&&(b+=k-1,f-=k-1),f--,C--}for(;T<l.length&&m+1<h.length&&!this._isCharWordSeparator(l.loadCell(T+1,this._workCell));){l.loadCell(T+1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,T++):k>1&&(S+=k-1,m+=k-1),m++,T++}}m++;let x=f+d-_+b,w=Math.min(this._bufferService.cols,m-f+_+v-b-S);if(!(!t&&h.slice(f,m).trim()==="")){if(s&&x===0&&l.getCodePoint(0)!==32){let C=o.lines.get(e[1]-1);if(C&&l.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let T=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(T){let O=this._bufferService.cols-T.start;x-=O,w+=O}}}if(r&&x+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let C=o.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(w+=T.length)}}return{start:x,length:w}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=sx(s,this._bufferService.cols)}};lg=It([ve(3,ji),ve(4,_a),ve(5,s_),ve(6,Bi),ve(7,Bn),ve(8,jn)],lg);var nx=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},rx=class{constructor(){this._color=new nx,this._css=new nx}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ni=Object.freeze((()=>{let e=[Ot.toColor("#2e3436"),Ot.toColor("#cc0000"),Ot.toColor("#4e9a06"),Ot.toColor("#c4a000"),Ot.toColor("#3465a4"),Ot.toColor("#75507b"),Ot.toColor("#06989a"),Ot.toColor("#d3d7cf"),Ot.toColor("#555753"),Ot.toColor("#ef2929"),Ot.toColor("#8ae234"),Ot.toColor("#fce94f"),Ot.toColor("#729fcf"),Ot.toColor("#ad7fa8"),Ot.toColor("#34e2e2"),Ot.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let r=t[s/36%6|0],o=t[s/6%6|0],l=t[s%6];e.push({css:ti.toCss(r,o,l),rgba:ti.toRgba(r,o,l)})}for(let s=0;s<24;s++){let r=8+s*10;e.push({css:ti.toCss(r,r,r),rgba:ti.toRgba(r,r,r)})}return e})()),ra=Ot.toColor("#ffffff"),Ul=Ot.toColor("#000000"),ax=Ot.toColor("#ffffff"),ox=Ul,Rl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},IO=ra,cg=class extends Ke{constructor(e){super(),this._optionsService=e,this._contrastCache=new rx,this._halfContrastCache=new rx,this._onChangeColors=this._register(new he),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ra,background:Ul,cursor:ax,cursorAccent:ox,selectionForeground:void 0,selectionBackgroundTransparent:Rl,selectionBackgroundOpaque:Ct.blend(Ul,Rl),selectionInactiveBackgroundTransparent:Rl,selectionInactiveBackgroundOpaque:Ct.blend(Ul,Rl),scrollbarSliderBackground:Ct.opacity(ra,.2),scrollbarSliderHoverBackground:Ct.opacity(ra,.4),scrollbarSliderActiveBackground:Ct.opacity(ra,.5),overviewRulerBorder:ra,ansi:ni.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=pt(e.foreground,ra),t.background=pt(e.background,Ul),t.cursor=Ct.blend(t.background,pt(e.cursor,ax)),t.cursorAccent=Ct.blend(t.background,pt(e.cursorAccent,ox)),t.selectionBackgroundTransparent=pt(e.selectionBackground,Rl),t.selectionBackgroundOpaque=Ct.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=pt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ct.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?pt(e.selectionForeground,ex):void 0,t.selectionForeground===ex&&(t.selectionForeground=void 0),Ct.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ct.opacity(t.selectionBackgroundTransparent,.3)),Ct.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ct.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=pt(e.scrollbarSliderBackground,Ct.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=pt(e.scrollbarSliderHoverBackground,Ct.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=pt(e.scrollbarSliderActiveBackground,Ct.opacity(t.foreground,.5)),t.overviewRulerBorder=pt(e.overviewRulerBorder,IO),t.ansi=ni.slice(),t.ansi[0]=pt(e.black,ni[0]),t.ansi[1]=pt(e.red,ni[1]),t.ansi[2]=pt(e.green,ni[2]),t.ansi[3]=pt(e.yellow,ni[3]),t.ansi[4]=pt(e.blue,ni[4]),t.ansi[5]=pt(e.magenta,ni[5]),t.ansi[6]=pt(e.cyan,ni[6]),t.ansi[7]=pt(e.white,ni[7]),t.ansi[8]=pt(e.brightBlack,ni[8]),t.ansi[9]=pt(e.brightRed,ni[9]),t.ansi[10]=pt(e.brightGreen,ni[10]),t.ansi[11]=pt(e.brightYellow,ni[11]),t.ansi[12]=pt(e.brightBlue,ni[12]),t.ansi[13]=pt(e.brightMagenta,ni[13]),t.ansi[14]=pt(e.brightCyan,ni[14]),t.ansi[15]=pt(e.brightWhite,ni[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<s;r++)t.ansi[r+16]=pt(e.extendedAnsi[r],ni[r+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()}}};cg=It([ve(0,Bi)],cg);function pt(e,t){if(e!==void 0)try{return Ot.toColor(e)}catch{}return t}var PO=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},UO=class{constructor(){this._services=new PO,this._services.set(i_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=OD(e).sort((l,h)=>l.index-h.index),r=[];for(let l of s){let h=this._services.get(l.id);if(!h)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(h)}let o=s.length>0?s[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},HO={trace:0,debug:1,info:2,warn:3,error:4,off:5},FO="xterm.js: ",ug=class extends Ke{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=HO[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":FO)+t,...s)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};ug=It([ve(0,Bi)],ug);var lx=class extends Ke{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new he),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new he),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new he),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...s){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+s.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<s.length;r++)this._array[this._getCyclicIndex(e+r)]=s[r];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let r=this._length+s.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let o=t-1;o>=0;o--)this.set(e+o+s,this.get(e+o));let r=e+t+s-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+s,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},$e=3,Qt=Object.freeze(new uc),Fu=0,_m=2,Hl=class FE{constructor(t,s,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*$e);let o=s||Cs.fromCharData([0,oE,1,0]);for(let l=0;l<t;++l)this.setCell(l,o);this.length=t}get(t){let s=this._data[t*$e+0],r=s&2097151;return[this._data[t*$e+1],s&2097152?this._combined[t]:r?br(r):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,s){this._data[t*$e+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*$e+0]=t|2097152|s[2]<<22):this._data[t*$e+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*$e+0]>>22}hasWidth(t){return this._data[t*$e+0]&12582912}getFg(t){return this._data[t*$e+1]}getBg(t){return this._data[t*$e+2]}hasContent(t){return this._data[t*$e+0]&4194303}getCodePoint(t){let s=this._data[t*$e+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*$e+0]&2097152}getString(t){let s=this._data[t*$e+0];return s&2097152?this._combined[t]:s&2097151?br(s&2097151):""}isProtected(t){return this._data[t*$e+2]&536870912}loadCell(t,s){return Fu=t*$e,s.content=this._data[Fu+0],s.fg=this._data[Fu+1],s.bg=this._data[Fu+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*$e+0]=s.content,this._data[t*$e+1]=s.fg,this._data[t*$e+2]=s.bg}setCellFromCodepoint(t,s,r,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*$e+0]=s|r<<22,this._data[t*$e+1]=o.fg,this._data[t*$e+2]=o.bg}addCodepointToCell(t,s,r){let o=this._data[t*$e+0];o&2097152?this._combined[t]+=br(s):o&2097151?(this._combined[t]=br(o&2097151)+br(s),o&=-2097152,o|=2097152):o=s|1<<22,r&&(o&=-12582913,o|=r<<22),this._data[t*$e+0]=o}insertCells(t,s,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length-t){let o=new Cs;for(let l=this.length-t-s-1;l>=0;--l)this.setCell(t+s+l,this.loadCell(t+l,o));for(let l=0;l<s;++l)this.setCell(t+l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,s,r){if(t%=this.length,s<this.length-t){let o=new Cs;for(let l=0;l<this.length-t-s;++l)this.setCell(t+l,this.loadCell(t+s+l,o));for(let l=this.length-s;l<this.length;++l)this.setCell(l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,s,r,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,r);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,r);t<s&&t<this.length;)this.setCell(t++,r)}resize(t,s){if(t===this.length)return this._data.length*4*_m<this._data.buffer.byteLength;let r=t*$e;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let o=new Uint32Array(r);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,s)}else{this._data=this._data.subarray(0,r);let o=Object.keys(this._combined);for(let h=0;h<o.length;h++){let f=parseInt(o[h],10);f>=t&&delete this._combined[f]}let l=Object.keys(this._extendedAttrs);for(let h=0;h<l.length;h++){let f=parseInt(l[h],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,r*4*_m<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*_m<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new FE(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$e+0]&4194303)return t+(this._data[t*$e+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$e+0]&4194303||this._data[t*$e+2]&50331648)return t+(this._data[t*$e+0]>>22);return 0}copyCellsFrom(t,s,r,o,l){let h=t._data;if(l)for(let m=o-1;m>=0;m--){for(let d=0;d<$e;d++)this._data[(r+m)*$e+d]=h[(s+m)*$e+d];h[(s+m)*$e+2]&268435456&&(this._extendedAttrs[r+m]=t._extendedAttrs[s+m])}else for(let m=0;m<o;m++){for(let d=0;d<$e;d++)this._data[(r+m)*$e+d]=h[(s+m)*$e+d];h[(s+m)*$e+2]&268435456&&(this._extendedAttrs[r+m]=t._extendedAttrs[s+m])}let f=Object.keys(t._combined);for(let m=0;m<f.length;m++){let d=parseInt(f[m],10);d>=s&&(this._combined[d-s+r]=t._combined[d])}}translateToString(t,s,r,o){s=s??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;s<r;){let h=this._data[s*$e+0],f=h&2097151,m=h&2097152?this._combined[s]:f?br(f):Sr;if(l+=m,o)for(let d=0;d<m.length;++d)o.push(s);s+=h>>22||1}return o&&o.push(s),l}};function VO(e,t,s,r,o,l){let h=[];for(let f=0;f<e.length-1;f++){let m=f,d=e.get(++m);if(!d.isWrapped)continue;let _=[e.get(f)];for(;m<e.length&&d.isWrapped;)_.push(d),d=e.get(++m);if(!l&&r>=f&&r<m){f+=_.length-1;continue}let v=0,b=nc(_,v,t),S=1,x=0;for(;S<_.length;){let C=nc(_,S,t),T=C-x,O=s-b,k=Math.min(T,O);_[v].copyCellsFrom(_[S],x,b,k,!1),b+=k,b===s&&(v++,b=0),x+=k,x===C&&(S++,x=0),b===0&&v!==0&&_[v-1].getWidth(s-1)===2&&(_[v].copyCellsFrom(_[v-1],s-1,b++,1,!1),_[v-1].setCell(s-1,o))}_[v].replaceCells(b,s,o);let w=0;for(let C=_.length-1;C>0&&(C>v||_[C].getTrimmedLength()===0);C--)w++;w>0&&(h.push(f+_.length-w),h.push(w)),f+=_.length-1}return h}function $O(e,t){let s=[],r=0,o=t[r],l=0;for(let h=0;h<e.length;h++)if(o===h){let f=t[++r];e.onDeleteEmitter.fire({index:h-l,amount:f}),h+=f-1,l+=f,o=t[++r]}else s.push(h);return{layout:s,countRemoved:l}}function qO(e,t){let s=[];for(let r=0;r<t.length;r++)s.push(e.get(t[r]));for(let r=0;r<s.length;r++)e.set(r,s[r]);e.length=t.length}function KO(e,t,s){let r=[],o=e.map((m,d)=>nc(e,d,t)).reduce((m,d)=>m+d),l=0,h=0,f=0;for(;f<o;){if(o-f<s){r.push(o-f);break}l+=s;let m=nc(e,h,t);l>m&&(l-=m,h++);let d=e[h].getWidth(l-1)===2;d&&l--;let _=d?s-1:s;r.push(_),f+=_}return r}function nc(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,o=e[t+1].getWidth(0)===2;return r&&o?s-1:s}var VE=class $E{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=$E._nextId++,this._onDispose=this.register(new he),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),fa(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};VE._nextId=1;var GO=VE,oi={},aa=oi.B;oi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};oi.A={"#":"£"};oi.B=void 0;oi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};oi.C=oi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};oi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};oi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};oi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};oi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};oi.E=oi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};oi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};oi.H=oi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};oi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var cx=4294967295,ux=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Qt.clone(),this.savedCharset=aa,this.markers=[],this._nullCell=Cs.fromCharData([0,oE,1,0]),this._whitespaceCell=Cs.fromCharData([0,Sr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new yh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new lx(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 gh),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 gh),this._whitespaceCell}getBlankLine(e,t){return new Hl(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>cx?cx:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Qt);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 lx(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(Qt),r=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let h=0;h<this.lines.length;h++)r+=+this.lines.get(h).resize(e,s);let l=0;if(this._rows<t)for(let h=this._rows;h<t;h++)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 Hl(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new Hl(e,s)));else for(let h=this._rows;h>t;h--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let h=this.lines.length-o;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=o}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++)r+=+this.lines.get(l).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,r=VO(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Qt),s);if(r.length>0){let o=$O(this.lines,r);qO(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let r=this.getNullCell(Qt),o=s;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Hl(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Qt),o=[],l=0;for(let h=this.lines.length-1;h>=0;h--){let f=this.lines.get(h);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let m=[f];for(;f.isWrapped&&h>0;)f=this.lines.get(--h),m.unshift(f);if(!s){let k=this.ybase+this.y;if(k>=h&&k<h+m.length)continue}let d=m[m.length-1].getTrimmedLength(),_=KO(m,this._cols,e),v=_.length-m.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+v):b=Math.max(0,this.lines.length-this.lines.maxLength+v);let S=[];for(let k=0;k<v;k++){let D=this.getBlankLine(Qt,!0);S.push(D)}S.length>0&&(o.push({start:h+m.length+l,newLines:S}),l+=S.length),m.push(...S);let x=_.length-1,w=_[x];w===0&&(x--,w=_[x]);let C=m.length-v-1,T=d;for(;C>=0;){let k=Math.min(T,w);if(m[x]===void 0)break;if(m[x].copyCellsFrom(m[C],T-k,w-k,k,!0),w-=k,w===0&&(x--,w=_[x]),T-=k,T===0){C--;let D=Math.max(C,0);T=nc(m,D,this._cols)}}for(let k=0;k<m.length;k++)_[k]<e&&m[k].setCell(_[k],r);let O=v-b;for(;O-- >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+v,this.ybase+t-1)}if(o.length>0){let h=[],f=[];for(let w=0;w<this.lines.length;w++)f.push(this.lines.get(w));let m=this.lines.length,d=m-1,_=0,v=o[_];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let b=0;for(let w=Math.min(this.lines.maxLength-1,m+l-1);w>=0;w--)if(v&&v.start>d+b){for(let C=v.newLines.length-1;C>=0;C--)this.lines.set(w--,v.newLines[C]);w++,h.push({index:d+1,amount:v.newLines.length}),b+=v.newLines.length,v=o[++_]}else this.lines.set(w,f[d--]);let S=0;for(let w=h.length-1;w>=0;w--)h[w].index+=S,this.lines.onInsertEmitter.fire(h[w]),S+=h[w].amount;let x=Math.max(0,m+l-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,s=0,r){let o=this.lines.get(e);return o?o.translateToString(t,s,r):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new GO(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},WO=class extends Ke{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new he),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 ux(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new ux(!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)}},qE=2,KE=1,hg=class extends Ke{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new he),this.onResize=this._onResize.event,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,qE),this.rows=Math.max(e.rawOptions.rows||0,KE),this.buffers=this._register(new WO(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=s.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let o=s.ybase+s.scrollTop,l=s.ybase+s.scrollBottom;if(s.scrollTop===0){let h=s.lines.isFull;l===s.lines.length-1?h?s.lines.recycle().copyFrom(r):s.lines.push(r.clone()):s.lines.splice(l+1,0,r.clone()),h?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let h=l-o+1;s.lines.shiftElements(o+1,h-1,-1),s.lines.set(l,r.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};hg=It([ve(0,Bi)],hg);var ao={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:bh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},YO=["normal","bold","100","200","300","400","500","600","700","800","900"],XO=class extends Ke{constructor(e){super(),this._onOptionChange=this._register(new he),this.onOptionChange=this._onOptionChange.event;let t={...ao};for(let s in e)if(s in t)try{let r=e[s];t[s]=this._sanitizeAndValidateOption(s,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Mt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in ao))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,r)=>{if(!(s in ao))throw new Error(`No option with key "${s}"`);r=this._sanitizeAndValidateOption(s,r),this.rawOptions[s]!==r&&(this.rawOptions[s]=r,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let r={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ao[e]),!ZO(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ao[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=YO.includes(t)?t:ao[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 ZO(e){return e==="block"||e==="underline"||e==="bar"}function Fl(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let r in e)s[r]=t<=1?e[r]:e[r]&&Fl(e[r],t-1);return s}var hx=Object.freeze({insertMode:!1}),dx=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),dg=class extends Ke{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new he),this.onData=this._onData.event,this._onUserInput=this._register(new he),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new he),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new he),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Fl(hx),this.decPrivateModes=Fl(dx)}reset(){this.modes=Fl(hx),this.decPrivateModes=Fl(dx)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.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))}};dg=It([ve(0,ji),ve(1,dE),ve(2,Bi)],dg);var fx={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 vm(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var bm=String.fromCharCode,mx={DEFAULT:e=>{let t=[vm(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${bm(t[0])}${bm(t[1])}${bm(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vm(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vm(e,!0)};${e.x};${e.y}${t}`}},fg=class extends Ke{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new he),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(fx))this.addProtocol(r,fx[r]);for(let r of Object.keys(mx))this.addEncoding(r,mx[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let r=t/s,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=r+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,s){if(s){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};fg=It([ve(0,ji),ve(1,_a),ve(2,Bi)],fg);var ym=[[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]],QO=[[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]],ri;function JO(e,t){let s=0,r=t.length-1,o;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(o=s+r>>1,e>t[o][1])s=o+1;else if(e<t[o][0])r=o-1;else return!0;return!1}var eL=class{constructor(){if(this.version="6",!ri){ri=new Uint8Array(65536),ri.fill(1),ri[0]=0,ri.fill(0,1,32),ri.fill(0,127,160),ri.fill(2,4352,4448),ri[9001]=2,ri[9002]=2,ri.fill(2,11904,42192),ri[12351]=1,ri.fill(2,44032,55204),ri.fill(2,63744,64256),ri.fill(2,65040,65050),ri.fill(2,65072,65136),ri.fill(2,65280,65377),ri.fill(2,65504,65511);for(let e=0;e<ym.length;++e)ri.fill(0,ym[e][0],ym[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ri[e]:JO(e,QO)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),r=s===0&&t!==0;if(r){let o=ca.extractWidth(t);o===0?r=!1:o>s&&(s=o)}return ca.createPropertyValue(0,s,r)}},ca=class ih{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new he,this.onChange=this._onChange.event;let t=new eL;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,r=!1){return(t&16777215)<<3|(s&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,r=0,o=t.length;for(let l=0;l<o;++l){let h=t.charCodeAt(l);if(55296<=h&&h<=56319){if(++l>=o)return s+this.wcwidth(h);let d=t.charCodeAt(l);56320<=d&&d<=57343?h=(h-55296)*1024+d-56320+65536:s+=this.wcwidth(d)}let f=this.charProperties(h,r),m=ih.extractWidth(f);ih.extractShouldJoin(f)&&(m-=ih.extractWidth(r)),s+=m,r=f}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},tL=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 px(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var Dl=2147483647,iL=256,GE=class mg{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>iL)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new mg;if(!t.length)return s;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let o=t[r];if(Array.isArray(o))for(let l=0;l<o.length;++l)s.addSubParam(o[l]);else s.addParam(o)}return s}clone(){let t=new mg(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,o))}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>Dl?Dl: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>Dl?Dl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-s>0?this._subParams.subarray(s,r):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&(t[s]=this._subParams.slice(r,o))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,o=r[s-1];r[s-1]=~o?Math.min(o*10+t,Dl):t}},Ol=[],sL=class{constructor(){this._state=0,this._active=Ol,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,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=Ol}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=Ol,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Ol,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Mh(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&s-t>0&&this._put(e,t,s)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].end(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ol,this._id=-1,this._state=0}}},rs=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Mh(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,t}},Ll=[],nL=class{constructor(){this._handlers=Object.create(null),this._active=Ll,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ll}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,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=Ll,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ll,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Mh(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].unhook(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ll,this._ident=0}},Vl=new GE;Vl.addParam(0);var gx=class{constructor(e){this._handler=e,this._data="",this._params=Vl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Vl,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Mh(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(s=>(this._params=Vl,this._data="",this._hitLimit=!1,s));return this._params=Vl,this._data="",this._hitLimit=!1,t}},rL=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,r){this.table[t<<8|e]=s<<4|r}addMany(e,t,s,r){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=s<<4|r}},Ss=160,aL=(function(){let e=new rL(4095),t=Array.apply(null,Array(256)).map((f,m)=>m),s=(f,m)=>t.slice(f,m),r=s(32,127),o=s(0,24);o.push(25),o.push.apply(o,s(28,32));let l=s(0,14),h;e.setDefault(1,0),e.addMany(r,0,2,0);for(h in l)e.addMany([24,26,153,154],h,3,0),e.addMany(s(128,144),h,3,0),e.addMany(s(144,152),h,3,0),e.add(156,h,0,0),e.add(27,h,11,1),e.add(157,h,4,8),e.addMany([152,158,159],h,0,7),e.add(155,h,11,3),e.add(144,h,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ss,0,2,0),e.add(Ss,8,5,8),e.add(Ss,6,0,6),e.add(Ss,11,0,11),e.add(Ss,13,13,13),e})(),oL=class extends Ke{constructor(e=aL){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 GE,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Mt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new sL),this._dcsParser=this._register(new nL),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let l=e.intermediates.charCodeAt(o);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=r,s}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let r=this._escHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let r=this._csiHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,s,r,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=r,this._parseStack.chunkPos=o}parse(e,t,s){let r=0,o=0,l=0,h;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(h=f[m](this._params),h!==!0);m--)if(h instanceof Promise)return this._parseStack.handlerPos=m,h}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(h=f[m](),h!==!0);m--)if(h instanceof Promise)return this._parseStack.handlerPos=m,h}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],h=this._dcsParser.unhook(r!==24&&r!==26,s),h)return h;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],h=this._oscParser.end(r!==24&&r!==26,s),h)return h;r===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 f=l;f<t;++f){switch(r=e[f],o=this._transitions.table[this.currentState<<8|(r<160?r:Ss)],o>>4){case 2:for(let b=f+1;;++b){if(b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|r],d=m?m.length-1:-1;for(;d>=0&&(h=m[d](this._params),h!==!0);d--)if(h instanceof Promise)return this._preserveStack(3,m,d,o,f),h;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++f<t&&(r=e[f])>47&&r<60);f--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let _=this._escHandlers[this._collect<<8|r],v=_?_.length-1:-1;for(;v>=0&&(h=_[v](),h!==!0);v--)if(h instanceof Promise)return this._preserveStack(4,_,v,o,f),h;v<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let b=f+1;;++b)if(b>=t||(r=e[b])===24||r===26||r===27||r>127&&r<Ss){this._dcsParser.put(e,f,b),f=b-1;break}break;case 14:if(h=this._dcsParser.unhook(r!==24&&r!==26),h)return this._preserveStack(6,[],0,o,f),h;r===27&&(o|=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 b=f+1;;b++)if(b>=t||(r=e[b])<32||r>127&&r<Ss){this._oscParser.put(e,f,b),f=b-1;break}break;case 6:if(h=this._oscParser.end(r!==24&&r!==26),h)return this._preserveStack(5,[],0,o,f),h;r===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},lL=/^([\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})$/,cL=/^[\da-f]+$/;function _x(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=lL.exec(t);if(s){let r=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/r*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/r*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),cL.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,r=[0,0,0];for(let o=0;o<3;++o){let l=parseInt(t.slice(s*o,s*o+s),16);r[o]=s===1?l<<4:s===2?l:s===3?l>>4:l>>8}return r}}function xm(e,t){let s=e.toString(16),r=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function uL(e,t=16){let[s,r,o]=e;return`rgb:${xm(s,t)}/${xm(r,t)}/${xm(o,t)}`}var hL={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_r=131072,vx=10;function bx(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 yx=5e3,xx=0,dL=class extends Ke{constructor(e,t,s,r,o,l,h,f,m=new oL){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=r,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=h,this._unicodeService=f,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new RD,this._utf8Decoder=new DD,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Qt.clone(),this._eraseAttrDataInternal=Qt.clone(),this._onRequestBell=this._register(new he),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new he),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new he),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new he),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new he),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new he),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new he),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new he),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new he),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new he),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new he),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new he),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 pg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,_)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:_.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,_,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:_,data:v})}),this._parser.setDcsHandlerFallback((d,_,v)=>{_==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:_,payload:v})}),this._parser.setPrintHandler((d,_,v)=>this.print(d,_,v)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!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(eh.IND,()=>this.index()),this._parser.setExecuteHandler(eh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(eh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new rs(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new rs(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new rs(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new rs(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new rs(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new rs(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new rs(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new rs(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new rs(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new rs(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new rs(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new rs(d=>this.restoreCursorColor(d))),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 d in oi)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new gx((d,_)=>this.requestStatusString(d,_)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),yx))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${yx} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,r=this._activeBuffer.x,o=this._activeBuffer.y,l=0,h=this._parseStack.paused;if(h){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;r=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>_r&&(l=this._parseStack.position+_r)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<_r&&(this._parseBuffer=new Uint32Array(Math.min(e.length,_r))),h||this._dirtyRowTracker.clearRange(),e.length>_r)for(let d=l;d<e.length;d+=_r){let _=d+_r<e.length?d+_r:e.length,v=typeof e=="string"?this._stringDecoder.decode(e.substring(d,_),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,_),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,v))return this._preserveStack(r,o,v,d),this._logSlowResolvingAsync(s),s}else if(!h){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,o,d,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==r||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let f=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(f,this._bufferService.rows-1)})}print(e,t,s){let r,o,l=this._charsetService.charset,h=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,_=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,_);let b=this._parser.precedingJoinState;for(let S=t;S<s;++S){if(r=e[S],r<127&&l){let T=l[String.fromCharCode(r)];T&&(r=T.charCodeAt(0))}let x=this._unicodeService.charProperties(r,b);o=ca.extractWidth(x);let w=ca.extractShouldJoin(x),C=w?ca.extractWidth(b):0;if(b=x,h&&this._onA11yChar.fire(br(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-C>f){if(m){let T=v,O=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&v instanceof Hl&&v.copyCellsFrom(T,O,0,C,!1);O<f;)T.setCellFromCodepoint(O++,0,1,_)}else if(this._activeBuffer.x=f-1,o===2)continue}if(w&&this._activeBuffer.x){let T=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-T,r,o);for(let O=o-C;--O>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,_);continue}if(d&&(v.insertCells(this._activeBuffer.x,o-C,this._activeBuffer.getNullCell(_)),v.getWidth(f-1)===2&&v.setCellFromCodepoint(f-1,0,1,_)),v.setCellFromCodepoint(this._activeBuffer.x++,r,o,_),o>0)for(;--o;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}this._parser.precedingJoinState=b,this._activeBuffer.x<f&&s-t>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,_),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>bx(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new gx(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new rs(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,s,r=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),o),r&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+s)?.getTrimmedLength(););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(s,1),this._activeBuffer.lines.splice(r,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(Qt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let s=e.params[0]||1,r=ca.extractWidth(t),o=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),h=new Uint32Array(l.length*s),f=0;for(let d=0;d<l.length;){let _=l.codePointAt(d)||0;h[f++]=_,d+=_>65535?2:1}let m=f;for(let d=1;d<s;++d)h.copyWithin(m,0,f),m+=f;return this.print(h,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,aa),this._charsetService.setgCharset(1,aa),this._charsetService.setgCharset(2,aa),this._charsetService.setgCharset(3,aa);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let s;(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"))(s||={});let r=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,h=this._coreService,{buffers:f,cols:m}=this._bufferService,{active:d,alt:_}=f,v=this._optionsService.rawOptions,b=(w,C)=>(h.triggerDataEvent(`${oe.ESC}[${t?"":"?"}${w};${C}$y`),!0),S=w=>w?1:2,x=e.params[0];return t?x===2?b(x,4):x===4?b(x,S(h.modes.insertMode)):x===12?b(x,3):x===20?b(x,S(v.convertEol)):b(x,0):x===1?b(x,S(r.applicationCursorKeys)):x===3?b(x,v.windowOptions.setWinLines?m===80?2:m===132?1:0:0):x===6?b(x,S(r.origin)):x===7?b(x,S(r.wraparound)):x===8?b(x,3):x===9?b(x,S(o==="X10")):x===12?b(x,S(v.cursorBlink)):x===25?b(x,S(!h.isCursorHidden)):x===45?b(x,S(r.reverseWraparound)):x===66?b(x,S(r.applicationKeypad)):x===67?b(x,4):x===1e3?b(x,S(o==="VT200")):x===1002?b(x,S(o==="DRAG")):x===1003?b(x,S(o==="ANY")):x===1004?b(x,S(r.sendFocus)):x===1005?b(x,4):x===1006?b(x,S(l==="SGR")):x===1015?b(x,4):x===1016?b(x,S(l==="SGR_PIXELS")):x===1048?b(x,1):x===47||x===1047||x===1049?b(x,S(d===_)):x===2004?b(x,S(r.bracketedPasteMode)):x===2026?b(x,S(r.synchronizedOutput)):b(x,0)}_updateAttrColor(e,t,s,r,o){return t===2?(e|=50331648,e&=-16777216,e|=uc.fromColorRGB([s,r,o])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let r=[0,0,-1,0,0,0],o=0,l=0;do{if(r[l+o]=e.params[t+l],e.hasSubParams(t+l)){let h=e.getSubParams(t+l),f=0;do r[1]===5&&(o=1),r[l+f+1+o]=h[f];while(++f<h.length&&f+l+1+o<r.length);break}if(r[1]===5&&l+o>=2||r[1]===2&&l+o>=5)break;r[1]&&(o=1)}while(++l+t<e.length&&l+o<r.length);for(let h=2;h<r.length;++h)r[h]===-1&&(r[h]=0);switch(r[0]){case 38:s.fg=this._updateAttrColor(s.fg,r[1],r[3],r[4],r[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,r[1],r[3],r[4],r[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,r[1],r[3],r[4],r[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=Qt.fg,e.bg=Qt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,s,r=this._curAttrData;for(let o=0;o<t;o++)s=e.params[o],s>=30&&s<=37?(r.fg&=-50331904,r.fg|=16777216|s-30):s>=40&&s<=47?(r.bg&=-50331904,r.bg|=16777216|s-40):s>=90&&s<=97?(r.fg&=-50331904,r.fg|=16777216|s-90|8):s>=100&&s<=107?(r.bg&=-50331904,r.bg|=16777216|s-100|8):s===0?this._processSGR0(r):s===1?r.fg|=134217728:s===3?r.bg|=67108864:s===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,r)):s===5?r.fg|=536870912:s===7?r.fg|=67108864:s===8?r.fg|=1073741824:s===9?r.fg|=2147483648:s===2?r.bg|=134217728:s===21?this._processUnderline(2,r):s===22?(r.fg&=-134217729,r.bg&=-134217729):s===23?r.bg&=-67108865:s===24?(r.fg&=-268435457,this._processUnderline(0,r)):s===25?r.fg&=-536870913:s===27?r.fg&=-67108865:s===28?r.fg&=-1073741825:s===29?r.fg&=2147483647:s===39?(r.fg&=-67108864,r.fg|=Qt.fg&16777215):s===49?(r.bg&=-67108864,r.bg|=Qt.bg&16777215):s===38||s===48||s===58?o+=this._extractColor(e,o,r):s===53?r.bg|=1073741824:s===55?r.bg&=-1073741825:s===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):s===100?(r.fg&=-67108864,r.fg|=Qt.fg&16777215,r.bg&=-67108864,r.bg|=Qt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);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,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[?${t};${s}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Qt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!bx(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>vx&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>vx&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],s=e.split(";");for(;s.length>1;){let r=s.shift(),o=s.shift();if(/^\d+$/.exec(r)){let l=parseInt(r);if(Sx(l))if(o==="?")t.push({type:0,index:l});else{let h=_x(o);h&&t.push({type:1,index:l,color:h})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(s,r):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),r,o=s.findIndex(l=>l.startsWith("id="));return o!==-1&&(r=s[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let s=e.split(";");for(let r=0;r<s.length&&!(t>=this._specialColors.length);++r,++t)if(s[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=_x(s[r]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],s=e.split(";");for(let r=0;r<s.length;++r)if(/^\d+$/.exec(s[r])){let o=parseInt(s[r]);Sx(o)&&t.push({type:2,index:o})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,aa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(hL[e[0]],oi[e[1]]||aa),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Qt.clone(),this._eraseAttrDataInternal=Qt.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 Cs;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let s=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(s);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=h=>(this._coreService.triggerDataEvent(`${oe.ESC}${h}${oe.ESC}\\`),!0),r=this._bufferService.buffer,o=this._optionsService.rawOptions;return s(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},pg=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&&(xx=e,e=t,t=xx),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};pg=It([ve(0,ji)],pg);function Sx(e){return 0<=e&&e<256}var fL=5e7,wx=12,mL=50,pL=class extends Ke{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 he),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>fL)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],o=this._action(r,t);if(o){let h=f=>performance.now()-s>=wx?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(s,f);o.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(h);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-s>=wx)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>mL&&(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()}},gg=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 f=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(m,f)),this._dataByLinkId.set(m.id,m),m.id}let s=e,r=this._getEntryIdKey(s),o=this._entriesWithId.get(r);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let l=t.addMarker(t.ybase+t.y),h={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(h,l)),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);s.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(s,r))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};gg=It([ve(0,ji)],gg);var Ex=!1,gL=class extends Ke{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new bo),this._onBinary=this._register(new he),this.onBinary=this._onBinary.event,this._onData=this._register(new he),this.onData=this._onData.event,this._onLineFeed=this._register(new he),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new he),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new he),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new he),this._instantiationService=new UO,this.optionsService=this._register(new XO(e)),this._instantiationService.setService(Bi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(hg)),this._instantiationService.setService(ji,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ug)),this._instantiationService.setService(dE,this._logService),this.coreService=this._register(this._instantiationService.createInstance(dg)),this._instantiationService.setService(_a,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(fg)),this._instantiationService.setService(hE,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ca)),this._instantiationService.setService(BD,this.unicodeService),this._charsetService=this._instantiationService.createInstance(tL),this._instantiationService.setService(jD,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(gg),this._instantiationService.setService(fE,this._oscLinkService),this._inputHandler=this._register(new dL(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(wi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(wi.forward(this._bufferService.onResize,this._onResize)),this._register(wi.forward(this.coreService.onData,this._onData)),this._register(wi.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 pL((t,s)=>this._inputHandler.parse(t,s))),this._register(wi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new he),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&&!Ex&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Ex=!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,qE),t=Math.max(t,KE),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(px.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(px(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Mt(()=>{for(let t of e)t.dispose()})}}},_L={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 vL(e,t,s,r){let o={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?o.key=oe.ESC+"OA":o.key=oe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=oe.ESC+"OD":o.key=oe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=oe.ESC+"OC":o.key=oe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=oe.ESC+"OB":o.key=oe.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":oe.DEL,e.altKey&&(o.key=oe.ESC+o.key);break;case 9:if(e.shiftKey){o.key=oe.ESC+"[Z";break}o.key=oe.HT,o.cancel=!0;break;case 13:o.key=e.altKey?oe.ESC+oe.CR:oe.CR,o.cancel=!0;break;case 27:o.key=oe.ESC,e.altKey&&(o.key=oe.ESC+oe.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"D":t?o.key=oe.ESC+"OD":o.key=oe.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"C":t?o.key=oe.ESC+"OC":o.key=oe.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"A":t?o.key=oe.ESC+"OA":o.key=oe.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"B":t?o.key=oe.ESC+"OB":o.key=oe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=oe.ESC+"[2~");break;case 46:l?o.key=oe.ESC+"[3;"+(l+1)+"~":o.key=oe.ESC+"[3~";break;case 36:l?o.key=oe.ESC+"[1;"+(l+1)+"H":t?o.key=oe.ESC+"OH":o.key=oe.ESC+"[H";break;case 35:l?o.key=oe.ESC+"[1;"+(l+1)+"F":t?o.key=oe.ESC+"OF":o.key=oe.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=oe.ESC+"[5;"+(l+1)+"~":o.key=oe.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=oe.ESC+"[6;"+(l+1)+"~":o.key=oe.ESC+"[6~";break;case 112:l?o.key=oe.ESC+"[1;"+(l+1)+"P":o.key=oe.ESC+"OP";break;case 113:l?o.key=oe.ESC+"[1;"+(l+1)+"Q":o.key=oe.ESC+"OQ";break;case 114:l?o.key=oe.ESC+"[1;"+(l+1)+"R":o.key=oe.ESC+"OR";break;case 115:l?o.key=oe.ESC+"[1;"+(l+1)+"S":o.key=oe.ESC+"OS";break;case 116:l?o.key=oe.ESC+"[15;"+(l+1)+"~":o.key=oe.ESC+"[15~";break;case 117:l?o.key=oe.ESC+"[17;"+(l+1)+"~":o.key=oe.ESC+"[17~";break;case 118:l?o.key=oe.ESC+"[18;"+(l+1)+"~":o.key=oe.ESC+"[18~";break;case 119:l?o.key=oe.ESC+"[19;"+(l+1)+"~":o.key=oe.ESC+"[19~";break;case 120:l?o.key=oe.ESC+"[20;"+(l+1)+"~":o.key=oe.ESC+"[20~";break;case 121:l?o.key=oe.ESC+"[21;"+(l+1)+"~":o.key=oe.ESC+"[21~";break;case 122:l?o.key=oe.ESC+"[23;"+(l+1)+"~":o.key=oe.ESC+"[23~";break;case 123:l?o.key=oe.ESC+"[24;"+(l+1)+"~":o.key=oe.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=oe.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=oe.DEL:e.keyCode===219?o.key=oe.ESC:e.keyCode===220?o.key=oe.FS:e.keyCode===221&&(o.key=oe.GS);else if((!s||r)&&e.altKey&&!e.metaKey){let h=_L[e.keyCode]?.[e.shiftKey?1:0];if(h)o.key=oe.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(f);e.shiftKey&&(m=m.toUpperCase()),o.key=oe.ESC+m}else if(e.keyCode===32)o.key=oe.ESC+(e.ctrlKey?oe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),o.key=oe.ESC+f,o.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=oe.US),e.key==="@"&&(o.key=oe.NUL));break}return o}var qt=0,bL=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new yh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new yh,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((o,l)=>this._getKey(o)-this._getKey(l)),t=0,s=0,r=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<r.length;o++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(r[o]=e[t],t++):r[o]=this._array[s++];this._array=r,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||(qt=this._search(t),qt===-1)||this._getKey(this._array[qt])!==t)return!1;do if(this._array[qt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(qt),!0;while(++qt<this._array.length&&this._getKey(this._array[qt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,l)=>o-l),t=0,s=new Array(this._array.length-e.length),r=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:s[r++]=this._array[o];this._array=s,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do yield this._array[qt];while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do t(this._array[qt]);while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let r=t+s>>1,o=this._getKey(this._array[r]);if(o>e)s=r-1;else if(o<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Sm=0,Cx=0,yL=class extends Ke{constructor(){super(),this._decorations=new bL(e=>e?.marker.line),this._onDecorationRegistered=this._register(new he),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new he),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Mt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new xL(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,s){let r=0,o=0;for(let l of this._decorations.getKeyIterator(t))r=l.options.x??0,o=r+(l.options.width??1),e>=r&&e<o&&(!s||(l.options.layer??"bottom")===s)&&(yield l)}forEachDecorationAtCell(e,t,s,r){this._decorations.forEachByKey(t,o=>{Sm=o.options.x??0,Cx=Sm+(o.options.width??1),e>=Sm&&e<Cx&&(!s||(o.options.layer??"bottom")===s)&&r(o)})}},xL=class extends wr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new he),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new he),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=Ot.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ot.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},SL=1e3,wL=class{constructor(e,t=SL){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=r-this._lastRefreshMs,l=this._debounceThresholdMS-o;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)}},Nx=20,xh=class extends Ke{constructor(e,t,s,r){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.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=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new wL(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(`
27
+ `))),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(Ie(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Mt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Nx+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
28
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===Nx+1&&(this._liveRegion.textContent+=Bp.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let s=this._terminal.buffer,r=s.lines.length.toString();for(let o=e;o<=t;o++){let l=s.lines.get(s.ydisp+o),h=[],f=l?.translateToString(!0,void 0,void 0,h)||"",m=(s.ydisp+o+1).toString(),d=this._rowElements[o];d&&(f.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=f,this._rowColumns.set(d,h)),d.setAttribute("aria-posinset",m),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],o=s.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==r)return;let h,f;if(t===0?(h=s,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(h=this._rowElements.shift(),f=s,this._rowContainer.removeChild(h)),h.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(s.node))return;let o=({node:f,offset:m})=>{let d=f instanceof Text?f.parentNode:f,_=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(_))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(d);if(!v)return console.warn("columns is null. Race condition?"),null;let b=m<v.length?v[m]:v.slice(-1)[0]+1;return b>=this._terminal.cols&&(++_,b=0),{row:_,column:b}},l=o(t),h=o(s);if(!(!l||!h)){if(l.row>h.row||l.row===h.row&&l.column>=h.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(h.row-l.row)*this._terminal.cols-l.column+h.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,s=this._rowColumns.get(e)?.slice(-1)?.[0];if(!s)return;let r=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};xh=It([ve(1,i_),ve(2,jn),ve(3,Bn)],xh);var _g=class extends Ke{constructor(e,t,s,r,o){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=r,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new he),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new he),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Mt(()=>{fa(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(Ie(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ie(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ie(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ie(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let s=e.composedPath();for(let r=0;r<s.length;r++){let o=s[r];if(o.classList.contains("xterm"))break;if(o.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(r=>{r?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[r,o]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(s=this._checkLinkProviderResult(r,e,s)):o.provideLinks(e.y,l=>{if(this._isMouseOut)return;let h=l?.map(f=>({link:f}));this._activeProviderReplies?.set(r,h),s=this._checkLinkProviderResult(r,e,s),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let r=0;r<t.size;r++){let o=t.get(r);if(o)for(let l=0;l<o.length;l++){let h=o[l],f=h.link.range.start.y<e?0:h.link.range.start.x,m=h.link.range.end.y>e?this._bufferService.cols:h.link.range.end.x;for(let d=f;d<=m;d++){if(s.has(d)){o.splice(l--,1);break}s.add(d)}}}}_checkLinkProviderResult(e,t,s){if(!this._activeProviderReplies)return s;let r=this._activeProviderReplies.get(e),o=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(o=!0);if(!o&&r){let l=r.find(h=>this._linkAtPosition(h.link,t));l&&(s=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let l=0;l<this._activeProviderReplies.size;l++){let h=this._activeProviderReplies.get(l)?.find(f=>this._linkAtPosition(f.link,t));if(h){s=!0,this._handleNewLink(h);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&EL(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,fa(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:s=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:s=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let r=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(r,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,r=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-r-1,s.end.x,s.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return s<=o&&o<=r}_positionFromMouseEvent(e,t,s){let r=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,r,o){return{x1:e,y1:t,x2:s,y2:r,cols:this._bufferService.cols,fg:o}}};_g=It([ve(1,s_),ve(2,Bn),ve(3,ji),ve(4,pE)],_g);function EL(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 CL=class extends gL{constructor(e={}){super(e),this._linkifier=this._register(new bo),this.browser=LE,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new bo),this._onCursorMove=this._register(new he),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new he),this.onKey=this._onKey.event,this._onRender=this._register(new he),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new he),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new he),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new he),this.onBell=this._onBell.event,this._onFocus=this._register(new he),this._onBlur=this._register(new he),this._onA11yCharEmitter=this._register(new he),this._onA11yTabEmitter=this._register(new he),this._onWillOpen=this._register(new he),this._setup(),this._decorationService=this._instantiationService.createInstance(yL),this._instantiationService.setService(hc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(mO),this._instantiationService.setService(pE,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ip)),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(wi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(wi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(wi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(wi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Mt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let s,r="";switch(t.index){case 256:s="foreground",r="10";break;case 257:s="background",r="11";break;case 258:s="cursor",r="12";break;default:s="ansi",r="4;"+t.index}switch(t.type){case 0:let o=Ct.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${oe.ESC}]${r};${uL(o)}${DE.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=ti.toColor(...t.color));else{let l=s;this._themeService.modifyColors(h=>h[l]=ti.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(xh,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 s=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,o=t.getWidth(s),l=this._renderService.dimensions.css.cell.width*o,h=this.buffer.y*this._renderService.dimensions.css.cell.height,f=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=h+"px",this.textarea.style.width=l+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ie(this.element,"copy",t=>{this.hasSelection()&&MD(t,this._selectionService)}));let e=t=>AD(t,this.textarea,this.coreService,this.optionsService);this._register(Ie(this.textarea,"paste",e)),this._register(Ie(this.element,"paste",e)),jE?this._register(Ie(this.element,"mousedown",t=>{t.button===2&&By(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ie(this.element,"contextmenu",t=>{By(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),h_&&this._register(Ie(this.element,"auxclick",t=>{t.button===1&&aE(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ie(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ie(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ie(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ie(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ie(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ie(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ie(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(Ie(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",jp.get()),IE||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(dO,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(jn,this._coreBrowserService),this._register(Ie(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Ie(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(rg,this._document,this._helperContainer),this._instantiationService.setService(Ah,this._charSizeService),this._themeService=this._instantiationService.createInstance(cg),this._instantiationService.setService(Co,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(vh),this._instantiationService.setService(mE,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(og,this.rows,this.screenElement)),this._instantiationService.setService(Bn,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ig,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ag),this._instantiationService.setService(s_,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(_g,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(eg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(lg,this.element,this.screenElement,r)),this._instantiationService.setService(ID,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(wi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(tg,this.screenElement)),this._register(Ie(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(xh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_h,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_h,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ng,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(l){let h=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!h)return!1;let f,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(f=3,l.button!==void 0&&(f=l.button<3?l.button:3)):f=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,f=l.button<3?l.button:3;break;case"mousedown":m=1,f=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let d=l.deltaY;if(d===0||e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=d<0?0:1,f=4;break;default:return!1}return m===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:h.col,row:h.row,x:h.x,y:h.y,button:f,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(s(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(s(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&s(l)},mousemove:l=>{l.buttons||s(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?r.mousemove||(t.addEventListener("mousemove",o.mousemove),r.mousemove=o.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),r.wheel=o.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ie(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return s(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(Ie(t,"wheel",l=>{if(!r.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 h=oe.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h,!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){rE(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,s){this._selectionService.setSelection(e,t,s)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=vL(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let r=this.rows-1;return this.scrollLines(s.type===2?-r:r),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((s.key===oe.ETX||s.key===oe.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(NL(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(Qt));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),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[4;${s};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[6;${o};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function NL(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var kL=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},TL=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 Cs)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},kx=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 TL(t)}getNullCell(){return new Cs}},ML=class extends Ke{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new he),this.onBufferChange=this._onBufferChange.event,this._normal=new kx(this._core.buffers.normal,"normal"),this._alternate=new kx(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)}},AL=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,r)=>t(s,r.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)}},RL=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}},DL=["cols","rows"],$s=0,OL=class extends Ke{constructor(e){super(),this._core=this._register(new CL(e)),this._addonManager=this._register(new kL),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],s=(r,o)=>{this._checkReadonlyOptions(r),this._core.options[r]=o};for(let r in this._core.options){let o={get:t.bind(this,r),set:s.bind(this,r)};Object.defineProperty(this._publicOptions,r,o)}}_checkReadonlyOptions(e){if(DL.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 AL(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new RL(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 ML(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
29
+ `,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 jp.get()},set promptLabel(e){jp.set(e)},get tooMuchOutput(){return Bp.get()},set tooMuchOutput(e){Bp.set(e)}}}_verifyIntegers(...e){for($s of e)if($s===1/0||isNaN($s)||$s%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for($s of e)if($s&&($s===1/0||isNaN($s)||$s%1!==0||$s<0))throw new Error("This API only accepts positive integers")}};function LL({sessionId:e,active:t}){const s=N.useRef(null),r=N.useRef(null),o=N.useRef(null),l=N.useRef(null),[h,f]=N.useState("Local workspace"),[m,d]=N.useState("connecting"),[_,v]=N.useState("Opening shell"),b=N.useCallback(()=>{const x=l.current,w=o.current;if(!x||x.readyState!==WebSocket.OPEN||!w)return;w.fit();const C=w.proposeDimensions();C&&x.send(JSON.stringify({cols:C.cols,rows:C.rows,type:"resize"}))},[]);N.useEffect(()=>{if(!s.current)return;const x=new OL({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 ED;x.loadAddon(w),x.open(s.current),r.current=x,o.current=w;const C=new WebSocket(jL(e));l.current=C;const T=x.onData(O=>{C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({data:O,type:"input"}))});return C.addEventListener("open",()=>{d("running"),v("Shell connected"),b()}),C.addEventListener("message",O=>{const k=BL(O.data);if(k){if(k.type==="output"){x.write(k.data);return}if(k.type==="error"){d("error"),v(k.error);return}d(k.state==="idle"?"connecting":k.state),k.cwd&&f(k.cwd),v(k.error??k.shell??"Shell connected")}}),C.addEventListener("close",()=>{d(O=>O==="exited"?O:"exited"),v("Socket closed")}),C.addEventListener("error",()=>{d("error"),v("Terminal socket error")}),window.addEventListener("resize",b),window.setTimeout(b,0),()=>{window.removeEventListener("resize",b),T.dispose(),C.close(),x.dispose(),l.current=null,r.current=null,o.current=null}},[e,b]),N.useEffect(()=>{if(!t)return;const x=window.setTimeout(()=>{b(),r.current?.focus()},0);return()=>window.clearTimeout(x)},[t,b]);const S=N.useCallback(x=>{const w=l.current;if(!w||w.readyState!==WebSocket.OPEN)return;const C=o.current?.proposeDimensions();w.send(JSON.stringify({cols:C?.cols,rows:C?.rows,...x}))},[]);return u.jsxs("section",{className:ge("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-white/10 bg-[#111111] px-4 py-2",children:[u.jsx("div",{className:"min-w-0",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ve,{className:ge("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}),u.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",_]})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(_e,{"aria-label":"Restart terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>S({type:"restart"}),type:"button",children:[u.jsx(PS,{}),"Restart"]}),u.jsxs(_e,{"aria-label":"Stop terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>S({type:"stop"}),type:"button",children:[u.jsx(Eh,{}),"Stop"]})]})]}),u.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden p-3",ref:s})]})}function jL(e){const t=window.location.protocol==="https:"?"wss:":"ws:",s=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${s}`}function BL(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function zL(){const[e,t]=N.useState([]),[s,r]=N.useState(null),[o,l]=N.useState(!1);N.useEffect(()=>{let m=!1;return(async()=>{let d=await L5().catch(()=>[]);if(d.length===0){const _=await Ff().catch(()=>null);d=_?[_]:[]}m||(t(d),r(d[0]?.id??null))})(),()=>{m=!0}},[]);const h=N.useCallback(async()=>{l(!0);try{const m=await Ff();t(d=>[...d,m]),r(m.id)}finally{l(!1)}},[]),f=N.useCallback(async m=>{l(!0);try{await j5(m);const d=e.findIndex(v=>v.id===m),_=e.filter(v=>v.id!==m);if(_.length===0){const v=await Ff();t([v]),r(v.id);return}if(t(_),s===m){const v=_[Math.min(d,_.length-1)];r(v.id)}}finally{l(!1)}},[e,s]);return u.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[u.jsxs("div",{"aria-label":"Terminal tabs",className:"flex shrink-0 items-center gap-1 overflow-x-auto border-b border-white/10 bg-[#111111] px-2 py-1.5",role:"tablist",children:[e.map((m,d)=>u.jsxs("div",{className:ge("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===s?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[u.jsxs("button",{"aria-selected":m.id===s,className:"max-w-[160px] truncate font-medium",onClick:()=>r(m.id),role:"tab",type:"button",children:["Terminal ",d+1]}),u.jsx("button",{"aria-label":`Close Terminal ${d+1}`,className:"rounded p-0.5 text-white/40 opacity-0 transition hover:bg-white/10 hover:text-white group-hover:opacity-100",disabled:o,onClick:()=>{f(m.id)},type:"button",children:u.jsx(Mr,{className:"size-3"})})]},m.id)),u.jsx("button",{"aria-label":"New terminal",className:"ml-1 rounded-md p-1 text-white/60 transition hover:bg-white/10 hover:text-white disabled:opacity-40",disabled:o,onClick:()=>{h()},type:"button",children:u.jsx(js,{className:"size-4"})})]}),u.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>u.jsx("div",{className:"absolute inset-0",children:u.jsx(LL,{active:m.id===s,sessionId:m.id})},m.id))})]})}const IL=800;function WE({activeHunkIndex:e=0,diff:t}){const s=UL(t),r=N.useRef([]),[o,l]=N.useState(!1),h=N.useMemo(()=>s.reduce((m,d)=>Math.max(m,d.content.length),0),[s]),f=h>IL;if(N.useEffect(()=>{l(!1)},[t]),N.useEffect(()=>{if(f&&!o)return;r.current[e]?.scrollIntoView({block:"start",behavior:"smooth"})},[e,t,f,o]),f&&!o){const m=s.filter(_=>_.kind==="add").length,d=s.filter(_=>_.kind==="delete").length;return u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-6",children:u.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),u.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",h.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),u.jsxs("p",{className:"font-mono text-[11px]",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",m]})," ",u.jsxs("span",{className:"text-red-700",children:["-",d]})," lines changed"]}),u.jsx(_e,{onClick:()=>l(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return u.jsx("div",{className:"absolute inset-0 overflow-auto bg-white text-xs leading-6",children:u.jsx("div",{className:"min-w-full font-mono",children:s.map((m,d)=>u.jsxs("div",{className:ge("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",Tx(s,d)&&m.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:m.hunkIndex!==null&&Tx(s,d)?_=>{r.current[m.hunkIndex??0]=_}:void 0,children:[u.jsx(Mx,{value:m.oldLine}),u.jsx(Mx,{value:m.newLine}),u.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:m.content||" "})]},`${d}-${m.content}`))})})}function PL(e){return e.split(`
30
+ `).reduce((t,s)=>(s.startsWith("@@")?t.hunks+=1:s.startsWith("+")&&!s.startsWith("+++")?t.additions+=1:s.startsWith("-")&&!s.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function UL(e){const t=HL(e);return t.some(s=>s.kind==="hunk")?t.filter(s=>s.kind!=="meta"&&s.kind!=="hunk"):t}function HL(e){let t=null,s=null,r=null;return e.split(`
31
+ `).map(o=>{if(FL(o))return t=null,s=null,r=null,{content:o,hunkIndex:r,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("@@")){const h=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(o);return h&&(t=Number(h[1]),s=Number(h[2])),r=(r??-1)+1,{content:o,hunkIndex:r,kind:"hunk",oldLine:null,newLine:null}}if(t===null||s===null)return{content:o,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("\\ No newline"))return{content:o,hunkIndex:r,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("+")&&!o.startsWith("+++")){const h={content:o,hunkIndex:r,kind:"add",oldLine:null,newLine:s};return s+=1,h}if(o.startsWith("-")&&!o.startsWith("---")){const h={content:o,hunkIndex:r,kind:"delete",oldLine:t,newLine:null};return t+=1,h}const l={content:o,hunkIndex:r,kind:"context",oldLine:t,newLine:s};return t+=1,s+=1,l})}function Tx(e,t){const s=e[t]?.hunkIndex;if(s===null)return!1;const r=e.findIndex(o=>o.hunkIndex===s&&(o.kind==="add"||o.kind==="delete"));return r!==-1?r===t:e.findIndex(o=>o.hunkIndex===s)===t}function FL(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 Mx({value:e}){return u.jsx("span",{className:ge("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}const VL=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),$L=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),qL=new Set(["conf","config","ini","toml","yaml","yml"]),KL=new Set(["csv","json","sql","xml"]),GL=new Set(["md","mdx","rst","txt"]),WL=new Set(["gif","jpeg","jpg","png","svg","webp"]),YL=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),XL=new Set(["css","less","sass","scss"]);function YE(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),s=t.includes(".")?t.split(".").pop()??"":"";return YL.has(t)||t.endsWith(".lock")?"lock":ZL(t)?"test":$L.has(t)||qL.has(s)?"config":XL.has(s)?"style":WL.has(s)?"image":GL.has(s)?"document":KL.has(s)?"data":VL.has(s)?"code":"generic"}function ZL(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function QL({branch:e,error:t,files:s,selectedFile:r,onSelectFile:o}){const l=N.useMemo(()=>s9(s).filter(m=>m.files.length),[s]),[h,f]=N.useState({staged:!1,unstaged:!1,untracked:!1});return u.jsxs(Qs,{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-none border-0 bg-transparent",children:[u.jsx(Js,{className:"border-b border-border px-2.5 py-1.5",children:u.jsxs(en,{className:"flex items-center justify-between gap-2",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(Xl,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Changes"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?u.jsx(Ve,{variant:"outline",children:e}):null,u.jsx(Ve,{variant:"secondary",children:s.length})]})]})}),u.jsx(tn,{className:"min-h-0 flex-1 overflow-auto p-0",children:l.length?l.map(m=>u.jsx(JL,{collapsed:h[m.id],group:m,onSelectFile:o,onToggle:()=>f(d=>({...d,[m.id]:!d[m.id]})),selectedFile:r},m.id)):u.jsx(yt,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function JL({collapsed:e,group:t,onSelectFile:s,onToggle:r,selectedFile:o}){const l=e?pa:Tr;return u.jsxs("section",{className:"border-b border-border last:border-b-0",children:[u.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/55 px-2.5 py-1 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:r,type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(l,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:t.label})]}),u.jsx(Ve,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:u.jsx("div",{children:t.files.map(h=>u.jsx(e9,{active:o===h.path,file:h,group:t.id,onClick:()=>s(h.path)},h.path))})]})}function e9({active:e,file:t,group:s,onClick:r}){const o=t.path.split("/").pop()||t.path,l=t.path.split("/").slice(0,-1).join("/");return u.jsxs(_e,{className:ge("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:r,type:"button",variant:"ghost",children:[u.jsxs("span",{className:"min-w-0",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(i9,{path:t.path}),u.jsx("span",{className:"truncate text-[13px] font-medium",children:o})]}),l?u.jsx("span",{className:"block truncate pl-5 text-[10px] text-muted-foreground",children:l}):null]}),u.jsx("span",{className:ge("w-3.5 shrink-0 text-center font-mono text-[11px] font-semibold",s==="untracked"&&"text-amber-700",s==="staged"&&"text-emerald-700",s==="unstaged"&&"text-zinc-800"),children:t9(t,s)})]})}function t9(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function i9({path:e}){const t=YE(e),s=n9[t];return u.jsx(s,{"aria-label":`${t} file`,className:ge("size-3.5 shrink-0",r9[t])})}function s9(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==="?")}]}const n9={code:RS,config:FS,data:yo,document:DS,generic:bg,image:jS,lock:BS,style:zS,test:OS},r9={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 a9(e){const t={name:"",path:"",children:[],isFile:!1},s=new Map;s.set("",t);const r=[...e].sort();for(const l of r){const h=l.split("/");let f="";for(let m=0;m<h.length;m+=1){const d=h[m],_=m===h.length-1,v=f?`${f}/${d}`:d;let b=s.get(v);b||(b={name:d,path:v,children:[],isFile:_},s.set(v,b),s.get(f).children.push(b)),f=v}}const o=l=>{l.children.sort((h,f)=>h.isFile!==f.isFile?h.isFile?1:-1:h.name.localeCompare(f.name)),l.children.forEach(o)};return o(t),t}function o9({paths:e,status:t,selectedFile:s,onSelectFile:r,branch:o}){const l=N.useMemo(()=>a9(e),[e]),h=N.useMemo(()=>{const b=new Map;for(const S of t)b.set(S.path,S);return b},[t]),[f,m]=N.useState({"":!0}),[d,_]=N.useState(!1);N.useEffect(()=>{if(d||l.children.length===0)return;const b={"":!0};for(const S of l.children)S.isFile||(b[S.path]=!0);m(b),_(!0)},[d,l.children]);function v(b){m(S=>({...S,[b]:!S[b]}))}return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(xo,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Files"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[o?u.jsx(Ve,{variant:"outline",children:o}):null,u.jsx(Ve,{variant:"secondary",children:e.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:l.children.length===0?u.jsx(yt,{variant:"muted",className:"m-3 text-center",children:"No tracked files."}):l.children.map(b=>u.jsx(XE,{depth:0,expanded:f,node:b,onSelectFile:r,onToggle:v,selectedFile:s,statusByPath:h},b.path))})]})}function XE({depth:e,expanded:t,node:s,onSelectFile:r,onToggle:o,selectedFile:l,statusByPath:h}){const f=t[s.path]??!1,m=6+e*12;if(s.isFile){const v=h.get(s.path),b=l===s.path;return u.jsxs("button",{className:ge("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",b&&"bg-muted font-medium"),onClick:()=>r(s.path),style:{paddingLeft:m},type:"button",children:[u.jsx(c9,{path:s.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),v?u.jsx(l9,{file:v}):null]})}const d=f?Tr:pa,_=f?wh:xo;return u.jsxs("div",{children:[u.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>o(s.path),style:{paddingLeft:m},type:"button",children:[u.jsx(d,{className:"size-3.5 shrink-0 text-muted-foreground"}),u.jsx(_,{className:"size-3.5 shrink-0 text-amber-600"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name})]}),f?s.children.map(v=>u.jsx(XE,{depth:e+1,expanded:t,node:v,onSelectFile:r,onToggle:o,selectedFile:l,statusByPath:h},v.path)):null]})}function l9({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const s=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return u.jsx("span",{className:ge("ml-1 shrink-0 font-mono text-[10px] font-semibold",s),children:t})}function c9({path:e}){const t=YE(e),s=u9[t];return u.jsx(s,{className:ge("size-3.5 shrink-0",h9[t])})}const u9={code:RS,config:FS,data:yo,document:DS,generic:bg,image:jS,lock:BS,style:zS,test:OS},h9={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"};var wm,Ax;function d9(){if(Ax)return wm;Ax=1;function e(j){return j instanceof Map?j.clear=j.delete=j.set=function(){throw new Error("map is read-only")}:j instanceof Set&&(j.add=j.clear=j.delete=function(){throw new Error("set is read-only")}),Object.freeze(j),Object.getOwnPropertyNames(j).forEach(ne=>{const me=j[ne],ze=typeof me;(ze==="object"||ze==="function")&&!Object.isFrozen(me)&&e(me)}),j}class t{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(j,...ne){const me=Object.create(null);for(const ze in j)me[ze]=j[ze];return ne.forEach(function(ze){for(const St in ze)me[St]=ze[St]}),me}const o="</span>",l=j=>!!j.scope,h=(j,{prefix:ne})=>{if(j.startsWith("language:"))return j.replace("language:","language-");if(j.includes(".")){const me=j.split(".");return[`${ne}${me.shift()}`,...me.map((ze,St)=>`${ze}${"_".repeat(St+1)}`)].join(" ")}return`${ne}${j}`};class f{constructor(ne,me){this.buffer="",this.classPrefix=me.classPrefix,ne.walk(this)}addText(ne){this.buffer+=s(ne)}openNode(ne){if(!l(ne))return;const me=h(ne.scope,{prefix:this.classPrefix});this.span(me)}closeNode(ne){l(ne)&&(this.buffer+=o)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const m=(j={})=>{const ne={children:[]};return Object.assign(ne,j),ne};class d{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const me=m({scope:ne});this.add(me),this.stack.push(me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,me){return typeof me=="string"?ne.addText(me):me.children&&(ne.openNode(me),me.children.forEach(ze=>this._walk(ne,ze)),ne.closeNode(me)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(me=>typeof me=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(me=>{d._collapse(me)}))}}class _ extends d{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,me){const ze=ne.root;me&&(ze.scope=`language:${me}`),this.add(ze)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(j){return j?typeof j=="string"?j:j.source:null}function b(j){return w("(?=",j,")")}function S(j){return w("(?:",j,")*")}function x(j){return w("(?:",j,")?")}function w(...j){return j.map(me=>v(me)).join("")}function C(j){const ne=j[j.length-1];return typeof ne=="object"&&ne.constructor===Object?(j.splice(j.length-1,1),ne):{}}function T(...j){return"("+(C(j).capture?"":"?:")+j.map(ze=>v(ze)).join("|")+")"}function O(j){return new RegExp(j.toString()+"|").exec("").length-1}function k(j,ne){const me=j&&j.exec(ne);return me&&me.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function U(j,{joinWith:ne}){let me=0;return j.map(ze=>{me+=1;const St=me;let gt=v(ze),ke="";for(;gt.length>0;){const be=D.exec(gt);if(!be){ke+=gt;break}ke+=gt.substring(0,be.index),gt=gt.substring(be.index+be[0].length),be[0][0]==="\\"&&be[1]?ke+="\\"+String(Number(be[1])+St):(ke+=be[0],be[0]==="("&&me++)}return ke}).map(ze=>`(${ze})`).join(ne)}const P=/\b\B/,B="[a-zA-Z]\\w*",M="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",Y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(j={})=>{const ne=/^#![ ]*\//;return j.binary&&(j.begin=w(ne,/.*\b/,j.binary,/\b.*/)),r({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(me,ze)=>{me.index!==0&&ze.ignoreMatch()}},j)},ie={begin:"\\\\[\\s\\S]",relevance:0},J={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ie]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ie]},q={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/},V=function(j,ne,me={}){const ze=r({scope:"comment",begin:j,end:ne,contains:[]},me);ze.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 St=T("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 ze.contains.push({begin:w(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ze},Z=V("//","$"),Q=V("/\\*","\\*/"),R=V("#","$"),te={scope:"number",begin:F,relevance:0},ce={scope:"number",begin:Y,relevance:0},le={scope:"number",begin:$,relevance:0},fe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ie,{begin:/\[/,end:/\]/,relevance:0,contains:[ie]}]},pe={scope:"title",begin:B,relevance:0},Se={scope:"title",begin:M,relevance:0},Be={begin:"\\.\\s*"+M,relevance:0};var tt=Object.freeze({__proto__:null,APOS_STRING_MODE:J,BACKSLASH_ESCAPE:ie,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:$,COMMENT:V,C_BLOCK_COMMENT_MODE:Q,C_LINE_COMMENT_MODE:Z,C_NUMBER_MODE:ce,C_NUMBER_RE:Y,END_SAME_AS_BEGIN:function(j){return Object.assign(j,{"on:begin":(ne,me)=>{me.data._beginMatch=ne[1]},"on:end":(ne,me)=>{me.data._beginMatch!==ne[1]&&me.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:B,MATCH_NOTHING_RE:P,METHOD_GUARD:Be,NUMBER_MODE:te,NUMBER_RE:F,PHRASAL_WORDS_MODE:q,QUOTE_STRING_MODE:A,REGEXP_MODE:fe,RE_STARTERS_RE:G,SHEBANG:I,TITLE_MODE:pe,UNDERSCORE_IDENT_RE:M,UNDERSCORE_TITLE_MODE:Se});function nt(j,ne){j.input[j.index-1]==="."&&ne.ignoreMatch()}function rt(j,ne){j.className!==void 0&&(j.scope=j.className,delete j.className)}function je(j,ne){ne&&j.beginKeywords&&(j.begin="\\b("+j.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",j.__beforeBegin=nt,j.keywords=j.keywords||j.beginKeywords,delete j.beginKeywords,j.relevance===void 0&&(j.relevance=0))}function Pt(j,ne){Array.isArray(j.illegal)&&(j.illegal=T(...j.illegal))}function Dr(j,ne){if(j.match){if(j.begin||j.end)throw new Error("begin & end are not supported with match");j.begin=j.match,delete j.match}}function nn(j,ne){j.relevance===void 0&&(j.relevance=1)}const va=(j,ne)=>{if(!j.beforeMatch)return;if(j.starts)throw new Error("beforeMatch cannot be used with starts");const me=Object.assign({},j);Object.keys(j).forEach(ze=>{delete j[ze]}),j.keywords=me.keywords,j.begin=w(me.beforeMatch,b(me.begin)),j.starts={relevance:0,contains:[Object.assign(me,{endsParent:!0})]},j.relevance=0,delete me.beforeMatch},Or=["of","and","for","in","not","or","if","then","parent","list","value"],Lr="keyword";function zn(j,ne,me=Lr){const ze=Object.create(null);return typeof j=="string"?St(me,j.split(" ")):Array.isArray(j)?St(me,j):Object.keys(j).forEach(function(gt){Object.assign(ze,zn(j[gt],ne,gt))}),ze;function St(gt,ke){ne&&(ke=ke.map(be=>be.toLowerCase())),ke.forEach(function(be){const Le=be.split("|");ze[Le[0]]=[gt,rn(Le[0],Le[1])]})}}function rn(j,ne){return ne?Number(ne):ko(j)?0:1}function ko(j){return Or.includes(j.toLowerCase())}const ba={},At=j=>{console.error(j)},an=(j,...ne)=>{console.log(`WARN: ${j}`,...ne)},pi=(j,ne)=>{ba[`${j}/${ne}`]||(console.log(`Deprecated as of ${j}. ${ne}`),ba[`${j}/${ne}`]=!0)},on=new Error;function ln(j,ne,{key:me}){let ze=0;const St=j[me],gt={},ke={};for(let be=1;be<=ne.length;be++)ke[be+ze]=St[be],gt[be+ze]=!0,ze+=O(ne[be-1]);j[me]=ke,j[me]._emit=gt,j[me]._multi=!0}function ya(j){if(Array.isArray(j.begin)){if(j.skip||j.excludeBegin||j.returnBegin)throw At("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),on;if(typeof j.beginScope!="object"||j.beginScope===null)throw At("beginScope must be object"),on;ln(j,j.begin,{key:"beginScope"}),j.begin=U(j.begin,{joinWith:""})}}function In(j){if(Array.isArray(j.end)){if(j.skip||j.excludeEnd||j.returnEnd)throw At("skip, excludeEnd, returnEnd not compatible with endScope: {}"),on;if(typeof j.endScope!="object"||j.endScope===null)throw At("endScope must be object"),on;ln(j,j.end,{key:"endScope"}),j.end=U(j.end,{joinWith:""})}}function To(j){j.scope&&typeof j.scope=="object"&&j.scope!==null&&(j.beginScope=j.scope,delete j.scope)}function xa(j){To(j),typeof j.beginScope=="string"&&(j.beginScope={_wrap:j.beginScope}),typeof j.endScope=="string"&&(j.endScope={_wrap:j.endScope}),ya(j),In(j)}function cn(j){function ne(ke,be){return new RegExp(v(ke),"m"+(j.case_insensitive?"i":"")+(j.unicodeRegex?"u":"")+(be?"g":""))}class me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(be,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,be]),this.matchAt+=O(be)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const be=this.regexes.map(Le=>Le[1]);this.matcherRe=ne(U(be,{joinWith:"|"}),!0),this.lastIndex=0}exec(be){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(be);if(!Le)return null;const Ut=Le.findIndex((un,wa)=>wa>0&&un!==void 0),kt=this.matchIndexes[Ut];return Le.splice(0,Ut),Object.assign(Le,kt)}}class ze{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(be){if(this.multiRegexes[be])return this.multiRegexes[be];const Le=new me;return this.rules.slice(be).forEach(([Ut,kt])=>Le.addRule(Ut,kt)),Le.compile(),this.multiRegexes[be]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(be,Le){this.rules.push([be,Le]),Le.type==="begin"&&this.count++}exec(be){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let Ut=Le.exec(be);if(this.resumingScanAtSamePosition()&&!(Ut&&Ut.index===this.lastIndex)){const kt=this.getMatcher(0);kt.lastIndex=this.lastIndex+1,Ut=kt.exec(be)}return Ut&&(this.regexIndex+=Ut.position+1,this.regexIndex===this.count&&this.considerAll()),Ut}}function St(ke){const be=new ze;return ke.contains.forEach(Le=>be.addRule(Le.begin,{rule:Le,type:"begin"})),ke.terminatorEnd&&be.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&be.addRule(ke.illegal,{type:"illegal"}),be}function gt(ke,be){const Le=ke;if(ke.isCompiled)return Le;[rt,Dr,xa,va].forEach(kt=>kt(ke,be)),j.compilerExtensions.forEach(kt=>kt(ke,be)),ke.__beforeBegin=null,[je,Pt,nn].forEach(kt=>kt(ke,be)),ke.isCompiled=!0;let Ut=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Ut=ke.keywords.$pattern,delete ke.keywords.$pattern),Ut=Ut||/\w+/,ke.keywords&&(ke.keywords=zn(ke.keywords,j.case_insensitive)),Le.keywordPatternRe=ne(Ut,!0),be&&(ke.begin||(ke.begin=/\B|\b/),Le.beginRe=ne(Le.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Le.endRe=ne(Le.end)),Le.terminatorEnd=v(Le.end)||"",ke.endsWithParent&&be.terminatorEnd&&(Le.terminatorEnd+=(ke.end?"|":"")+be.terminatorEnd)),ke.illegal&&(Le.illegalRe=ne(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(kt){return cs(kt==="self"?ke:kt)})),ke.contains.forEach(function(kt){gt(kt,Le)}),ke.starts&&gt(ke.starts,be),Le.matcher=St(Le),Le}if(j.compilerExtensions||(j.compilerExtensions=[]),j.contains&&j.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return j.classNameAliases=r(j.classNameAliases||{}),gt(j)}function li(j){return j?j.endsWithParent||li(j.starts):!1}function cs(j){return j.variants&&!j.cachedVariants&&(j.cachedVariants=j.variants.map(function(ne){return r(j,{variants:null},ne)})),j.cachedVariants?j.cachedVariants:li(j)?r(j,{starts:j.starts?r(j.starts):null}):Object.isFrozen(j)?r(j):j}var gi="11.11.1";class Mo extends Error{constructor(ne,me){super(ne),this.name="HTMLInjectionError",this.html=me}}const jr=s,Sa=r,et=Symbol("nomatch"),Ms=7,Wi=function(j){const ne=Object.create(null),me=Object.create(null),ze=[];let St=!0;const gt="Could not find the language '{}', did you forget to load/include a language module?",ke={disableAutodetect:!0,name:"Plain text",contains:[]};let be={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:_};function Le(ue){return be.noHighlightRe.test(ue)}function Ut(ue){let Ae=ue.className+" ";Ae+=ue.parentNode?ue.parentNode.className:"";const Ge=be.languageDetectRe.exec(Ae);if(Ge){const lt=Ai(Ge[1]);return lt||(an(gt.replace("{}",Ge[1])),an("Falling back to no-highlight mode for this block.",ue)),lt?Ge[1]:"no-highlight"}return Ae.split(/\s+/).find(lt=>Le(lt)||Ai(lt))}function kt(ue,Ae,Ge){let lt="",Ft="";typeof Ae=="object"?(lt=ue,Ge=Ae.ignoreIllegals,Ft=Ae.language):(pi("10.7.0","highlight(lang, code, ...args) has been deprecated."),pi("10.7.0",`Please use highlight(code, options) instead.
32
+ https://github.com/highlightjs/highlight.js/issues/2277`),Ft=ue,lt=Ae),Ge===void 0&&(Ge=!0);const ki={code:lt,language:Ft};zr("before:highlight",ki);const Yi=ki.result?ki.result:un(ki.language,ki.code,Ge);return Yi.code=ki.code,zr("after:highlight",Yi),Yi}function un(ue,Ae,Ge,lt){const Ft=Object.create(null);function ki(de,Te){return de.keywords[Te]}function Yi(){if(!Oe.keywords){Gt.addText(ct);return}let de=0;Oe.keywordPatternRe.lastIndex=0;let Te=Oe.keywordPatternRe.exec(ct),Ue="";for(;Te;){Ue+=ct.substring(de,Te.index);const Xe=_i.case_insensitive?Te[0].toLowerCase():Te[0],Rt=ki(Oe,Xe);if(Rt){const[us,jo]=Rt;if(Gt.addText(Ue),Ue="",Ft[Xe]=(Ft[Xe]||0)+1,Ft[Xe]<=Ms&&(Fn+=jo),us.startsWith("_"))Ue+=Te[0];else{const yc=_i.classNameAliases[us]||us;Xi(Te[0],yc)}}else Ue+=Te[0];de=Oe.keywordPatternRe.lastIndex,Te=Oe.keywordPatternRe.exec(ct)}Ue+=ct.substring(de),Gt.addText(Ue)}function zi(){if(ct==="")return;let de=null;if(typeof Oe.subLanguage=="string"){if(!ne[Oe.subLanguage]){Gt.addText(ct);return}de=un(Oe.subLanguage,ct,!0,bc[Oe.subLanguage]),bc[Oe.subLanguage]=de._top}else de=Ea(ct,Oe.subLanguage.length?Oe.subLanguage:null);Oe.relevance>0&&(Fn+=de.relevance),Gt.__addSublanguage(de._emitter,de.language)}function xt(){Oe.subLanguage!=null?zi():Yi(),ct=""}function Xi(de,Te){de!==""&&(Gt.startScope(Te),Gt.addText(de),Gt.endScope())}function _c(de,Te){let Ue=1;const Xe=Te.length-1;for(;Ue<=Xe;){if(!de._emit[Ue]){Ue++;continue}const Rt=_i.classNameAliases[de[Ue]]||de[Ue],us=Te[Ue];Rt?Xi(us,Rt):(ct=us,Yi(),ct=""),Ue++}}function Na(de,Te){return de.scope&&typeof de.scope=="string"&&Gt.openNode(_i.classNameAliases[de.scope]||de.scope),de.beginScope&&(de.beginScope._wrap?(Xi(ct,_i.classNameAliases[de.beginScope._wrap]||de.beginScope._wrap),ct=""):de.beginScope._multi&&(_c(de.beginScope,Te),ct="")),Oe=Object.create(de,{parent:{value:Oe}}),Oe}function Do(de,Te,Ue){let Xe=k(de.endRe,Ue);if(Xe){if(de["on:end"]){const Rt=new t(de);de["on:end"](Te,Rt),Rt.isMatchIgnored&&(Xe=!1)}if(Xe){for(;de.endsParent&&de.parent;)de=de.parent;return de}}if(de.endsWithParent)return Do(de.parent,Te,Ue)}function ka(de){return Oe.matcher.regexIndex===0?(ct+=de[0],1):(Vn=!0,0)}function Oh(de){const Te=de[0],Ue=de.rule,Xe=new t(Ue),Rt=[Ue.__beforeBegin,Ue["on:begin"]];for(const us of Rt)if(us&&(us(de,Xe),Xe.isMatchIgnored))return ka(Te);return Ue.skip?ct+=Te:(Ue.excludeBegin&&(ct+=Te),xt(),!Ue.returnBegin&&!Ue.excludeBegin&&(ct=Te)),Na(Ue,de),Ue.returnBegin?0:Te.length}function Ii(de){const Te=de[0],Ue=Ae.substring(de.index),Xe=Do(Oe,de,Ue);if(!Xe)return et;const Rt=Oe;Oe.endScope&&Oe.endScope._wrap?(xt(),Xi(Te,Oe.endScope._wrap)):Oe.endScope&&Oe.endScope._multi?(xt(),_c(Oe.endScope,de)):Rt.skip?ct+=Te:(Rt.returnEnd||Rt.excludeEnd||(ct+=Te),xt(),Rt.excludeEnd&&(ct=Te));do Oe.scope&&Gt.closeNode(),!Oe.skip&&!Oe.subLanguage&&(Fn+=Oe.relevance),Oe=Oe.parent;while(Oe!==Xe.parent);return Xe.starts&&Na(Xe.starts,de),Rt.returnEnd?0:Te.length}function Oo(){const de=[];for(let Te=Oe;Te!==_i;Te=Te.parent)Te.scope&&de.unshift(Te.scope);de.forEach(Te=>Gt.openNode(Te))}let Ir={};function Ta(de,Te){const Ue=Te&&Te[0];if(ct+=de,Ue==null)return xt(),0;if(Ir.type==="begin"&&Te.type==="end"&&Ir.index===Te.index&&Ue===""){if(ct+=Ae.slice(Te.index,Te.index+1),!St){const Xe=new Error(`0 width match regex (${ue})`);throw Xe.languageName=ue,Xe.badRule=Ir.rule,Xe}return 1}if(Ir=Te,Te.type==="begin")return Oh(Te);if(Te.type==="illegal"&&!Ge){const Xe=new Error('Illegal lexeme "'+Ue+'" for mode "'+(Oe.scope||"<unnamed>")+'"');throw Xe.mode=Oe,Xe}else if(Te.type==="end"){const Xe=Ii(Te);if(Xe!==et)return Xe}if(Te.type==="illegal"&&Ue==="")return ct+=`
33
+ `,1;if(Lo>1e5&&Lo>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ct+=Ue,Ue.length}const _i=Ai(ue);if(!_i)throw At(gt.replace("{}",ue)),new Error('Unknown language: "'+ue+'"');const vc=cn(_i);let Ma="",Oe=lt||vc;const bc={},Gt=new be.__emitter(be);Oo();let ct="",Fn=0,fn=0,Lo=0,Vn=!1;try{if(_i.__emitTokens)_i.__emitTokens(Ae,Gt);else{for(Oe.matcher.considerAll();;){Lo++,Vn?Vn=!1:Oe.matcher.considerAll(),Oe.matcher.lastIndex=fn;const de=Oe.matcher.exec(Ae);if(!de)break;const Te=Ae.substring(fn,de.index),Ue=Ta(Te,de);fn=de.index+Ue}Ta(Ae.substring(fn))}return Gt.finalize(),Ma=Gt.toHTML(),{language:ue,value:Ma,relevance:Fn,illegal:!1,_emitter:Gt,_top:Oe}}catch(de){if(de.message&&de.message.includes("Illegal"))return{language:ue,value:jr(Ae),illegal:!0,relevance:0,_illegalBy:{message:de.message,index:fn,context:Ae.slice(fn-100,fn+100),mode:de.mode,resultSoFar:Ma},_emitter:Gt};if(St)return{language:ue,value:jr(Ae),illegal:!1,relevance:0,errorRaised:de,_emitter:Gt,_top:Oe};throw de}}function wa(ue){const Ae={value:jr(ue),illegal:!1,relevance:0,_top:ke,_emitter:new be.__emitter(be)};return Ae._emitter.addText(ue),Ae}function Ea(ue,Ae){Ae=Ae||be.languages||Object.keys(ne);const Ge=wa(ue),lt=Ae.filter(Ai).filter(Un).map(xt=>un(xt,ue,!1));lt.unshift(Ge);const Ft=lt.sort((xt,Xi)=>{if(xt.relevance!==Xi.relevance)return Xi.relevance-xt.relevance;if(xt.language&&Xi.language){if(Ai(xt.language).supersetOf===Xi.language)return 1;if(Ai(Xi.language).supersetOf===xt.language)return-1}return 0}),[ki,Yi]=Ft,zi=ki;return zi.secondBest=Yi,zi}function zs(ue,Ae,Ge){const lt=Ae&&me[Ae]||Ge;ue.classList.add("hljs"),ue.classList.add(`language-${lt}`)}function Ht(ue){let Ae=null;const Ge=Ut(ue);if(Le(Ge))return;if(zr("before:highlightElement",{el:ue,language:Ge}),ue.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ue);return}if(ue.children.length>0&&(be.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)),be.throwUnescapedHTML))throw new Mo("One of your code blocks includes unescaped HTML.",ue.innerHTML);Ae=ue;const lt=Ae.textContent,Ft=Ge?kt(lt,{language:Ge,ignoreIllegals:!0}):Ea(lt);ue.innerHTML=Ft.value,ue.dataset.highlighted="yes",zs(ue,Ge,Ft.language),ue.result={language:Ft.language,re:Ft.relevance,relevance:Ft.relevance},Ft.secondBest&&(ue.secondBest={language:Ft.secondBest.language,relevance:Ft.secondBest.relevance}),zr("after:highlightElement",{el:ue,result:Ft,text:lt})}function Ni(ue){be=Sa(be,ue)}const Pn=()=>{Ca(),pi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ao(){Ca(),pi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let mc=!1;function Ca(){function ue(){Ca()}if(document.readyState==="loading"){mc||window.addEventListener("DOMContentLoaded",ue,!1),mc=!0;return}document.querySelectorAll(be.cssSelector).forEach(Ht)}function pc(ue,Ae){let Ge=null;try{Ge=Ae(j)}catch(lt){if(At("Language definition for '{}' could not be registered.".replace("{}",ue)),St)At(lt);else throw lt;Ge=ke}Ge.name||(Ge.name=ue),ne[ue]=Ge,Ge.rawDefinition=Ae.bind(null,j),Ge.aliases&&hn(Ge.aliases,{languageName:ue})}function Br(ue){delete ne[ue];for(const Ae of Object.keys(me))me[Ae]===ue&&delete me[Ae]}function Ro(){return Object.keys(ne)}function Ai(ue){return ue=(ue||"").toLowerCase(),ne[ue]||ne[me[ue]]}function hn(ue,{languageName:Ae}){typeof ue=="string"&&(ue=[ue]),ue.forEach(Ge=>{me[Ge.toLowerCase()]=Ae})}function Un(ue){const Ae=Ai(ue);return Ae&&!Ae.disableAutodetect}function Hn(ue){ue["before:highlightBlock"]&&!ue["before:highlightElement"]&&(ue["before:highlightElement"]=Ae=>{ue["before:highlightBlock"](Object.assign({block:Ae.el},Ae))}),ue["after:highlightBlock"]&&!ue["after:highlightElement"]&&(ue["after:highlightElement"]=Ae=>{ue["after:highlightBlock"](Object.assign({block:Ae.el},Ae))})}function Kt(ue){Hn(ue),ze.push(ue)}function gc(ue){const Ae=ze.indexOf(ue);Ae!==-1&&ze.splice(Ae,1)}function zr(ue,Ae){const Ge=ue;ze.forEach(function(lt){lt[Ge]&&lt[Ge](Ae)})}function dn(ue){return pi("10.7.0","highlightBlock will be removed entirely in v12.0"),pi("10.7.0","Please use highlightElement now."),Ht(ue)}Object.assign(j,{highlight:kt,highlightAuto:Ea,highlightAll:Ca,highlightElement:Ht,highlightBlock:dn,configure:Ni,initHighlighting:Pn,initHighlightingOnLoad:Ao,registerLanguage:pc,unregisterLanguage:Br,listLanguages:Ro,getLanguage:Ai,registerAliases:hn,autoDetection:Un,inherit:Sa,addPlugin:Kt,removePlugin:gc}),j.debugMode=function(){St=!1},j.safeMode=function(){St=!0},j.versionString=gi,j.regex={concat:w,lookahead:b,either:T,optional:x,anyNumberOfTimes:S};for(const ue in tt)typeof tt[ue]=="object"&&e(tt[ue]);return Object.assign(j,tt),j},Ci=Wi({});return Ci.newInstance=()=>Wi({}),wm=Ci,Ci.HighlightJS=Ci,Ci.default=Ci,wm}var Em,Rx;function f9(){if(Rx)return Em;Rx=1;function e(t){const s=t.regex,r=s.concat(/[\p{L}_]/u,s.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},h={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},f=t.inherit(h,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),_={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,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:[h,d,m,f,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[h,f,d,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[_],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[_],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:s.concat(/</,s.lookahead(s.concat(r,s.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:_}]},{className:"tag",begin:s.concat(/<\//,s.lookahead(s.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Em=e,Em}var Cm,Dx;function m9(){if(Dx)return Cm;Dx=1;function e(t){const s=t.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},h=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),f={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,r,l]};l.contains.push(m);const d={match:/\\"/},_={className:"string",begin:/'/,end:/'/},v={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},S=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=t.SHEBANG({binary:`(${S.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],O={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],D=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],U=["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"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:T,built_in:[...k,...D,"set","shopt",...U,...P]},contains:[x,t.SHEBANG(),w,b,h,f,O,m,d,_,v,r]}}return Cm=e,Cm}var Nm,Ox;function p9(){if(Ox)return Nm;Ox=1;function e(t){const s=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",f="("+o+"|"+s.optional(l)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},_={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})"/})]},v={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},b={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(_,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},S={className:"title",begin:s.optional(l)+t.IDENT_RE,relevance:0},x=s.optional(l)+t.IDENT_RE+"\\s*\\(",T={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"},O=[b,m,r,t.C_BLOCK_COMMENT_MODE,v,_],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:O.concat([{begin:/\(/,end:/\)/,keywords:T,contains:O.concat(["self"]),relevance:0}]),relevance:0},D={begin:"("+f+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:T,relevance:0},{begin:x,returnBegin:!0,contains:[t.inherit(S,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,_,v,m,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,_,v,m]}]},m,r,t.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:T,disableAutodetect:!0,illegal:"</",contains:[].concat(k,D,O,[b,{begin:t.IDENT_RE+"::",keywords:T},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:b,strings:_,keywords:T}}}return Nm=e,Nm}var km,Lx;function g9(){if(Lx)return km;Lx=1;function e(t){const s=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",f="(?!struct)("+o+"|"+s.optional(l)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},_={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})"/})]},v={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},b={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(_,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},S={className:"title",begin:s.optional(l)+t.IDENT_RE,relevance:0},x=s.optional(l)+t.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["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"],O=["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"],U={type:C,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},P={className:"function.dispatch",relevance:0,keywords:{_hint:O},begin:s.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,s.lookahead(/(<[^<>]+>|)\s*\(/))},B=[P,b,m,r,t.C_BLOCK_COMMENT_MODE,v,_],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:U,contains:B.concat([{begin:/\(/,end:/\)/,keywords:U,contains:B.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+f+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:U,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:U,relevance:0},{begin:x,returnBegin:!0,contains:[S],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[_,v]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,_,v,m,{begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,_,v,m]}]},m,r,t.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:U,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,F,P,B,[b,{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:U,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:U},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return km=e,km}var Tm,jx;function _9(){if(jx)return Tm;jx=1;function e(t){const s=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["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"],h=["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"],f={keyword:l.concat(h),built_in:s,literal:o},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={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},_={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},v={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=t.inherit(v,{illegal:/\n/}),S={className:"subst",begin:/\{/,end:/\}/,keywords:f},x=t.inherit(S,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,x]},C={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},S]},T=t.inherit(C,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});S.contains=[C,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.C_BLOCK_COMMENT_MODE],x.contains=[T,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const O={variants:[_,C,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},D=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",U={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:f,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"}},O,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,k,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,k,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:"("+D+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:f,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,relevance:0,contains:[O,d,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},U]}}return Tm=e,Tm}var Mm,Bx;function v9(){if(Bx)return Mm;Bx=1;const e=d=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:d.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:[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:d.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["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(),h=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["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(d){const _=d.regex,v=e(d),b={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},S="and or not only",x=/@-?\w[\w]*(-\w+)*/,w="[a-zA-Z-][a-zA-Z0-9_-]*",C=[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[v.BLOCK_COMMENT,b,v.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+w,relevance:0},v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+h.join("|")+")"}]},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[v.BLOCK_COMMENT,v.HEXCOLOR,v.IMPORTANT,v.CSS_NUMBER_MODE,...C,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...C,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},v.FUNCTION_DISPATCH]},{begin:_.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:x},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:S,attribute:o.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...C,v.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b"}]}}return Mm=m,Mm}var Am,zx;function b9(){if(zx)return Am;zx=1;function e(t){const s=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={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}]},h={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},f={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+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:s.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},_={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},v={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=t.inherit(_,{contains:[]}),S=t.inherit(v,{contains:[]});_.contains.push(S),v.contains.push(b);let x=[r,d];return[_,v,b,S].forEach(O=>{O.contains=O.contains.concat(x)}),x=x.concat(_,v),{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}]}]},r,h,_,v,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,o,d,f,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Am=e,Am}var Rm,Ix;function y9(){if(Ix)return Rm;Ix=1;function e(t){const s=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:s.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:s.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Rm=e,Rm}var Dm,Px;function x9(){if(Px)return Dm;Px=1;function e(t){const s=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=s.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=s.concat(o,/(::\w+)*/),f={"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]+"},d={begin:"#<",end:">"},_=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],v={className:"subst",begin:/#\{/,end:/\}/,keywords:f},b={className:"string",contains:[t.BACKSLASH_ESCAPE,v],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:s.concat(/<<[-~]?'?/,s.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,v]})]}]},S="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${S})(\\.(${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"}]},C={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:f}]},B=[b,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:f},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:f},{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:o,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[C]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:r}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:f},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,v],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(d,_),relevance:0}].concat(d,_);v.contains=B,C.contains=B;const $=[{begin:/^\s*=>/,starts:{end:"$",contains:B}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:f,contains:B}}];return _.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:f,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat($).concat(_).concat(B)}}return Dm=e,Dm}var Om,Ux;function S9(){if(Ux)return Om;Ux=1;function e(t){const h={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:h,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:h,illegal:/["']/}]}]}}return Om=e,Om}var Lm,Hx;function w9(){if(Hx)return Lm;Hx=1;function e(t){const s=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:s.concat(r,s.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Lm=e,Lm}var jm,Fx;function E9(){if(Fx)return jm;Fx=1;function e(t){const s=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},o=t.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},h={className:"literal",begin:/\bon|off|true|false|yes|no\b/},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[o,h,l,f,r,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,_=/"(\\"|[^"])*"/,v=/'[^']*'/,b=s.either(d,_,v),S=s.concat(b,"(\\s*\\.\\s*",b,")*",s.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:S,className:"attr",starts:{end:/$/,contains:[o,m,h,l,f,r]}}]}}return jm=e,jm}var Bm,Vx;function C9(){if(Vx)return Bm;Vx=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(h,f,m){return m===-1?"":h.replace(f,d=>o(h,f,m-1))}function l(h){const f=h.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",d=m+o("(?:<"+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"]}]},C={className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[h.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:x,illegal:/<\/|#/,contains:[h.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[h.BACKSLASH_ESCAPE]},h.APOS_STRING_MODE,h.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:[f.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[C,h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+d+"\\s+)",h.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:x,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[w,h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,r,h.C_BLOCK_COMMENT_MODE]},h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE]},r,w]}}return Bm=l,Bm}var zm,$x;function N9(){if($x)return zm;$x=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],r=["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"],o=["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"],h=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],f=[].concat(l,r,o);function m(d){const _=d.regex,v=(Se,{after:Be})=>{const Ee="</"+Se[0].slice(1);return Se.input.indexOf(Ee,Be)!==-1},b=e,S={begin:"<>",end:"</>"},x=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Se,Be)=>{const Ee=Se[0].length+Se.index,tt=Se.input[Ee];if(tt==="<"||tt===","){Be.ignoreMatch();return}tt===">"&&(v(Se,{after:Ee})||Be.ignoreMatch());let nt;const rt=Se.input.substring(Ee);if(nt=rt.match(/^\s*=/)){Be.ignoreMatch();return}if((nt=rt.match(/^\s+extends\s+/))&&nt.index===0){Be.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:s,built_in:f,"variable.language":h},T="[0-9](_?[0-9])*",O=`\\.(${T})`,k="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",D={className:"number",variants:[{begin:`(\\b(${k})((${O})|\\.)?|(${O}))[eE][+-]?(${T})\\b`},{begin:`\\b(${k})\\b((${O})\\b|\\.)?|(${O})\\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:C,contains:[]},P={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},B={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,U],subLanguage:"css"}},M={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},F={className:"string",begin:"`",end:"`",contains:[d.BACKSLASH_ESCAPE,U]},$={className:"comment",variants:[d.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:b+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),d.C_BLOCK_COMMENT_MODE,d.C_LINE_COMMENT_MODE]},G=[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,P,B,M,F,{match:/\$\d+/},D];U.contains=G.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(G)});const I=[].concat($,U.contains),ie=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(I)}]),J={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:ie},A={variants:[{match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,_.concat(b,"(",_.concat(/\./,b),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},q={relevance:0,match:_.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r,...o]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Z={variants:[{match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[J],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(Se){return _.concat("(?!",Se.join("|"),")")}const te={match:_.concat(/\b/,R([...l,"super","import"].map(Se=>`${Se}\\s*\\(`)),b,_.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:_.concat(/\./,_.lookahead(_.concat(b,/(?![0-9A-Za-z$_(])/))),end:b,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},J]},fe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+d.UNDERSCORE_IDENT_RE+")\\s*=>",pe={match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,_.lookahead(fe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[J]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:ie,CLASS_REFERENCE:q},illegal:/#(?![$_A-z])/,contains:[d.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,P,B,M,F,$,{match:/\$\d+/},D,q,{scope:"attr",match:b+_.lookahead(":"),relevance:0},pe,{begin:"("+d.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[$,d.REGEXP_MODE,{className:"function",begin:fe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:d.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:ie}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:S.begin,end:S.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)"+d.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[J,d.inherit(d.TITLE_MODE,{begin:b,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+b,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[J]},te,Q,A,le,{match:/\$[(.]/}]}}return zm=m,zm}var Im,qx;function k9(){if(qx)return Im;qx=1;function e(t){const s={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],l={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[s,r,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Im=e,Im}var Pm,Kx;function T9(){if(Kx)return Pm;Kx=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(l){const h={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"},f={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:l.UNDERSCORE_IDENT_RE+"@"},d={className:"subst",begin:/\$\{/,end:/\}/,contains:[l.C_NUMBER_MODE]},_={className:"variable",begin:"\\$"+l.UNDERSCORE_IDENT_RE},v={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[_,d]},{begin:"'",end:"'",illegal:/\n/,contains:[l.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[l.BACKSLASH_ESCAPE,_,d]}]};d.contains.push(v);const b={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},S={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(v,{className:"string"}),"self"]}]},x=r,w=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),C={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},T=C;return T.variants[1].contains=[C],C.variants[1].contains=[T],{name:"Kotlin",aliases:["kt","kts"],keywords:h,contains:[l.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),l.C_LINE_COMMENT_MODE,w,f,m,b,S,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:h,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:h,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[C,l.C_LINE_COMMENT_MODE,w],relevance:0},l.C_LINE_COMMENT_MODE,w,b,S,v,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},b,S]},v,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
34
+ `},x]}}return Pm=o,Pm}var Um,Gx;function M9(){if(Gx)return Um;Gx=1;const e=_=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:_.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:[_.APOS_STRING_MODE,_.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:_.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["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(),h=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["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(h).sort().reverse();function d(_){const v=e(_),b=m,S="and or not only",x="[\\w-]+",w="("+x+"|@\\{"+x+"\\})",C=[],T=[],O=function(I){return{className:"string",begin:"~?"+I+".*?"+I}},k=function(I,ie,J){return{className:I,begin:ie,relevance:J}},D={$pattern:/[a-z-]+/,keyword:S,attribute:o.join(" ")},U={begin:"\\(",end:"\\)",contains:T,keywords:D,relevance:0};T.push(_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,O("'"),O('"'),v.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},v.HEXCOLOR,U,k("variable","@@?"+x,10),k("variable","@\\{"+x+"\\}"),k("built_in","~?`[^`]*?`"),{className:"attribute",begin:x+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},v.IMPORTANT,{beginKeywords:"and not"},v.FUNCTION_DISPATCH);const P=T.concat({begin:/\{/,end:/\}/,contains:C}),B={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(T)},M={begin:w+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:T}}]},F={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:D,returnEnd:!0,contains:T,relevance:0}},Y={className:"variable",variants:[{begin:"@"+x+"\\s*:",relevance:15},{begin:"@"+x}],starts:{end:"[;}]",returnEnd:!0,contains:P}},$={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:w,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,B,k("keyword","all\\b"),k("variable","@\\{"+x+"\\}"),{begin:"\\b("+r.join("|")+")\\b",className:"selector-tag"},v.CSS_NUMBER_MODE,k("selector-tag",w,0),k("selector-id","#"+w),k("selector-class","\\."+w,0),k("selector-tag","&",0),v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+h.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:P},{begin:"!important"},v.FUNCTION_DISPATCH]},G={begin:x+`:(:)?(${b.join("|")})`,returnBegin:!0,contains:[$]};return C.push(_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,F,Y,G,M,$,B,v.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:C}}return Um=d,Um}var Hm,Wx;function A9(){if(Wx)return Hm;Wx=1;function e(t){const s="\\[=*\\[",r="\\]=*\\]",o={begin:s,end:r,contains:["self"]},l=[t.COMMENT("--(?!"+s+")","$"),t.COMMENT("--"+s,r,{contains:[o],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:s,end:r,contains:[o],relevance:5}])}}return Hm=e,Hm}var Fm,Yx;function R9(){if(Yx)return Fm;Yx=1;function e(t){const s={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,s]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[s,r]},l={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},h={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},f={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[s]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,s,r,o,l,h,f]}}return Fm=e,Fm}var Vm,Xx;function D9(){if(Xx)return Vm;Xx=1;function e(t){const s=t.regex,r=["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"],o=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:r.join(" ")},h={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},f={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:s.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},_={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},v=[t.BACKSLASH_ESCAPE,h,d],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],S=(C,T,O="\\1")=>{const k=O==="\\1"?O:s.concat(O,T);return s.concat(s.concat("(?:",C,")"),T,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,O,o)},x=(C,T,O)=>s.concat(s.concat("(?:",C,")"),T,/(?:\\.|[^\\\/])*?/,O,o),w=[d,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),f,{className:"string",contains:v,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}]},_,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:S("s|tr|y",s.either(...b,{capture:!0}))},{begin:S("s|tr|y","\\(","\\)")},{begin:S("s|tr|y","\\[","\\]")},{begin:S("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",s.either(...b,{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,_]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return h.contains=w,f.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:w}}return Vm=e,Vm}var $m,Zx;function O9(){if(Zx)return $m;Zx=1;function e(t){const s={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:r,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"]},d={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return $m=e,$m}var qm,Qx;function L9(){if(Qx)return qm;Qx=1;function e(t){const s=t.regex,r=/(?![A-Za-z0-9])(?![$])/,o=s.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),l=s.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),h=s.concat(/[A-Z]+/,r),f={scope:"variable",match:"\\$+"+o},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},_=t.inherit(t.APOS_STRING_MODE,{illegal:null}),v=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(d)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(J,A)=>{A.data._beginMatch=J[1]||J[2]},"on:end":(J,A)=>{A.data._beginMatch!==J[1]&&A.ignoreMatch()}},S=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
35
+ ]`,w={scope:"string",variants:[v,_,b,S]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},T=["false","null","true"],O=["__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"],k=["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"],U={keyword:O,literal:(J=>{const A=[];return J.forEach(q=>{A.push(q),q.toLowerCase()===q?A.push(q.toUpperCase()):A.push(q.toLowerCase())}),A})(T),built_in:k},P=J=>J.map(A=>A.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,s.concat(x,"+"),s.concat("(?!",P(k).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},M=s.concat(o,"\\b(?!\\()"),F={variants:[{match:[s.concat(/::/,s.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,s.concat(/::/,s.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[l,s.concat("::",s.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Y={scope:"attr",match:s.concat(o,s.lookahead(":"),s.lookahead(/(?!::)/))},$={relevance:0,begin:/\(/,end:/\)/,keywords:U,contains:[Y,f,F,t.C_BLOCK_COMMENT_MODE,w,C,B]},G={relevance:0,match:[/\b/,s.concat("(?!fn\\b|function\\b|",P(O).join("\\b|"),"|",P(k).join("\\b|"),"\\b)"),o,s.concat(x,"*"),s.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[$]};$.contains.push(G);const I=[Y,F,t.C_BLOCK_COMMENT_MODE,w,C,B],ie={begin:s.concat(/#\[\s*\\?/,s.either(l,h)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:T,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:T,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:l},{match:h}]}]};return{case_insensitive:!1,keywords:U,contains:[ie,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},f,G,F,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},B,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:U,contains:["self",ie,f,F,t.C_BLOCK_COMMENT_MODE,w,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},w,C]}}return qm=e,qm}var Km,Jx;function j9(){if(Jx)return Km;Jx=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 Km=e,Km}var Gm,eS;function B9(){if(eS)return Gm;eS=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Gm=e,Gm}var Wm,tS;function z9(){if(tS)return Wm;tS=1;function e(t){const s=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["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:o,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"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},_={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},v={begin:/\{\{/,relevance:0},b={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,v,_]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,v,_]},{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,v,_]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,v,_]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S="[0-9](_?[0-9])*",x=`(\\b(${S}))?\\.(${S})|\\b(${S})\\.`,w=`\\b|${o.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${S})|(${x}))[eE][+-]?(${S})[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(${S})[jJ](?=${w})`}]},T={className:"comment",begin:s.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},O={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",d,C,b,t.HASH_COMMENT_MODE]}]};return _.contains=[b,C,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[d,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,T,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[O]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[C,O,b]}]}}return Wm=e,Wm}var Ym,iS;function I9(){if(iS)return Ym;iS=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return Ym=e,Ym}var Xm,sS;function P9(){if(sS)return Xm;sS=1;function e(t){const s=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=s.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,h=s.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:s.lookahead(s.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{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,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[h,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:h},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return Xm=e,Xm}var Zm,nS;function U9(){if(nS)return Zm;nS=1;function e(t){const s=t.regex,r=/(r#)?/,o=s.concat(r,t.UNDERSCORE_IDENT_RE),l=s.concat(r,t.IDENT_RE),h={className:"title.function.invoke",relevance:0,begin:s.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,s.lookahead(/\s*\(/))},f="([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"],d=["true","false","Some","None","Ok","Err"],_=["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!"],v=["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:v,keyword:m,literal:d,built_in:_},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_]+)"+f},{begin:"\\b0o([0-7_]+)"+f},{begin:"\\b0x([A-Fa-f0-9_]+)"+f},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+f}],relevance:0},{begin:[/fn/,/\s+/,o],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,o],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,o,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:_,type:v}},{className:"punctuation",begin:"->"},h]}}return Zm=e,Zm}var Qm,rS;function H9(){if(rS)return Qm;rS=1;const e=d=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:d.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:[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:d.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["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(),h=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["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(d){const _=e(d),v=h,b=l,S="@[a-z-]+",x="and or not only",C={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE,_.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},_.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+b.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+v.join("|")+")"},C,{begin:/\(/,end:/\)/,contains:[_.CSS_NUMBER_MODE]},_.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.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:[_.BLOCK_COMMENT,C,_.HEXCOLOR,_.CSS_NUMBER_MODE,d.QUOTE_STRING_MODE,d.APOS_STRING_MODE,_.IMPORTANT,_.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:S,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:o.join(" ")},contains:[{begin:S,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},C,d.QUOTE_STRING_MODE,d.APOS_STRING_MODE,_.HEXCOLOR,_.CSS_NUMBER_MODE]},_.FUNCTION_DISPATCH]}}return Qm=m,Qm}var Jm,aS;function F9(){if(aS)return Jm;aS=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 Jm=e,Jm}var ep,oS;function V9(){if(oS)return ep;oS=1;function e(t){const s=t.regex,r=t.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},h=["true","false","unknown"],f=["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"],d=["add","asc","collation","desc","final","first","last","view"],_=["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"],v=["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"],b=["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"],S=["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=v,w=[..._,...d].filter(P=>!v.includes(P)),C={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},O={match:s.concat(/\b/,s.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function k(P){return s.concat(/\b/,s.either(...P.map(B=>B.replace(/\s+/,"\\s+"))),/\b/)}const D={scope:"keyword",match:k(S),relevance:0};function U(P,{exceptions:B,when:M}={}){const F=M;return B=B||[],P.map(Y=>Y.match(/\|\d+$/)||B.includes(Y)?Y:F(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:U(w,{when:P=>P.length<3}),literal:h,type:m,built_in:b},contains:[{scope:"type",match:k(f)},D,O,C,o,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,T]}}return ep=e,ep}var tp,lS;function $9(){if(lS)return tp;lS=1;function e(M){return M?typeof M=="string"?M:M.source:null}function t(M){return s("(?=",M,")")}function s(...M){return M.map(Y=>e(Y)).join("")}function r(M){const F=M[M.length-1];return typeof F=="object"&&F.constructor===Object?(M.splice(M.length-1,1),F):{}}function o(...M){return"("+(r(M).capture?"":"?:")+M.map($=>e($)).join("|")+")"}const l=M=>s(/\b/,M,/\w$/.test(M)?/\b/:/\B/),h=["Protocol","Type"].map(l),f=["init","self"].map(l),m=["Any","Self"],d=["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"],_=["false","nil","true"],v=["assignment","associativity","higherThan","left","lowerThan","none","right"],b=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],S=["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=o(/[/=\-+!*%<>&|^~?]/,/[\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=o(x,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),C=s(x,w,"*"),T=o(/[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]/),O=o(T,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),k=s(T,O,"*"),D=s(/[A-Z]/,O,"*"),U=["attached","autoclosure",s(/convention\(/,o("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",s(/objc\(/,k,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],P=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function B(M){const F={match:/\s+/,relevance:0},Y=M.COMMENT("/\\*","\\*/",{contains:["self"]}),$=[M.C_LINE_COMMENT_MODE,Y],G={match:[/\./,o(...h,...f)],className:{2:"keyword"}},I={match:s(/\./,o(...d)),relevance:0},ie=d.filter(et=>typeof et=="string").concat(["_|0"]),J=d.filter(et=>typeof et!="string").concat(m).map(l),A={variants:[{className:"keyword",match:o(...J,...f)}]},q={$pattern:o(/\b\w+/,/#\w+/),keyword:ie.concat(b),literal:_},V=[G,I,A],Z={match:s(/\./,o(...S)),relevance:0},Q={className:"built_in",match:s(/\b/,o(...S),/(?=\()/)},R=[Z,Q],te={match:/->/,relevance:0},ce={className:"operator",relevance:0,variants:[{match:C},{match:`\\.(\\.|${w})+`}]},le=[te,ce],fe="([0-9]_*)+",pe="([0-9a-fA-F]_*)+",Se={className:"number",relevance:0,variants:[{match:`\\b(${fe})(\\.(${fe}))?([eE][+-]?(${fe}))?\\b`},{match:`\\b0x(${pe})(\\.(${pe}))?([pP][+-]?(${fe}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Be=(et="")=>({className:"subst",variants:[{match:s(/\\/,et,/[0\\tnr"']/)},{match:s(/\\/,et,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Ee=(et="")=>({className:"subst",match:s(/\\/,et,/[\t ]*(?:[\r\n]|\r\n)/)}),tt=(et="")=>({className:"subst",label:"interpol",begin:s(/\\/,et,/\(/),end:/\)/}),nt=(et="")=>({begin:s(et,/"""/),end:s(/"""/,et),contains:[Be(et),Ee(et),tt(et)]}),rt=(et="")=>({begin:s(et,/"/),end:s(/"/,et),contains:[Be(et),tt(et)]}),je={className:"string",variants:[nt(),nt("#"),nt("##"),nt("###"),rt(),rt("#"),rt("##"),rt("###")]},Pt=[M.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[M.BACKSLASH_ESCAPE]}],Dr={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Pt},nn=et=>{const Ms=s(et,/\//),Wi=s(/\//,et);return{begin:Ms,end:Wi,contains:[...Pt,{scope:"comment",begin:`#(?!.*${Wi})`,end:/$/}]}},va={scope:"regexp",variants:[nn("###"),nn("##"),nn("#"),Dr]},Or={match:s(/`/,k,/`/)},Lr={className:"variable",match:/\$\d+/},zn={className:"variable",match:`\\$${O}+`},rn=[Or,Lr,zn],ko={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:P,contains:[...le,Se,je]}]}},ba={scope:"keyword",match:s(/@/,o(...U),t(o(/\(/,/\s+/)))},At={scope:"meta",match:s(/@/,k)},an=[ko,ba,At],pi={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:s(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,O,"+")},{className:"type",match:D,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:s(/\s+&\s+/,t(D)),relevance:0}]},on={begin:/</,end:/>/,keywords:q,contains:[...$,...V,...an,te,pi]};pi.contains.push(on);const ln={match:s(k,/\s*:/),keywords:"_|0",relevance:0},ya={begin:/\(/,end:/\)/,relevance:0,keywords:q,contains:["self",ln,...$,va,...V,...R,...le,Se,je,...rn,...an,pi]},In={begin:/</,end:/>/,keywords:"repeat each",contains:[...$,pi]},To={begin:o(t(s(k,/\s*:/)),t(s(k,/\s+/,k,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:k}]},xa={begin:/\(/,end:/\)/,keywords:q,contains:[To,...$,...V,...le,Se,je,...an,pi,ya],endsParent:!0,illegal:/["']/},cn={match:[/(func|macro)/,/\s+/,o(Or.match,k,C)],className:{1:"keyword",3:"title.function"},contains:[In,xa,F],illegal:[/\[/,/%/]},li={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[In,xa,F],illegal:/\[|%/},cs={match:[/operator/,/\s+/,C],className:{1:"keyword",3:"title"}},gi={begin:[/precedencegroup/,/\s+/,D],className:{1:"keyword",3:"title"},contains:[pi],keywords:[...v,..._],end:/}/},Mo={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},jr={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Sa={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,k,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:q,contains:[In,...V,{begin:/:/,end:/\{/,keywords:q,contains:[{scope:"title.class.inherited",match:D},...V],relevance:0}]};for(const et of je.variants){const Ms=et.contains.find(Ci=>Ci.label==="interpol");Ms.keywords=q;const Wi=[...V,...R,...le,Se,je,...rn];Ms.contains=[...Wi,{begin:/\(/,end:/\)/,contains:["self",...Wi]}]}return{name:"Swift",keywords:q,contains:[...$,cn,li,Mo,jr,Sa,cs,gi,{beginKeywords:"import",end:/$/,contains:[...$],relevance:0},va,...V,...R,...le,Se,je,...rn,...an,pi,ya]}}return tp=B,tp}var ip,cS;function q9(){if(cS)return ip;cS=1;function e(t){const s="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},h={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},f={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},m=t.inherit(f,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),S={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},w={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},C={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},T=[o,{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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},S,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},w,C,h,f],O=[...T];return O.pop(),O.push(m),x.contains=O,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}return ip=e,ip}var sp,uS;function K9(){if(uS)return sp;uS=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],r=["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"],o=["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"],h=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],f=[].concat(l,r,o);function m(_){const v=_.regex,b=(Be,{after:Ee})=>{const tt="</"+Be[0].slice(1);return Be.input.indexOf(tt,Ee)!==-1},S=e,x={begin:"<>",end:"</>"},w=/<[A-Za-z0-9\\._:-]+\s*\/>/,C={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Be,Ee)=>{const tt=Be[0].length+Be.index,nt=Be.input[tt];if(nt==="<"||nt===","){Ee.ignoreMatch();return}nt===">"&&(b(Be,{after:tt})||Ee.ignoreMatch());let rt;const je=Be.input.substring(tt);if(rt=je.match(/^\s*=/)){Ee.ignoreMatch();return}if((rt=je.match(/^\s+extends\s+/))&&rt.index===0){Ee.ignoreMatch();return}}},T={$pattern:e,keyword:t,literal:s,built_in:f,"variable.language":h},O="[0-9](_?[0-9])*",k=`\\.(${O})`,D="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",U={className:"number",variants:[{begin:`(\\b(${D})((${k})|\\.)?|(${k}))[eE][+-]?(${O})\\b`},{begin:`\\b(${D})\\b((${k})\\b|\\.)?|(${k})\\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},P={className:"subst",begin:"\\$\\{",end:"\\}",keywords:T,contains:[]},B={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,P],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,P],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,P],subLanguage:"graphql"}},Y={className:"string",begin:"`",end:"`",contains:[_.BACKSLASH_ESCAPE,P]},G={className:"comment",variants:[_.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:S+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),_.C_BLOCK_COMMENT_MODE,_.C_LINE_COMMENT_MODE]},I=[_.APOS_STRING_MODE,_.QUOTE_STRING_MODE,B,M,F,Y,{match:/\$\d+/},U];P.contains=I.concat({begin:/\{/,end:/\}/,keywords:T,contains:["self"].concat(I)});const ie=[].concat(G,P.contains),J=ie.concat([{begin:/(\s*)\(/,end:/\)/,keywords:T,contains:["self"].concat(ie)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:T,contains:J},q={variants:[{match:[/class/,/\s+/,S,/\s+/,/extends/,/\s+/,v.concat(S,"(",v.concat(/\./,S),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,S],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:v.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:{_:[...r,...o]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,S,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(Be){return v.concat("(?!",Be.join("|"),")")}const ce={match:v.concat(/\b/,te([...l,"super","import"].map(Be=>`${Be}\\s*\\(`)),S,v.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:v.concat(/\./,v.lookahead(v.concat(S,/(?![0-9A-Za-z$_(])/))),end:S,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,S,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+_.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,S,/\s*/,/=\s*/,/(async\s*)?/,v.lookahead(pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:T,exports:{PARAMS_CONTAINS:J,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[_.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,_.APOS_STRING_MODE,_.QUOTE_STRING_MODE,B,M,F,Y,G,{match:/\$\d+/},U,V,{scope:"attr",match:S+v.lookahead(":"),relevance:0},Se,{begin:"("+_.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,_.REGEXP_MODE,{className:"function",begin:pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:_.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:T,contains:J}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:w},{begin:C.begin,"on:begin":C.isTrulyOpeningTag,end:C.end}],subLanguage:"xml",contains:[{begin:C.begin,end:C.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+_.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,_.inherit(_.TITLE_MODE,{begin:S,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+S,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},ce,R,q,fe,{match:/\$[(.]/}]}}function d(_){const v=_.regex,b=m(_),S=e,x=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],w={begin:[/namespace/,/\s+/,_.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},C={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:x},contains:[b.exports.CLASS_REFERENCE]},T={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},O=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],k={$pattern:e,keyword:t.concat(O),literal:s,built_in:f.concat(x),"variable.language":h},D={className:"meta",begin:"@"+S},U=(F,Y,$)=>{const G=F.contains.findIndex(I=>I.label===Y);if(G===-1)throw new Error("can not find mode to replace");F.contains.splice(G,1,$)};Object.assign(b.keywords,k),b.exports.PARAMS_CONTAINS.push(D);const P=b.contains.find(F=>F.scope==="attr"),B=Object.assign({},P,{match:v.concat(S,v.lookahead(/\s*\?:/))});b.exports.PARAMS_CONTAINS.push([b.exports.CLASS_REFERENCE,P,B]),b.contains=b.contains.concat([D,w,C,B]),U(b,"shebang",_.SHEBANG()),U(b,"use_strict",T);const M=b.contains.find(F=>F.label==="func.def");return M.relevance=0,Object.assign(b,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),b}return sp=d,sp}var np,hS;function G9(){if(hS)return np;hS=1;function e(t){const s=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,h=/\d{4}-\d{1,2}-\d{1,2}/,f=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:s.concat(/# */,s.either(h,l),/ *#/)},{begin:s.concat(/# */,m,/ *#/)},{begin:s.concat(/# */,f,/ *#/)},{begin:s.concat(/# */,s.either(h,l),/ +/,s.either(f,m),/ *#/)}]},_={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])|[%&])?/}]},v={className:"label",begin:/^\w+:/},b=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),S=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:[r,o,d,_,v,b,S,{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:[S]}]}}return np=e,np}var rp,dS;function W9(){if(dS)return rp;dS=1;function e(t){t.regex;const s=t.COMMENT(/\(;/,/;\)/);s.contains.push("self");const r=t.COMMENT(/;;/,/$/),o=["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"}},h={className:"variable",begin:/\$[\w_]+/},f={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/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},_={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:o},contains:[r,s,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},h,f,l,t.QUOTE_STRING_MODE,d,_,m]}}return rp=e,rp}var ap,fS;function Y9(){if(fS)return ap;fS=1;var e=d9();return e.registerLanguage("xml",f9()),e.registerLanguage("bash",m9()),e.registerLanguage("c",p9()),e.registerLanguage("cpp",g9()),e.registerLanguage("csharp",_9()),e.registerLanguage("css",v9()),e.registerLanguage("markdown",b9()),e.registerLanguage("diff",y9()),e.registerLanguage("ruby",x9()),e.registerLanguage("go",S9()),e.registerLanguage("graphql",w9()),e.registerLanguage("ini",E9()),e.registerLanguage("java",C9()),e.registerLanguage("javascript",N9()),e.registerLanguage("json",k9()),e.registerLanguage("kotlin",T9()),e.registerLanguage("less",M9()),e.registerLanguage("lua",A9()),e.registerLanguage("makefile",R9()),e.registerLanguage("perl",D9()),e.registerLanguage("objectivec",O9()),e.registerLanguage("php",L9()),e.registerLanguage("php-template",j9()),e.registerLanguage("plaintext",B9()),e.registerLanguage("python",z9()),e.registerLanguage("python-repl",I9()),e.registerLanguage("r",P9()),e.registerLanguage("rust",U9()),e.registerLanguage("scss",H9()),e.registerLanguage("shell",F9()),e.registerLanguage("sql",V9()),e.registerLanguage("swift",$9()),e.registerLanguage("yaml",q9()),e.registerLanguage("typescript",K9()),e.registerLanguage("vbnet",G9()),e.registerLanguage("wasm",W9()),e.HighlightJS=e,e.default=e,ap=e,ap}var X9=Y9();const mS=eN(X9);function Z9(e){const t=e.split("/").pop()?.toLowerCase()??"",s=t.includes(".")?t.split(".").pop()??"":"",r={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 r[s]?r[s]:t==="dockerfile"?"dockerfile":null}function Q9(e,t){const s=e.endsWith(`
36
+ `)?e.slice(0,-1):e;return!t||!mS.getLanguage(t)?s.split(`
37
+ `).map(pS):s.split(`
38
+ `).map(r=>{if(!r)return"";try{return mS.highlight(r,{language:t,ignoreIllegals:!0}).value}catch{return pS(r)}})}function pS(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function J9({content:e,path:t}){const s=N.useMemo(()=>Z9(t),[t]),r=N.useMemo(()=>Q9(e,s),[e,s]),o=`${Math.max(2,String(r.length).length)}ch`;return u.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:r.map((l,h)=>u.jsxs("div",{className:"flex",children:[u.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400",style:{minWidth:`calc(${o} + 1rem)`},children:h+1}),u.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800",dangerouslySetInnerHTML:{__html:l||" "}})]},h))})}function ej({path:e,isModified:t,onViewDiff:s}){const[r,o]=N.useState(null),[l,h]=N.useState(null),[f,m]=N.useState(!1);return N.useEffect(()=>{if(!e){o(null);return}let d=!0;return m(!0),h(null),x5(e).then(_=>{d&&(o(_),m(!1))}).catch(_=>{d&&(h(_ instanceof Error?_.message:String(_)),m(!1))}),()=>{d=!1}},[e]),e?u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Read-only view of tracked file."}),r?.truncated?u.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,r?.binary?u.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),t?u.jsx(_e,{onClick:s,size:"sm",type:"button",variant:"outline",children:"View diff"}):null]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50",children:l?u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"destructive",children:l})}):f?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):r?.binary?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):r?u.jsx(J9,{content:r.content,path:e}):null})]}):u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function tj({activeHunkIndex:e,filePaths:t,hunkCount:s,pendingNextFilePath:r,selectedFile:o}){if(s>0&&e<s-1)return{kind:"hunk",activeHunkIndex:e+1};const l=t.indexOf(o),h=t[l+1];return h?r===h?{kind:"file",filePath:h}:{kind:"confirm-next-file",filePath:h}:{kind:"none"}}function gS(e){const t={name:"",fullPath:"",children:new Map};for(const s of e){const r=s.name.split("/");let o=t;r.forEach((l,h)=>{let f=o.children.get(l);f||(f={name:l,fullPath:r.slice(0,h+1).join("/"),children:new Map},o.children.set(l,f)),o=f}),o.branch=s}return t}function _S({label:e,tree:t,onSelect:s,defaultOpen:r,forceOpen:o}){const[l,h]=N.useState(r??!1),f=o||l,m=t.children.size===0;return u.jsxs("div",{className:"mb-1",children:[u.jsxs("button",{type:"button",onClick:()=>h(d=>!d),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:[f?u.jsx(Tr,{size:12}):u.jsx(pa,{size:12}),e,m?null:u.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),f&&!m?u.jsx("ul",{children:Array.from(t.children.values()).map(d=>u.jsx(ZE,{node:d,depth:1,onSelect:s,forceOpen:o},d.fullPath))}):null]})}function ZE({node:e,depth:t,onSelect:s,forceOpen:r}){const[o,l]=N.useState(!0),h=r||o,f=e.children.size>0,m=e.branch,d={paddingLeft:`${t*10}px`};return!f&&m?u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>s(m),style:d,title:m.name,className:`flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60 ${m.current?"font-semibold text-emerald-700":""}`,children:[u.jsx(Xl,{size:11,className:"shrink-0 opacity-70"}),u.jsx("span",{className:"truncate",children:e.name}),m.current?u.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>{m?s(m):l(_=>!_)},style:d,className:"flex w-full items-center gap-1 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60",children:[f?h?u.jsx(Tr,{size:11}):u.jsx(pa,{size:11}):u.jsx("span",{className:"inline-block w-[11px]"}),u.jsx("span",{className:"truncate",children:e.name})]}),h&&f?u.jsx("ul",{children:Array.from(e.children.values()).map(_=>u.jsx(ZE,{node:_,depth:t+1,onSelect:s,forceOpen:r},_.fullPath))}):null]})}function ij({selectedCommit:e,selectedFile:t,diff:s,diffLoading:r,diffError:o}){return u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-white border-b border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),u.jsxs("span",{children:[e.author," <",e.email,">"]}),u.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:o?u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"destructive",children:o})}):e?r?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):s?u.jsx(WE,{activeHunkIndex:0,diff:s}):u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-dashed p-6 text-center",children:e.parents.length>1?"Merge commit with no conflict resolution — no diff against the first parent.":"No textual changes in this commit."})}):u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function sj({files:e,filesError:t,selectedHash:s,selectedFile:r,onSelect:o}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?u.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?u.jsx("div",{className:"p-3",children:u.jsx(yt,{variant:"destructive",children:t})}):s?e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>u.jsx("li",{children:u.jsxs("button",{onClick:()=>o(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 ${r===l.path?"bg-muted":""}`,children:[u.jsx("span",{className:nj(l.index),children:l.index.trim()||"·"}),u.jsx("span",{className:"truncate font-mono",children:l.path})]})},l.path))}):u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function nj(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 vS=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function jl(e){return vS[e%vS.length]}function rj({lane:e,laneCount:t,edges:s,throughLanes:r,isMerge:o,height:l=28,laneWidth:h=14}){const m=Math.max(e+1,t,1)*h,d=l/2,_=Bl(e,h),v=o?4:3.5;return u.jsxs("svg",{width:m,height:l,viewBox:`0 0 ${m} ${l}`,style:{flex:"0 0 auto",display:"block"},children:[r.map(b=>u.jsx("line",{x1:Bl(b,h),y1:0,x2:Bl(b,h),y2:l,stroke:jl(b),strokeWidth:1.5},`t-${b}`)),u.jsx("line",{x1:_,y1:0,x2:_,y2:d,stroke:jl(e),strokeWidth:1.5}),s.map((b,S)=>{const x=Bl(b.fromLane,h),w=Bl(b.toLane,h);if(x===w)return u.jsx("line",{x1:x,y1:d,x2:w,y2:l,stroke:jl(b.toLane),strokeWidth:1.5},`e-${S}`);const C=d+(l-d)/2;return u.jsx("path",{d:`M ${x} ${d} C ${x} ${C}, ${w} ${C}, ${w} ${l}`,fill:"none",stroke:jl(b.toLane),strokeWidth:1.5},`e-${S}`)}),u.jsx("circle",{cx:_,cy:d,r:v,fill:jl(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function Bl(e,t){return e*t+t/2}const bS=28;function aj({commits:e,loading:t,error:s,selectedHash:r,maxLanes:o,rowRefs:l,onSelect:h,onLoadMore:f}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?u.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),u.jsx(_e,{disabled:t,onClick:f,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:s?u.jsx("div",{className:"p-3",children:u.jsx(yt,{variant:"destructive",children:s})}):t&&e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>u.jsx("li",{ref:d=>{d?l.current.set(m.hash,d):l.current.delete(m.hash)},children:u.jsxs("button",{onClick:()=>h(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 ${r===m.hash?"bg-muted":""}`,style:{minHeight:bS},title:`${m.hash}
39
+ ${m.author} <${m.email}>
40
+ ${m.subject}`,children:[u.jsx(rj,{lane:m.lane,laneCount:Math.max(m.laneCount,o),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:bS}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(d=>u.jsx("span",{className:lj(d.kind),children:d.name},`${d.kind}-${d.name}`)),u.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),u.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:oj(m.timestamp)})]})},m.hash))})})]})}function oj(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const s=Math.floor(t/60);if(s<60)return`${s}m`;const r=Math.floor(s/60);if(r<24)return`${r}h`;const o=Math.floor(r/24);if(o<30)return`${o}d`;const l=Math.floor(o/30);return l<12?`${l}mo`:`${Math.floor(l/12)}y`}function lj(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 yS=200;function cj(){const[e,t]=N.useState([]),[s,r]=N.useState(yS),[o,l]=N.useState(!0),[h,f]=N.useState(null),[m,d]=N.useState(null),[_,v]=N.useState([]),[b,S]=N.useState(null),[x,w]=N.useState(null),[C,T]=N.useState(""),[O,k]=N.useState(!1),[D,U]=N.useState(null);N.useEffect(()=>{let M=!0;return l(!0),f(null),_5(s).then(F=>{M&&(t(F),F.length>0&&!F.some(Y=>Y.hash===m)&&d(F[0].hash))}).catch(F=>{M&&f(F instanceof Error?F.message:String(F))}).finally(()=>{M&&l(!1)}),()=>{M=!1}},[s]),N.useEffect(()=>{if(!m){v([]),w(null);return}let M=!0;return S(null),b5(m).then(F=>{M&&(v(F),w(F[0]?.path??null))}).catch(F=>{M&&S(F instanceof Error?F.message:String(F))}),()=>{M=!1}},[m]),N.useEffect(()=>{if(!m){T("");return}let M=!0;return U(null),k(!0),v5(m,x??void 0).then(F=>{M&&T(F)}).catch(F=>{M&&U(F instanceof Error?F.message:String(F))}).finally(()=>{M&&k(!1)}),()=>{M=!1}},[m,x]);const P=N.useMemo(()=>e.reduce((M,F)=>Math.max(M,F.laneCount),1),[e]),B=e.find(M=>M.hash===m)??null;return{commits:e,loading:o,error:h,selectedHash:m,setSelectedHash:d,files:_,filesError:b,selectedFile:x,setSelectedFile:w,diff:C,diffLoading:O,diffError:D,maxLanes:P,selectedCommit:B,loadMore:()=>r(M=>M+yS)}}function uj({branches:e=[]}){const{commits:t,loading:s,error:r,selectedHash:o,setSelectedHash:l,files:h,filesError:f,selectedFile:m,setSelectedFile:d,diff:_,diffLoading:v,diffError:b,maxLanes:S,selectedCommit:x,loadMore:w}=cj(),[C,T]=N.useState(""),O=N.useMemo(()=>{const M=C.trim().toLowerCase();return M?e.filter(F=>F.name.toLowerCase().includes(M)):e},[e,C]),k=N.useMemo(()=>gS(O.filter(M=>!M.remote)),[O]),D=N.useMemo(()=>gS(O.filter(M=>M.remote)),[O]),U=C.trim().length>0,P=N.useRef(new Map);function B(M){const F=M.remote?"remote":"branch",Y=t.find(G=>G.refs.some(I=>I.kind===F&&I.name===M.name));if(!Y)return;l(Y.hash);const $=P.current.get(Y.hash);$&&$.scrollIntoView({block:"center",behavior:"smooth"})}return u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[u.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),u.jsx("input",{type:"search",value:C,onChange:M=>T(M.target.value),placeholder:"Search branches…",className:"w-full rounded border border-border bg-background px-2 py-1 text-[11px] outline-none focus:border-foreground"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[u.jsx(_S,{label:"Local",tree:k,onSelect:B,defaultOpen:!0,forceOpen:U}),u.jsx(_S,{label:"Remote",tree:D,onSelect:B,forceOpen:U})]})]}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[u.jsx(ij,{selectedCommit:x,selectedFile:m,diff:_,diffLoading:v,diffError:b}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[u.jsx(aj,{commits:t,loading:s,error:r,selectedHash:o,maxLanes:S,rowRefs:P,onSelect:l,onLoadMore:w}),u.jsx(sj,{files:h,filesError:f,selectedHash:o,selectedFile:m,onSelect:d})]})]})]})}function hj({data:e}){const[t,s]=N.useState("changes"),[r,o]=N.useState("changes"),[l,h]=N.useState(e.git.status?.files[0]?.path??""),[f,m]=N.useState(""),[d,_]=N.useState([]),[v,b]=N.useState(null),[S,x]=N.useState(""),[w,C]=N.useState(null),[T,O]=N.useState(0),[k,D]=N.useState(null),U=e.git.status?.files??[],P=N.useMemo(()=>U.map(Z=>Z.path),[U]),B=N.useMemo(()=>PL(S),[S]);N.useEffect(()=>{const Z=e.git.status?.files[0]?.path??"";h(Q=>Q&&e.git.status?.files.some(R=>R.path===Q)?Q:Z)},[e.git.status?.files]),N.useEffect(()=>{if(r!=="all"||d.length>0)return;let Z=!0;return b(null),y5().then(Q=>{Z&&_(Q)}).catch(Q=>{Z&&b(Q instanceof Error?Q.message:String(Q))}),()=>{Z=!1}},[r,d.length]),N.useEffect(()=>{if(!l){x("");return}let Z=!0;return C(null),S5(l).then(Q=>{Z&&(x(Q),O(0),D(null))}).catch(Q=>{Z&&C(Q instanceof Error?Q.message:String(Q))}),()=>{Z=!1}},[l]);function M(Z){O(0),D(null),h(Z)}function F(){const Z=tj({activeHunkIndex:T,filePaths:P,hunkCount:B.hunks,pendingNextFilePath:k,selectedFile:l});Z.kind==="hunk"?(D(null),O(Z.activeHunkIndex)):Z.kind==="confirm-next-file"?D(Z.filePath):Z.kind==="file"?M(Z.filePath):D(null)}function Y(){if(D(null),T>0){O(R=>R-1);return}const Z=U.findIndex(R=>R.path===l),Q=U[Z-1];Q&&M(Q.path)}const $=U.findIndex(Z=>Z.path===l),G=!!(B.hunks&&T<B.hunks-1||U[$+1]),I=!!(T>0||U[$-1]),ie=k?`End of file. Click Next again to open ${k}.`:null,J=Z=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${Z?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,A=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"}`,q=N.useMemo(()=>new Set(U.map(Z=>Z.path)),[U]);function V(){f&&(o("changes"),M(f))}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[u.jsx("button",{type:"button",className:J(t==="changes"),onClick:()=>s("changes"),children:"Changes"}),u.jsx("button",{type:"button",className:J(t==="graph"),onClick:()=>s("graph"),children:"Tree"})]}),u.jsx("div",{className:"min-h-0 flex-1",children:t==="graph"?u.jsx(uj,{branches:e.git.branches??[]}):u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[u.jsx("button",{className:A(r==="changes"),onClick:()=>o("changes"),type:"button",children:"Changes"}),u.jsx("button",{className:A(r==="all"),onClick:()=>o("all"),type:"button",children:"All files"})]}),r==="changes"?u.jsx(QL,{branch:e.git.status?.branch||void 0,error:e.git.error,files:e.git.status?.files??[],selectedFile:l,onSelectFile:M}):v?u.jsx(yt,{variant:"destructive",className:"m-3",children:v}):u.jsx(o9,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:d,selectedFile:f,status:e.git.status?.files??[]})]}),r==="all"?u.jsx(ej,{isModified:q.has(f),onViewDiff:V,path:f}):u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:l||"Diff"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Long rows wrap inside the editor pane."}),B.additions||B.deletions?u.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",B.additions]}),u.jsxs("span",{className:"text-red-700",children:["-",B.deletions]})]}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[ie?u.jsx("span",{className:"max-w-72 truncate rounded border border-amber-200 bg-amber-50 px-2 py-1 text-[11px] text-amber-900",children:ie}):null,u.jsxs(_e,{disabled:!l||!I,onClick:Y,size:"sm",type:"button",variant:"outline",children:[u.jsx(bN,{}),"Previous"]}),u.jsxs(_e,{disabled:!l||!G,onClick:F,size:"sm",type:"button",variant:"outline",children:[u.jsx(_N,{}),"Next"]})]})]}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:w?u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"destructive",children:w})}):l?u.jsx(WE,{activeHunkIndex:T,diff:S||"No unstaged diff for this file."}):u.jsx("div",{className:"p-4",children:u.jsx(yt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function dj({initialPath:e,onSelect:t,selectedPath:s}){const[r,o]=N.useState(e),[l,h]=N.useState(null),[f,m]=N.useState(null),[d,_]=N.useState(!1),v=fj(l);return N.useEffect(()=>{o(e)},[e]),N.useEffect(()=>{let b=!0;return _(!0),m(null),k5(r).then(S=>{b&&(h(S),t(S.path))}).catch(S=>{b&&m(S instanceof Error?S.message:String(S))}).finally(()=>{b&&_(!1)}),()=>{b=!1}},[r,t]),u.jsxs("div",{className:"rounded-md border border-border bg-background",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[v?u.jsx(_e,{"aria-label":"Open parent folder",onClick:()=>l&&o(l.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(Tr,{className:"rotate-90"})}):null,u.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l?.path??r}),d?u.jsx(po,{className:"size-4 animate-spin text-muted-foreground"}):null]}),u.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[f?u.jsx(yt,{variant:"destructive",className:"m-1",children:f}):null,!f&&l?.entries.length===0?u.jsx(yt,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,l?.entries.map(b=>u.jsxs(_e,{className:ge("h-8 w-full justify-start rounded-sm px-2 text-left",s===b.path&&"bg-muted"),onClick:()=>o(b.path),title:b.path,type:"button",variant:"ghost",children:[u.jsx(xo,{className:"text-accent"}),u.jsx("span",{className:"truncate",children:b.name})]},b.path))]})]})}function fj(e){return!!(e&&e.parent!==e.path)}function xS(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function mj({data:e,onRefresh:t}){const[s,r]=N.useState(!1),[o,l]=N.useState(e.git.cwd),[h,f]=N.useState(null),[m,d]=N.useState(!1),[_,v]=N.useState(e.git.cwd),b=N.useRef(null),S=e.git.selectedRepository,x=S?.name??xS(e.git.cwd),{error:w,success:C}=Gi(),T=gj({gitCwd:e.git.cwd});N.useEffect(()=>{l(e.git.cwd),v(e.git.cwd)},[e.git.cwd]),N.useEffect(()=>{if(!s)return;function B(M){b.current&&M.target instanceof Node&&!b.current.contains(M.target)&&r(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[s]);async function O(B){try{await os("/api/git/select",{name:B}),r(!1),await t(),C(`Switched to ${B}.`)}catch(M){w(M instanceof Error?M.message:String(M))}}async function k(B){const M=B.trim();if(!pj(M)){const F="Please add an absolute path. Paths beginning with ~ are not expanded here.";return f(F),w(F),!1}try{const F=xS(M);return await os("/api/git/repositories",{name:F,path:M}),f(null),await t(),C(`Added Git project ${F}.`),!0}catch(F){const Y=F instanceof Error?F.message:String(F);return f(Y),w(Y),!1}}async function D(B){try{await w5(B),await t(),C(`Removed Git project ${B}.`)}catch(M){w(M instanceof Error?M.message:String(M))}}async function U(B){B.preventDefault(),await k(o)&&r(!1)}function P(){f(null),v(T.selectedPath),d(!0)}return u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:b,children:[u.jsxs(_e,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>r(B=>!B),size:"sm",type:"button",variant:"outline",children:[u.jsx(xo,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:x}),u.jsx(Tr,{className:ge("ml-auto transition-transform",s&&"rotate-180")})]}),u.jsx(_e,{"aria-label":"Add Git project",onClick:P,size:"sm",type:"button",variant:"outline",children:u.jsx(js,{})}),s?u.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(380px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(BN,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),u.jsx(Ve,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?u.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(B=>{const M=B.name===S?.name;return u.jsxs("div",{className:ge("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",M&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{O(B.name)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:B.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:B.path})]}),M?u.jsx(Sh,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(_e,{"aria-label":`Remove ${B.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{D(B.name)},size:"icon",title:`Remove ${B.name}`,type:"button",variant:"ghost",children:u.jsx(xg,{className:"size-3.5 text-destructive"})})]},B.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),u.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[u.jsxs("form",{className:"flex gap-1.5",onSubmit:U,children:[u.jsx(vt,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:B=>{l(B.target.value),f(null)},placeholder:"/absolute/path",value:o}),u.jsxs(_e,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[u.jsx(js,{className:"size-3"}),"Add"]}),u.jsx(_e,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:P,size:"sm",type:"button",variant:"outline",children:u.jsx(WN,{className:"size-3"})})]}),h?u.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:h}):null]})]}):null,m?u.jsx(_j,{confirmLabel:T.confirmLabel,errorMessage:h,initialPath:T.initialPath,selectedPath:_,title:"Add Git Project",onCancel:()=>d(!1),onSelect:v,onUse:async()=>{await k(_)&&(d(!1),r(!1))}}):null]})}function pj(e){return e.startsWith("/")}function gj({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function _j({confirmLabel:e="Use this folder",errorMessage:t,initialPath:s,onCancel:r,onSelect:o,onUse:l,selectedPath:h,title:f="Choose Git Project Folder"}){return Jg.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:u.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:u.jsx(xo,{className:"size-4"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"text-sm font-semibold",children:f}),u.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:h})]}),u.jsx(_e,{"aria-label":"Close folder picker",onClick:r,size:"icon",variant:"ghost",children:u.jsx(Mr,{})})]}),u.jsx(dj,{initialPath:s,onSelect:o,selectedPath:h}),t?u.jsx("div",{className:"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:t}):null,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx(_e,{onClick:r,type:"button",variant:"outline",children:"Cancel"}),u.jsx(_e,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function vj({branches:e,currentBranch:t,disabled:s,onRefresh:r}){const[o,l]=N.useState(!1),[h,f]=N.useState(""),[m,d]=N.useState(null),[_,v]=N.useState(null),[b,S]=N.useState(null),x=e.filter(D=>!D.remote),w=e.filter(D=>D.remote);async function C(D,U){d(D),S(null),v(null);try{await U(),await r()}catch(P){S(P instanceof Error?P.message:String(P))}finally{d(null)}}async function T(D){await C(`switch:${D}`,async()=>{await os("/api/git/branches/switch",{name:D}),l(!1)})}async function O(){await C("fetch",async()=>{await os("/api/git/fetch",{}),v("Fetched latest branch refs.")})}async function k(D){D.preventDefault();const U=h.trim();if(!U){S("Branch name is required.");return}await C("create",async()=>{await os("/api/git/branches",{name:U}),f(""),l(!1)})}return u.jsxs("div",{className:"fixed bottom-3 right-4 z-50 flex items-end",children:[o?u.jsxs("div",{"aria-label":"Switch Git branch",className:"mb-11 w-[min(460px,calc(100vw-2rem))] rounded-lg border border-border bg-card shadow-xl",role:"dialog",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Xl,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(_e,{"aria-label":"Fetch branches",disabled:s||m!==null,onClick:()=>{O()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:u.jsx(IS,{className:ge(m==="fetch"&&"animate-spin")})}),u.jsx(_e,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:u.jsx(Mr,{})})]})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsxs(u.Fragment,{children:[u.jsx(SS,{branches:x,busy:m!==null,disabled:s,label:"Local",onSwitch:T}),u.jsx(SS,{branches:w,busy:m!==null,disabled:s,label:"Remote",onSwitch:T})]}):u.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),u.jsxs("div",{className:"border-t border-border p-3",children:[u.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:k,children:[u.jsx(vt,{"aria-label":"New branch name",disabled:s||m!==null,onChange:D=>{f(D.target.value),S(null),v(null)},placeholder:"feature/new-work",value:h}),u.jsxs(_e,{disabled:s||m!==null,type:"submit",children:[u.jsx(tk,{}),"Create"]})]}),b||_?u.jsx(yt,{className:"mt-3 px-3 py-2 text-xs",variant:b?"destructive":"muted",children:b??_}):null]})]}):null,u.jsxs(_e,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:s,onClick:()=>l(D=>!D),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[u.jsx(Xl,{className:"size-4"}),u.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),u.jsx(Tr,{className:ge("size-4 transition-transform",o&&"rotate-180")})]})]})}function SS({branches:e,busy:t,disabled:s,label:r,onSwitch:o}){return u.jsxs("section",{children:[u.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:r}),e.length?e.map(l=>u.jsxs("button",{className:ge("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:s||t||l.current,onClick:()=>{o(l.name)},type:"button",children:[u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block truncate font-medium",children:l.name}),l.upstream?u.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",l.upstream]}):null]}),u.jsx(Ve,{variant:l.current?"success":l.remote?"outline":"secondary",children:l.current?"current":l.remote?"remote":"local"})]},`${l.remote?"remote":"local"}:${l.name}`)):u.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",r.toLowerCase()," branches."]})]})}function bj(e=!1){return ge("group/sidebar hidden h-screen 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 yj(e,t=!1){return ge("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 xj(e=!1,t=!1){return ge("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 Sj(e=!1){return ge("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 wj({docked:e,onToggleDock:t}){return u.jsxs("div",{className:ge("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[u.jsxs("span",{className:ge("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[u.jsx("span",{children:"Made with"}),u.jsx(sk,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),u.jsx("span",{children:"by Robert Wang"}),u.jsx("a",{"aria-label":"Robert Wang on LinkedIn",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-[#0A66C2]",href:"https://www.linkedin.com/in/robert-wang-cs/",rel:"noopener noreferrer",target:"_blank",title:"LinkedIn",children:u.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.063 2.063 0 1 1 0-4.126 2.063 2.063 0 0 1 0 4.126zM7.119 20.452H3.554V9h3.565v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"})})})]}),u.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:ge("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?u.jsx(Sk,{}):u.jsx(Ek,{})})]})}function Ej({className:e}){return u.jsxs("div",{className:ge("min-w-0",e),children:[u.jsxs("div",{className:"flex items-baseline gap-1.5",children:[u.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),u.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.29"]})]}),u.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function Cj(){const[e,t]=N.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"),[s,r]=N.useState(null),[o,l]=N.useState(null),[h,f]=N.useState(!0),{error:m,success:d}=Gi(),[_,v]=N.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),b=N.useCallback(async(x={})=>{x.silent||f(!0),l(null);try{r(await N5()),x.notify&&d("Dashboard refreshed.")}catch(w){const C=w instanceof Error?w.message:String(w);l(C),m(C)}finally{f(!1)}},[m,d]);N.useEffect(()=>{b()},[b]),N.useEffect(()=>{function x(){document.visibilityState==="visible"&&b({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,b]),N.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]),N.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(_))},[_]);const S=N.useMemo(()=>s?Object.values(s.runtime.services).filter(x=>x.state==="running").length:0,[s]);return u.jsxs("div",{className:"h-screen overflow-hidden",children:[u.jsxs("div",{className:"mx-auto flex h-screen max-w-[1500px]",children:[u.jsxs("aside",{className:bj(_),children:[u.jsxs("div",{className:ge("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",_?"w-full":"w-12 group-hover/sidebar:w-full"),children:[u.jsx("div",{className:"flex size-12 items-center justify-center",children:u.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary",children:u.jsx("img",{alt:"NoMoreIDE",className:"size-full object-cover",src:s5})})}),u.jsx(Ej,{className:ge("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",_?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),u.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[u.jsx(oo,{active:e==="services",badge:S,docked:_,icon:u.jsx(Hk,{}),label:"Services",onClick:()=>t("services")}),u.jsx(oo,{active:e==="git",docked:_,icon:u.jsx(Xl,{}),label:"Git Review",onClick:()=>t("git")}),u.jsx(oo,{active:e==="errors",docked:_,icon:u.jsx(lp,{}),label:"Error Inbox",onClick:()=>t("errors")}),u.jsx(oo,{active:e==="database",docked:_,icon:u.jsx(yo,{}),label:"Database",onClick:()=>t("database")}),u.jsx(oo,{active:e==="terminal",docked:_,icon:u.jsx(Kk,{}),label:"Terminal",onClick:()=>t("terminal")}),u.jsx(oo,{active:e==="agent",docked:_,icon:u.jsx(Yl,{}),label:"Agent",onClick:()=>t("agent")})]}),u.jsx(wj,{docked:_,onToggleDock:()=>v(x=>!x)})]}),u.jsxs("main",{className:"flex h-screen min-w-0 flex-1 flex-col px-0 py-0",children:[u.jsxs("header",{className:ge("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Nk,{className:"size-4 text-muted-foreground md:hidden"}),u.jsxs("div",{children:[u.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"}),u.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s?.git.selectedRepository?.name??s?.git.cwd??"Local workspace"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[o?u.jsx(Ve,{variant:"danger",children:o}):null,s&&e==="git"?u.jsx(mj,{data:s,onRefresh:b}):null,u.jsxs(_e,{onClick:()=>{b({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[u.jsx(IS,{className:ge(h&&"animate-spin")}),"Refresh"]})]})]}),h&&!s?u.jsx(yt,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,u.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[s&&e==="services"?u.jsx(yD,{data:s,onRefresh:b}):null,s&&e==="git"?u.jsx(hj,{data:s}):null,e==="agent"?u.jsx(IR,{}):null,e==="errors"?u.jsx(r8,{}):null,e==="database"?u.jsx(e8,{}):null,e==="terminal"?u.jsx(zL,{}):null]})]})]}),s&&e==="git"?u.jsx(vj,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:b}):null]})}function oo({active:e,badge:t,docked:s,icon:r,label:o,onClick:l}){return u.jsxs(_e,{"aria-label":o,title:o,className:yj(e,s),variant:"ghost",onClick:l,type:"button",children:[u.jsx("span",{className:Sj(s),children:r}),u.jsx("span",{className:xj(s,t!==void 0),children:o}),t!==void 0?u.jsx(Ve,{appearance:t>0?"solid":"outline",className:ge("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",s&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}ES.createRoot(document.getElementById("root")).render(u.jsx(N.StrictMode,{children:u.jsx(Cj,{})}));