@jean2/client 0.4.2 → 0.5.0
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.
- package/README.md +13 -4
- package/dist/assets/index-BEUdYnis.js +524 -0
- package/dist/assets/index-CSWc-HB2.css +32 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-CT1xCMr6.css +0 -32
- package/dist/assets/index-sGQIMDFW.js +0 -519
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
function $2(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const h=Object.getOwnPropertyDescriptor(s,l);h&&Object.defineProperty(e,l,h.get?h:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const h of l)if(h.type==="childList")for(const u of h.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const h={};return l.integrity&&(h.integrity=l.integrity),l.referrerPolicy&&(h.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?h.credentials="include":l.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(l){if(l.ep)return;l.ep=!0;const h=i(l);fetch(l.href,h)}})();function rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var np={exports:{}},sl={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Sb;function q2(){if(Sb)return sl;Sb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,l,h){var u=null;if(h!==void 0&&(u=""+h),l.key!==void 0&&(u=""+l.key),"key"in l){h={};for(var o in l)o!=="key"&&(h[o]=l[o])}else h=l;return l=h.ref,{$$typeof:e,type:s,key:u,ref:l!==void 0?l:null,props:h}}return sl.Fragment=n,sl.jsx=i,sl.jsxs=i,sl}var wb;function V2(){return wb||(wb=1,np.exports=q2()),np.exports}var m=V2(),rp={exports:{}},qe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Cb;function G2(){if(Cb)return qe;Cb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),b=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function y(I,L,z){this.props=I,this.context=L,this.refs=_,this.updater=z||k}y.prototype.isReactComponent={},y.prototype.setState=function(I,L){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,L,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=y.prototype;function x(I,L,z){this.props=I,this.context=L,this.refs=_,this.updater=z||k}var E=x.prototype=new v;E.constructor=x,w(E,y.prototype),E.isPureReactComponent=!0;var M=Array.isArray;function R(){}var N={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(I,L,z){var X=z.ref;return{$$typeof:e,type:I,key:L,ref:X!==void 0?X:null,props:z}}function P(I,L){return O(I.type,L,I.props)}function $(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var L={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(z){return L[z]})}var q=/\/+/g;function Y(I,L){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):L.toString(36)}function K(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(R,R):(I.status="pending",I.then(function(L){I.status==="pending"&&(I.status="fulfilled",I.value=L)},function(L){I.status==="pending"&&(I.status="rejected",I.reason=L)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function V(I,L,z,X,ee){var te=typeof I;(te==="undefined"||te==="boolean")&&(I=null);var W=!1;if(I===null)W=!0;else switch(te){case"bigint":case"string":case"number":W=!0;break;case"object":switch(I.$$typeof){case e:case n:W=!0;break;case g:return W=I._init,V(W(I._payload),L,z,X,ee)}}if(W)return ee=ee(I),W=X===""?"."+Y(I,0):X,M(ee)?(z="",W!=null&&(z=W.replace(q,"$&/")+"/"),V(ee,L,z,"",function(ae){return ae})):ee!=null&&($(ee)&&(ee=P(ee,z+(ee.key==null||I&&I.key===ee.key?"":(""+ee.key).replace(q,"$&/")+"/")+W)),L.push(ee)),1;W=0;var H=X===""?".":X+":";if(M(I))for(var re=0;re<I.length;re++)X=I[re],te=H+Y(X,re),W+=V(X,L,z,te,ee);else if(re=S(I),typeof re=="function")for(I=re.call(I),re=0;!(X=I.next()).done;)X=X.value,te=H+Y(X,re++),W+=V(X,L,z,te,ee);else if(te==="object"){if(typeof I.then=="function")return V(K(I),L,z,X,ee);throw L=String(I),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return W}function Q(I,L,z){if(I==null)return I;var X=[],ee=0;return V(I,X,"","",function(te){return L.call(z,te,ee++)}),X}function J(I){if(I._status===-1){var L=I._result;L=L(),L.then(function(z){(I._status===0||I._status===-1)&&(I._status=1,I._result=z)},function(z){(I._status===0||I._status===-1)&&(I._status=2,I._result=z)}),I._status===-1&&(I._status=0,I._result=L)}if(I._status===1)return I._result.default;throw I._result}var F=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},j={map:Q,forEach:function(I,L,z){Q(I,function(){L.apply(this,arguments)},z)},count:function(I){var L=0;return Q(I,function(){L++}),L},toArray:function(I){return Q(I,function(L){return L})||[]},only:function(I){if(!$(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return qe.Activity=f,qe.Children=j,qe.Component=y,qe.Fragment=i,qe.Profiler=l,qe.PureComponent=x,qe.StrictMode=s,qe.Suspense=c,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,qe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return N.H.useMemoCache(I)}},qe.cache=function(I){return function(){return I.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(I,L,z){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=w({},I.props),ee=I.key;if(L!=null)for(te in L.key!==void 0&&(ee=""+L.key),L)!D.call(L,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&L.ref===void 0||(X[te]=L[te]);var te=arguments.length-2;if(te===1)X.children=z;else if(1<te){for(var W=Array(te),H=0;H<te;H++)W[H]=arguments[H+2];X.children=W}return O(I.type,ee,X)},qe.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:h,_context:I},I},qe.createElement=function(I,L,z){var X,ee={},te=null;if(L!=null)for(X in L.key!==void 0&&(te=""+L.key),L)D.call(L,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(ee[X]=L[X]);var W=arguments.length-2;if(W===1)ee.children=z;else if(1<W){for(var H=Array(W),re=0;re<W;re++)H[re]=arguments[re+2];ee.children=H}if(I&&I.defaultProps)for(X in W=I.defaultProps,W)ee[X]===void 0&&(ee[X]=W[X]);return O(I,te,ee)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(I){return{$$typeof:o,render:I}},qe.isValidElement=$,qe.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:J}},qe.memo=function(I,L){return{$$typeof:d,type:I,compare:L===void 0?null:L}},qe.startTransition=function(I){var L=N.T,z={};N.T=z;try{var X=I(),ee=N.S;ee!==null&&ee(z,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(R,F)}catch(te){F(te)}finally{L!==null&&z.types!==null&&(L.types=z.types),N.T=L}},qe.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},qe.use=function(I){return N.H.use(I)},qe.useActionState=function(I,L,z){return N.H.useActionState(I,L,z)},qe.useCallback=function(I,L){return N.H.useCallback(I,L)},qe.useContext=function(I){return N.H.useContext(I)},qe.useDebugValue=function(){},qe.useDeferredValue=function(I,L){return N.H.useDeferredValue(I,L)},qe.useEffect=function(I,L){return N.H.useEffect(I,L)},qe.useEffectEvent=function(I){return N.H.useEffectEvent(I)},qe.useId=function(){return N.H.useId()},qe.useImperativeHandle=function(I,L,z){return N.H.useImperativeHandle(I,L,z)},qe.useInsertionEffect=function(I,L){return N.H.useInsertionEffect(I,L)},qe.useLayoutEffect=function(I,L){return N.H.useLayoutEffect(I,L)},qe.useMemo=function(I,L){return N.H.useMemo(I,L)},qe.useOptimistic=function(I,L){return N.H.useOptimistic(I,L)},qe.useReducer=function(I,L,z){return N.H.useReducer(I,L,z)},qe.useRef=function(I){return N.H.useRef(I)},qe.useState=function(I){return N.H.useState(I)},qe.useSyncExternalStore=function(I,L,z){return N.H.useSyncExternalStore(I,L,z)},qe.useTransition=function(){return N.H.useTransition()},qe.version="19.2.4",qe}var kb;function Tm(){return kb||(kb=1,rp.exports=G2()),rp.exports}var T=Tm();const er=rd(T),jx=$2({__proto__:null,default:er},[T]);var ip={exports:{}},al={},sp={exports:{}},ap={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Eb;function W2(){return Eb||(Eb=1,(function(e){function n(V,Q){var J=V.length;V.push(Q);e:for(;0<J;){var F=J-1>>>1,j=V[F];if(0<l(j,Q))V[F]=Q,V[J]=j,J=F;else break e}}function i(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var Q=V[0],J=V.pop();if(J!==Q){V[0]=J;e:for(var F=0,j=V.length,I=j>>>1;F<I;){var L=2*(F+1)-1,z=V[L],X=L+1,ee=V[X];if(0>l(z,J))X<j&&0>l(ee,z)?(V[F]=ee,V[X]=J,F=X):(V[F]=z,V[L]=J,F=L);else if(X<j&&0>l(ee,J))V[F]=ee,V[X]=J,F=X;else break e}}return Q}function l(V,Q){var J=V.sortIndex-Q.sortIndex;return J!==0?J:V.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],d=[],g=1,f=null,b=3,S=!1,k=!1,w=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var Q=i(d);Q!==null;){if(Q.callback===null)s(d);else if(Q.startTime<=V)s(d),Q.sortIndex=Q.expirationTime,n(c,Q);else break;Q=i(d)}}function M(V){if(w=!1,E(V),!k)if(i(c)!==null)k=!0,R||(R=!0,U());else{var Q=i(d);Q!==null&&K(M,Q.startTime-V)}}var R=!1,N=-1,D=5,O=-1;function P(){return _?!0:!(e.unstable_now()-O<D)}function $(){if(_=!1,R){var V=e.unstable_now();O=V;var Q=!0;try{e:{k=!1,w&&(w=!1,v(N),N=-1),S=!0;var J=b;try{t:{for(E(V),f=i(c);f!==null&&!(f.expirationTime>V&&P());){var F=f.callback;if(typeof F=="function"){f.callback=null,b=f.priorityLevel;var j=F(f.expirationTime<=V);if(V=e.unstable_now(),typeof j=="function"){f.callback=j,E(V),Q=!0;break t}f===i(c)&&s(c),E(V)}else s(c);f=i(c)}if(f!==null)Q=!0;else{var I=i(d);I!==null&&K(M,I.startTime-V),Q=!1}}break e}finally{f=null,b=J,S=!1}Q=void 0}}finally{Q?U():R=!1}}}var U;if(typeof x=="function")U=function(){x($)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Y=q.port2;q.port1.onmessage=$,U=function(){Y.postMessage(null)}}else U=function(){y($,0)};function K(V,Q){N=y(function(){V(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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(V){switch(b){case 1:case 2:case 3:var Q=3;break;default:Q=b}var J=b;b=Q;try{return V()}finally{b=J}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var J=b;b=V;try{return Q()}finally{b=J}},e.unstable_scheduleCallback=function(V,Q,J){var F=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?F+J:F):J=F,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=J+j,V={id:g++,callback:Q,priorityLevel:V,startTime:J,expirationTime:j,sortIndex:-1},J>F?(V.sortIndex=J,n(d,V),i(c)===null&&V===i(d)&&(w?(v(N),N=-1):w=!0,K(M,J-F))):(V.sortIndex=j,n(c,V),k||S||(k=!0,R||(R=!0,U()))),V},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(V){var Q=b;return function(){var J=b;b=Q;try{return V.apply(this,arguments)}finally{b=J}}}})(ap)),ap}var Ab;function K2(){return Ab||(Ab=1,sp.exports=W2()),sp.exports}var op={exports:{}},cn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Tb;function Y2(){if(Tb)return cn;Tb=1;var e=Tm();function n(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function h(c,d,g){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:f==null?null:""+f,children:c,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,cn.createPortal=function(c,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return h(c,d,null,g)},cn.flushSync=function(c){var d=u.T,g=s.p;try{if(u.T=null,s.p=2,c)return c()}finally{u.T=d,s.p=g,s.d.f()}},cn.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(c,d))},cn.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},cn.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var g=d.as,f=o(g,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?s.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:b,fetchPriority:S}):g==="script"&&s.d.X(c,{crossOrigin:f,integrity:b,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},cn.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=o(d.as,d.crossOrigin);s.d.M(c,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(c)},cn.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,f=o(g,d.crossOrigin);s.d.L(c,g,{crossOrigin:f,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})}},cn.preloadModule=function(c,d){if(typeof c=="string")if(d){var g=o(d.as,d.crossOrigin);s.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(c)},cn.requestFormReset=function(c){s.d.r(c)},cn.unstable_batchedUpdates=function(c,d){return c(d)},cn.useFormState=function(c,d,g){return u.H.useFormState(c,d,g)},cn.useFormStatus=function(){return u.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var Rb;function Ox(){if(Rb)return op.exports;Rb=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(n){console.error(n)}}return e(),op.exports=Y2(),op.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Db;function X2(){if(Db)return al;Db=1;var e=K2(),n=Tm(),i=Ox();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function o(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function c(t){if(h(t)!==t)throw Error(s(188))}function d(t){var r=t.alternate;if(!r){if(r=h(t),r===null)throw Error(s(188));return r!==t?null:t}for(var a=t,p=r;;){var C=a.return;if(C===null)break;var A=C.alternate;if(A===null){if(p=C.return,p!==null){a=p;continue}break}if(C.child===A.child){for(A=C.child;A;){if(A===a)return c(C),t;if(A===p)return c(C),r;A=A.sibling}throw Error(s(188))}if(a.return!==p.return)a=C,p=A;else{for(var B=!1,G=C.child;G;){if(G===a){B=!0,a=C,p=A;break}if(G===p){B=!0,p=C,a=A;break}G=G.sibling}if(!B){for(G=A.child;G;){if(G===a){B=!0,a=A,p=C;break}if(G===p){B=!0,p=A,a=C;break}G=G.sibling}if(!B)throw Error(s(189))}}if(a.alternate!==p)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var f=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),x=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function U(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var q=Symbol.for("react.client.reference");function Y(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===q?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case y:return"Profiler";case _:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case x:return t.displayName||"Context";case v:return(t._context.displayName||"Context")+".Consumer";case E:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case N:return r=t.displayName||null,r!==null?r:Y(t.type)||"Memo";case D:r=t._payload,t=t._init;try{return Y(t(r))}catch{}}return null}var K=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},F=[],j=-1;function I(t){return{current:t}}function L(t){0>j||(t.current=F[j],F[j]=null,j--)}function z(t,r){j++,F[j]=t.current,t.current=r}var X=I(null),ee=I(null),te=I(null),W=I(null);function H(t,r){switch(z(te,r),z(ee,t),z(X,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Vy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Vy(r),t=Gy(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(X),z(X,t)}function re(){L(X),L(ee),L(te)}function ae(t){t.memoizedState!==null&&z(W,t);var r=X.current,a=Gy(r,t.type);r!==a&&(z(ee,t),z(X,a))}function pe(t){ee.current===t&&(L(X),L(ee)),W.current===t&&(L(W),tl._currentValue=J)}var ce,Oe;function Be(t){if(ce===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ce=r&&r[1]||"",Oe=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ce+t+Oe}var $e=!1;function ut(t,r){if(!t||$e)return"";$e=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(de){var ue=de}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(de){ue=de}t.call(ge.prototype)}}else{try{throw Error()}catch(de){ue=de}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=p.DetermineComponentFrameRoot(),B=A[0],G=A[1];if(B&&G){var ne=B.split(`
|
|
44
|
-
`),le=G.split(`
|
|
45
|
-
`);for(C=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;C<le.length&&!le[C].includes("DetermineComponentFrameRoot");)C++;if(p===ne.length||C===le.length)for(p=ne.length-1,C=le.length-1;1<=p&&0<=C&&ne[p]!==le[C];)C--;for(;1<=p&&0<=C;p--,C--)if(ne[p]!==le[C]){if(p!==1||C!==1)do if(p--,C--,0>C||ne[p]!==le[C]){var fe=`
|
|
46
|
-
`+ne[p].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=p&&0<=C);break}}}finally{$e=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Be(a):""}function Me(t,r){switch(t.tag){case 26:case 27:case 5:return Be(t.type);case 16:return Be("Lazy");case 13:return t.child!==r&&r!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return ut(t.type,!1);case 11:return ut(t.type.render,!1);case 1:return ut(t.type,!0);case 31:return Be("Activity");default:return""}}function vn(t){try{var r="",a=null;do r+=Me(t,a),a=t,t=t.return;while(t);return r}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var Wt=Object.prototype.hasOwnProperty,on=e.unstable_scheduleCallback,Kt=e.unstable_cancelCallback,$n=e.unstable_shouldYield,Dt=e.unstable_requestPaint,Et=e.unstable_now,Qt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,He=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,xt=e.log,nt=e.unstable_setDisableYieldValue,At=null,Mt=null;function Jt(t){if(typeof xt=="function"&&nt(t),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(At,t)}catch{}}var ot=Math.clz32?Math.clz32:Wd,mr=Math.log,An=Math.LN2;function Wd(t){return t>>>=0,t===0?32:31-(mr(t)/An|0)|0}var Mr=256,Nr=262144,co=4194304;function sr(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function dt(t,r,a){var p=t.pendingLanes;if(p===0)return 0;var C=0,A=t.suspendedLanes,B=t.pingedLanes;t=t.warmLanes;var G=p&134217727;return G!==0?(p=G&~A,p!==0?C=sr(p):(B&=G,B!==0?C=sr(B):a||(a=G&~t,a!==0&&(C=sr(a))))):(G=p&~A,G!==0?C=sr(G):B!==0?C=sr(B):a||(a=p&~t,a!==0&&(C=sr(a)))),C===0?0:r!==0&&r!==C&&(r&A)===0&&(A=C&-C,a=r&-r,A>=a||A===32&&(a&4194048)!==0)?r:C}function lt(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Os(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ji(){var t=co;return co<<=1,(co&62914560)===0&&(co=4194304),t}function Ls(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Tn(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Kd(t,r,a,p,C,A){var B=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var G=t.entanglements,ne=t.expirationTimes,le=t.hiddenUpdates;for(a=B&~a;0<a;){var fe=31-ot(a),ge=1<<fe;G[fe]=0,ne[fe]=-1;var ue=le[fe];if(ue!==null)for(le[fe]=null,fe=0;fe<ue.length;fe++){var de=ue[fe];de!==null&&(de.lane&=-536870913)}a&=~ge}p!==0&&Is(t,p,0),A!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=A&~(B&~r))}function Is(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var p=31-ot(r);t.entangledLanes|=r,t.entanglements[p]=t.entanglements[p]|1073741824|a&261930}function qn(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var p=31-ot(a),C=1<<p;C&r|t[p]&r&&(t[p]|=r),a&=~C}}function ec(t,r){var a=r&-r;return a=(a&42)!==0?1:Bs(a),(a&(t.suspendedLanes|r))!==0?0:a}function Bs(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function uo(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ho(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:mb(t.type))}function tc(t,r){var a=Q.p;try{return Q.p=t,r()}finally{Q.p=a}}var gr=Math.random().toString(36).slice(2),Ht="__reactFiber$"+gr,en="__reactProps$"+gr,Pe="__reactContainer$"+gr,fo="__reactEvents$"+gr,zs="__reactListeners$"+gr,Yd="__reactHandles$"+gr,nc="__reactResources$"+gr,es="__reactMarker$"+gr;function po(t){delete t[Ht],delete t[en],delete t[fo],delete t[zs],delete t[Yd]}function li(t){var r=t[Ht];if(r)return r;for(var a=t.parentNode;a;){if(r=a[Pe]||a[Ht]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Jy(t);t!==null;){if(a=t[Ht])return a;t=Jy(t)}return r}t=a,a=t.parentNode}return null}function ci(t){if(t=t[Ht]||t[Pe]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ts(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ui(t){var r=t[nc];return r||(r=t[nc]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Ot(t){t[es]=!0}var rc=new Set,ic={};function vr(t,r){di(t,r),di(t+"Capture",r)}function di(t,r){for(ic[t]=r,t=0;t<r.length;t++)rc.add(r[t])}var Xd=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]*$"),sc={},ac={};function Zd(t){return Wt.call(ac,t)?!0:Wt.call(sc,t)?!1:Xd.test(t)?ac[t]=!0:(sc[t]=!0,!1)}function Ps(t,r,a){if(Zd(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var p=r.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Fs(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function ar(t,r,a,p){if(p===null)t.removeAttribute(a);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+p)}}function _n(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function mo(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Hs(t,r,a){var p=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var C=p.get,A=p.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return C.call(this)},set:function(B){a=""+B,A.call(this,B)}}),Object.defineProperty(t,r,{enumerable:p.enumerable}),{getValue:function(){return a},setValue:function(B){a=""+B},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function go(t){if(!t._valueTracker){var r=mo(t)?"checked":"value";t._valueTracker=Hs(t,r,""+t[r])}}function oc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),p="";return t&&(p=mo(t)?t.checked?"true":"false":t.value),t=p,t!==a?(r.setValue(t),!0):!1}function Ut(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Qd=/[\n"\\]/g;function fn(t){return t.replace(Qd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Us(t,r,a,p,C,A,B,G){t.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?t.type=B:t.removeAttribute("type"),r!=null?B==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+_n(r)):t.value!==""+_n(r)&&(t.value=""+_n(r)):B!=="submit"&&B!=="reset"||t.removeAttribute("value"),r!=null?$s(t,B,_n(r)):a!=null?$s(t,B,_n(a)):p!=null&&t.removeAttribute("value"),C==null&&A!=null&&(t.defaultChecked=!!A),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?t.name=""+_n(G):t.removeAttribute("name")}function vo(t,r,a,p,C,A,B,G){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(t.type=A),r!=null||a!=null){if(!(A!=="submit"&&A!=="reset"||r!=null)){go(t);return}a=a!=null?""+_n(a):"",r=r!=null?""+_n(r):a,G||r===t.value||(t.value=r),t.defaultValue=r}p=p!=null?p:C,p=typeof p!="function"&&typeof p!="symbol"&&!!p,t.checked=G?t.checked:!!p,t.defaultChecked=!!p,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(t.name=B),go(t)}function $s(t,r,a){r==="number"&&Ut(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Z(t,r,a,p){if(t=t.options,r){r={};for(var C=0;C<a.length;C++)r["$"+a[C]]=!0;for(a=0;a<t.length;a++)C=r.hasOwnProperty("$"+t[a].value),t[a].selected!==C&&(t[a].selected=C),C&&p&&(t[a].defaultSelected=!0)}else{for(a=""+_n(a),r=null,C=0;C<t.length;C++){if(t[C].value===a){t[C].selected=!0,p&&(t[C].defaultSelected=!0);return}r!==null||t[C].disabled||(r=t[C])}r!==null&&(r.selected=!0)}}function be(t,r,a){if(r!=null&&(r=""+_n(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+_n(a):""}function Ue(t,r,a,p){if(r==null){if(p!=null){if(a!=null)throw Error(s(92));if(K(p)){if(1<p.length)throw Error(s(93));p=p[0]}a=p}a==null&&(a=""),r=a}a=_n(r),t.defaultValue=a,p=t.textContent,p===a&&p!==""&&p!==null&&(t.value=p),go(t)}function Le(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Ct=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 Vn(t,r,a){var p=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?p?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":p?t.setProperty(r,a):typeof a!="number"||a===0||Ct.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function ye(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var p in a)!a.hasOwnProperty(p)||r!=null&&r.hasOwnProperty(p)||(p.indexOf("--")===0?t.setProperty(p,""):p==="float"?t.cssFloat="":t[p]="");for(var C in r)p=r[C],r.hasOwnProperty(C)&&a[C]!==p&&Vn(t,C,p)}else for(var A in r)r.hasOwnProperty(A)&&Vn(t,A,r[A])}function we(t){if(t.indexOf("-")===-1)return!1;switch(t){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 ht=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"]]),$t=/^[\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 ln(t){return $t.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Lt(){}var hi=null;function Jd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qs=null,Vs=null;function qg(t){var r=ci(t);if(r&&(t=r.stateNode)){var a=t[en]||null;e:switch(t=r.stateNode,r.type){case"input":if(Us(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+fn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var p=a[r];if(p!==t&&p.form===t.form){var C=p[en]||null;if(!C)throw Error(s(90));Us(p,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(r=0;r<a.length;r++)p=a[r],p.form===t.form&&oc(p)}break e;case"textarea":be(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Z(t,!!a.multiple,r,!1)}}}var eh=!1;function Vg(t,r,a){if(eh)return t(r,a);eh=!0;try{var p=t(r);return p}finally{if(eh=!1,(qs!==null||Vs!==null)&&(Kc(),qs&&(r=qs,t=Vs,Vs=qs=null,qg(r),t)))for(r=0;r<t.length;r++)qg(t[r])}}function _o(t,r){var a=t.stateNode;if(a===null)return null;var p=a[en]||null;if(p===null)return null;a=p[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(t=t.type,p=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!p;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),th=!1;if(jr)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){th=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{th=!1}var fi=null,nh=null,lc=null;function Gg(){if(lc)return lc;var t,r=nh,a=r.length,p,C="value"in fi?fi.value:fi.textContent,A=C.length;for(t=0;t<a&&r[t]===C[t];t++);var B=a-t;for(p=1;p<=B&&r[a-p]===C[A-p];p++);return lc=C.slice(t,1<p?1-p:void 0)}function cc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function uc(){return!0}function Wg(){return!1}function yn(t){function r(a,p,C,A,B){this._reactName=a,this._targetInst=C,this.type=p,this.nativeEvent=A,this.target=B,this.currentTarget=null;for(var G in t)t.hasOwnProperty(G)&&(a=t[G],this[G]=a?a(A):A[G]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?uc:Wg,this.isPropagationStopped=Wg,this}return f(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=uc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=uc)},persist:function(){},isPersistent:uc}),r}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dc=yn(ns),bo=f({},ns,{view:0,detail:0}),Hk=yn(bo),rh,ih,xo,hc=f({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==xo&&(xo&&t.type==="mousemove"?(rh=t.screenX-xo.screenX,ih=t.screenY-xo.screenY):ih=rh=0,xo=t),rh)},movementY:function(t){return"movementY"in t?t.movementY:ih}}),Kg=yn(hc),Uk=f({},hc,{dataTransfer:0}),$k=yn(Uk),qk=f({},bo,{relatedTarget:0}),sh=yn(qk),Vk=f({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),Gk=yn(Vk),Wk=f({},ns,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Kk=yn(Wk),Yk=f({},ns,{data:0}),Yg=yn(Yk),Xk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zk={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"},Qk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jk(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Qk[t])?!!r[t]:!1}function ah(){return Jk}var eE=f({},bo,{key:function(t){if(t.key){var r=Xk[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=cc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Zk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(t){return t.type==="keypress"?cc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?cc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),tE=yn(eE),nE=f({},hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xg=yn(nE),rE=f({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),iE=yn(rE),sE=f({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),aE=yn(sE),oE=f({},hc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lE=yn(oE),cE=f({},ns,{newState:0,oldState:0}),uE=yn(cE),dE=[9,13,27,32],oh=jr&&"CompositionEvent"in window,So=null;jr&&"documentMode"in document&&(So=document.documentMode);var hE=jr&&"TextEvent"in window&&!So,Zg=jr&&(!oh||So&&8<So&&11>=So),Qg=" ",Jg=!1;function ev(t,r){switch(t){case"keyup":return dE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gs=!1;function fE(t,r){switch(t){case"compositionend":return tv(r);case"keypress":return r.which!==32?null:(Jg=!0,Qg);case"textInput":return t=r.data,t===Qg&&Jg?null:t;default:return null}}function pE(t,r){if(Gs)return t==="compositionend"||!oh&&ev(t,r)?(t=Gg(),lc=nh=fi=null,Gs=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Zg&&r.locale!=="ko"?null:r.data;default:return null}}var mE={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 nv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!mE[t.type]:r==="textarea"}function rv(t,r,a,p){qs?Vs?Vs.push(p):Vs=[p]:qs=p,r=tu(r,"onChange"),0<r.length&&(a=new dc("onChange","change",null,a,p),t.push({event:a,listeners:r}))}var wo=null,Co=null;function gE(t){Py(t,0)}function fc(t){var r=ts(t);if(oc(r))return t}function iv(t,r){if(t==="change")return r}var sv=!1;if(jr){var lh;if(jr){var ch="oninput"in document;if(!ch){var av=document.createElement("div");av.setAttribute("oninput","return;"),ch=typeof av.oninput=="function"}lh=ch}else lh=!1;sv=lh&&(!document.documentMode||9<document.documentMode)}function ov(){wo&&(wo.detachEvent("onpropertychange",lv),Co=wo=null)}function lv(t){if(t.propertyName==="value"&&fc(Co)){var r=[];rv(r,Co,t,Jd(t)),Vg(gE,r)}}function vE(t,r,a){t==="focusin"?(ov(),wo=r,Co=a,wo.attachEvent("onpropertychange",lv)):t==="focusout"&&ov()}function _E(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return fc(Co)}function yE(t,r){if(t==="click")return fc(r)}function bE(t,r){if(t==="input"||t==="change")return fc(r)}function xE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Rn=typeof Object.is=="function"?Object.is:xE;function ko(t,r){if(Rn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),p=Object.keys(r);if(a.length!==p.length)return!1;for(p=0;p<a.length;p++){var C=a[p];if(!Wt.call(r,C)||!Rn(t[C],r[C]))return!1}return!0}function cv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function uv(t,r){var a=cv(t);t=0;for(var p;a;){if(a.nodeType===3){if(p=t+a.textContent.length,t<=r&&p>=r)return{node:a,offset:r-t};t=p}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=cv(a)}}function dv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?dv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function hv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Ut(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Ut(t.document)}return r}function uh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var SE=jr&&"documentMode"in document&&11>=document.documentMode,Ws=null,dh=null,Eo=null,hh=!1;function fv(t,r,a){var p=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hh||Ws==null||Ws!==Ut(p)||(p=Ws,"selectionStart"in p&&uh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Eo&&ko(Eo,p)||(Eo=p,p=tu(dh,"onSelect"),0<p.length&&(r=new dc("onSelect","select",null,r,a),t.push({event:r,listeners:p}),r.target=Ws)))}function rs(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Ks={animationend:rs("Animation","AnimationEnd"),animationiteration:rs("Animation","AnimationIteration"),animationstart:rs("Animation","AnimationStart"),transitionrun:rs("Transition","TransitionRun"),transitionstart:rs("Transition","TransitionStart"),transitioncancel:rs("Transition","TransitionCancel"),transitionend:rs("Transition","TransitionEnd")},fh={},pv={};jr&&(pv=document.createElement("div").style,"AnimationEvent"in window||(delete Ks.animationend.animation,delete Ks.animationiteration.animation,delete Ks.animationstart.animation),"TransitionEvent"in window||delete Ks.transitionend.transition);function is(t){if(fh[t])return fh[t];if(!Ks[t])return t;var r=Ks[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in pv)return fh[t]=r[a];return t}var mv=is("animationend"),gv=is("animationiteration"),vv=is("animationstart"),wE=is("transitionrun"),CE=is("transitionstart"),kE=is("transitioncancel"),_v=is("transitionend"),yv=new Map,ph="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(" ");ph.push("scrollEnd");function or(t,r){yv.set(t,r),vr(r,[t])}var pc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Gn=[],Ys=0,mh=0;function mc(){for(var t=Ys,r=mh=Ys=0;r<t;){var a=Gn[r];Gn[r++]=null;var p=Gn[r];Gn[r++]=null;var C=Gn[r];Gn[r++]=null;var A=Gn[r];if(Gn[r++]=null,p!==null&&C!==null){var B=p.pending;B===null?C.next=C:(C.next=B.next,B.next=C),p.pending=C}A!==0&&bv(a,C,A)}}function gc(t,r,a,p){Gn[Ys++]=t,Gn[Ys++]=r,Gn[Ys++]=a,Gn[Ys++]=p,mh|=p,t.lanes|=p,t=t.alternate,t!==null&&(t.lanes|=p)}function gh(t,r,a,p){return gc(t,r,a,p),vc(t)}function ss(t,r){return gc(t,null,null,r),vc(t)}function bv(t,r,a){t.lanes|=a;var p=t.alternate;p!==null&&(p.lanes|=a);for(var C=!1,A=t.return;A!==null;)A.childLanes|=a,p=A.alternate,p!==null&&(p.childLanes|=a),A.tag===22&&(t=A.stateNode,t===null||t._visibility&1||(C=!0)),t=A,A=A.return;return t.tag===3?(A=t.stateNode,C&&r!==null&&(C=31-ot(a),t=A.hiddenUpdates,p=t[C],p===null?t[C]=[r]:p.push(r),r.lane=a|536870912),A):null}function vc(t){if(50<Ko)throw Ko=0,Ef=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Xs={};function EE(t,r,a,p){this.tag=t,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=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dn(t,r,a,p){return new EE(t,r,a,p)}function vh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Or(t,r){var a=t.alternate;return a===null?(a=Dn(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function xv(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function _c(t,r,a,p,C,A){var B=0;if(p=t,typeof t=="function")vh(t)&&(B=1);else if(typeof t=="string")B=M2(t,a,X.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=Dn(31,a,r,C),t.elementType=O,t.lanes=A,t;case w:return as(a.children,C,A,r);case _:B=8,C|=24;break;case y:return t=Dn(12,a,r,C|2),t.elementType=y,t.lanes=A,t;case M:return t=Dn(13,a,r,C),t.elementType=M,t.lanes=A,t;case R:return t=Dn(19,a,r,C),t.elementType=R,t.lanes=A,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:B=10;break e;case v:B=9;break e;case E:B=11;break e;case N:B=14;break e;case D:B=16,p=null;break e}B=29,a=Error(s(130,t===null?"null":typeof t,"")),p=null}return r=Dn(B,a,r,C),r.elementType=t,r.type=p,r.lanes=A,r}function as(t,r,a,p){return t=Dn(7,t,p,r),t.lanes=a,t}function _h(t,r,a){return t=Dn(6,t,null,r),t.lanes=a,t}function Sv(t){var r=Dn(18,null,null,0);return r.stateNode=t,r}function yh(t,r,a){return r=Dn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var wv=new WeakMap;function Wn(t,r){if(typeof t=="object"&&t!==null){var a=wv.get(t);return a!==void 0?a:(r={value:t,source:r,stack:vn(r)},wv.set(t,r),r)}return{value:t,source:r,stack:vn(r)}}var Zs=[],Qs=0,yc=null,Ao=0,Kn=[],Yn=0,pi=null,_r=1,yr="";function Lr(t,r){Zs[Qs++]=Ao,Zs[Qs++]=yc,yc=t,Ao=r}function Cv(t,r,a){Kn[Yn++]=_r,Kn[Yn++]=yr,Kn[Yn++]=pi,pi=t;var p=_r;t=yr;var C=32-ot(p)-1;p&=~(1<<C),a+=1;var A=32-ot(r)+C;if(30<A){var B=C-C%5;A=(p&(1<<B)-1).toString(32),p>>=B,C-=B,_r=1<<32-ot(r)+C|a<<C|p,yr=A+t}else _r=1<<A|a<<C|p,yr=t}function bh(t){t.return!==null&&(Lr(t,1),Cv(t,1,0))}function xh(t){for(;t===yc;)yc=Zs[--Qs],Zs[Qs]=null,Ao=Zs[--Qs],Zs[Qs]=null;for(;t===pi;)pi=Kn[--Yn],Kn[Yn]=null,yr=Kn[--Yn],Kn[Yn]=null,_r=Kn[--Yn],Kn[Yn]=null}function kv(t,r){Kn[Yn++]=_r,Kn[Yn++]=yr,Kn[Yn++]=pi,_r=r.id,yr=r.overflow,pi=t}var tn=null,St=null,rt=!1,mi=null,Xn=!1,Sh=Error(s(519));function gi(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw To(Wn(r,t)),Sh}function Ev(t){var r=t.stateNode,a=t.type,p=t.memoizedProps;switch(r[Ht]=t,r[en]=p,a){case"dialog":Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":case"embed":Qe("load",r);break;case"video":case"audio":for(a=0;a<Xo.length;a++)Qe(Xo[a],r);break;case"source":Qe("error",r);break;case"img":case"image":case"link":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"input":Qe("invalid",r),vo(r,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Qe("invalid",r);break;case"textarea":Qe("invalid",r),Ue(r,p.value,p.defaultValue,p.children)}a=p.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||p.suppressHydrationWarning===!0||$y(r.textContent,a)?(p.popover!=null&&(Qe("beforetoggle",r),Qe("toggle",r)),p.onScroll!=null&&Qe("scroll",r),p.onScrollEnd!=null&&Qe("scrollend",r),p.onClick!=null&&(r.onclick=Lt),r=!0):r=!1,r||gi(t,!0)}function Av(t){for(tn=t.return;tn;)switch(tn.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:tn=tn.return}}function Js(t){if(t!==tn)return!1;if(!rt)return Av(t),rt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Hf(t.type,t.memoizedProps)),a=!a),a&&St&&gi(t),Av(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));St=Qy(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));St=Qy(t)}else r===27?(r=St,Di(t.type)?(t=Gf,Gf=null,St=t):St=r):St=tn?Qn(t.stateNode.nextSibling):null;return!0}function os(){St=tn=null,rt=!1}function wh(){var t=mi;return t!==null&&(wn===null?wn=t:wn.push.apply(wn,t),mi=null),t}function To(t){mi===null?mi=[t]:mi.push(t)}var Ch=I(null),ls=null,Ir=null;function vi(t,r,a){z(Ch,r._currentValue),r._currentValue=a}function Br(t){t._currentValue=Ch.current,L(Ch)}function kh(t,r,a){for(;t!==null;){var p=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,p!==null&&(p.childLanes|=r)):p!==null&&(p.childLanes&r)!==r&&(p.childLanes|=r),t===a)break;t=t.return}}function Eh(t,r,a,p){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var A=C.dependencies;if(A!==null){var B=C.child;A=A.firstContext;e:for(;A!==null;){var G=A;A=C;for(var ne=0;ne<r.length;ne++)if(G.context===r[ne]){A.lanes|=a,G=A.alternate,G!==null&&(G.lanes|=a),kh(A.return,a,t),p||(B=null);break e}A=G.next}}else if(C.tag===18){if(B=C.return,B===null)throw Error(s(341));B.lanes|=a,A=B.alternate,A!==null&&(A.lanes|=a),kh(B,a,t),B=null}else B=C.child;if(B!==null)B.return=C;else for(B=C;B!==null;){if(B===t){B=null;break}if(C=B.sibling,C!==null){C.return=B.return,B=C;break}B=B.return}C=B}}function ea(t,r,a,p){t=null;for(var C=r,A=!1;C!==null;){if(!A){if((C.flags&524288)!==0)A=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var B=C.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var G=C.type;Rn(C.pendingProps.value,B.value)||(t!==null?t.push(G):t=[G])}}else if(C===W.current){if(B=C.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(tl):t=[tl])}C=C.return}t!==null&&Eh(r,t,a,p),r.flags|=262144}function bc(t){for(t=t.firstContext;t!==null;){if(!Rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function cs(t){ls=t,Ir=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function nn(t){return Tv(ls,t)}function xc(t,r){return ls===null&&cs(t),Tv(t,r)}function Tv(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ir===null){if(t===null)throw Error(s(308));Ir=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ir=Ir.next=r;return a}var AE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,p){t.push(p)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},TE=e.unstable_scheduleCallback,RE=e.unstable_NormalPriority,It={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ah(){return{controller:new AE,data:new Map,refCount:0}}function Ro(t){t.refCount--,t.refCount===0&&TE(RE,function(){t.controller.abort()})}var Do=null,Th=0,ta=0,na=null;function DE(t,r){if(Do===null){var a=Do=[];Th=0,ta=Nf(),na={status:"pending",value:void 0,then:function(p){a.push(p)}}}return Th++,r.then(Rv,Rv),r}function Rv(){if(--Th===0&&Do!==null){na!==null&&(na.status="fulfilled");var t=Do;Do=null,ta=0,na=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function ME(t,r){var a=[],p={status:"pending",value:null,reason:null,then:function(C){a.push(C)}};return t.then(function(){p.status="fulfilled",p.value=r;for(var C=0;C<a.length;C++)(0,a[C])(r)},function(C){for(p.status="rejected",p.reason=C,C=0;C<a.length;C++)(0,a[C])(void 0)}),p}var Dv=V.S;V.S=function(t,r){fy=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&DE(t,r),Dv!==null&&Dv(t,r)};var us=I(null);function Rh(){var t=us.current;return t!==null?t:_t.pooledCache}function Sc(t,r){r===null?z(us,us.current):z(us,r.pool)}function Mv(){var t=Rh();return t===null?null:{parent:It._currentValue,pool:t}}var ra=Error(s(460)),Dh=Error(s(474)),wc=Error(s(542)),Cc={then:function(){}};function Nv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function jv(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(Lt,Lt),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Lv(t),t;default:if(typeof r.status=="string")r.then(Lt,Lt);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(p){if(r.status==="pending"){var C=r;C.status="fulfilled",C.value=p}},function(p){if(r.status==="pending"){var C=r;C.status="rejected",C.reason=p}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Lv(t),t}throw hs=r,ra}}function ds(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(hs=a,ra):a}}var hs=null;function Ov(){if(hs===null)throw Error(s(459));var t=hs;return hs=null,t}function Lv(t){if(t===ra||t===wc)throw Error(s(483))}var ia=null,Mo=0;function kc(t){var r=Mo;return Mo+=1,ia===null&&(ia=[]),jv(ia,t,r)}function No(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function Ec(t,r){throw r.$$typeof===b?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Iv(t){function r(se,ie){if(t){var oe=se.deletions;oe===null?(se.deletions=[ie],se.flags|=16):oe.push(ie)}}function a(se,ie){if(!t)return null;for(;ie!==null;)r(se,ie),ie=ie.sibling;return null}function p(se){for(var ie=new Map;se!==null;)se.key!==null?ie.set(se.key,se):ie.set(se.index,se),se=se.sibling;return ie}function C(se,ie){return se=Or(se,ie),se.index=0,se.sibling=null,se}function A(se,ie,oe){return se.index=oe,t?(oe=se.alternate,oe!==null?(oe=oe.index,oe<ie?(se.flags|=67108866,ie):oe):(se.flags|=67108866,ie)):(se.flags|=1048576,ie)}function B(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function G(se,ie,oe,me){return ie===null||ie.tag!==6?(ie=_h(oe,se.mode,me),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function ne(se,ie,oe,me){var Ie=oe.type;return Ie===w?fe(se,ie,oe.props.children,me,oe.key):ie!==null&&(ie.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===D&&ds(Ie)===ie.type)?(ie=C(ie,oe.props),No(ie,oe),ie.return=se,ie):(ie=_c(oe.type,oe.key,oe.props,null,se.mode,me),No(ie,oe),ie.return=se,ie)}function le(se,ie,oe,me){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==oe.containerInfo||ie.stateNode.implementation!==oe.implementation?(ie=yh(oe,se.mode,me),ie.return=se,ie):(ie=C(ie,oe.children||[]),ie.return=se,ie)}function fe(se,ie,oe,me,Ie){return ie===null||ie.tag!==7?(ie=as(oe,se.mode,me,Ie),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function ge(se,ie,oe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=_h(""+ie,se.mode,oe),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:return oe=_c(ie.type,ie.key,ie.props,null,se.mode,oe),No(oe,ie),oe.return=se,oe;case k:return ie=yh(ie,se.mode,oe),ie.return=se,ie;case D:return ie=ds(ie),ge(se,ie,oe)}if(K(ie)||U(ie))return ie=as(ie,se.mode,oe,null),ie.return=se,ie;if(typeof ie.then=="function")return ge(se,kc(ie),oe);if(ie.$$typeof===x)return ge(se,xc(se,ie),oe);Ec(se,ie)}return null}function ue(se,ie,oe,me){var Ie=ie!==null?ie.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Ie!==null?null:G(se,ie,""+oe,me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return oe.key===Ie?ne(se,ie,oe,me):null;case k:return oe.key===Ie?le(se,ie,oe,me):null;case D:return oe=ds(oe),ue(se,ie,oe,me)}if(K(oe)||U(oe))return Ie!==null?null:fe(se,ie,oe,me,null);if(typeof oe.then=="function")return ue(se,ie,kc(oe),me);if(oe.$$typeof===x)return ue(se,ie,xc(se,oe),me);Ec(se,oe)}return null}function de(se,ie,oe,me,Ie){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return se=se.get(oe)||null,G(ie,se,""+me,Ie);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return se=se.get(me.key===null?oe:me.key)||null,ne(ie,se,me,Ie);case k:return se=se.get(me.key===null?oe:me.key)||null,le(ie,se,me,Ie);case D:return me=ds(me),de(se,ie,oe,me,Ie)}if(K(me)||U(me))return se=se.get(oe)||null,fe(ie,se,me,Ie,null);if(typeof me.then=="function")return de(se,ie,oe,kc(me),Ie);if(me.$$typeof===x)return de(se,ie,oe,xc(ie,me),Ie);Ec(ie,me)}return null}function Ee(se,ie,oe,me){for(var Ie=null,st=null,Ne=ie,We=ie=0,tt=null;Ne!==null&&We<oe.length;We++){Ne.index>We?(tt=Ne,Ne=null):tt=Ne.sibling;var at=ue(se,Ne,oe[We],me);if(at===null){Ne===null&&(Ne=tt);break}t&&Ne&&at.alternate===null&&r(se,Ne),ie=A(at,ie,We),st===null?Ie=at:st.sibling=at,st=at,Ne=tt}if(We===oe.length)return a(se,Ne),rt&&Lr(se,We),Ie;if(Ne===null){for(;We<oe.length;We++)Ne=ge(se,oe[We],me),Ne!==null&&(ie=A(Ne,ie,We),st===null?Ie=Ne:st.sibling=Ne,st=Ne);return rt&&Lr(se,We),Ie}for(Ne=p(Ne);We<oe.length;We++)tt=de(Ne,se,We,oe[We],me),tt!==null&&(t&&tt.alternate!==null&&Ne.delete(tt.key===null?We:tt.key),ie=A(tt,ie,We),st===null?Ie=tt:st.sibling=tt,st=tt);return t&&Ne.forEach(function(Li){return r(se,Li)}),rt&&Lr(se,We),Ie}function Fe(se,ie,oe,me){if(oe==null)throw Error(s(151));for(var Ie=null,st=null,Ne=ie,We=ie=0,tt=null,at=oe.next();Ne!==null&&!at.done;We++,at=oe.next()){Ne.index>We?(tt=Ne,Ne=null):tt=Ne.sibling;var Li=ue(se,Ne,at.value,me);if(Li===null){Ne===null&&(Ne=tt);break}t&&Ne&&Li.alternate===null&&r(se,Ne),ie=A(Li,ie,We),st===null?Ie=Li:st.sibling=Li,st=Li,Ne=tt}if(at.done)return a(se,Ne),rt&&Lr(se,We),Ie;if(Ne===null){for(;!at.done;We++,at=oe.next())at=ge(se,at.value,me),at!==null&&(ie=A(at,ie,We),st===null?Ie=at:st.sibling=at,st=at);return rt&&Lr(se,We),Ie}for(Ne=p(Ne);!at.done;We++,at=oe.next())at=de(Ne,se,We,at.value,me),at!==null&&(t&&at.alternate!==null&&Ne.delete(at.key===null?We:at.key),ie=A(at,ie,We),st===null?Ie=at:st.sibling=at,st=at);return t&&Ne.forEach(function(U2){return r(se,U2)}),rt&&Lr(se,We),Ie}function vt(se,ie,oe,me){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:e:{for(var Ie=oe.key;ie!==null;){if(ie.key===Ie){if(Ie=oe.type,Ie===w){if(ie.tag===7){a(se,ie.sibling),me=C(ie,oe.props.children),me.return=se,se=me;break e}}else if(ie.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===D&&ds(Ie)===ie.type){a(se,ie.sibling),me=C(ie,oe.props),No(me,oe),me.return=se,se=me;break e}a(se,ie);break}else r(se,ie);ie=ie.sibling}oe.type===w?(me=as(oe.props.children,se.mode,me,oe.key),me.return=se,se=me):(me=_c(oe.type,oe.key,oe.props,null,se.mode,me),No(me,oe),me.return=se,se=me)}return B(se);case k:e:{for(Ie=oe.key;ie!==null;){if(ie.key===Ie)if(ie.tag===4&&ie.stateNode.containerInfo===oe.containerInfo&&ie.stateNode.implementation===oe.implementation){a(se,ie.sibling),me=C(ie,oe.children||[]),me.return=se,se=me;break e}else{a(se,ie);break}else r(se,ie);ie=ie.sibling}me=yh(oe,se.mode,me),me.return=se,se=me}return B(se);case D:return oe=ds(oe),vt(se,ie,oe,me)}if(K(oe))return Ee(se,ie,oe,me);if(U(oe)){if(Ie=U(oe),typeof Ie!="function")throw Error(s(150));return oe=Ie.call(oe),Fe(se,ie,oe,me)}if(typeof oe.then=="function")return vt(se,ie,kc(oe),me);if(oe.$$typeof===x)return vt(se,ie,xc(se,oe),me);Ec(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ie!==null&&ie.tag===6?(a(se,ie.sibling),me=C(ie,oe),me.return=se,se=me):(a(se,ie),me=_h(oe,se.mode,me),me.return=se,se=me),B(se)):a(se,ie)}return function(se,ie,oe,me){try{Mo=0;var Ie=vt(se,ie,oe,me);return ia=null,Ie}catch(Ne){if(Ne===ra||Ne===wc)throw Ne;var st=Dn(29,Ne,null,se.mode);return st.lanes=me,st.return=se,st}finally{}}}var fs=Iv(!0),Bv=Iv(!1),_i=!1;function Mh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function yi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function bi(t,r,a){var p=t.updateQueue;if(p===null)return null;if(p=p.shared,(ct&2)!==0){var C=p.pending;return C===null?r.next=r:(r.next=C.next,C.next=r),p.pending=r,r=vc(t),bv(t,null,a),r}return gc(t,p,r,a),vc(t)}function jo(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var p=r.lanes;p&=t.pendingLanes,a|=p,r.lanes=a,qn(t,a)}}function jh(t,r){var a=t.updateQueue,p=t.alternate;if(p!==null&&(p=p.updateQueue,a===p)){var C=null,A=null;if(a=a.firstBaseUpdate,a!==null){do{var B={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};A===null?C=A=B:A=A.next=B,a=a.next}while(a!==null);A===null?C=A=r:A=A.next=r}else C=A=r;a={baseState:p.baseState,firstBaseUpdate:C,lastBaseUpdate:A,shared:p.shared,callbacks:p.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Oh=!1;function Oo(){if(Oh){var t=na;if(t!==null)throw t}}function Lo(t,r,a,p){Oh=!1;var C=t.updateQueue;_i=!1;var A=C.firstBaseUpdate,B=C.lastBaseUpdate,G=C.shared.pending;if(G!==null){C.shared.pending=null;var ne=G,le=ne.next;ne.next=null,B===null?A=le:B.next=le,B=ne;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,G=fe.lastBaseUpdate,G!==B&&(G===null?fe.firstBaseUpdate=le:G.next=le,fe.lastBaseUpdate=ne))}if(A!==null){var ge=C.baseState;B=0,fe=le=ne=null,G=A;do{var ue=G.lane&-536870913,de=ue!==G.lane;if(de?(et&ue)===ue:(p&ue)===ue){ue!==0&&ue===ta&&(Oh=!0),fe!==null&&(fe=fe.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var Ee=t,Fe=G;ue=r;var vt=a;switch(Fe.tag){case 1:if(Ee=Fe.payload,typeof Ee=="function"){ge=Ee.call(vt,ge,ue);break e}ge=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Fe.payload,ue=typeof Ee=="function"?Ee.call(vt,ge,ue):Ee,ue==null)break e;ge=f({},ge,ue);break e;case 2:_i=!0}}ue=G.callback,ue!==null&&(t.flags|=64,de&&(t.flags|=8192),de=C.callbacks,de===null?C.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:G.tag,payload:G.payload,callback:G.callback,next:null},fe===null?(le=fe=de,ne=ge):fe=fe.next=de,B|=ue;if(G=G.next,G===null){if(G=C.shared.pending,G===null)break;de=G,G=de.next,de.next=null,C.lastBaseUpdate=de,C.shared.pending=null}}while(!0);fe===null&&(ne=ge),C.baseState=ne,C.firstBaseUpdate=le,C.lastBaseUpdate=fe,A===null&&(C.shared.lanes=0),ki|=B,t.lanes=B,t.memoizedState=ge}}function zv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Pv(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)zv(a[t],r)}var sa=I(null),Ac=I(0);function Fv(t,r){t=Gr,z(Ac,t),z(sa,r),Gr=t|r.baseLanes}function Lh(){z(Ac,Gr),z(sa,sa.current)}function Ih(){Gr=Ac.current,L(sa),L(Ac)}var Mn=I(null),Zn=null;function xi(t){var r=t.alternate;z(Nt,Nt.current&1),z(Mn,t),Zn===null&&(r===null||sa.current!==null||r.memoizedState!==null)&&(Zn=t)}function Bh(t){z(Nt,Nt.current),z(Mn,t),Zn===null&&(Zn=t)}function Hv(t){t.tag===22?(z(Nt,Nt.current),z(Mn,t),Zn===null&&(Zn=t)):Si()}function Si(){z(Nt,Nt.current),z(Mn,Mn.current)}function Nn(t){L(Mn),Zn===t&&(Zn=null),L(Nt)}var Nt=I(0);function Tc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qf(a)||Vf(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var zr=0,Ge=null,mt=null,Bt=null,Rc=!1,aa=!1,ps=!1,Dc=0,Io=0,oa=null,NE=0;function Tt(){throw Error(s(321))}function zh(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Rn(t[a],r[a]))return!1;return!0}function Ph(t,r,a,p,C,A){return zr=A,Ge=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,V.H=t===null||t.memoizedState===null?C_:ef,ps=!1,A=a(p,C),ps=!1,aa&&(A=$v(r,a,p,C)),Uv(t),A}function Uv(t){V.H=Po;var r=mt!==null&&mt.next!==null;if(zr=0,Bt=mt=Ge=null,Rc=!1,Io=0,oa=null,r)throw Error(s(300));t===null||zt||(t=t.dependencies,t!==null&&bc(t)&&(zt=!0))}function $v(t,r,a,p){Ge=t;var C=0;do{if(aa&&(oa=null),Io=0,aa=!1,25<=C)throw Error(s(301));if(C+=1,Bt=mt=null,t.updateQueue!=null){var A=t.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}V.H=k_,A=r(a,p)}while(aa);return A}function jE(){var t=V.H,r=t.useState()[0];return r=typeof r.then=="function"?Bo(r):r,t=t.useState()[0],(mt!==null?mt.memoizedState:null)!==t&&(Ge.flags|=1024),r}function Fh(){var t=Dc!==0;return Dc=0,t}function Hh(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Uh(t){if(Rc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Rc=!1}zr=0,Bt=mt=Ge=null,aa=!1,Io=Dc=0,oa=null}function pn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ge.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function jt(){if(mt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=mt.next;var r=Bt===null?Ge.memoizedState:Bt.next;if(r!==null)Bt=r,mt=t;else{if(t===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));mt=t,t={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Bt===null?Ge.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bo(t){var r=Io;return Io+=1,oa===null&&(oa=[]),t=jv(oa,t,r),r=Ge,(Bt===null?r.memoizedState:Bt.next)===null&&(r=r.alternate,V.H=r===null||r.memoizedState===null?C_:ef),t}function Nc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Bo(t);if(t.$$typeof===x)return nn(t)}throw Error(s(438,String(t)))}function $h(t){var r=null,a=Ge.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var p=Ge.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(r={data:p.data.map(function(C){return C.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Mc(),Ge.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),p=0;p<t;p++)a[p]=P;return r.index++,a}function Pr(t,r){return typeof r=="function"?r(t):r}function jc(t){var r=jt();return qh(r,mt,t)}function qh(t,r,a){var p=t.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=a;var C=t.baseQueue,A=p.pending;if(A!==null){if(C!==null){var B=C.next;C.next=A.next,A.next=B}r.baseQueue=C=A,p.pending=null}if(A=t.baseState,C===null)t.memoizedState=A;else{r=C.next;var G=B=null,ne=null,le=r,fe=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(et&ge)===ge:(zr&ge)===ge){var ue=le.revertLane;if(ue===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===ta&&(fe=!0);else if((zr&ue)===ue){le=le.next,ue===ta&&(fe=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ne===null?(G=ne=ge,B=A):ne=ne.next=ge,Ge.lanes|=ue,ki|=ue;ge=le.action,ps&&a(A,ge),A=le.hasEagerState?le.eagerState:a(A,ge)}else ue={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ne===null?(G=ne=ue,B=A):ne=ne.next=ue,Ge.lanes|=ge,ki|=ge;le=le.next}while(le!==null&&le!==r);if(ne===null?B=A:ne.next=G,!Rn(A,t.memoizedState)&&(zt=!0,fe&&(a=na,a!==null)))throw a;t.memoizedState=A,t.baseState=B,t.baseQueue=ne,p.lastRenderedState=A}return C===null&&(p.lanes=0),[t.memoizedState,p.dispatch]}function Vh(t){var r=jt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var p=a.dispatch,C=a.pending,A=r.memoizedState;if(C!==null){a.pending=null;var B=C=C.next;do A=t(A,B.action),B=B.next;while(B!==C);Rn(A,r.memoizedState)||(zt=!0),r.memoizedState=A,r.baseQueue===null&&(r.baseState=A),a.lastRenderedState=A}return[A,p]}function qv(t,r,a){var p=Ge,C=jt(),A=rt;if(A){if(a===void 0)throw Error(s(407));a=a()}else a=r();var B=!Rn((mt||C).memoizedState,a);if(B&&(C.memoizedState=a,zt=!0),C=C.queue,Kh(Wv.bind(null,p,C,t),[t]),C.getSnapshot!==r||B||Bt!==null&&Bt.memoizedState.tag&1){if(p.flags|=2048,la(9,{destroy:void 0},Gv.bind(null,p,C,a,r),null),_t===null)throw Error(s(349));A||(zr&127)!==0||Vv(p,r,a)}return a}function Vv(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ge.updateQueue,r===null?(r=Mc(),Ge.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Gv(t,r,a,p){r.value=a,r.getSnapshot=p,Kv(r)&&Yv(t)}function Wv(t,r,a){return a(function(){Kv(r)&&Yv(t)})}function Kv(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Rn(t,a)}catch{return!0}}function Yv(t){var r=ss(t,2);r!==null&&Cn(r,t,2)}function Gh(t){var r=pn();if(typeof t=="function"){var a=t;if(t=a(),ps){Jt(!0);try{a()}finally{Jt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:t},r}function Xv(t,r,a,p){return t.baseState=a,qh(t,mt,typeof p=="function"?p:Pr)}function OE(t,r,a,p,C){if(Ic(t))throw Error(s(485));if(t=r.action,t!==null){var A={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){A.listeners.push(B)}};V.T!==null?a(!0):A.isTransition=!1,p(A),a=r.pending,a===null?(A.next=r.pending=A,Zv(r,A)):(A.next=a.next,r.pending=a.next=A)}}function Zv(t,r){var a=r.action,p=r.payload,C=t.state;if(r.isTransition){var A=V.T,B={};V.T=B;try{var G=a(C,p),ne=V.S;ne!==null&&ne(B,G),Qv(t,r,G)}catch(le){Wh(t,r,le)}finally{A!==null&&B.types!==null&&(A.types=B.types),V.T=A}}else try{A=a(C,p),Qv(t,r,A)}catch(le){Wh(t,r,le)}}function Qv(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(p){Jv(t,r,p)},function(p){return Wh(t,r,p)}):Jv(t,r,a)}function Jv(t,r,a){r.status="fulfilled",r.value=a,e_(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Zv(t,a)))}function Wh(t,r,a){var p=t.pending;if(t.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=a,e_(r),r=r.next;while(r!==p)}t.action=null}function e_(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function t_(t,r){return r}function n_(t,r){if(rt){var a=_t.formState;if(a!==null){e:{var p=Ge;if(rt){if(St){t:{for(var C=St,A=Xn;C.nodeType!==8;){if(!A){C=null;break t}if(C=Qn(C.nextSibling),C===null){C=null;break t}}A=C.data,C=A==="F!"||A==="F"?C:null}if(C){St=Qn(C.nextSibling),p=C.data==="F!";break e}}gi(p)}p=!1}p&&(r=a[0])}}return a=pn(),a.memoizedState=a.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t_,lastRenderedState:r},a.queue=p,a=x_.bind(null,Ge,p),p.dispatch=a,p=Gh(!1),A=Jh.bind(null,Ge,!1,p.queue),p=pn(),C={state:r,dispatch:null,action:t,pending:null},p.queue=C,a=OE.bind(null,Ge,C,A,a),C.dispatch=a,p.memoizedState=t,[r,a,!1]}function r_(t){var r=jt();return i_(r,mt,t)}function i_(t,r,a){if(r=qh(t,r,t_)[0],t=jc(Pr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=Bo(r)}catch(B){throw B===ra?wc:B}else p=r;r=jt();var C=r.queue,A=C.dispatch;return a!==r.memoizedState&&(Ge.flags|=2048,la(9,{destroy:void 0},LE.bind(null,C,a),null)),[p,A,t]}function LE(t,r){t.action=r}function s_(t){var r=jt(),a=mt;if(a!==null)return i_(r,a,t);jt(),r=r.memoizedState,a=jt();var p=a.queue.dispatch;return a.memoizedState=t,[r,p,!1]}function la(t,r,a,p){return t={tag:t,create:a,deps:p,inst:r,next:null},r=Ge.updateQueue,r===null&&(r=Mc(),Ge.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(p=a.next,a.next=t,t.next=p,r.lastEffect=t),t}function a_(){return jt().memoizedState}function Oc(t,r,a,p){var C=pn();Ge.flags|=t,C.memoizedState=la(1|r,{destroy:void 0},a,p===void 0?null:p)}function Lc(t,r,a,p){var C=jt();p=p===void 0?null:p;var A=C.memoizedState.inst;mt!==null&&p!==null&&zh(p,mt.memoizedState.deps)?C.memoizedState=la(r,A,a,p):(Ge.flags|=t,C.memoizedState=la(1|r,A,a,p))}function o_(t,r){Oc(8390656,8,t,r)}function Kh(t,r){Lc(2048,8,t,r)}function IE(t){Ge.flags|=4;var r=Ge.updateQueue;if(r===null)r=Mc(),Ge.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function l_(t){var r=jt().memoizedState;return IE({ref:r,nextImpl:t}),function(){if((ct&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function c_(t,r){return Lc(4,2,t,r)}function u_(t,r){return Lc(4,4,t,r)}function d_(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function h_(t,r,a){a=a!=null?a.concat([t]):null,Lc(4,4,d_.bind(null,r,t),a)}function Yh(){}function f_(t,r){var a=jt();r=r===void 0?null:r;var p=a.memoizedState;return r!==null&&zh(r,p[1])?p[0]:(a.memoizedState=[t,r],t)}function p_(t,r){var a=jt();r=r===void 0?null:r;var p=a.memoizedState;if(r!==null&&zh(r,p[1]))return p[0];if(p=t(),ps){Jt(!0);try{t()}finally{Jt(!1)}}return a.memoizedState=[p,r],p}function Xh(t,r,a){return a===void 0||(zr&1073741824)!==0&&(et&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=my(),Ge.lanes|=t,ki|=t,a)}function m_(t,r,a,p){return Rn(a,r)?a:sa.current!==null?(t=Xh(t,a,p),Rn(t,r)||(zt=!0),t):(zr&42)===0||(zr&1073741824)!==0&&(et&261930)===0?(zt=!0,t.memoizedState=a):(t=my(),Ge.lanes|=t,ki|=t,r)}function g_(t,r,a,p,C){var A=Q.p;Q.p=A!==0&&8>A?A:8;var B=V.T,G={};V.T=G,Jh(t,!1,r,a);try{var ne=C(),le=V.S;if(le!==null&&le(G,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var fe=ME(ne,p);zo(t,r,fe,Ln(t))}else zo(t,r,p,Ln(t))}catch(ge){zo(t,r,{then:function(){},status:"rejected",reason:ge},Ln())}finally{Q.p=A,B!==null&&G.types!==null&&(B.types=G.types),V.T=B}}function BE(){}function Zh(t,r,a,p){if(t.tag!==5)throw Error(s(476));var C=v_(t).queue;g_(t,C,r,J,a===null?BE:function(){return __(t),a(p)})}function v_(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:J},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function __(t){var r=v_(t);r.next===null&&(r=t.alternate.memoizedState),zo(t,r.next.queue,{},Ln())}function Qh(){return nn(tl)}function y_(){return jt().memoizedState}function b_(){return jt().memoizedState}function zE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Ln();t=yi(a);var p=bi(r,t,a);p!==null&&(Cn(p,r,a),jo(p,r,a)),r={cache:Ah()},t.payload=r;return}r=r.return}}function PE(t,r,a){var p=Ln();a={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ic(t)?S_(r,a):(a=gh(t,r,a,p),a!==null&&(Cn(a,t,p),w_(a,r,p)))}function x_(t,r,a){var p=Ln();zo(t,r,a,p)}function zo(t,r,a,p){var C={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ic(t))S_(r,C);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=r.lastRenderedReducer,A!==null))try{var B=r.lastRenderedState,G=A(B,a);if(C.hasEagerState=!0,C.eagerState=G,Rn(G,B))return gc(t,r,C,0),_t===null&&mc(),!1}catch{}finally{}if(a=gh(t,r,C,p),a!==null)return Cn(a,t,p),w_(a,r,p),!0}return!1}function Jh(t,r,a,p){if(p={lane:2,revertLane:Nf(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Ic(t)){if(r)throw Error(s(479))}else r=gh(t,a,p,2),r!==null&&Cn(r,t,2)}function Ic(t){var r=t.alternate;return t===Ge||r!==null&&r===Ge}function S_(t,r){aa=Rc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function w_(t,r,a){if((a&4194048)!==0){var p=r.lanes;p&=t.pendingLanes,a|=p,r.lanes=a,qn(t,a)}}var Po={readContext:nn,use:Nc,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};Po.useEffectEvent=Tt;var C_={readContext:nn,use:Nc,useCallback:function(t,r){return pn().memoizedState=[t,r===void 0?null:r],t},useContext:nn,useEffect:o_,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Oc(4194308,4,d_.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Oc(4194308,4,t,r)},useInsertionEffect:function(t,r){Oc(4,2,t,r)},useMemo:function(t,r){var a=pn();r=r===void 0?null:r;var p=t();if(ps){Jt(!0);try{t()}finally{Jt(!1)}}return a.memoizedState=[p,r],p},useReducer:function(t,r,a){var p=pn();if(a!==void 0){var C=a(r);if(ps){Jt(!0);try{a(r)}finally{Jt(!1)}}}else C=r;return p.memoizedState=p.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},p.queue=t,t=t.dispatch=PE.bind(null,Ge,t),[p.memoizedState,t]},useRef:function(t){var r=pn();return t={current:t},r.memoizedState=t},useState:function(t){t=Gh(t);var r=t.queue,a=x_.bind(null,Ge,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Yh,useDeferredValue:function(t,r){var a=pn();return Xh(a,t,r)},useTransition:function(){var t=Gh(!1);return t=g_.bind(null,Ge,t.queue,!0,!1),pn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var p=Ge,C=pn();if(rt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),_t===null)throw Error(s(349));(et&127)!==0||Vv(p,r,a)}C.memoizedState=a;var A={value:a,getSnapshot:r};return C.queue=A,o_(Wv.bind(null,p,A,t),[t]),p.flags|=2048,la(9,{destroy:void 0},Gv.bind(null,p,A,a,r),null),a},useId:function(){var t=pn(),r=_t.identifierPrefix;if(rt){var a=yr,p=_r;a=(p&~(1<<32-ot(p)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Dc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=NE++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Qh,useFormState:n_,useActionState:n_,useOptimistic:function(t){var r=pn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Jh.bind(null,Ge,!0,a),a.dispatch=r,[t,r]},useMemoCache:$h,useCacheRefresh:function(){return pn().memoizedState=zE.bind(null,Ge)},useEffectEvent:function(t){var r=pn(),a={impl:t};return r.memoizedState=a,function(){if((ct&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},ef={readContext:nn,use:Nc,useCallback:f_,useContext:nn,useEffect:Kh,useImperativeHandle:h_,useInsertionEffect:c_,useLayoutEffect:u_,useMemo:p_,useReducer:jc,useRef:a_,useState:function(){return jc(Pr)},useDebugValue:Yh,useDeferredValue:function(t,r){var a=jt();return m_(a,mt.memoizedState,t,r)},useTransition:function(){var t=jc(Pr)[0],r=jt().memoizedState;return[typeof t=="boolean"?t:Bo(t),r]},useSyncExternalStore:qv,useId:y_,useHostTransitionStatus:Qh,useFormState:r_,useActionState:r_,useOptimistic:function(t,r){var a=jt();return Xv(a,mt,t,r)},useMemoCache:$h,useCacheRefresh:b_};ef.useEffectEvent=l_;var k_={readContext:nn,use:Nc,useCallback:f_,useContext:nn,useEffect:Kh,useImperativeHandle:h_,useInsertionEffect:c_,useLayoutEffect:u_,useMemo:p_,useReducer:Vh,useRef:a_,useState:function(){return Vh(Pr)},useDebugValue:Yh,useDeferredValue:function(t,r){var a=jt();return mt===null?Xh(a,t,r):m_(a,mt.memoizedState,t,r)},useTransition:function(){var t=Vh(Pr)[0],r=jt().memoizedState;return[typeof t=="boolean"?t:Bo(t),r]},useSyncExternalStore:qv,useId:y_,useHostTransitionStatus:Qh,useFormState:s_,useActionState:s_,useOptimistic:function(t,r){var a=jt();return mt!==null?Xv(a,mt,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:$h,useCacheRefresh:b_};k_.useEffectEvent=l_;function tf(t,r,a,p){r=t.memoizedState,a=a(p,r),a=a==null?r:f({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var nf={enqueueSetState:function(t,r,a){t=t._reactInternals;var p=Ln(),C=yi(p);C.payload=r,a!=null&&(C.callback=a),r=bi(t,C,p),r!==null&&(Cn(r,t,p),jo(r,t,p))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var p=Ln(),C=yi(p);C.tag=1,C.payload=r,a!=null&&(C.callback=a),r=bi(t,C,p),r!==null&&(Cn(r,t,p),jo(r,t,p))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Ln(),p=yi(a);p.tag=2,r!=null&&(p.callback=r),r=bi(t,p,a),r!==null&&(Cn(r,t,a),jo(r,t,a))}};function E_(t,r,a,p,C,A,B){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(p,A,B):r.prototype&&r.prototype.isPureReactComponent?!ko(a,p)||!ko(C,A):!0}function A_(t,r,a,p){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,p),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,p),r.state!==t&&nf.enqueueReplaceState(r,r.state,null)}function ms(t,r){var a=r;if("ref"in r){a={};for(var p in r)p!=="ref"&&(a[p]=r[p])}if(t=t.defaultProps){a===r&&(a=f({},a));for(var C in t)a[C]===void 0&&(a[C]=t[C])}return a}function T_(t){pc(t)}function R_(t){console.error(t)}function D_(t){pc(t)}function Bc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function M_(t,r,a){try{var p=t.onCaughtError;p(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function rf(t,r,a){return a=yi(a),a.tag=3,a.payload={element:null},a.callback=function(){Bc(t,r)},a}function N_(t){return t=yi(t),t.tag=3,t}function j_(t,r,a,p){var C=a.type.getDerivedStateFromError;if(typeof C=="function"){var A=p.value;t.payload=function(){return C(A)},t.callback=function(){M_(r,a,p)}}var B=a.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(t.callback=function(){M_(r,a,p),typeof C!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var G=p.stack;this.componentDidCatch(p.value,{componentStack:G!==null?G:""})})}function FE(t,r,a,p,C){if(a.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=a.alternate,r!==null&&ea(r,a,C,!0),a=Mn.current,a!==null){switch(a.tag){case 31:case 13:return Zn===null?Yc():a.alternate===null&&Rt===0&&(Rt=3),a.flags&=-257,a.flags|=65536,a.lanes=C,p===Cc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([p]):r.add(p),Rf(t,p,C)),!1;case 22:return a.flags|=65536,p===Cc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([p])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([p]):a.add(p)),Rf(t,p,C)),!1}throw Error(s(435,a.tag))}return Rf(t,p,C),Yc(),!1}if(rt)return r=Mn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=C,p!==Sh&&(t=Error(s(422),{cause:p}),To(Wn(t,a)))):(p!==Sh&&(r=Error(s(423),{cause:p}),To(Wn(r,a))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,p=Wn(p,a),C=rf(t.stateNode,p,C),jh(t,C),Rt!==4&&(Rt=2)),!1;var A=Error(s(520),{cause:p});if(A=Wn(A,a),Wo===null?Wo=[A]:Wo.push(A),Rt!==4&&(Rt=2),r===null)return!0;p=Wn(p,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=C&-C,a.lanes|=t,t=rf(a.stateNode,p,t),jh(a,t),!1;case 1:if(r=a.type,A=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Ei===null||!Ei.has(A))))return a.flags|=65536,C&=-C,a.lanes|=C,C=N_(C),j_(C,t,a,p),jh(a,C),!1}a=a.return}while(a!==null);return!1}var sf=Error(s(461)),zt=!1;function rn(t,r,a,p){r.child=t===null?Bv(r,null,a,p):fs(r,t.child,a,p)}function O_(t,r,a,p,C){a=a.render;var A=r.ref;if("ref"in p){var B={};for(var G in p)G!=="ref"&&(B[G]=p[G])}else B=p;return cs(r),p=Ph(t,r,a,B,A,C),G=Fh(),t!==null&&!zt?(Hh(t,r,C),Fr(t,r,C)):(rt&&G&&bh(r),r.flags|=1,rn(t,r,p,C),r.child)}function L_(t,r,a,p,C){if(t===null){var A=a.type;return typeof A=="function"&&!vh(A)&&A.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=A,I_(t,r,A,p,C)):(t=_c(a.type,null,p,r,r.mode,C),t.ref=r.ref,t.return=r,r.child=t)}if(A=t.child,!ff(t,C)){var B=A.memoizedProps;if(a=a.compare,a=a!==null?a:ko,a(B,p)&&t.ref===r.ref)return Fr(t,r,C)}return r.flags|=1,t=Or(A,p),t.ref=r.ref,t.return=r,r.child=t}function I_(t,r,a,p,C){if(t!==null){var A=t.memoizedProps;if(ko(A,p)&&t.ref===r.ref)if(zt=!1,r.pendingProps=p=A,ff(t,C))(t.flags&131072)!==0&&(zt=!0);else return r.lanes=t.lanes,Fr(t,r,C)}return af(t,r,a,p,C)}function B_(t,r,a,p){var C=p.children,A=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((r.flags&128)!==0){if(A=A!==null?A.baseLanes|a:a,t!==null){for(p=r.child=t.child,C=0;p!==null;)C=C|p.lanes|p.childLanes,p=p.sibling;p=C&~A}else p=0,r.child=null;return z_(t,r,A,a,p)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Sc(r,A!==null?A.cachePool:null),A!==null?Fv(r,A):Lh(),Hv(r);else return p=r.lanes=536870912,z_(t,r,A!==null?A.baseLanes|a:a,a,p)}else A!==null?(Sc(r,A.cachePool),Fv(r,A),Si(),r.memoizedState=null):(t!==null&&Sc(r,null),Lh(),Si());return rn(t,r,C,a),r.child}function Fo(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function z_(t,r,a,p,C){var A=Rh();return A=A===null?null:{parent:It._currentValue,pool:A},r.memoizedState={baseLanes:a,cachePool:A},t!==null&&Sc(r,null),Lh(),Hv(r),t!==null&&ea(t,r,p,!0),r.childLanes=C,null}function zc(t,r){return r=Fc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function P_(t,r,a){return fs(r,t.child,null,a),t=zc(r,r.pendingProps),t.flags|=2,Nn(r),r.memoizedState=null,t}function HE(t,r,a){var p=r.pendingProps,C=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(rt){if(p.mode==="hidden")return t=zc(r,p),r.lanes=536870912,Fo(null,t);if(Bh(r),(t=St)?(t=Zy(t,Xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:pi!==null?{id:_r,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=Sv(t),a.return=r,r.child=a,tn=r,St=null)):t=null,t===null)throw gi(r);return r.lanes=536870912,null}return zc(r,p)}var A=t.memoizedState;if(A!==null){var B=A.dehydrated;if(Bh(r),C)if(r.flags&256)r.flags&=-257,r=P_(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(zt||ea(t,r,a,!1),C=(a&t.childLanes)!==0,zt||C){if(p=_t,p!==null&&(B=ec(p,a),B!==0&&B!==A.retryLane))throw A.retryLane=B,ss(t,B),Cn(p,t,B),sf;Yc(),r=P_(t,r,a)}else t=A.treeContext,St=Qn(B.nextSibling),tn=r,rt=!0,mi=null,Xn=!1,t!==null&&kv(r,t),r=zc(r,p),r.flags|=4096;return r}return t=Or(t.child,{mode:p.mode,children:p.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Pc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function af(t,r,a,p,C){return cs(r),a=Ph(t,r,a,p,void 0,C),p=Fh(),t!==null&&!zt?(Hh(t,r,C),Fr(t,r,C)):(rt&&p&&bh(r),r.flags|=1,rn(t,r,a,C),r.child)}function F_(t,r,a,p,C,A){return cs(r),r.updateQueue=null,a=$v(r,p,a,C),Uv(t),p=Fh(),t!==null&&!zt?(Hh(t,r,A),Fr(t,r,A)):(rt&&p&&bh(r),r.flags|=1,rn(t,r,a,A),r.child)}function H_(t,r,a,p,C){if(cs(r),r.stateNode===null){var A=Xs,B=a.contextType;typeof B=="object"&&B!==null&&(A=nn(B)),A=new a(p,A),r.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=nf,r.stateNode=A,A._reactInternals=r,A=r.stateNode,A.props=p,A.state=r.memoizedState,A.refs={},Mh(r),B=a.contextType,A.context=typeof B=="object"&&B!==null?nn(B):Xs,A.state=r.memoizedState,B=a.getDerivedStateFromProps,typeof B=="function"&&(tf(r,a,B,p),A.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(B=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),B!==A.state&&nf.enqueueReplaceState(A,A.state,null),Lo(r,p,A,C),Oo(),A.state=r.memoizedState),typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(t===null){A=r.stateNode;var G=r.memoizedProps,ne=ms(a,G);A.props=ne;var le=A.context,fe=a.contextType;B=Xs,typeof fe=="object"&&fe!==null&&(B=nn(fe));var ge=a.getDerivedStateFromProps;fe=typeof ge=="function"||typeof A.getSnapshotBeforeUpdate=="function",G=r.pendingProps!==G,fe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(G||le!==B)&&A_(r,A,p,B),_i=!1;var ue=r.memoizedState;A.state=ue,Lo(r,p,A,C),Oo(),le=r.memoizedState,G||ue!==le||_i?(typeof ge=="function"&&(tf(r,a,ge,p),le=r.memoizedState),(ne=_i||E_(r,a,ne,p,ue,le,B))?(fe||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(r.flags|=4194308)):(typeof A.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=p,r.memoizedState=le),A.props=p,A.state=le,A.context=B,p=ne):(typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{A=r.stateNode,Nh(t,r),B=r.memoizedProps,fe=ms(a,B),A.props=fe,ge=r.pendingProps,ue=A.context,le=a.contextType,ne=Xs,typeof le=="object"&&le!==null&&(ne=nn(le)),G=a.getDerivedStateFromProps,(le=typeof G=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(B!==ge||ue!==ne)&&A_(r,A,p,ne),_i=!1,ue=r.memoizedState,A.state=ue,Lo(r,p,A,C),Oo();var de=r.memoizedState;B!==ge||ue!==de||_i||t!==null&&t.dependencies!==null&&bc(t.dependencies)?(typeof G=="function"&&(tf(r,a,G,p),de=r.memoizedState),(fe=_i||E_(r,a,fe,p,ue,de,ne)||t!==null&&t.dependencies!==null&&bc(t.dependencies))?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(p,de,ne),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(p,de,ne)),typeof A.componentDidUpdate=="function"&&(r.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof A.componentDidUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=de),A.props=p,A.state=de,A.context=ne,p=fe):(typeof A.componentDidUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),p=!1)}return A=p,Pc(t,r),p=(r.flags&128)!==0,A||p?(A=r.stateNode,a=p&&typeof a.getDerivedStateFromError!="function"?null:A.render(),r.flags|=1,t!==null&&p?(r.child=fs(r,t.child,null,C),r.child=fs(r,null,a,C)):rn(t,r,a,C),r.memoizedState=A.state,t=r.child):t=Fr(t,r,C),t}function U_(t,r,a,p){return os(),r.flags|=256,rn(t,r,a,p),r.child}var of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(t){return{baseLanes:t,cachePool:Mv()}}function cf(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=On),t}function $_(t,r,a){var p=r.pendingProps,C=!1,A=(r.flags&128)!==0,B;if((B=A)||(B=t!==null&&t.memoizedState===null?!1:(Nt.current&2)!==0),B&&(C=!0,r.flags&=-129),B=(r.flags&32)!==0,r.flags&=-33,t===null){if(rt){if(C?xi(r):Si(),(t=St)?(t=Zy(t,Xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:pi!==null?{id:_r,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=Sv(t),a.return=r,r.child=a,tn=r,St=null)):t=null,t===null)throw gi(r);return Vf(t)?r.lanes=32:r.lanes=536870912,null}var G=p.children;return p=p.fallback,C?(Si(),C=r.mode,G=Fc({mode:"hidden",children:G},C),p=as(p,C,a,null),G.return=r,p.return=r,G.sibling=p,r.child=G,p=r.child,p.memoizedState=lf(a),p.childLanes=cf(t,B,a),r.memoizedState=of,Fo(null,p)):(xi(r),uf(r,G))}var ne=t.memoizedState;if(ne!==null&&(G=ne.dehydrated,G!==null)){if(A)r.flags&256?(xi(r),r.flags&=-257,r=df(t,r,a)):r.memoizedState!==null?(Si(),r.child=t.child,r.flags|=128,r=null):(Si(),G=p.fallback,C=r.mode,p=Fc({mode:"visible",children:p.children},C),G=as(G,C,a,null),G.flags|=2,p.return=r,G.return=r,p.sibling=G,r.child=p,fs(r,t.child,null,a),p=r.child,p.memoizedState=lf(a),p.childLanes=cf(t,B,a),r.memoizedState=of,r=Fo(null,p));else if(xi(r),Vf(G)){if(B=G.nextSibling&&G.nextSibling.dataset,B)var le=B.dgst;B=le,p=Error(s(419)),p.stack="",p.digest=B,To({value:p,source:null,stack:null}),r=df(t,r,a)}else if(zt||ea(t,r,a,!1),B=(a&t.childLanes)!==0,zt||B){if(B=_t,B!==null&&(p=ec(B,a),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,ss(t,p),Cn(B,t,p),sf;qf(G)||Yc(),r=df(t,r,a)}else qf(G)?(r.flags|=192,r.child=t.child,r=null):(t=ne.treeContext,St=Qn(G.nextSibling),tn=r,rt=!0,mi=null,Xn=!1,t!==null&&kv(r,t),r=uf(r,p.children),r.flags|=4096);return r}return C?(Si(),G=p.fallback,C=r.mode,ne=t.child,le=ne.sibling,p=Or(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,le!==null?G=Or(le,G):(G=as(G,C,a,null),G.flags|=2),G.return=r,p.return=r,p.sibling=G,r.child=p,Fo(null,p),p=r.child,G=t.child.memoizedState,G===null?G=lf(a):(C=G.cachePool,C!==null?(ne=It._currentValue,C=C.parent!==ne?{parent:ne,pool:ne}:C):C=Mv(),G={baseLanes:G.baseLanes|a,cachePool:C}),p.memoizedState=G,p.childLanes=cf(t,B,a),r.memoizedState=of,Fo(t.child,p)):(xi(r),a=t.child,t=a.sibling,a=Or(a,{mode:"visible",children:p.children}),a.return=r,a.sibling=null,t!==null&&(B=r.deletions,B===null?(r.deletions=[t],r.flags|=16):B.push(t)),r.child=a,r.memoizedState=null,a)}function uf(t,r){return r=Fc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Fc(t,r){return t=Dn(22,t,null,r),t.lanes=0,t}function df(t,r,a){return fs(r,t.child,null,a),t=uf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function q_(t,r,a){t.lanes|=r;var p=t.alternate;p!==null&&(p.lanes|=r),kh(t.return,r,a)}function hf(t,r,a,p,C,A){var B=t.memoizedState;B===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:a,tailMode:C,treeForkCount:A}:(B.isBackwards=r,B.rendering=null,B.renderingStartTime=0,B.last=p,B.tail=a,B.tailMode=C,B.treeForkCount=A)}function V_(t,r,a){var p=r.pendingProps,C=p.revealOrder,A=p.tail;p=p.children;var B=Nt.current,G=(B&2)!==0;if(G?(B=B&1|2,r.flags|=128):B&=1,z(Nt,B),rn(t,r,p,a),p=rt?Ao:0,!G&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&q_(t,a,r);else if(t.tag===19)q_(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"forwards":for(a=r.child,C=null;a!==null;)t=a.alternate,t!==null&&Tc(t)===null&&(C=a),a=a.sibling;a=C,a===null?(C=r.child,r.child=null):(C=a.sibling,a.sibling=null),hf(r,!1,C,a,A,p);break;case"backwards":case"unstable_legacy-backwards":for(a=null,C=r.child,r.child=null;C!==null;){if(t=C.alternate,t!==null&&Tc(t)===null){r.child=C;break}t=C.sibling,C.sibling=a,a=C,C=t}hf(r,!0,a,null,A,p);break;case"together":hf(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function Fr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ki|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(ea(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=Or(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Or(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function ff(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&bc(t)))}function UE(t,r,a){switch(r.tag){case 3:H(r,r.stateNode.containerInfo),vi(r,It,t.memoizedState.cache),os();break;case 27:case 5:ae(r);break;case 4:H(r,r.stateNode.containerInfo);break;case 10:vi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Bh(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(xi(r),r.flags|=128,null):(a&r.child.childLanes)!==0?$_(t,r,a):(xi(r),t=Fr(t,r,a),t!==null?t.sibling:null);xi(r);break;case 19:var C=(t.flags&128)!==0;if(p=(a&r.childLanes)!==0,p||(ea(t,r,a,!1),p=(a&r.childLanes)!==0),C){if(p)return V_(t,r,a);r.flags|=128}if(C=r.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),z(Nt,Nt.current),p)break;return null;case 22:return r.lanes=0,B_(t,r,a,r.pendingProps);case 24:vi(r,It,t.memoizedState.cache)}return Fr(t,r,a)}function G_(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)zt=!0;else{if(!ff(t,a)&&(r.flags&128)===0)return zt=!1,UE(t,r,a);zt=(t.flags&131072)!==0}else zt=!1,rt&&(r.flags&1048576)!==0&&Cv(r,Ao,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(t=ds(r.elementType),r.type=t,typeof t=="function")vh(t)?(p=ms(t,p),r.tag=1,r=H_(null,r,t,p,a)):(r.tag=0,r=af(null,r,t,p,a));else{if(t!=null){var C=t.$$typeof;if(C===E){r.tag=11,r=O_(null,r,t,p,a);break e}else if(C===N){r.tag=14,r=L_(null,r,t,p,a);break e}}throw r=Y(t)||t,Error(s(306,r,""))}}return r;case 0:return af(t,r,r.type,r.pendingProps,a);case 1:return p=r.type,C=ms(p,r.pendingProps),H_(t,r,p,C,a);case 3:e:{if(H(r,r.stateNode.containerInfo),t===null)throw Error(s(387));p=r.pendingProps;var A=r.memoizedState;C=A.element,Nh(t,r),Lo(r,p,null,a);var B=r.memoizedState;if(p=B.cache,vi(r,It,p),p!==A.cache&&Eh(r,[It],a,!0),Oo(),p=B.element,A.isDehydrated)if(A={element:p,isDehydrated:!1,cache:B.cache},r.updateQueue.baseState=A,r.memoizedState=A,r.flags&256){r=U_(t,r,p,a);break e}else if(p!==C){C=Wn(Error(s(424)),r),To(C),r=U_(t,r,p,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(St=Qn(t.firstChild),tn=r,rt=!0,mi=null,Xn=!0,a=Bv(r,null,p,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(os(),p===C){r=Fr(t,r,a);break e}rn(t,r,p,a)}r=r.child}return r;case 26:return Pc(t,r),t===null?(a=rb(r.type,null,r.pendingProps,null))?r.memoizedState=a:rt||(a=r.type,t=r.pendingProps,p=nu(te.current).createElement(a),p[Ht]=r,p[en]=t,sn(p,a,t),Ot(p),r.stateNode=p):r.memoizedState=rb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ae(r),t===null&&rt&&(p=r.stateNode=eb(r.type,r.pendingProps,te.current),tn=r,Xn=!0,C=St,Di(r.type)?(Gf=C,St=Qn(p.firstChild)):St=C),rn(t,r,r.pendingProps.children,a),Pc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&rt&&((C=p=St)&&(p=_2(p,r.type,r.pendingProps,Xn),p!==null?(r.stateNode=p,tn=r,St=Qn(p.firstChild),Xn=!1,C=!0):C=!1),C||gi(r)),ae(r),C=r.type,A=r.pendingProps,B=t!==null?t.memoizedProps:null,p=A.children,Hf(C,A)?p=null:B!==null&&Hf(C,B)&&(r.flags|=32),r.memoizedState!==null&&(C=Ph(t,r,jE,null,null,a),tl._currentValue=C),Pc(t,r),rn(t,r,p,a),r.child;case 6:return t===null&&rt&&((t=a=St)&&(a=y2(a,r.pendingProps,Xn),a!==null?(r.stateNode=a,tn=r,St=null,t=!0):t=!1),t||gi(r)),null;case 13:return $_(t,r,a);case 4:return H(r,r.stateNode.containerInfo),p=r.pendingProps,t===null?r.child=fs(r,null,p,a):rn(t,r,p,a),r.child;case 11:return O_(t,r,r.type,r.pendingProps,a);case 7:return rn(t,r,r.pendingProps,a),r.child;case 8:return rn(t,r,r.pendingProps.children,a),r.child;case 12:return rn(t,r,r.pendingProps.children,a),r.child;case 10:return p=r.pendingProps,vi(r,r.type,p.value),rn(t,r,p.children,a),r.child;case 9:return C=r.type._context,p=r.pendingProps.children,cs(r),C=nn(C),p=p(C),r.flags|=1,rn(t,r,p,a),r.child;case 14:return L_(t,r,r.type,r.pendingProps,a);case 15:return I_(t,r,r.type,r.pendingProps,a);case 19:return V_(t,r,a);case 31:return HE(t,r,a);case 22:return B_(t,r,a,r.pendingProps);case 24:return cs(r),p=nn(It),t===null?(C=Rh(),C===null&&(C=_t,A=Ah(),C.pooledCache=A,A.refCount++,A!==null&&(C.pooledCacheLanes|=a),C=A),r.memoizedState={parent:p,cache:C},Mh(r),vi(r,It,C)):((t.lanes&a)!==0&&(Nh(t,r),Lo(r,null,null,a),Oo()),C=t.memoizedState,A=r.memoizedState,C.parent!==p?(C={parent:p,cache:p},r.memoizedState=C,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=C),vi(r,It,p)):(p=A.cache,vi(r,It,p),p!==C.cache&&Eh(r,[It],a,!0))),rn(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Hr(t){t.flags|=4}function pf(t,r,a,p,C){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(yy())t.flags|=8192;else throw hs=Cc,Dh}else t.flags&=-16777217}function W_(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!lb(r))if(yy())t.flags|=8192;else throw hs=Cc,Dh}function Hc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Ji():536870912,t.lanes|=r,ha|=r)}function Ho(t,r){if(!rt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var p=null;a!==null;)a.alternate!==null&&(p=a),a=a.sibling;p===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:p.sibling=null}}function wt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,p=0;if(r)for(var C=t.child;C!==null;)a|=C.lanes|C.childLanes,p|=C.subtreeFlags&65011712,p|=C.flags&65011712,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)a|=C.lanes|C.childLanes,p|=C.subtreeFlags,p|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=p,t.childLanes=a,r}function $E(t,r,a){var p=r.pendingProps;switch(xh(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(r),null;case 1:return wt(r),null;case 3:return a=r.stateNode,p=null,t!==null&&(p=t.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Br(It),re(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Js(r)?Hr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,wh())),wt(r),null;case 26:var C=r.type,A=r.memoizedState;return t===null?(Hr(r),A!==null?(wt(r),W_(r,A)):(wt(r),pf(r,C,null,p,a))):A?A!==t.memoizedState?(Hr(r),wt(r),W_(r,A)):(wt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==p&&Hr(r),wt(r),pf(r,C,t,p,a)),null;case 27:if(pe(r),a=te.current,C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&Hr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return wt(r),null}t=X.current,Js(r)?Ev(r):(t=eb(C,p,a),r.stateNode=t,Hr(r))}return wt(r),null;case 5:if(pe(r),C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&Hr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return wt(r),null}if(A=X.current,Js(r))Ev(r);else{var B=nu(te.current);switch(A){case 1:A=B.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:A=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":A=B.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":A=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":A=B.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof p.is=="string"?B.createElement("select",{is:p.is}):B.createElement("select"),p.multiple?A.multiple=!0:p.size&&(A.size=p.size);break;default:A=typeof p.is=="string"?B.createElement(C,{is:p.is}):B.createElement(C)}}A[Ht]=r,A[en]=p;e:for(B=r.child;B!==null;){if(B.tag===5||B.tag===6)A.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===r)break e;for(;B.sibling===null;){if(B.return===null||B.return===r)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}r.stateNode=A;e:switch(sn(A,C,p),C){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Hr(r)}}return wt(r),pf(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==p&&Hr(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(s(166));if(t=te.current,Js(r)){if(t=r.stateNode,a=r.memoizedProps,p=null,C=tn,C!==null)switch(C.tag){case 27:case 5:p=C.memoizedProps}t[Ht]=r,t=!!(t.nodeValue===a||p!==null&&p.suppressHydrationWarning===!0||$y(t.nodeValue,a)),t||gi(r,!0)}else t=nu(t).createTextNode(p),t[Ht]=r,r.stateNode=t}return wt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(p=Js(r),a!==null){if(t===null){if(!p)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Ht]=r}else os(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;wt(r),t=!1}else a=wh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(Nn(r),r):(Nn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return wt(r),null;case 13:if(p=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=Js(r),p!==null&&p.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=r.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[Ht]=r}else os(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;wt(r),C=!1}else C=wh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return r.flags&256?(Nn(r),r):(Nn(r),null)}return Nn(r),(r.flags&128)!==0?(r.lanes=a,r):(a=p!==null,t=t!==null&&t.memoizedState!==null,a&&(p=r.child,C=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(C=p.alternate.memoizedState.cachePool.pool),A=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),A!==C&&(p.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Hc(r,r.updateQueue),wt(r),null);case 4:return re(),t===null&&If(r.stateNode.containerInfo),wt(r),null;case 10:return Br(r.type),wt(r),null;case 19:if(L(Nt),p=r.memoizedState,p===null)return wt(r),null;if(C=(r.flags&128)!==0,A=p.rendering,A===null)if(C)Ho(p,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(A=Tc(t),A!==null){for(r.flags|=128,Ho(p,!1),t=A.updateQueue,r.updateQueue=t,Hc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)xv(a,t),a=a.sibling;return z(Nt,Nt.current&1|2),rt&&Lr(r,p.treeForkCount),r.child}t=t.sibling}p.tail!==null&&Et()>Gc&&(r.flags|=128,C=!0,Ho(p,!1),r.lanes=4194304)}else{if(!C)if(t=Tc(A),t!==null){if(r.flags|=128,C=!0,t=t.updateQueue,r.updateQueue=t,Hc(r,t),Ho(p,!0),p.tail===null&&p.tailMode==="hidden"&&!A.alternate&&!rt)return wt(r),null}else 2*Et()-p.renderingStartTime>Gc&&a!==536870912&&(r.flags|=128,C=!0,Ho(p,!1),r.lanes=4194304);p.isBackwards?(A.sibling=r.child,r.child=A):(t=p.last,t!==null?t.sibling=A:r.child=A,p.last=A)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Et(),t.sibling=null,a=Nt.current,z(Nt,C?a&1|2:a&1),rt&&Lr(r,p.treeForkCount),t):(wt(r),null);case 22:case 23:return Nn(r),Ih(),p=r.memoizedState!==null,t!==null?t.memoizedState!==null!==p&&(r.flags|=8192):p&&(r.flags|=8192),p?(a&536870912)!==0&&(r.flags&128)===0&&(wt(r),r.subtreeFlags&6&&(r.flags|=8192)):wt(r),a=r.updateQueue,a!==null&&Hc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),p=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),p!==a&&(r.flags|=2048),t!==null&&L(us),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Br(It),wt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function qE(t,r){switch(xh(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Br(It),re(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return pe(r),null;case 31:if(r.memoizedState!==null){if(Nn(r),r.alternate===null)throw Error(s(340));os()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Nn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));os()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return L(Nt),null;case 4:return re(),null;case 10:return Br(r.type),null;case 22:case 23:return Nn(r),Ih(),t!==null&&L(us),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Br(It),null;case 25:return null;default:return null}}function K_(t,r){switch(xh(r),r.tag){case 3:Br(It),re();break;case 26:case 27:case 5:pe(r);break;case 4:re();break;case 31:r.memoizedState!==null&&Nn(r);break;case 13:Nn(r);break;case 19:L(Nt);break;case 10:Br(r.type);break;case 22:case 23:Nn(r),Ih(),t!==null&&L(us);break;case 24:Br(It)}}function Uo(t,r){try{var a=r.updateQueue,p=a!==null?a.lastEffect:null;if(p!==null){var C=p.next;a=C;do{if((a.tag&t)===t){p=void 0;var A=a.create,B=a.inst;p=A(),B.destroy=p}a=a.next}while(a!==C)}}catch(G){pt(r,r.return,G)}}function wi(t,r,a){try{var p=r.updateQueue,C=p!==null?p.lastEffect:null;if(C!==null){var A=C.next;p=A;do{if((p.tag&t)===t){var B=p.inst,G=B.destroy;if(G!==void 0){B.destroy=void 0,C=r;var ne=a,le=G;try{le()}catch(fe){pt(C,ne,fe)}}}p=p.next}while(p!==A)}}catch(fe){pt(r,r.return,fe)}}function Y_(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{Pv(r,a)}catch(p){pt(t,t.return,p)}}}function X_(t,r,a){a.props=ms(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(p){pt(t,r,p)}}function $o(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var p=t.stateNode;break;case 30:p=t.stateNode;break;default:p=t.stateNode}typeof a=="function"?t.refCleanup=a(p):a.current=p}}catch(C){pt(t,r,C)}}function br(t,r){var a=t.ref,p=t.refCleanup;if(a!==null)if(typeof p=="function")try{p()}catch(C){pt(t,r,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(C){pt(t,r,C)}else a.current=null}function Z_(t){var r=t.type,a=t.memoizedProps,p=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&p.focus();break e;case"img":a.src?p.src=a.src:a.srcSet&&(p.srcset=a.srcSet)}}catch(C){pt(t,t.return,C)}}function mf(t,r,a){try{var p=t.stateNode;h2(p,t.type,a,r),p[en]=r}catch(C){pt(t,t.return,C)}}function Q_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Di(t.type)||t.tag===4}function gf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Q_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Di(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function vf(t,r,a){var p=t.tag;if(p===5||p===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Lt));else if(p!==4&&(p===27&&Di(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(vf(t,r,a),t=t.sibling;t!==null;)vf(t,r,a),t=t.sibling}function Uc(t,r,a){var p=t.tag;if(p===5||p===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(p!==4&&(p===27&&Di(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Uc(t,r,a),t=t.sibling;t!==null;)Uc(t,r,a),t=t.sibling}function J_(t){var r=t.stateNode,a=t.memoizedProps;try{for(var p=t.type,C=r.attributes;C.length;)r.removeAttributeNode(C[0]);sn(r,p,a),r[Ht]=t,r[en]=a}catch(A){pt(t,t.return,A)}}var Ur=!1,Pt=!1,_f=!1,ey=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function VE(t,r){if(t=t.containerInfo,Pf=cu,t=hv(t),uh(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var p=a.getSelection&&a.getSelection();if(p&&p.rangeCount!==0){a=p.anchorNode;var C=p.anchorOffset,A=p.focusNode;p=p.focusOffset;try{a.nodeType,A.nodeType}catch{a=null;break e}var B=0,G=-1,ne=-1,le=0,fe=0,ge=t,ue=null;t:for(;;){for(var de;ge!==a||C!==0&&ge.nodeType!==3||(G=B+C),ge!==A||p!==0&&ge.nodeType!==3||(ne=B+p),ge.nodeType===3&&(B+=ge.nodeValue.length),(de=ge.firstChild)!==null;)ue=ge,ge=de;for(;;){if(ge===t)break t;if(ue===a&&++le===C&&(G=B),ue===A&&++fe===p&&(ne=B),(de=ge.nextSibling)!==null)break;ge=ue,ue=ge.parentNode}ge=de}a=G===-1||ne===-1?null:{start:G,end:ne}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ff={focusedElem:t,selectionRange:a},cu=!1,Yt=r;Yt!==null;)if(r=Yt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Yt=t;else for(;Yt!==null;){switch(r=Yt,A=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)C=t[a],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&A!==null){t=void 0,a=r,C=A.memoizedProps,A=A.memoizedState,p=a.stateNode;try{var Ee=ms(a.type,C);t=p.getSnapshotBeforeUpdate(Ee,A),p.__reactInternalSnapshotBeforeUpdate=t}catch(Fe){pt(a,a.return,Fe)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)$f(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":$f(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Yt=t;break}Yt=r.return}}function ty(t,r,a){var p=a.flags;switch(a.tag){case 0:case 11:case 15:qr(t,a),p&4&&Uo(5,a);break;case 1:if(qr(t,a),p&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(B){pt(a,a.return,B)}else{var C=ms(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(C,r,t.__reactInternalSnapshotBeforeUpdate)}catch(B){pt(a,a.return,B)}}p&64&&Y_(a),p&512&&$o(a,a.return);break;case 3:if(qr(t,a),p&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Pv(t,r)}catch(B){pt(a,a.return,B)}}break;case 27:r===null&&p&4&&J_(a);case 26:case 5:qr(t,a),r===null&&p&4&&Z_(a),p&512&&$o(a,a.return);break;case 12:qr(t,a);break;case 31:qr(t,a),p&4&&iy(t,a);break;case 13:qr(t,a),p&4&&sy(t,a),p&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=e2.bind(null,a),b2(t,a))));break;case 22:if(p=a.memoizedState!==null||Ur,!p){r=r!==null&&r.memoizedState!==null||Pt,C=Ur;var A=Pt;Ur=p,(Pt=r)&&!A?Vr(t,a,(a.subtreeFlags&8772)!==0):qr(t,a),Ur=C,Pt=A}break;case 30:break;default:qr(t,a)}}function ny(t){var r=t.alternate;r!==null&&(t.alternate=null,ny(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&po(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var kt=null,bn=!1;function $r(t,r,a){for(a=a.child;a!==null;)ry(t,r,a),a=a.sibling}function ry(t,r,a){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(At,a)}catch{}switch(a.tag){case 26:Pt||br(a,r),$r(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Pt||br(a,r);var p=kt,C=bn;Di(a.type)&&(kt=a.stateNode,bn=!1),$r(t,r,a),Qo(a.stateNode),kt=p,bn=C;break;case 5:Pt||br(a,r);case 6:if(p=kt,C=bn,kt=null,$r(t,r,a),kt=p,bn=C,kt!==null)if(bn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(a.stateNode)}catch(A){pt(a,r,A)}else try{kt.removeChild(a.stateNode)}catch(A){pt(a,r,A)}break;case 18:kt!==null&&(bn?(t=kt,Yy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ba(t)):Yy(kt,a.stateNode));break;case 4:p=kt,C=bn,kt=a.stateNode.containerInfo,bn=!0,$r(t,r,a),kt=p,bn=C;break;case 0:case 11:case 14:case 15:wi(2,a,r),Pt||wi(4,a,r),$r(t,r,a);break;case 1:Pt||(br(a,r),p=a.stateNode,typeof p.componentWillUnmount=="function"&&X_(a,r,p)),$r(t,r,a);break;case 21:$r(t,r,a);break;case 22:Pt=(p=Pt)||a.memoizedState!==null,$r(t,r,a),Pt=p;break;default:$r(t,r,a)}}function iy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ba(t)}catch(a){pt(r,r.return,a)}}}function sy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ba(t)}catch(a){pt(r,r.return,a)}}function GE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new ey),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new ey),r;default:throw Error(s(435,t.tag))}}function $c(t,r){var a=GE(t);r.forEach(function(p){if(!a.has(p)){a.add(p);var C=t2.bind(null,t,p);p.then(C,C)}})}function xn(t,r){var a=r.deletions;if(a!==null)for(var p=0;p<a.length;p++){var C=a[p],A=t,B=r,G=B;e:for(;G!==null;){switch(G.tag){case 27:if(Di(G.type)){kt=G.stateNode,bn=!1;break e}break;case 5:kt=G.stateNode,bn=!1;break e;case 3:case 4:kt=G.stateNode.containerInfo,bn=!0;break e}G=G.return}if(kt===null)throw Error(s(160));ry(A,B,C),kt=null,bn=!1,A=C.alternate,A!==null&&(A.return=null),C.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)ay(r,t),r=r.sibling}var lr=null;function ay(t,r){var a=t.alternate,p=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:xn(r,t),Sn(t),p&4&&(wi(3,t,t.return),Uo(3,t),wi(5,t,t.return));break;case 1:xn(r,t),Sn(t),p&512&&(Pt||a===null||br(a,a.return)),p&64&&Ur&&(t=t.updateQueue,t!==null&&(p=t.callbacks,p!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?p:a.concat(p))));break;case 26:var C=lr;if(xn(r,t),Sn(t),p&512&&(Pt||a===null||br(a,a.return)),p&4){var A=a!==null?a.memoizedState:null;if(p=t.memoizedState,a===null)if(p===null)if(t.stateNode===null){e:{p=t.type,a=t.memoizedProps,C=C.ownerDocument||C;t:switch(p){case"title":A=C.getElementsByTagName("title")[0],(!A||A[es]||A[Ht]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=C.createElement(p),C.head.insertBefore(A,C.querySelector("head > title"))),sn(A,p,a),A[Ht]=t,Ot(A),p=A;break e;case"link":var B=ab("link","href",C).get(p+(a.href||""));if(B){for(var G=0;G<B.length;G++)if(A=B[G],A.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&A.getAttribute("rel")===(a.rel==null?null:a.rel)&&A.getAttribute("title")===(a.title==null?null:a.title)&&A.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){B.splice(G,1);break t}}A=C.createElement(p),sn(A,p,a),C.head.appendChild(A);break;case"meta":if(B=ab("meta","content",C).get(p+(a.content||""))){for(G=0;G<B.length;G++)if(A=B[G],A.getAttribute("content")===(a.content==null?null:""+a.content)&&A.getAttribute("name")===(a.name==null?null:a.name)&&A.getAttribute("property")===(a.property==null?null:a.property)&&A.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&A.getAttribute("charset")===(a.charSet==null?null:a.charSet)){B.splice(G,1);break t}}A=C.createElement(p),sn(A,p,a),C.head.appendChild(A);break;default:throw Error(s(468,p))}A[Ht]=t,Ot(A),p=A}t.stateNode=p}else ob(C,t.type,t.stateNode);else t.stateNode=sb(C,p,t.memoizedProps);else A!==p?(A===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):A.count--,p===null?ob(C,t.type,t.stateNode):sb(C,p,t.memoizedProps)):p===null&&t.stateNode!==null&&mf(t,t.memoizedProps,a.memoizedProps)}break;case 27:xn(r,t),Sn(t),p&512&&(Pt||a===null||br(a,a.return)),a!==null&&p&4&&mf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(xn(r,t),Sn(t),p&512&&(Pt||a===null||br(a,a.return)),t.flags&32){C=t.stateNode;try{Le(C,"")}catch(Ee){pt(t,t.return,Ee)}}p&4&&t.stateNode!=null&&(C=t.memoizedProps,mf(t,C,a!==null?a.memoizedProps:C)),p&1024&&(_f=!0);break;case 6:if(xn(r,t),Sn(t),p&4){if(t.stateNode===null)throw Error(s(162));p=t.memoizedProps,a=t.stateNode;try{a.nodeValue=p}catch(Ee){pt(t,t.return,Ee)}}break;case 3:if(su=null,C=lr,lr=ru(r.containerInfo),xn(r,t),lr=C,Sn(t),p&4&&a!==null&&a.memoizedState.isDehydrated)try{ba(r.containerInfo)}catch(Ee){pt(t,t.return,Ee)}_f&&(_f=!1,oy(t));break;case 4:p=lr,lr=ru(t.stateNode.containerInfo),xn(r,t),Sn(t),lr=p;break;case 12:xn(r,t),Sn(t);break;case 31:xn(r,t),Sn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,$c(t,p)));break;case 13:xn(r,t),Sn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Vc=Et()),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,$c(t,p)));break;case 22:C=t.memoizedState!==null;var ne=a!==null&&a.memoizedState!==null,le=Ur,fe=Pt;if(Ur=le||C,Pt=fe||ne,xn(r,t),Pt=fe,Ur=le,Sn(t),p&8192)e:for(r=t.stateNode,r._visibility=C?r._visibility&-2:r._visibility|1,C&&(a===null||ne||Ur||Pt||gs(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){ne=a=r;try{if(A=ne.stateNode,C)B=A.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{G=ne.stateNode;var ge=ne.memoizedProps.style,ue=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;G.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ee){pt(ne,ne.return,Ee)}}}else if(r.tag===6){if(a===null){ne=r;try{ne.stateNode.nodeValue=C?"":ne.memoizedProps}catch(Ee){pt(ne,ne.return,Ee)}}}else if(r.tag===18){if(a===null){ne=r;try{var de=ne.stateNode;C?Xy(de,!0):Xy(ne.stateNode,!1)}catch(Ee){pt(ne,ne.return,Ee)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}p&4&&(p=t.updateQueue,p!==null&&(a=p.retryQueue,a!==null&&(p.retryQueue=null,$c(t,a))));break;case 19:xn(r,t),Sn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,$c(t,p)));break;case 30:break;case 21:break;default:xn(r,t),Sn(t)}}function Sn(t){var r=t.flags;if(r&2){try{for(var a,p=t.return;p!==null;){if(Q_(p)){a=p;break}p=p.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,A=gf(t);Uc(t,A,C);break;case 5:var B=a.stateNode;a.flags&32&&(Le(B,""),a.flags&=-33);var G=gf(t);Uc(t,G,B);break;case 3:case 4:var ne=a.stateNode.containerInfo,le=gf(t);vf(t,le,ne);break;default:throw Error(s(161))}}catch(fe){pt(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function oy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;oy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function qr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)ty(t,r.alternate,r),r=r.sibling}function gs(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:wi(4,r,r.return),gs(r);break;case 1:br(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&X_(r,r.return,a),gs(r);break;case 27:Qo(r.stateNode);case 26:case 5:br(r,r.return),gs(r);break;case 22:r.memoizedState===null&&gs(r);break;case 30:gs(r);break;default:gs(r)}t=t.sibling}}function Vr(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,C=t,A=r,B=A.flags;switch(A.tag){case 0:case 11:case 15:Vr(C,A,a),Uo(4,A);break;case 1:if(Vr(C,A,a),p=A,C=p.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(le){pt(p,p.return,le)}if(p=A,C=p.updateQueue,C!==null){var G=p.stateNode;try{var ne=C.shared.hiddenCallbacks;if(ne!==null)for(C.shared.hiddenCallbacks=null,C=0;C<ne.length;C++)zv(ne[C],G)}catch(le){pt(p,p.return,le)}}a&&B&64&&Y_(A),$o(A,A.return);break;case 27:J_(A);case 26:case 5:Vr(C,A,a),a&&p===null&&B&4&&Z_(A),$o(A,A.return);break;case 12:Vr(C,A,a);break;case 31:Vr(C,A,a),a&&B&4&&iy(C,A);break;case 13:Vr(C,A,a),a&&B&4&&sy(C,A);break;case 22:A.memoizedState===null&&Vr(C,A,a),$o(A,A.return);break;case 30:break;default:Vr(C,A,a)}r=r.sibling}}function yf(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Ro(a))}function bf(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ro(t))}function cr(t,r,a,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ly(t,r,a,p),r=r.sibling}function ly(t,r,a,p){var C=r.flags;switch(r.tag){case 0:case 11:case 15:cr(t,r,a,p),C&2048&&Uo(9,r);break;case 1:cr(t,r,a,p);break;case 3:cr(t,r,a,p),C&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ro(t)));break;case 12:if(C&2048){cr(t,r,a,p),t=r.stateNode;try{var A=r.memoizedProps,B=A.id,G=A.onPostCommit;typeof G=="function"&&G(B,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ne){pt(r,r.return,ne)}}else cr(t,r,a,p);break;case 31:cr(t,r,a,p);break;case 13:cr(t,r,a,p);break;case 23:break;case 22:A=r.stateNode,B=r.alternate,r.memoizedState!==null?A._visibility&2?cr(t,r,a,p):qo(t,r):A._visibility&2?cr(t,r,a,p):(A._visibility|=2,ca(t,r,a,p,(r.subtreeFlags&10256)!==0||!1)),C&2048&&yf(B,r);break;case 24:cr(t,r,a,p),C&2048&&bf(r.alternate,r);break;default:cr(t,r,a,p)}}function ca(t,r,a,p,C){for(C=C&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var A=t,B=r,G=a,ne=p,le=B.flags;switch(B.tag){case 0:case 11:case 15:ca(A,B,G,ne,C),Uo(8,B);break;case 23:break;case 22:var fe=B.stateNode;B.memoizedState!==null?fe._visibility&2?ca(A,B,G,ne,C):qo(A,B):(fe._visibility|=2,ca(A,B,G,ne,C)),C&&le&2048&&yf(B.alternate,B);break;case 24:ca(A,B,G,ne,C),C&&le&2048&&bf(B.alternate,B);break;default:ca(A,B,G,ne,C)}r=r.sibling}}function qo(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,p=r,C=p.flags;switch(p.tag){case 22:qo(a,p),C&2048&&yf(p.alternate,p);break;case 24:qo(a,p),C&2048&&bf(p.alternate,p);break;default:qo(a,p)}r=r.sibling}}var Vo=8192;function ua(t,r,a){if(t.subtreeFlags&Vo)for(t=t.child;t!==null;)cy(t,r,a),t=t.sibling}function cy(t,r,a){switch(t.tag){case 26:ua(t,r,a),t.flags&Vo&&t.memoizedState!==null&&N2(a,lr,t.memoizedState,t.memoizedProps);break;case 5:ua(t,r,a);break;case 3:case 4:var p=lr;lr=ru(t.stateNode.containerInfo),ua(t,r,a),lr=p;break;case 22:t.memoizedState===null&&(p=t.alternate,p!==null&&p.memoizedState!==null?(p=Vo,Vo=16777216,ua(t,r,a),Vo=p):ua(t,r,a));break;default:ua(t,r,a)}}function uy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Go(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var p=r[a];Yt=p,hy(p,t)}uy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dy(t),t=t.sibling}function dy(t){switch(t.tag){case 0:case 11:case 15:Go(t),t.flags&2048&&wi(9,t,t.return);break;case 3:Go(t);break;case 12:Go(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,qc(t)):Go(t);break;default:Go(t)}}function qc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var p=r[a];Yt=p,hy(p,t)}uy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:wi(8,r,r.return),qc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,qc(r));break;default:qc(r)}t=t.sibling}}function hy(t,r){for(;Yt!==null;){var a=Yt;switch(a.tag){case 0:case 11:case 15:wi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var p=a.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Ro(a.memoizedState.cache)}if(p=a.child,p!==null)p.return=a,Yt=p;else e:for(a=t;Yt!==null;){p=Yt;var C=p.sibling,A=p.return;if(ny(p),p===a){Yt=null;break e}if(C!==null){C.return=A,Yt=C;break e}Yt=A}}}var WE={getCacheForType:function(t){var r=nn(It),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return nn(It).controller.signal}},KE=typeof WeakMap=="function"?WeakMap:Map,ct=0,_t=null,Ze=null,et=0,ft=0,jn=null,Ci=!1,da=!1,xf=!1,Gr=0,Rt=0,ki=0,vs=0,Sf=0,On=0,ha=0,Wo=null,wn=null,wf=!1,Vc=0,fy=0,Gc=1/0,Wc=null,Ei=null,qt=0,Ai=null,fa=null,Wr=0,Cf=0,kf=null,py=null,Ko=0,Ef=null;function Ln(){return(ct&2)!==0&&et!==0?et&-et:V.T!==null?Nf():ho()}function my(){if(On===0)if((et&536870912)===0||rt){var t=Nr;Nr<<=1,(Nr&3932160)===0&&(Nr=262144),On=t}else On=536870912;return t=Mn.current,t!==null&&(t.flags|=32),On}function Cn(t,r,a){(t===_t&&(ft===2||ft===9)||t.cancelPendingCommit!==null)&&(pa(t,0),Ti(t,et,On,!1)),Tn(t,a),((ct&2)===0||t!==_t)&&(t===_t&&((ct&2)===0&&(vs|=a),Rt===4&&Ti(t,et,On,!1)),xr(t))}function gy(t,r,a){if((ct&6)!==0)throw Error(s(327));var p=!a&&(r&127)===0&&(r&t.expiredLanes)===0||lt(t,r),C=p?ZE(t,r):Tf(t,r,!0),A=p;do{if(C===0){da&&!p&&Ti(t,r,0,!1);break}else{if(a=t.current.alternate,A&&!YE(a)){C=Tf(t,r,!1),A=!1;continue}if(C===2){if(A=r,t.errorRecoveryDisabledLanes&A)var B=0;else B=t.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){r=B;e:{var G=t;C=Wo;var ne=G.current.memoizedState.isDehydrated;if(ne&&(pa(G,B).flags|=256),B=Tf(G,B,!1),B!==2){if(xf&&!ne){G.errorRecoveryDisabledLanes|=A,vs|=A,C=4;break e}A=wn,wn=C,A!==null&&(wn===null?wn=A:wn.push.apply(wn,A))}C=B}if(A=!1,C!==2)continue}}if(C===1){pa(t,0),Ti(t,r,0,!0);break}e:{switch(p=t,A=C,A){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Ti(p,r,On,!Ci);break e;case 2:wn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(C=Vc+300-Et(),10<C)){if(Ti(p,r,On,!Ci),dt(p,0,!0)!==0)break e;Wr=r,p.timeoutHandle=Wy(vy.bind(null,p,a,wn,Wc,wf,r,On,vs,ha,Ci,A,"Throttled",-0,0),C);break e}vy(p,a,wn,Wc,wf,r,On,vs,ha,Ci,A,null,-0,0)}}break}while(!0);xr(t)}function vy(t,r,a,p,C,A,B,G,ne,le,fe,ge,ue,de){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lt},cy(r,A,ge);var Ee=(A&62914560)===A?Vc-Et():(A&4194048)===A?fy-Et():0;if(Ee=j2(ge,Ee),Ee!==null){Wr=A,t.cancelPendingCommit=Ee(ky.bind(null,t,r,A,a,p,C,B,G,ne,fe,ge,null,ue,de)),Ti(t,A,B,!le);return}}ky(t,r,A,a,p,C,B,G,ne)}function YE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var p=0;p<a.length;p++){var C=a[p],A=C.getSnapshot;C=C.value;try{if(!Rn(A(),C))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ti(t,r,a,p){r&=~Sf,r&=~vs,t.suspendedLanes|=r,t.pingedLanes&=~r,p&&(t.warmLanes|=r),p=t.expirationTimes;for(var C=r;0<C;){var A=31-ot(C),B=1<<A;p[A]=-1,C&=~B}a!==0&&Is(t,a,r)}function Kc(){return(ct&6)===0?(Yo(0),!1):!0}function Af(){if(Ze!==null){if(ft===0)var t=Ze.return;else t=Ze,Ir=ls=null,Uh(t),ia=null,Mo=0,t=Ze;for(;t!==null;)K_(t.alternate,t),t=t.return;Ze=null}}function pa(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,m2(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Wr=0,Af(),_t=t,Ze=a=Or(t.current,null),et=r,ft=0,jn=null,Ci=!1,da=lt(t,r),xf=!1,ha=On=Sf=vs=ki=Rt=0,wn=Wo=null,wf=!1,(r&8)!==0&&(r|=r&32);var p=t.entangledLanes;if(p!==0)for(t=t.entanglements,p&=r;0<p;){var C=31-ot(p),A=1<<C;r|=t[C],p&=~A}return Gr=r,mc(),a}function _y(t,r){Ge=null,V.H=Po,r===ra||r===wc?(r=Ov(),ft=3):r===Dh?(r=Ov(),ft=4):ft=r===sf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,jn=r,Ze===null&&(Rt=1,Bc(t,Wn(r,t.current)))}function yy(){var t=Mn.current;return t===null?!0:(et&4194048)===et?Zn===null:(et&62914560)===et||(et&536870912)!==0?t===Zn:!1}function by(){var t=V.H;return V.H=Po,t===null?Po:t}function xy(){var t=V.A;return V.A=WE,t}function Yc(){Rt=4,Ci||(et&4194048)!==et&&Mn.current!==null||(da=!0),(ki&134217727)===0&&(vs&134217727)===0||_t===null||Ti(_t,et,On,!1)}function Tf(t,r,a){var p=ct;ct|=2;var C=by(),A=xy();(_t!==t||et!==r)&&(Wc=null,pa(t,r)),r=!1;var B=Rt;e:do try{if(ft!==0&&Ze!==null){var G=Ze,ne=jn;switch(ft){case 8:Af(),B=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(r=!0);var le=ft;if(ft=0,jn=null,ma(t,G,ne,le),a&&da){B=0;break e}break;default:le=ft,ft=0,jn=null,ma(t,G,ne,le)}}XE(),B=Rt;break}catch(fe){_y(t,fe)}while(!0);return r&&t.shellSuspendCounter++,Ir=ls=null,ct=p,V.H=C,V.A=A,Ze===null&&(_t=null,et=0,mc()),B}function XE(){for(;Ze!==null;)Sy(Ze)}function ZE(t,r){var a=ct;ct|=2;var p=by(),C=xy();_t!==t||et!==r?(Wc=null,Gc=Et()+500,pa(t,r)):da=lt(t,r);e:do try{if(ft!==0&&Ze!==null){r=Ze;var A=jn;t:switch(ft){case 1:ft=0,jn=null,ma(t,r,A,1);break;case 2:case 9:if(Nv(A)){ft=0,jn=null,wy(r);break}r=function(){ft!==2&&ft!==9||_t!==t||(ft=7),xr(t)},A.then(r,r);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Nv(A)?(ft=0,jn=null,wy(r)):(ft=0,jn=null,ma(t,r,A,7));break;case 5:var B=null;switch(Ze.tag){case 26:B=Ze.memoizedState;case 5:case 27:var G=Ze;if(B?lb(B):G.stateNode.complete){ft=0,jn=null;var ne=G.sibling;if(ne!==null)Ze=ne;else{var le=G.return;le!==null?(Ze=le,Xc(le)):Ze=null}break t}}ft=0,jn=null,ma(t,r,A,5);break;case 6:ft=0,jn=null,ma(t,r,A,6);break;case 8:Af(),Rt=6;break e;default:throw Error(s(462))}}QE();break}catch(fe){_y(t,fe)}while(!0);return Ir=ls=null,V.H=p,V.A=C,ct=a,Ze!==null?0:(_t=null,et=0,mc(),Rt)}function QE(){for(;Ze!==null&&!$n();)Sy(Ze)}function Sy(t){var r=G_(t.alternate,t,Gr);t.memoizedProps=t.pendingProps,r===null?Xc(t):Ze=r}function wy(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=F_(a,r,r.pendingProps,r.type,void 0,et);break;case 11:r=F_(a,r,r.pendingProps,r.type.render,r.ref,et);break;case 5:Uh(r);default:K_(a,r),r=Ze=xv(r,Gr),r=G_(a,r,Gr)}t.memoizedProps=t.pendingProps,r===null?Xc(t):Ze=r}function ma(t,r,a,p){Ir=ls=null,Uh(r),ia=null,Mo=0;var C=r.return;try{if(FE(t,C,r,a,et)){Rt=1,Bc(t,Wn(a,t.current)),Ze=null;return}}catch(A){if(C!==null)throw Ze=C,A;Rt=1,Bc(t,Wn(a,t.current)),Ze=null;return}r.flags&32768?(rt||p===1?t=!0:da||(et&536870912)!==0?t=!1:(Ci=t=!0,(p===2||p===9||p===3||p===6)&&(p=Mn.current,p!==null&&p.tag===13&&(p.flags|=16384))),Cy(r,t)):Xc(r)}function Xc(t){var r=t;do{if((r.flags&32768)!==0){Cy(r,Ci);return}t=r.return;var a=$E(r.alternate,r,Gr);if(a!==null){Ze=a;return}if(r=r.sibling,r!==null){Ze=r;return}Ze=r=t}while(r!==null);Rt===0&&(Rt=5)}function Cy(t,r){do{var a=qE(t.alternate,t);if(a!==null){a.flags&=32767,Ze=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=a}while(t!==null);Rt=6,Ze=null}function ky(t,r,a,p,C,A,B,G,ne){t.cancelPendingCommit=null;do Zc();while(qt!==0);if((ct&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(A=r.lanes|r.childLanes,A|=mh,Kd(t,a,A,B,G,ne),t===_t&&(Ze=_t=null,et=0),fa=r,Ai=t,Wr=a,Cf=A,kf=C,py=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,n2(Re,function(){return Dy(),null})):(t.callbackNode=null,t.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=V.T,V.T=null,C=Q.p,Q.p=2,B=ct,ct|=4;try{VE(t,r,a)}finally{ct=B,Q.p=C,V.T=p}}qt=1,Ey(),Ay(),Ty()}}function Ey(){if(qt===1){qt=0;var t=Ai,r=fa,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var p=Q.p;Q.p=2;var C=ct;ct|=4;try{ay(r,t);var A=Ff,B=hv(t.containerInfo),G=A.focusedElem,ne=A.selectionRange;if(B!==G&&G&&G.ownerDocument&&dv(G.ownerDocument.documentElement,G)){if(ne!==null&&uh(G)){var le=ne.start,fe=ne.end;if(fe===void 0&&(fe=le),"selectionStart"in G)G.selectionStart=le,G.selectionEnd=Math.min(fe,G.value.length);else{var ge=G.ownerDocument||document,ue=ge&&ge.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),Ee=G.textContent.length,Fe=Math.min(ne.start,Ee),vt=ne.end===void 0?Fe:Math.min(ne.end,Ee);!de.extend&&Fe>vt&&(B=vt,vt=Fe,Fe=B);var se=uv(G,Fe),ie=uv(G,vt);if(se&&ie&&(de.rangeCount!==1||de.anchorNode!==se.node||de.anchorOffset!==se.offset||de.focusNode!==ie.node||de.focusOffset!==ie.offset)){var oe=ge.createRange();oe.setStart(se.node,se.offset),de.removeAllRanges(),Fe>vt?(de.addRange(oe),de.extend(ie.node,ie.offset)):(oe.setEnd(ie.node,ie.offset),de.addRange(oe))}}}}for(ge=[],de=G;de=de.parentNode;)de.nodeType===1&&ge.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<ge.length;G++){var me=ge[G];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}cu=!!Pf,Ff=Pf=null}finally{ct=C,Q.p=p,V.T=a}}t.current=r,qt=2}}function Ay(){if(qt===2){qt=0;var t=Ai,r=fa,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var p=Q.p;Q.p=2;var C=ct;ct|=4;try{ty(t,r.alternate,r)}finally{ct=C,Q.p=p,V.T=a}}qt=3}}function Ty(){if(qt===4||qt===3){qt=0,Dt();var t=Ai,r=fa,a=Wr,p=py;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?qt=5:(qt=0,fa=Ai=null,Ry(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(Ei=null),uo(a),r=r.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=V.T,C=Q.p,Q.p=2,V.T=null;try{for(var A=t.onRecoverableError,B=0;B<p.length;B++){var G=p[B];A(G.value,{componentStack:G.stack})}}finally{V.T=r,Q.p=C}}(Wr&3)!==0&&Zc(),xr(t),C=t.pendingLanes,(a&261930)!==0&&(C&42)!==0?t===Ef?Ko++:(Ko=0,Ef=t):Ko=0,Yo(0)}}function Ry(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Ro(r)))}function Zc(){return Ey(),Ay(),Ty(),Dy()}function Dy(){if(qt!==5)return!1;var t=Ai,r=Cf;Cf=0;var a=uo(Wr),p=V.T,C=Q.p;try{Q.p=32>a?32:a,V.T=null,a=kf,kf=null;var A=Ai,B=Wr;if(qt=0,fa=Ai=null,Wr=0,(ct&6)!==0)throw Error(s(331));var G=ct;if(ct|=4,dy(A.current),ly(A,A.current,B,a),ct=G,Yo(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(At,A)}catch{}return!0}finally{Q.p=C,V.T=p,Ry(t,r)}}function My(t,r,a){r=Wn(a,r),r=rf(t.stateNode,r,2),t=bi(t,r,2),t!==null&&(Tn(t,2),xr(t))}function pt(t,r,a){if(t.tag===3)My(t,t,a);else for(;r!==null;){if(r.tag===3){My(r,t,a);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ei===null||!Ei.has(p))){t=Wn(a,t),a=N_(2),p=bi(r,a,2),p!==null&&(j_(a,p,r,t),Tn(p,2),xr(p));break}}r=r.return}}function Rf(t,r,a){var p=t.pingCache;if(p===null){p=t.pingCache=new KE;var C=new Set;p.set(r,C)}else C=p.get(r),C===void 0&&(C=new Set,p.set(r,C));C.has(a)||(xf=!0,C.add(a),t=JE.bind(null,t,r,a),r.then(t,t))}function JE(t,r,a){var p=t.pingCache;p!==null&&p.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,_t===t&&(et&a)===a&&(Rt===4||Rt===3&&(et&62914560)===et&&300>Et()-Vc?(ct&2)===0&&pa(t,0):Sf|=a,ha===et&&(ha=0)),xr(t)}function Ny(t,r){r===0&&(r=Ji()),t=ss(t,r),t!==null&&(Tn(t,r),xr(t))}function e2(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),Ny(t,a)}function t2(t,r){var a=0;switch(t.tag){case 31:case 13:var p=t.stateNode,C=t.memoizedState;C!==null&&(a=C.retryLane);break;case 19:p=t.stateNode;break;case 22:p=t.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(r),Ny(t,a)}function n2(t,r){return on(t,r)}var Qc=null,ga=null,Df=!1,Jc=!1,Mf=!1,Ri=0;function xr(t){t!==ga&&t.next===null&&(ga===null?Qc=ga=t:ga=ga.next=t),Jc=!0,Df||(Df=!0,i2())}function Yo(t,r){if(!Mf&&Jc){Mf=!0;do for(var a=!1,p=Qc;p!==null;){if(t!==0){var C=p.pendingLanes;if(C===0)var A=0;else{var B=p.suspendedLanes,G=p.pingedLanes;A=(1<<31-ot(42|t)+1)-1,A&=C&~(B&~G),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(a=!0,Iy(p,A))}else A=et,A=dt(p,p===_t?A:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(A&3)===0||lt(p,A)||(a=!0,Iy(p,A));p=p.next}while(a);Mf=!1}}function r2(){jy()}function jy(){Jc=Df=!1;var t=0;Ri!==0&&p2()&&(t=Ri);for(var r=Et(),a=null,p=Qc;p!==null;){var C=p.next,A=Oy(p,r);A===0?(p.next=null,a===null?Qc=C:a.next=C,C===null&&(ga=a)):(a=p,(t!==0||(A&3)!==0)&&(Jc=!0)),p=C}qt!==0&&qt!==5||Yo(t),Ri!==0&&(Ri=0)}function Oy(t,r){for(var a=t.suspendedLanes,p=t.pingedLanes,C=t.expirationTimes,A=t.pendingLanes&-62914561;0<A;){var B=31-ot(A),G=1<<B,ne=C[B];ne===-1?((G&a)===0||(G&p)!==0)&&(C[B]=Os(G,r)):ne<=r&&(t.expiredLanes|=G),A&=~G}if(r=_t,a=et,a=dt(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p=t.callbackNode,a===0||t===r&&(ft===2||ft===9)||t.cancelPendingCommit!==null)return p!==null&&p!==null&&Kt(p),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||lt(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(p!==null&&Kt(p),uo(a)){case 2:case 8:a=Se;break;case 32:a=Re;break;case 268435456:a=Ve;break;default:a=Re}return p=Ly.bind(null,t),a=on(a,p),t.callbackPriority=r,t.callbackNode=a,r}return p!==null&&p!==null&&Kt(p),t.callbackPriority=2,t.callbackNode=null,2}function Ly(t,r){if(qt!==0&&qt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Zc()&&t.callbackNode!==a)return null;var p=et;return p=dt(t,t===_t?p:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p===0?null:(gy(t,p,r),Oy(t,Et()),t.callbackNode!=null&&t.callbackNode===a?Ly.bind(null,t):null)}function Iy(t,r){if(Zc())return null;gy(t,r,!0)}function i2(){g2(function(){(ct&6)!==0?on(he,r2):jy()})}function Nf(){if(Ri===0){var t=ta;t===0&&(t=Mr,Mr<<=1,(Mr&261888)===0&&(Mr=256)),Ri=t}return Ri}function By(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ln(""+t)}function zy(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function s2(t,r,a,p,C){if(r==="submit"&&a&&a.stateNode===C){var A=By((C[en]||null).action),B=p.submitter;B&&(r=(r=B[en]||null)?By(r.formAction):B.getAttribute("formAction"),r!==null&&(A=r,B=null));var G=new dc("action","action",null,p,C);t.push({event:G,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Ri!==0){var ne=B?zy(C,B):new FormData(C);Zh(a,{pending:!0,data:ne,method:C.method,action:A},null,ne)}}else typeof A=="function"&&(G.preventDefault(),ne=B?zy(C,B):new FormData(C),Zh(a,{pending:!0,data:ne,method:C.method,action:A},A,ne))},currentTarget:C}]})}}for(var jf=0;jf<ph.length;jf++){var Of=ph[jf],a2=Of.toLowerCase(),o2=Of[0].toUpperCase()+Of.slice(1);or(a2,"on"+o2)}or(mv,"onAnimationEnd"),or(gv,"onAnimationIteration"),or(vv,"onAnimationStart"),or("dblclick","onDoubleClick"),or("focusin","onFocus"),or("focusout","onBlur"),or(wE,"onTransitionRun"),or(CE,"onTransitionStart"),or(kE,"onTransitionCancel"),or(_v,"onTransitionEnd"),di("onMouseEnter",["mouseout","mouseover"]),di("onMouseLeave",["mouseout","mouseover"]),di("onPointerEnter",["pointerout","pointerover"]),di("onPointerLeave",["pointerout","pointerover"]),vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="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(" "),l2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xo));function Py(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var p=t[a],C=p.event;p=p.listeners;e:{var A=void 0;if(r)for(var B=p.length-1;0<=B;B--){var G=p[B],ne=G.instance,le=G.currentTarget;if(G=G.listener,ne!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){pc(fe)}C.currentTarget=null,A=ne}else for(B=0;B<p.length;B++){if(G=p[B],ne=G.instance,le=G.currentTarget,G=G.listener,ne!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){pc(fe)}C.currentTarget=null,A=ne}}}}function Qe(t,r){var a=r[fo];a===void 0&&(a=r[fo]=new Set);var p=t+"__bubble";a.has(p)||(Fy(r,t,2,!1),a.add(p))}function Lf(t,r,a){var p=0;r&&(p|=4),Fy(a,t,p,r)}var eu="_reactListening"+Math.random().toString(36).slice(2);function If(t){if(!t[eu]){t[eu]=!0,rc.forEach(function(a){a!=="selectionchange"&&(l2.has(a)||Lf(a,!1,t),Lf(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[eu]||(r[eu]=!0,Lf("selectionchange",!1,r))}}function Fy(t,r,a,p){switch(mb(r)){case 2:var C=I2;break;case 8:C=B2;break;default:C=Zf}a=C.bind(null,r,a,t),C=void 0,!th||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(C=!0),p?C!==void 0?t.addEventListener(r,a,{capture:!0,passive:C}):t.addEventListener(r,a,!0):C!==void 0?t.addEventListener(r,a,{passive:C}):t.addEventListener(r,a,!1)}function Bf(t,r,a,p,C){var A=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var B=p.tag;if(B===3||B===4){var G=p.stateNode.containerInfo;if(G===C)break;if(B===4)for(B=p.return;B!==null;){var ne=B.tag;if((ne===3||ne===4)&&B.stateNode.containerInfo===C)return;B=B.return}for(;G!==null;){if(B=li(G),B===null)return;if(ne=B.tag,ne===5||ne===6||ne===26||ne===27){p=A=B;continue e}G=G.parentNode}}p=p.return}Vg(function(){var le=A,fe=Jd(a),ge=[];e:{var ue=yv.get(t);if(ue!==void 0){var de=dc,Ee=t;switch(t){case"keypress":if(cc(a)===0)break e;case"keydown":case"keyup":de=tE;break;case"focusin":Ee="focus",de=sh;break;case"focusout":Ee="blur",de=sh;break;case"beforeblur":case"afterblur":de=sh;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":de=Kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=$k;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=iE;break;case mv:case gv:case vv:de=Gk;break;case _v:de=aE;break;case"scroll":case"scrollend":de=Hk;break;case"wheel":de=lE;break;case"copy":case"cut":case"paste":de=Kk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Xg;break;case"toggle":case"beforetoggle":de=uE}var Fe=(r&4)!==0,vt=!Fe&&(t==="scroll"||t==="scrollend"),se=Fe?ue!==null?ue+"Capture":null:ue;Fe=[];for(var ie=le,oe;ie!==null;){var me=ie;if(oe=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||oe===null||se===null||(me=_o(ie,se),me!=null&&Fe.push(Zo(ie,me,oe))),vt)break;ie=ie.return}0<Fe.length&&(ue=new de(ue,Ee,null,a,fe),ge.push({event:ue,listeners:Fe}))}}if((r&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",de=t==="mouseout"||t==="pointerout",ue&&a!==hi&&(Ee=a.relatedTarget||a.fromElement)&&(li(Ee)||Ee[Pe]))break e;if((de||ue)&&(ue=fe.window===fe?fe:(ue=fe.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(Ee=a.relatedTarget||a.toElement,de=le,Ee=Ee?li(Ee):null,Ee!==null&&(vt=h(Ee),Fe=Ee.tag,Ee!==vt||Fe!==5&&Fe!==27&&Fe!==6)&&(Ee=null)):(de=null,Ee=le),de!==Ee)){if(Fe=Kg,me="onMouseLeave",se="onMouseEnter",ie="mouse",(t==="pointerout"||t==="pointerover")&&(Fe=Xg,me="onPointerLeave",se="onPointerEnter",ie="pointer"),vt=de==null?ue:ts(de),oe=Ee==null?ue:ts(Ee),ue=new Fe(me,ie+"leave",de,a,fe),ue.target=vt,ue.relatedTarget=oe,me=null,li(fe)===le&&(Fe=new Fe(se,ie+"enter",Ee,a,fe),Fe.target=oe,Fe.relatedTarget=vt,me=Fe),vt=me,de&&Ee)t:{for(Fe=c2,se=de,ie=Ee,oe=0,me=se;me;me=Fe(me))oe++;me=0;for(var Ie=ie;Ie;Ie=Fe(Ie))me++;for(;0<oe-me;)se=Fe(se),oe--;for(;0<me-oe;)ie=Fe(ie),me--;for(;oe--;){if(se===ie||ie!==null&&se===ie.alternate){Fe=se;break t}se=Fe(se),ie=Fe(ie)}Fe=null}else Fe=null;de!==null&&Hy(ge,ue,de,Fe,!1),Ee!==null&&vt!==null&&Hy(ge,vt,Ee,Fe,!0)}}e:{if(ue=le?ts(le):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var st=iv;else if(nv(ue))if(sv)st=bE;else{st=_E;var Ne=vE}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&we(le.elementType)&&(st=iv):st=yE;if(st&&(st=st(t,le))){rv(ge,st,a,fe);break e}Ne&&Ne(t,ue,le),t==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&$s(ue,"number",ue.value)}switch(Ne=le?ts(le):window,t){case"focusin":(nv(Ne)||Ne.contentEditable==="true")&&(Ws=Ne,dh=le,Eo=null);break;case"focusout":Eo=dh=Ws=null;break;case"mousedown":hh=!0;break;case"contextmenu":case"mouseup":case"dragend":hh=!1,fv(ge,a,fe);break;case"selectionchange":if(SE)break;case"keydown":case"keyup":fv(ge,a,fe)}var We;if(oh)e:{switch(t){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Gs?ev(t,a)&&(tt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(tt="onCompositionStart");tt&&(Zg&&a.locale!=="ko"&&(Gs||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Gs&&(We=Gg()):(fi=fe,nh="value"in fi?fi.value:fi.textContent,Gs=!0)),Ne=tu(le,tt),0<Ne.length&&(tt=new Yg(tt,t,null,a,fe),ge.push({event:tt,listeners:Ne}),We?tt.data=We:(We=tv(a),We!==null&&(tt.data=We)))),(We=hE?fE(t,a):pE(t,a))&&(tt=tu(le,"onBeforeInput"),0<tt.length&&(Ne=new Yg("onBeforeInput","beforeinput",null,a,fe),ge.push({event:Ne,listeners:tt}),Ne.data=We)),s2(ge,t,le,a,fe)}Py(ge,r)})}function Zo(t,r,a){return{instance:t,listener:r,currentTarget:a}}function tu(t,r){for(var a=r+"Capture",p=[];t!==null;){var C=t,A=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||A===null||(C=_o(t,a),C!=null&&p.unshift(Zo(t,C,A)),C=_o(t,r),C!=null&&p.push(Zo(t,C,A))),t.tag===3)return p;t=t.return}return[]}function c2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hy(t,r,a,p,C){for(var A=r._reactName,B=[];a!==null&&a!==p;){var G=a,ne=G.alternate,le=G.stateNode;if(G=G.tag,ne!==null&&ne===p)break;G!==5&&G!==26&&G!==27||le===null||(ne=le,C?(le=_o(a,A),le!=null&&B.unshift(Zo(a,le,ne))):C||(le=_o(a,A),le!=null&&B.push(Zo(a,le,ne)))),a=a.return}B.length!==0&&t.push({event:r,listeners:B})}var u2=/\r\n?/g,d2=/\u0000|\uFFFD/g;function Uy(t){return(typeof t=="string"?t:""+t).replace(u2,`
|
|
49
|
-
`).replace(d2,"")}function $y(t,r){return r=Uy(r),Uy(t)===r}function gt(t,r,a,p,C,A){switch(a){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||Le(t,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&Le(t,""+p);break;case"className":Fs(t,"class",p);break;case"tabIndex":Fs(t,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Fs(t,a,p);break;case"style":ye(t,p,A);break;case"data":if(r!=="object"){Fs(t,"data",p);break}case"src":case"href":if(p===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(a);break}p=ln(""+p),t.setAttribute(a,p);break;case"action":case"formAction":if(typeof p=="function"){t.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 A=="function"&&(a==="formAction"?(r!=="input"&>(t,r,"name",C.name,C,null),gt(t,r,"formEncType",C.formEncType,C,null),gt(t,r,"formMethod",C.formMethod,C,null),gt(t,r,"formTarget",C.formTarget,C,null)):(gt(t,r,"encType",C.encType,C,null),gt(t,r,"method",C.method,C,null),gt(t,r,"target",C.target,C,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(a);break}p=ln(""+p),t.setAttribute(a,p);break;case"onClick":p!=null&&(t.onclick=Lt);break;case"onScroll":p!=null&&Qe("scroll",t);break;case"onScrollEnd":p!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(a=p.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":t.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){t.removeAttribute("xlink:href");break}a=ln(""+p),t.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":p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,""+p):t.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":p&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":p===!0?t.setAttribute(a,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,p):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?t.setAttribute(a,p):t.removeAttribute(a);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?t.removeAttribute(a):t.setAttribute(a,p);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),Ps(t,"popover",p);break;case"xlinkActuate":ar(t,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":ar(t,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":ar(t,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":ar(t,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":ar(t,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":ar(t,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":ar(t,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":ar(t,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":ar(t,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ps(t,"is",p);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ht.get(a)||a,Ps(t,a,p))}}function zf(t,r,a,p,C,A){switch(a){case"style":ye(t,p,A);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(a=p.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof p=="string"?Le(t,p):(typeof p=="number"||typeof p=="bigint")&&Le(t,""+p);break;case"onScroll":p!=null&&Qe("scroll",t);break;case"onScrollEnd":p!=null&&Qe("scrollend",t);break;case"onClick":p!=null&&(t.onclick=Lt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ic.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(C=a.endsWith("Capture"),r=a.slice(2,C?a.length-7:void 0),A=t[en]||null,A=A!=null?A[a]:null,typeof A=="function"&&t.removeEventListener(r,A,C),typeof p=="function")){typeof A!="function"&&A!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,p,C);break e}a in t?t[a]=p:p===!0?t.setAttribute(a,""):Ps(t,a,p)}}}function sn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var p=!1,C=!1,A;for(A in a)if(a.hasOwnProperty(A)){var B=a[A];if(B!=null)switch(A){case"src":p=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:gt(t,r,A,B,a,null)}}C&>(t,r,"srcSet",a.srcSet,a,null),p&>(t,r,"src",a.src,a,null);return;case"input":Qe("invalid",t);var G=A=B=C=null,ne=null,le=null;for(p in a)if(a.hasOwnProperty(p)){var fe=a[p];if(fe!=null)switch(p){case"name":C=fe;break;case"type":B=fe;break;case"checked":ne=fe;break;case"defaultChecked":le=fe;break;case"value":A=fe;break;case"defaultValue":G=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:gt(t,r,p,fe,a,null)}}vo(t,A,G,ne,le,B,C,!1);return;case"select":Qe("invalid",t),p=B=A=null;for(C in a)if(a.hasOwnProperty(C)&&(G=a[C],G!=null))switch(C){case"value":A=G;break;case"defaultValue":B=G;break;case"multiple":p=G;default:gt(t,r,C,G,a,null)}r=A,a=B,t.multiple=!!p,r!=null?Z(t,!!p,r,!1):a!=null&&Z(t,!!p,a,!0);return;case"textarea":Qe("invalid",t),A=C=p=null;for(B in a)if(a.hasOwnProperty(B)&&(G=a[B],G!=null))switch(B){case"value":p=G;break;case"defaultValue":C=G;break;case"children":A=G;break;case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(91));break;default:gt(t,r,B,G,a,null)}Ue(t,p,C,A);return;case"option":for(ne in a)if(a.hasOwnProperty(ne)&&(p=a[ne],p!=null))switch(ne){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:gt(t,r,ne,p,a,null)}return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(p=0;p<Xo.length;p++)Qe(Xo[p],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in a)if(a.hasOwnProperty(le)&&(p=a[le],p!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:gt(t,r,le,p,a,null)}return;default:if(we(r)){for(fe in a)a.hasOwnProperty(fe)&&(p=a[fe],p!==void 0&&zf(t,r,fe,p,a,void 0));return}}for(G in a)a.hasOwnProperty(G)&&(p=a[G],p!=null&>(t,r,G,p,a,null))}function h2(t,r,a,p){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,A=null,B=null,G=null,ne=null,le=null,fe=null;for(de in a){var ge=a[de];if(a.hasOwnProperty(de)&&ge!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":ne=ge;default:p.hasOwnProperty(de)||gt(t,r,de,null,p,ge)}}for(var ue in p){var de=p[ue];if(ge=a[ue],p.hasOwnProperty(ue)&&(de!=null||ge!=null))switch(ue){case"type":A=de;break;case"name":C=de;break;case"checked":le=de;break;case"defaultChecked":fe=de;break;case"value":B=de;break;case"defaultValue":G=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:de!==ge&>(t,r,ue,de,p,ge)}}Us(t,B,G,ne,le,fe,A,C);return;case"select":de=B=G=ue=null;for(A in a)if(ne=a[A],a.hasOwnProperty(A)&&ne!=null)switch(A){case"value":break;case"multiple":de=ne;default:p.hasOwnProperty(A)||gt(t,r,A,null,p,ne)}for(C in p)if(A=p[C],ne=a[C],p.hasOwnProperty(C)&&(A!=null||ne!=null))switch(C){case"value":ue=A;break;case"defaultValue":G=A;break;case"multiple":B=A;default:A!==ne&>(t,r,C,A,p,ne)}r=G,a=B,p=de,ue!=null?Z(t,!!a,ue,!1):!!p!=!!a&&(r!=null?Z(t,!!a,r,!0):Z(t,!!a,a?[]:"",!1));return;case"textarea":de=ue=null;for(G in a)if(C=a[G],a.hasOwnProperty(G)&&C!=null&&!p.hasOwnProperty(G))switch(G){case"value":break;case"children":break;default:gt(t,r,G,null,p,C)}for(B in p)if(C=p[B],A=a[B],p.hasOwnProperty(B)&&(C!=null||A!=null))switch(B){case"value":ue=C;break;case"defaultValue":de=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==A&>(t,r,B,C,p,A)}be(t,ue,de);return;case"option":for(var Ee in a)if(ue=a[Ee],a.hasOwnProperty(Ee)&&ue!=null&&!p.hasOwnProperty(Ee))switch(Ee){case"selected":t.selected=!1;break;default:gt(t,r,Ee,null,p,ue)}for(ne in p)if(ue=p[ne],de=a[ne],p.hasOwnProperty(ne)&&ue!==de&&(ue!=null||de!=null))switch(ne){case"selected":t.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:gt(t,r,ne,ue,p,de)}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 Fe in a)ue=a[Fe],a.hasOwnProperty(Fe)&&ue!=null&&!p.hasOwnProperty(Fe)&>(t,r,Fe,null,p,ue);for(le in p)if(ue=p[le],de=a[le],p.hasOwnProperty(le)&&ue!==de&&(ue!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:gt(t,r,le,ue,p,de)}return;default:if(we(r)){for(var vt in a)ue=a[vt],a.hasOwnProperty(vt)&&ue!==void 0&&!p.hasOwnProperty(vt)&&zf(t,r,vt,void 0,p,ue);for(fe in p)ue=p[fe],de=a[fe],!p.hasOwnProperty(fe)||ue===de||ue===void 0&&de===void 0||zf(t,r,fe,ue,p,de);return}}for(var se in a)ue=a[se],a.hasOwnProperty(se)&&ue!=null&&!p.hasOwnProperty(se)&>(t,r,se,null,p,ue);for(ge in p)ue=p[ge],de=a[ge],!p.hasOwnProperty(ge)||ue===de||ue==null&&de==null||gt(t,r,ge,ue,p,de)}function qy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),p=0;p<a.length;p++){var C=a[p],A=C.transferSize,B=C.initiatorType,G=C.duration;if(A&&G&&qy(B)){for(B=0,G=C.responseEnd,p+=1;p<a.length;p++){var ne=a[p],le=ne.startTime;if(le>G)break;var fe=ne.transferSize,ge=ne.initiatorType;fe&&qy(ge)&&(ne=ne.responseEnd,B+=fe*(ne<G?1:(G-le)/(ne-le)))}if(--p,r+=8*(A+B)/(C.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Pf=null,Ff=null;function nu(t){return t.nodeType===9?t:t.ownerDocument}function Vy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Gy(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Hf(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Uf=null;function p2(){var t=window.event;return t&&t.type==="popstate"?t===Uf?!1:(Uf=t,!0):(Uf=null,!1)}var Wy=typeof setTimeout=="function"?setTimeout:void 0,m2=typeof clearTimeout=="function"?clearTimeout:void 0,Ky=typeof Promise=="function"?Promise:void 0,g2=typeof queueMicrotask=="function"?queueMicrotask:typeof Ky<"u"?function(t){return Ky.resolve(null).then(t).catch(v2)}:Wy;function v2(t){setTimeout(function(){throw t})}function Di(t){return t==="head"}function Yy(t,r){var a=r,p=0;do{var C=a.nextSibling;if(t.removeChild(a),C&&C.nodeType===8)if(a=C.data,a==="/$"||a==="/&"){if(p===0){t.removeChild(C),ba(r);return}p--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")p++;else if(a==="html")Qo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Qo(a);for(var A=a.firstChild;A;){var B=A.nextSibling,G=A.nodeName;A[es]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&A.rel.toLowerCase()==="stylesheet"||a.removeChild(A),A=B}}else a==="body"&&Qo(t.ownerDocument.body);a=C}while(a);ba(r)}function Xy(t,r){var a=t;t=0;do{var p=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),p&&p.nodeType===8)if(a=p.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=p}while(a)}function $f(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":$f(a),po(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function _2(t,r,a,p){for(;t.nodeType===1;){var C=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!p&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(p){if(!t[es])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(A=t.getAttribute("rel"),A==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(A!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(A=t.getAttribute("src"),(A!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&A&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var A=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===A)return t}else return t;if(t=Qn(t.nextSibling),t===null)break}return null}function y2(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Qn(t.nextSibling),t===null))return null;return t}function Zy(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Qn(t.nextSibling),t===null))return null;return t}function qf(t){return t.data==="$?"||t.data==="$~"}function Vf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function b2(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var p=function(){r(),a.removeEventListener("DOMContentLoaded",p)};a.addEventListener("DOMContentLoaded",p),t._reactRetry=p}}function Qn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Gf=null;function Qy(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Qn(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Jy(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function eb(t,r,a){switch(r=nu(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Qo(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);po(t)}var Jn=new Map,tb=new Set;function ru(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Kr=Q.d;Q.d={f:x2,r:S2,D:w2,C:C2,L:k2,m:E2,X:T2,S:A2,M:R2};function x2(){var t=Kr.f(),r=Kc();return t||r}function S2(t){var r=ci(t);r!==null&&r.tag===5&&r.type==="form"?__(r):Kr.r(t)}var va=typeof document>"u"?null:document;function nb(t,r,a){var p=va;if(p&&typeof r=="string"&&r){var C=fn(r);C='link[rel="'+t+'"][href="'+C+'"]',typeof a=="string"&&(C+='[crossorigin="'+a+'"]'),tb.has(C)||(tb.add(C),t={rel:t,crossOrigin:a,href:r},p.querySelector(C)===null&&(r=p.createElement("link"),sn(r,"link",t),Ot(r),p.head.appendChild(r)))}}function w2(t){Kr.D(t),nb("dns-prefetch",t,null)}function C2(t,r){Kr.C(t,r),nb("preconnect",t,r)}function k2(t,r,a){Kr.L(t,r,a);var p=va;if(p&&t&&r){var C='link[rel="preload"][as="'+fn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(C+='[imagesrcset="'+fn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(C+='[imagesizes="'+fn(a.imageSizes)+'"]')):C+='[href="'+fn(t)+'"]';var A=C;switch(r){case"style":A=_a(t);break;case"script":A=ya(t)}Jn.has(A)||(t=f({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Jn.set(A,t),p.querySelector(C)!==null||r==="style"&&p.querySelector(Jo(A))||r==="script"&&p.querySelector(el(A))||(r=p.createElement("link"),sn(r,"link",t),Ot(r),p.head.appendChild(r)))}}function E2(t,r){Kr.m(t,r);var a=va;if(a&&t){var p=r&&typeof r.as=="string"?r.as:"script",C='link[rel="modulepreload"][as="'+fn(p)+'"][href="'+fn(t)+'"]',A=C;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=ya(t)}if(!Jn.has(A)&&(t=f({rel:"modulepreload",href:t},r),Jn.set(A,t),a.querySelector(C)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(el(A)))return}p=a.createElement("link"),sn(p,"link",t),Ot(p),a.head.appendChild(p)}}}function A2(t,r,a){Kr.S(t,r,a);var p=va;if(p&&t){var C=ui(p).hoistableStyles,A=_a(t);r=r||"default";var B=C.get(A);if(!B){var G={loading:0,preload:null};if(B=p.querySelector(Jo(A)))G.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Jn.get(A))&&Wf(t,a);var ne=B=p.createElement("link");Ot(ne),sn(ne,"link",t),ne._p=new Promise(function(le,fe){ne.onload=le,ne.onerror=fe}),ne.addEventListener("load",function(){G.loading|=1}),ne.addEventListener("error",function(){G.loading|=2}),G.loading|=4,iu(B,r,p)}B={type:"stylesheet",instance:B,count:1,state:G},C.set(A,B)}}}function T2(t,r){Kr.X(t,r);var a=va;if(a&&t){var p=ui(a).hoistableScripts,C=ya(t),A=p.get(C);A||(A=a.querySelector(el(C)),A||(t=f({src:t,async:!0},r),(r=Jn.get(C))&&Kf(t,r),A=a.createElement("script"),Ot(A),sn(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function R2(t,r){Kr.M(t,r);var a=va;if(a&&t){var p=ui(a).hoistableScripts,C=ya(t),A=p.get(C);A||(A=a.querySelector(el(C)),A||(t=f({src:t,async:!0,type:"module"},r),(r=Jn.get(C))&&Kf(t,r),A=a.createElement("script"),Ot(A),sn(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function rb(t,r,a,p){var C=(C=te.current)?ru(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=_a(a.href),a=ui(C).hoistableStyles,p=a.get(r),p||(p={type:"style",instance:null,count:0,state:null},a.set(r,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=_a(a.href);var A=ui(C).hoistableStyles,B=A.get(t);if(B||(C=C.ownerDocument||C,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(t,B),(A=C.querySelector(Jo(t)))&&!A._p&&(B.instance=A,B.state.loading=5),Jn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jn.set(t,a),A||D2(C,t,a,B.state))),r&&p===null)throw Error(s(528,""));return B}if(r&&p!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ya(a),a=ui(C).hoistableScripts,p=a.get(r),p||(p={type:"script",instance:null,count:0,state:null},a.set(r,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function _a(t){return'href="'+fn(t)+'"'}function Jo(t){return'link[rel="stylesheet"]['+t+"]"}function ib(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function D2(t,r,a,p){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?p.loading=1:(r=t.createElement("link"),p.preload=r,r.addEventListener("load",function(){return p.loading|=1}),r.addEventListener("error",function(){return p.loading|=2}),sn(r,"link",a),Ot(r),t.head.appendChild(r))}function ya(t){return'[src="'+fn(t)+'"]'}function el(t){return"script[async]"+t}function sb(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var p=t.querySelector('style[data-href~="'+fn(a.href)+'"]');if(p)return r.instance=p,Ot(p),p;var C=f({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return p=(t.ownerDocument||t).createElement("style"),Ot(p),sn(p,"style",C),iu(p,a.precedence,t),r.instance=p;case"stylesheet":C=_a(a.href);var A=t.querySelector(Jo(C));if(A)return r.state.loading|=4,r.instance=A,Ot(A),A;p=ib(a),(C=Jn.get(C))&&Wf(p,C),A=(t.ownerDocument||t).createElement("link"),Ot(A);var B=A;return B._p=new Promise(function(G,ne){B.onload=G,B.onerror=ne}),sn(A,"link",p),r.state.loading|=4,iu(A,a.precedence,t),r.instance=A;case"script":return A=ya(a.src),(C=t.querySelector(el(A)))?(r.instance=C,Ot(C),C):(p=a,(C=Jn.get(A))&&(p=f({},a),Kf(p,C)),t=t.ownerDocument||t,C=t.createElement("script"),Ot(C),sn(C,"link",p),t.head.appendChild(C),r.instance=C);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(p=r.instance,r.state.loading|=4,iu(p,a.precedence,t));return r.instance}function iu(t,r,a){for(var p=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=p.length?p[p.length-1]:null,A=C,B=0;B<p.length;B++){var G=p[B];if(G.dataset.precedence===r)A=G;else if(A!==C)break}A?A.parentNode.insertBefore(t,A.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Wf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Kf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var su=null;function ab(t,r,a){if(su===null){var p=new Map,C=su=new Map;C.set(a,p)}else C=su,p=C.get(a),p||(p=new Map,C.set(a,p));if(p.has(t))return p;for(p.set(t,null),a=a.getElementsByTagName(t),C=0;C<a.length;C++){var A=a[C];if(!(A[es]||A[Ht]||t==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var B=A.getAttribute(r)||"";B=t+B;var G=p.get(B);G?G.push(A):p.set(B,[A])}}return p}function ob(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function M2(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function lb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function N2(t,r,a,p){if(a.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var C=_a(p.href),A=r.querySelector(Jo(C));if(A){r=A._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=au.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=A,Ot(A);return}A=r.ownerDocument||r,p=ib(p),(C=Jn.get(C))&&Wf(p,C),A=A.createElement("link"),Ot(A);var B=A;B._p=new Promise(function(G,ne){B.onload=G,B.onerror=ne}),sn(A,"link",p),a.instance=A}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=au.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Yf=0;function j2(t,r){return t.stylesheets&&t.count===0&&lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var p=setTimeout(function(){if(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend){var A=t.unsuspend;t.unsuspend=null,A()}},6e4+r);0<t.imgBytes&&Yf===0&&(Yf=62500*f2());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend)){var A=t.unsuspend;t.unsuspend=null,A()}},(t.imgBytes>Yf?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(p),clearTimeout(C)}}:null}function au(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ou=null;function lu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ou=new Map,r.forEach(O2,t),ou=null,au.call(t))}function O2(t,r){if(!(r.state.loading&4)){var a=ou.get(t);if(a)var p=a.get(null);else{a=new Map,ou.set(t,a);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<C.length;A++){var B=C[A];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(a.set(B.dataset.precedence,B),p=B)}p&&a.set(null,p)}C=r.instance,B=C.getAttribute("data-precedence"),A=a.get(B)||p,A===p&&a.set(null,C),a.set(B,C),this.count++,p=au.bind(this),C.addEventListener("load",p),C.addEventListener("error",p),A?A.parentNode.insertBefore(C,A.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),r.state.loading|=4}}var tl={$$typeof:x,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function L2(t,r,a,p,C,A,B,G,ne){this.tag=1,this.containerInfo=t,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=Ls(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ls(0),this.hiddenUpdates=Ls(null),this.identifierPrefix=p,this.onUncaughtError=C,this.onCaughtError=A,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function cb(t,r,a,p,C,A,B,G,ne,le,fe,ge){return t=new L2(t,r,a,B,ne,le,fe,ge,G),r=1,A===!0&&(r|=24),A=Dn(3,null,null,r),t.current=A,A.stateNode=t,r=Ah(),r.refCount++,t.pooledCache=r,r.refCount++,A.memoizedState={element:p,isDehydrated:a,cache:r},Mh(A),t}function ub(t){return t?(t=Xs,t):Xs}function db(t,r,a,p,C,A){C=ub(C),p.context===null?p.context=C:p.pendingContext=C,p=yi(r),p.payload={element:a},A=A===void 0?null:A,A!==null&&(p.callback=A),a=bi(t,p,r),a!==null&&(Cn(a,t,r),jo(a,t,r))}function hb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Xf(t,r){hb(t,r),(t=t.alternate)&&hb(t,r)}function fb(t){if(t.tag===13||t.tag===31){var r=ss(t,67108864);r!==null&&Cn(r,t,67108864),Xf(t,67108864)}}function pb(t){if(t.tag===13||t.tag===31){var r=Ln();r=Bs(r);var a=ss(t,r);a!==null&&Cn(a,t,r),Xf(t,r)}}var cu=!0;function I2(t,r,a,p){var C=V.T;V.T=null;var A=Q.p;try{Q.p=2,Zf(t,r,a,p)}finally{Q.p=A,V.T=C}}function B2(t,r,a,p){var C=V.T;V.T=null;var A=Q.p;try{Q.p=8,Zf(t,r,a,p)}finally{Q.p=A,V.T=C}}function Zf(t,r,a,p){if(cu){var C=Qf(p);if(C===null)Bf(t,r,p,uu,a),gb(t,p);else if(P2(C,t,r,a,p))p.stopPropagation();else if(gb(t,p),r&4&&-1<z2.indexOf(t)){for(;C!==null;){var A=ci(C);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var B=sr(A.pendingLanes);if(B!==0){var G=A;for(G.pendingLanes|=2,G.entangledLanes|=2;B;){var ne=1<<31-ot(B);G.entanglements[1]|=ne,B&=~ne}xr(A),(ct&6)===0&&(Gc=Et()+500,Yo(0))}}break;case 31:case 13:G=ss(A,2),G!==null&&Cn(G,A,2),Kc(),Xf(A,2)}if(A=Qf(p),A===null&&Bf(t,r,p,uu,a),A===C)break;C=A}C!==null&&p.stopPropagation()}else Bf(t,r,p,null,a)}}function Qf(t){return t=Jd(t),Jf(t)}var uu=null;function Jf(t){if(uu=null,t=li(t),t!==null){var r=h(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=u(r),t!==null)return t;t=null}else if(a===31){if(t=o(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return uu=t,null}function mb(t){switch(t){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(Qt()){case he:return 2;case Se:return 8;case Re:case He:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var ep=!1,Mi=null,Ni=null,ji=null,nl=new Map,rl=new Map,Oi=[],z2="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 gb(t,r){switch(t){case"focusin":case"focusout":Mi=null;break;case"dragenter":case"dragleave":Ni=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":nl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(r.pointerId)}}function il(t,r,a,p,C,A){return t===null||t.nativeEvent!==A?(t={blockedOn:r,domEventName:a,eventSystemFlags:p,nativeEvent:A,targetContainers:[C]},r!==null&&(r=ci(r),r!==null&&fb(r)),t):(t.eventSystemFlags|=p,r=t.targetContainers,C!==null&&r.indexOf(C)===-1&&r.push(C),t)}function P2(t,r,a,p,C){switch(r){case"focusin":return Mi=il(Mi,t,r,a,p,C),!0;case"dragenter":return Ni=il(Ni,t,r,a,p,C),!0;case"mouseover":return ji=il(ji,t,r,a,p,C),!0;case"pointerover":var A=C.pointerId;return nl.set(A,il(nl.get(A)||null,t,r,a,p,C)),!0;case"gotpointercapture":return A=C.pointerId,rl.set(A,il(rl.get(A)||null,t,r,a,p,C)),!0}return!1}function vb(t){var r=li(t.target);if(r!==null){var a=h(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){t.blockedOn=r,tc(t.priority,function(){pb(a)});return}}else if(r===31){if(r=o(a),r!==null){t.blockedOn=r,tc(t.priority,function(){pb(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function du(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Qf(t.nativeEvent);if(a===null){a=t.nativeEvent;var p=new a.constructor(a.type,a);hi=p,a.target.dispatchEvent(p),hi=null}else return r=ci(a),r!==null&&fb(r),t.blockedOn=a,!1;r.shift()}return!0}function _b(t,r,a){du(t)&&a.delete(r)}function F2(){ep=!1,Mi!==null&&du(Mi)&&(Mi=null),Ni!==null&&du(Ni)&&(Ni=null),ji!==null&&du(ji)&&(ji=null),nl.forEach(_b),rl.forEach(_b)}function hu(t,r){t.blockedOn===r&&(t.blockedOn=null,ep||(ep=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,F2)))}var fu=null;function yb(t){fu!==t&&(fu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fu===t&&(fu=null);for(var r=0;r<t.length;r+=3){var a=t[r],p=t[r+1],C=t[r+2];if(typeof p!="function"){if(Jf(p||a)===null)continue;break}var A=ci(a);A!==null&&(t.splice(r,3),r-=3,Zh(A,{pending:!0,data:C,method:a.method,action:p},p,C))}}))}function ba(t){function r(ne){return hu(ne,t)}Mi!==null&&hu(Mi,t),Ni!==null&&hu(Ni,t),ji!==null&&hu(ji,t),nl.forEach(r),rl.forEach(r);for(var a=0;a<Oi.length;a++){var p=Oi[a];p.blockedOn===t&&(p.blockedOn=null)}for(;0<Oi.length&&(a=Oi[0],a.blockedOn===null);)vb(a),a.blockedOn===null&&Oi.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(p=0;p<a.length;p+=3){var C=a[p],A=a[p+1],B=C[en]||null;if(typeof A=="function")B||yb(a);else if(B){var G=null;if(A&&A.hasAttribute("formAction")){if(C=A,B=A[en]||null)G=B.formAction;else if(Jf(C)!==null)continue}else G=B.action;typeof G=="function"?a[p+1]=G:(a.splice(p,3),p-=3),yb(a)}}}function bb(){function t(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(B){return C=B})},focusReset:"manual",scroll:"manual"})}function r(){C!==null&&(C(),C=null),p||setTimeout(a,20)}function a(){if(!p&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){p=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),C!==null&&(C(),C=null)}}}function tp(t){this._internalRoot=t}pu.prototype.render=tp.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,p=Ln();db(a,p,t,r,null,null)},pu.prototype.unmount=tp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;db(t.current,2,null,t,null,null),Kc(),r[Pe]=null}};function pu(t){this._internalRoot=t}pu.prototype.unstable_scheduleHydration=function(t){if(t){var r=ho();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Oi.length&&r!==0&&r<Oi[a].priority;a++);Oi.splice(a,0,t),a===0&&vb(t)}};var xb=n.version;if(xb!=="19.2.4")throw Error(s(527,xb,"19.2.4"));Q.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var H2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{At=mu.inject(H2),Mt=mu}catch{}}return al.createRoot=function(t,r){if(!l(t))throw Error(s(299));var a=!1,p="",C=T_,A=R_,B=D_;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(C=r.onUncaughtError),r.onCaughtError!==void 0&&(A=r.onCaughtError),r.onRecoverableError!==void 0&&(B=r.onRecoverableError)),r=cb(t,1,!1,null,null,a,p,null,C,A,B,bb),t[Pe]=r.current,If(t),new tp(r)},al.hydrateRoot=function(t,r,a){if(!l(t))throw Error(s(299));var p=!1,C="",A=T_,B=R_,G=D_,ne=null;return a!=null&&(a.unstable_strictMode===!0&&(p=!0),a.identifierPrefix!==void 0&&(C=a.identifierPrefix),a.onUncaughtError!==void 0&&(A=a.onUncaughtError),a.onCaughtError!==void 0&&(B=a.onCaughtError),a.onRecoverableError!==void 0&&(G=a.onRecoverableError),a.formState!==void 0&&(ne=a.formState)),r=cb(t,1,!0,r,a!=null?a:null,p,C,ne,A,B,G,bb),r.context=ub(null),a=r.current,p=Ln(),p=Bs(p),C=yi(p),C.callback=null,bi(a,C,p),a=p,r.current.lanes=a,Tn(r,a),xr(r),t[Pe]=r.current,If(t),new pu(r)},al.version="19.2.4",al}var Mb;function Z2(){if(Mb)return ip.exports;Mb=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(n){console.error(n)}}return e(),ip.exports=X2(),ip.exports}var Q2=Z2();const J2={theme:"system",setTheme:()=>null,resolvedTheme:"dark"},Lx=T.createContext(J2);function eA({children:e,defaultTheme:n="system",storageKey:i="jean2-theme",...s}){const[l,h]=T.useState(()=>localStorage.getItem(i)||n),[u,o]=T.useState("dark");T.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),l==="system"){const g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(g),o(g);return}d.classList.add(l),o(l)},[l]);const c={theme:l,setTheme:d=>{localStorage.setItem(i,d),h(d)},resolvedTheme:u};return m.jsx(Lx.Provider,{...s,value:c,children:e})}const tA=()=>{const e=T.useContext(Lx);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function nA(e,n={},i){return window.__TAURI_INTERNALS__.invoke(e,n,i)}/**
|
|
50
|
-
* @license lucide-react v0.577.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const Ix=(...e)=>e.filter((n,i,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===i).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v0.577.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const rA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
60
|
-
* @license lucide-react v0.577.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const iA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,s)=>s?s.toUpperCase():i.toLowerCase());/**
|
|
65
|
-
* @license lucide-react v0.577.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const Nb=e=>{const n=iA(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
|
70
|
-
* @license lucide-react v0.577.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/var sA={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"};/**
|
|
75
|
-
* @license lucide-react v0.577.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const aA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};/**
|
|
80
|
-
* @license lucide-react v0.577.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const oA=T.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:h,iconNode:u,...o},c)=>T.createElement("svg",{ref:c,...sA,width:n,height:n,stroke:e,strokeWidth:s?Number(i)*24/Number(n):i,className:Ix("lucide",l),...!h&&!aA(o)&&{"aria-hidden":"true"},...o},[...u.map(([d,g])=>T.createElement(d,g)),...Array.isArray(h)?h:[h]]));/**
|
|
85
|
-
* @license lucide-react v0.577.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const Ae=(e,n)=>{const i=T.forwardRef(({className:s,...l},h)=>T.createElement(oA,{ref:h,iconNode:n,className:Ix(`lucide-${rA(Nb(e))}`,`lucide-${e}`,s),...l}));return i.displayName=Nb(e),i};/**
|
|
90
|
-
* @license lucide-react v0.577.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const lA=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],cA=Ae("archive",lA);/**
|
|
95
|
-
* @license lucide-react v0.577.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const uA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dA=Ae("arrow-left",uA);/**
|
|
100
|
-
* @license lucide-react v0.577.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const hA=[["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"}]],fA=Ae("bot",hA);/**
|
|
105
|
-
* @license lucide-react v0.577.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const pA=[["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"}]],Yp=Ae("box",pA);/**
|
|
110
|
-
* @license lucide-react v0.577.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const mA=[["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"}]],gA=Ae("brain",mA);/**
|
|
115
|
-
* @license lucide-react v0.577.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const vA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ei=Ae("check",vA);/**
|
|
120
|
-
* @license lucide-react v0.577.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const _A=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ka=Ae("chevron-down",_A);/**
|
|
125
|
-
* @license lucide-react v0.577.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const yA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],bA=Ae("chevron-left",yA);/**
|
|
130
|
-
* @license lucide-react v0.577.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const xA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ti=Ae("chevron-right",xA);/**
|
|
135
|
-
* @license lucide-react v0.577.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const SA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],wA=Ae("chevron-up",SA);/**
|
|
140
|
-
* @license lucide-react v0.577.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const CA=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Bx=Ae("chevrons-up-down",CA);/**
|
|
145
|
-
* @license lucide-react v0.577.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const kA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gl=Ae("circle-alert",kA);/**
|
|
150
|
-
* @license lucide-react v0.577.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const EA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],jl=Ae("circle-check-big",EA);/**
|
|
155
|
-
* @license lucide-react v0.577.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const AA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],id=Ae("circle-x",AA);/**
|
|
160
|
-
* @license lucide-react v0.577.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const TA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],RA=Ae("circle",TA);/**
|
|
165
|
-
* @license lucide-react v0.577.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const DA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],zx=Ae("clock",DA);/**
|
|
170
|
-
* @license lucide-react v0.577.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const MA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],wl=Ae("copy",MA);/**
|
|
175
|
-
* @license lucide-react v0.577.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const NA=[["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"}]],jA=Ae("cpu",NA);/**
|
|
180
|
-
* @license lucide-react v0.577.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const OA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],LA=Ae("ellipsis",OA);/**
|
|
185
|
-
* @license lucide-react v0.577.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const IA=[["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"}]],Xp=Ae("external-link",IA);/**
|
|
190
|
-
* @license lucide-react v0.577.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const BA=[["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"}]],zA=Ae("eye-off",BA);/**
|
|
195
|
-
* @license lucide-react v0.577.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const PA=[["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"}]],FA=Ae("eye",PA);/**
|
|
200
|
-
* @license lucide-react v0.577.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const HA=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],UA=Ae("file-pen",HA);/**
|
|
205
|
-
* @license lucide-react v0.577.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const $A=[["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"}]],Rm=Ae("file-text",$A);/**
|
|
210
|
-
* @license lucide-react v0.577.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const qA=[["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"}]],Sr=Ae("file",qA);/**
|
|
215
|
-
* @license lucide-react v0.577.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const VA=[["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"}]],Zp=Ae("folder-open",VA);/**
|
|
220
|
-
* @license lucide-react v0.577.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const GA=[["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"}]],Hi=Ae("folder",GA);/**
|
|
225
|
-
* @license lucide-react v0.577.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const WA=[["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"}]],KA=Ae("git-branch",WA);/**
|
|
230
|
-
* @license lucide-react v0.577.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const YA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],jb=Ae("info",YA);/**
|
|
235
|
-
* @license lucide-react v0.577.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const XA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],ZA=Ae("layout-grid",XA);/**
|
|
240
|
-
* @license lucide-react v0.577.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const QA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],JA=Ae("layout-list",QA);/**
|
|
245
|
-
* @license lucide-react v0.577.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const eT=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],tT=Ae("link-2",eT);/**
|
|
250
|
-
* @license lucide-react v0.577.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const nT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=Ae("loader-circle",nT);/**
|
|
255
|
-
* @license lucide-react v0.577.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const rT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],iT=Ae("lock",rT);/**
|
|
260
|
-
* @license lucide-react v0.577.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const sT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],aT=Ae("message-square",sT);/**
|
|
265
|
-
* @license lucide-react v0.577.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const oT=[["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"}]],lT=Ae("minimize-2",oT);/**
|
|
270
|
-
* @license lucide-react v0.577.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const cT=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],uT=Ae("monitor",cT);/**
|
|
275
|
-
* @license lucide-react v0.577.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const dT=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],hT=Ae("moon",dT);/**
|
|
280
|
-
* @license lucide-react v0.577.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const fT=[["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"}]],pT=Ae("palette",fT);/**
|
|
285
|
-
* @license lucide-react v0.577.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const mT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],gT=Ae("panel-left",mT);/**
|
|
290
|
-
* @license lucide-react v0.577.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const vT=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],_T=Ae("plug-zap",vT);/**
|
|
295
|
-
* @license lucide-react v0.577.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const yT=[["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"}]],bT=Ae("plug",yT);/**
|
|
300
|
-
* @license lucide-react v0.577.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const xT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ya=Ae("plus",xT);/**
|
|
305
|
-
* @license lucide-react v0.577.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const ST=[["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"}]],Da=Ae("refresh-cw",ST);/**
|
|
310
|
-
* @license lucide-react v0.577.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const wT=[["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"}]],CT=Ae("rotate-ccw",wT);/**
|
|
315
|
-
* @license lucide-react v0.577.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const kT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dm=Ae("search",kT);/**
|
|
320
|
-
* @license lucide-react v0.577.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const ET=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],AT=Ae("send",ET);/**
|
|
325
|
-
* @license lucide-react v0.577.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const TT=[["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"}]],Ss=Ae("server",TT);/**
|
|
330
|
-
* @license lucide-react v0.577.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const RT=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Px=Ae("settings",RT);/**
|
|
335
|
-
* @license lucide-react v0.577.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const DT=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Fx=Ae("shield",DT);/**
|
|
340
|
-
* @license lucide-react v0.577.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const MT=[["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"}]],Ob=Ae("square-terminal",MT);/**
|
|
345
|
-
* @license lucide-react v0.577.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const NT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Hx=Ae("square",NT);/**
|
|
350
|
-
* @license lucide-react v0.577.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const jT=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Lb=Ae("star",jT);/**
|
|
355
|
-
* @license lucide-react v0.577.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const OT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],LT=Ae("sun",OT);/**
|
|
360
|
-
* @license lucide-react v0.577.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const IT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ib=Ae("terminal",IT);/**
|
|
365
|
-
* @license lucide-react v0.577.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const BT=[["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"}]],Ol=Ae("trash-2",BT);/**
|
|
370
|
-
* @license lucide-react v0.577.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const zT=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bb=Ae("triangle-alert",zT);/**
|
|
375
|
-
* @license lucide-react v0.577.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const PT=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],FT=Ae("undo-2",PT);/**
|
|
380
|
-
* @license lucide-react v0.577.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const HT=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],UT=Ae("unplug",HT);/**
|
|
385
|
-
* @license lucide-react v0.577.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const $T=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ux=Ae("user",$T);/**
|
|
390
|
-
* @license lucide-react v0.577.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const qT=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],$x=Ae("wifi-off",qT);/**
|
|
395
|
-
* @license lucide-react v0.577.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const VT=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],GT=Ae("wifi",VT);/**
|
|
400
|
-
* @license lucide-react v0.577.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const WT=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],KT=Ae("wrench",WT);/**
|
|
405
|
-
* @license lucide-react v0.577.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const YT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qr=Ae("x",YT);/**
|
|
410
|
-
* @license lucide-react v0.577.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const XT=[["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"}]],lp=Ae("zap",XT),nr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Xr(){try{const e=localStorage.getItem(nr.SERVERS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading saved servers from localStorage:",e),[]}}function ZT(e){return Xr().find(i=>i.id===e)||null}function QT(e){try{const n=Xr();n.push(e),localStorage.setItem(nr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error saving server to localStorage:",n)}}function JT(e,n){try{const i=Xr(),s=i.findIndex(l=>l.id===e);if(s===-1){console.error("Server not found:",e);return}i[s]={...i[s],...n},localStorage.setItem(nr.SERVERS,JSON.stringify(i))}catch(i){console.error("Error updating server in localStorage:",i)}}function eR(e){try{const i=Xr().filter(u=>u.id!==e);localStorage.setItem(nr.SERVERS,JSON.stringify(i));const l=Zr().filter(u=>u.serverId!==e);localStorage.setItem(nr.QUICK_CONNECTIONS,JSON.stringify(l)),qx()===e&&localStorage.removeItem(nr.ACTIVE_SERVER_ID)}catch(n){console.error("Error deleting server from localStorage:",n)}}function qx(){try{return localStorage.getItem(nr.ACTIVE_SERVER_ID)}catch(e){return console.error("Error reading active server ID from localStorage:",e),null}}function cp(e){try{localStorage.setItem(nr.ACTIVE_SERVER_ID,e)}catch(n){console.error("Error setting active server ID in localStorage:",n)}}function zb(){const e=qx();return e?ZT(e):null}function Zr(){try{const e=localStorage.getItem(nr.QUICK_CONNECTIONS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading quick connections from localStorage:",e),[]}}function tR(e){const n=Zr(),i=n.reduce((l,h)=>Math.max(l,h.order),-1),s={...e,id:crypto.randomUUID(),order:i+1};n.push(s);try{localStorage.setItem(nr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(l){console.error("Error saving quick connection to localStorage:",l)}return s}function nR(e){try{const i=Zr().filter(s=>s.id!==e);localStorage.setItem(nr.QUICK_CONNECTIONS,JSON.stringify(i))}catch(n){console.error("Error removing quick connection from localStorage:",n)}}function rR(e){try{const n=Zr(),i=new Map(n.map(s=>[s.id,s]));e.forEach((s,l)=>{const h=i.get(s);h&&(h.order=l)}),localStorage.setItem(nr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(n){console.error("Error reordering quick connections in localStorage:",n)}}function Vx(e){return/^[a-f0-9]{64}$/.test(e)}function iR(e){return e.length<12?e:`${e.slice(0,4)}...${e.slice(-4)}`}function zu(e){let n=e.trim();return n=n.replace(/^(https?:\/\/|wss?:\/\/)/i,""),n=n.replace(/\/+$/,""),n}const Gx=T.createContext(null),sR=({children:e})=>{const[n,i]=T.useState([]),[s,l]=T.useState(null),[h,u]=T.useState([]),[o,c]=T.useState(!1),d=T.useRef(null);T.useEffect(()=>{const x=Xr(),E=zb(),M=Zr();i(x),l(E),u(M)},[]);const g=(x,E,M)=>{const R=zu(E),N={id:crypto.randomUUID(),name:x,url:R,token:M,createdAt:new Date().toISOString()};return QT(N),i(Xr()),n.length===0&&(cp(N.id),l(N)),N},f=(x,E)=>{const M={...E,...E.url&&{url:zu(E.url)}};JT(x,M),i(Xr()),(s==null?void 0:s.id)===x&&l(zb())},b=x=>{const E=(s==null?void 0:s.id)===x;if(eR(x),i(Xr()),E){const M=Xr(),R=M.length>0?M[0]:null;R?(cp(R.id),l(R)):l(null)}u(Zr())},S=T.useCallback(x=>(d.current&&(clearTimeout(d.current),d.current=null),o&&(s==null?void 0:s.id)===x?!1:(o&&c(!1),c(!0),d.current=setTimeout(()=>{cp(x);const E=n.find(M=>M.id===x)||null;l(E),c(!1)},100),!0)),[o,s,n]),k=T.useCallback(()=>{c(!1)},[]),v={servers:n,activeServer:s,quickConnections:h,isSwitching:o,addServer:g,editServer:f,removeServer:b,switchServer:S,clearSwitchingState:k,addToQuickConnections:(x,E,M,R)=>{tR({serverId:x,serverName:E,workspaceId:M,workspaceName:R}),u(Zr())},removeFromQuickConnections:x=>{nR(x),u(Zr())},reorderQuick:x=>{rR(x),u(Zr())}};return m.jsx(Gx.Provider,{value:v,children:e})},Xa=()=>{const e=T.useContext(Gx);if(e===null)throw new Error("useServerContext must be used within a ServerProvider");return e};function Wx(e){var n,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(i=Wx(e[n]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function sd(){for(var e,n,i=0,s="",l=arguments.length;i<l;i++)(e=arguments[i])&&(n=Wx(e))&&(s&&(s+=" "),s+=n);return s}const Pb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fb=sd,Za=(e,n)=>i=>{var s;if((n==null?void 0:n.variants)==null)return Fb(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:l,defaultVariants:h}=n,u=Object.keys(l).map(d=>{const g=i==null?void 0:i[d],f=h==null?void 0:h[d];if(g===null)return null;const b=Pb(g)||Pb(f);return l[d][b]}),o=i&&Object.entries(i).reduce((d,g)=>{let[f,b]=g;return b===void 0||(d[f]=b),d},{}),c=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((d,g)=>{let{class:f,className:b,...S}=g;return Object.entries(S).every(k=>{let[w,_]=k;return Array.isArray(_)?_.includes({...h,...o}[w]):{...h,...o}[w]===_})?[...d,f,b]:d},[]);return Fb(e,u,c,i==null?void 0:i.class,i==null?void 0:i.className)};var Ll=Ox();const aR=rd(Ll);function Hb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function ni(...e){return n=>{let i=!1;const s=e.map(l=>{const h=Hb(l,n);return!i&&typeof h=="function"&&(i=!0),h});if(i)return()=>{for(let l=0;l<s.length;l++){const h=s[l];typeof h=="function"?h():Hb(e[l],null)}}}}function Xe(...e){return T.useCallback(ni(...e),e)}function Ui(e){const n=oR(e),i=T.forwardRef((s,l)=>{const{children:h,...u}=s,o=T.Children.toArray(h),c=o.find(cR);if(c){const d=c.props.children,g=o.map(f=>f===c?T.Children.count(d)>1?T.Children.only(null):T.isValidElement(d)?d.props.children:null:f);return m.jsx(n,{...u,ref:l,children:T.isValidElement(d)?T.cloneElement(d,void 0,g):null})}return m.jsx(n,{...u,ref:l,children:h})});return i.displayName=`${e}.Slot`,i}var Il=Ui("Slot");function oR(e){const n=T.forwardRef((i,s)=>{const{children:l,...h}=i;if(T.isValidElement(l)){const u=dR(l),o=uR(h,l.props);return l.type!==T.Fragment&&(o.ref=s?ni(s,u):u),T.cloneElement(l,o)}return T.Children.count(l)>1?T.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Kx=Symbol("radix.slottable");function lR(e){const n=({children:i})=>m.jsx(m.Fragment,{children:i});return n.displayName=`${e}.Slottable`,n.__radixId=Kx,n}function cR(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kx}function uR(e,n){const i={...n};for(const s in n){const l=e[s],h=n[s];/^on[A-Z]/.test(s)?l&&h?i[s]=(...o)=>{const c=h(...o);return l(...o),c}:l&&(i[s]=l):s==="style"?i[s]={...l,...h}:s==="className"&&(i[s]=[l,h].filter(Boolean).join(" "))}return{...e,...i}}function dR(e){var s,l;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var hR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=hR.reduce((e,n)=>{const i=Ui(`Primitive.${n}`),s=T.forwardRef((l,h)=>{const{asChild:u,...o}=l,c=u?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...o,ref:h})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function Yx(e,n){e&&Ll.flushSync(()=>e.dispatchEvent(n))}var Xx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fR="VisuallyHidden",Zx=T.forwardRef((e,n)=>m.jsx(je.span,{...e,ref:n,style:{...Xx,...e.style}}));Zx.displayName=fR;var pR=Zx;function mR(e,n){const i=T.createContext(n),s=h=>{const{children:u,...o}=h,c=T.useMemo(()=>o,Object.values(o));return m.jsx(i.Provider,{value:c,children:u})};s.displayName=e+"Provider";function l(h){const u=T.useContext(i);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${h}\` must be used within \`${e}\``)}return[s,l]}function Un(e,n=[]){let i=[];function s(h,u){const o=T.createContext(u),c=i.length;i=[...i,u];const d=f=>{var y;const{scope:b,children:S,...k}=f,w=((y=b==null?void 0:b[e])==null?void 0:y[c])||o,_=T.useMemo(()=>k,Object.values(k));return m.jsx(w.Provider,{value:_,children:S})};d.displayName=h+"Provider";function g(f,b){var w;const S=((w=b==null?void 0:b[e])==null?void 0:w[c])||o,k=T.useContext(S);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${f}\` must be used within \`${h}\``)}return[d,g]}const l=()=>{const h=i.map(u=>T.createContext(u));return function(o){const c=(o==null?void 0:o[e])||h;return T.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return l.scopeName=e,[s,gR(l,...n)]}function gR(...e){const n=e[0];if(e.length===1)return n;const i=()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(h){const u=s.reduce((o,{useScope:c,scopeName:d})=>{const f=c(h)[`__scope${d}`];return{...o,...f}},{});return T.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return i.scopeName=n.scopeName,i}function Mm(e){const n=e+"CollectionProvider",[i,s]=Un(n),[l,h]=i(n,{collectionRef:{current:null},itemMap:new Map}),u=w=>{const{scope:_,children:y}=w,v=er.useRef(null),x=er.useRef(new Map).current;return m.jsx(l,{scope:_,itemMap:x,collectionRef:v,children:y})};u.displayName=n;const o=e+"CollectionSlot",c=Ui(o),d=er.forwardRef((w,_)=>{const{scope:y,children:v}=w,x=h(o,y),E=Xe(_,x.collectionRef);return m.jsx(c,{ref:E,children:v})});d.displayName=o;const g=e+"CollectionItemSlot",f="data-radix-collection-item",b=Ui(g),S=er.forwardRef((w,_)=>{const{scope:y,children:v,...x}=w,E=er.useRef(null),M=Xe(_,E),R=h(g,y);return er.useEffect(()=>(R.itemMap.set(E,{ref:E,...x}),()=>void R.itemMap.delete(E))),m.jsx(b,{[f]:"",ref:M,children:v})});S.displayName=g;function k(w){const _=h(e+"CollectionConsumer",w);return er.useCallback(()=>{const v=_.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((R,N)=>x.indexOf(R.ref.current)-x.indexOf(N.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:u,Slot:d,ItemSlot:S},k,s]}function Ce(e,n,{checkForDefaultPrevented:i=!0}={}){return function(l){if(e==null||e(l),i===!1||!l.defaultPrevented)return n==null?void 0:n(l)}}var Xt=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},vR=jx[" useInsertionEffect ".trim().toString()]||Xt;function ri({prop:e,defaultProp:n,onChange:i=()=>{},caller:s}){const[l,h,u]=_R({defaultProp:n,onChange:i}),o=e!==void 0,c=o?e:l;{const g=T.useRef(e!==void 0);T.useEffect(()=>{const f=g.current;f!==o&&console.warn(`${s} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=o},[o,s])}const d=T.useCallback(g=>{var f;if(o){const b=yR(g)?g(e):g;b!==e&&((f=u.current)==null||f.call(u,b))}else h(g)},[o,e,h,u]);return[c,d]}function _R({defaultProp:e,onChange:n}){const[i,s]=T.useState(e),l=T.useRef(i),h=T.useRef(n);return vR(()=>{h.current=n},[n]),T.useEffect(()=>{var u;l.current!==i&&((u=h.current)==null||u.call(h,i),l.current=i)},[i,l]),[i,s,h]}function yR(e){return typeof e=="function"}function bR(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var Zt=e=>{const{present:n,children:i}=e,s=xR(n),l=typeof i=="function"?i({present:s.isPresent}):T.Children.only(i),h=Xe(s.ref,SR(l));return typeof i=="function"||s.isPresent?T.cloneElement(l,{ref:h}):null};Zt.displayName="Presence";function xR(e){const[n,i]=T.useState(),s=T.useRef(null),l=T.useRef(e),h=T.useRef("none"),u=e?"mounted":"unmounted",[o,c]=bR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const d=gu(s.current);h.current=o==="mounted"?d:"none"},[o]),Xt(()=>{const d=s.current,g=l.current;if(g!==e){const b=h.current,S=gu(d);e?c("MOUNT"):S==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Xt(()=>{var d;if(n){let g;const f=(d=n.ownerDocument.defaultView)!=null?d:window,b=k=>{const _=gu(s.current).includes(CSS.escape(k.animationName));if(k.target===n&&_&&(c("ANIMATION_END"),!l.current)){const y=n.style.animationFillMode;n.style.animationFillMode="forwards",g=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=y)})}},S=k=>{k.target===n&&(h.current=gu(s.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",b),n.addEventListener("animationend",b),()=>{f.clearTimeout(g),n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",b),n.removeEventListener("animationend",b)}}else c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:T.useCallback(d=>{s.current=d?getComputedStyle(d):null,i(d)},[])}}function gu(e){return(e==null?void 0:e.animationName)||"none"}function SR(e){var s,l;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var wR=jx[" useId ".trim().toString()]||(()=>{}),CR=0;function Gt(e){const[n,i]=T.useState(wR());return Xt(()=>{i(s=>s!=null?s:String(CR++))},[e]),e||(n?`radix-${n}`:"")}var ad="Collapsible",[kR]=Un(ad),[ER,Nm]=kR(ad),Qx=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,open:s,defaultOpen:l,disabled:h,onOpenChange:u,...o}=e,[c,d]=ri({prop:s,defaultProp:l!=null?l:!1,onChange:u,caller:ad});return m.jsx(ER,{scope:i,disabled:h,contentId:Gt(),open:c,onOpenToggle:T.useCallback(()=>d(g=>!g),[d]),children:m.jsx(je.div,{"data-state":Om(c),"data-disabled":h?"":void 0,...o,ref:n})})});Qx.displayName=ad;var Jx="CollapsibleTrigger",e1=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,...s}=e,l=Nm(Jx,i);return m.jsx(je.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":Om(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...s,ref:n,onClick:Ce(e.onClick,l.onOpenToggle)})});e1.displayName=Jx;var jm="CollapsibleContent",t1=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=Nm(jm,e.__scopeCollapsible);return m.jsx(Zt,{present:i||l.open,children:({present:h})=>m.jsx(AR,{...s,ref:n,present:h})})});t1.displayName=jm;var AR=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,present:s,children:l,...h}=e,u=Nm(jm,i),[o,c]=T.useState(s),d=T.useRef(null),g=Xe(n,d),f=T.useRef(0),b=f.current,S=T.useRef(0),k=S.current,w=u.open||o,_=T.useRef(w),y=T.useRef(void 0);return T.useEffect(()=>{const v=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(v)},[]),Xt(()=>{const v=d.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();f.current=x.height,S.current=x.width,_.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(s)}},[u.open,s]),m.jsx(je.div,{"data-state":Om(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...h,ref:g,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":k?`${k}px`:void 0,...e.style},children:w&&l})});function Om(e){return e?"open":"closed"}var TR=Qx,RR=T.createContext(void 0);function Bl(e){const n=T.useContext(RR);return e||n||"ltr"}function an(e){const n=T.useRef(e);return T.useEffect(()=>{n.current=e}),T.useMemo(()=>(...i)=>{var s;return(s=n.current)==null?void 0:s.call(n,...i)},[])}function DR(e,n=globalThis==null?void 0:globalThis.document){const i=an(e);T.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(l)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[i,n])}var MR="DismissableLayer",Qp="dismissableLayer.update",NR="dismissableLayer.pointerDownOutside",jR="dismissableLayer.focusOutside",Ub,n1=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qa=T.forwardRef((e,n)=>{var N;const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:h,onInteractOutside:u,onDismiss:o,...c}=e,d=T.useContext(n1),[g,f]=T.useState(null),b=(N=g==null?void 0:g.ownerDocument)!=null?N:globalThis==null?void 0:globalThis.document,[,S]=T.useState({}),k=Xe(n,D=>f(D)),w=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(_),v=g?w.indexOf(g):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,M=IR(D=>{const O=D.target,P=[...d.branches].some($=>$.contains(O));!E||P||(l==null||l(D),u==null||u(D),D.defaultPrevented||o==null||o())},b),R=BR(D=>{const O=D.target;[...d.branches].some($=>$.contains(O))||(h==null||h(D),u==null||u(D),D.defaultPrevented||o==null||o())},b);return DR(D=>{v===d.layers.size-1&&(s==null||s(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},b),T.useEffect(()=>{if(g)return i&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ub=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),$b(),()=>{i&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Ub)}},[g,b,i,d]),T.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),$b())},[g,d]),T.useEffect(()=>{const D=()=>S({});return document.addEventListener(Qp,D),()=>document.removeEventListener(Qp,D)},[]),m.jsx(je.div,{...c,ref:k,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,M.onPointerDownCapture)})});Qa.displayName=MR;var OR="DismissableLayerBranch",LR=T.forwardRef((e,n)=>{const i=T.useContext(n1),s=T.useRef(null),l=Xe(n,s);return T.useEffect(()=>{const h=s.current;if(h)return i.branches.add(h),()=>{i.branches.delete(h)}},[i.branches]),m.jsx(je.div,{...e,ref:l})});LR.displayName=OR;function IR(e,n=globalThis==null?void 0:globalThis.document){const i=an(e),s=T.useRef(!1),l=T.useRef(()=>{});return T.useEffect(()=>{const h=o=>{if(o.target&&!s.current){let c=function(){r1(NR,i,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(n.removeEventListener("click",l.current),l.current=c,n.addEventListener("click",l.current,{once:!0})):c()}else n.removeEventListener("click",l.current);s.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",h),n.removeEventListener("click",l.current)}},[n,i]),{onPointerDownCapture:()=>s.current=!0}}function BR(e,n=globalThis==null?void 0:globalThis.document){const i=an(e),s=T.useRef(!1);return T.useEffect(()=>{const l=h=>{h.target&&!s.current&&r1(jR,i,{originalEvent:h},{discrete:!1})};return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,i]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function $b(){const e=new CustomEvent(Qp);document.dispatchEvent(e)}function r1(e,n,i,{discrete:s}){const l=i.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&l.addEventListener(e,n,{once:!0}),s?Yx(l,h):l.dispatchEvent(h)}var up="focusScope.autoFocusOnMount",dp="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},zR="FocusScope",zl=T.forwardRef((e,n)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:l,onUnmountAutoFocus:h,...u}=e,[o,c]=T.useState(null),d=an(l),g=an(h),f=T.useRef(null),b=Xe(n,w=>c(w)),S=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(s){let w=function(x){if(S.paused||!o)return;const E=x.target;o.contains(E)?f.current=E:Fi(f.current,{select:!0})},_=function(x){if(S.paused||!o)return;const E=x.relatedTarget;E!==null&&(o.contains(E)||Fi(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const M of x)M.removedNodes.length>0&&Fi(o)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const v=new MutationObserver(y);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),v.disconnect()}}},[s,o,S.paused]),T.useEffect(()=>{if(o){Gb.add(S);const w=document.activeElement;if(!o.contains(w)){const y=new CustomEvent(up,qb);o.addEventListener(up,d),o.dispatchEvent(y),y.defaultPrevented||(PR(qR(i1(o)),{select:!0}),document.activeElement===w&&Fi(o))}return()=>{o.removeEventListener(up,d),setTimeout(()=>{const y=new CustomEvent(dp,qb);o.addEventListener(dp,g),o.dispatchEvent(y),y.defaultPrevented||Fi(w!=null?w:document.body,{select:!0}),o.removeEventListener(dp,g),Gb.remove(S)},0)}}},[o,d,g,S]);const k=T.useCallback(w=>{if(!i&&!s||S.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,y=document.activeElement;if(_&&y){const v=w.currentTarget,[x,E]=FR(v);x&&E?!w.shiftKey&&y===E?(w.preventDefault(),i&&Fi(x,{select:!0})):w.shiftKey&&y===x&&(w.preventDefault(),i&&Fi(E,{select:!0})):y===v&&w.preventDefault()}},[i,s,S.paused]);return m.jsx(je.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});zl.displayName=zR;function PR(e,{select:n=!1}={}){const i=document.activeElement;for(const s of e)if(Fi(s,{select:n}),document.activeElement!==i)return}function FR(e){const n=i1(e),i=Vb(n,e),s=Vb(n.reverse(),e);return[i,s]}function i1(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const l=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||l?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function Vb(e,n){for(const i of e)if(!HR(i,{upTo:n}))return i}function HR(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function UR(e){return e instanceof HTMLInputElement&&"select"in e}function Fi(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&UR(e)&&n&&e.select()}}var Gb=$R();function $R(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=Wb(e,n),e.unshift(n)},remove(n){var i;e=Wb(e,n),(i=e[0])==null||i.resume()}}}function Wb(e,n){const i=[...e],s=i.indexOf(n);return s!==-1&&i.splice(s,1),i}function qR(e){return e.filter(n=>n.tagName!=="A")}var VR="Portal",Ja=T.forwardRef((e,n)=>{var o;const{container:i,...s}=e,[l,h]=T.useState(!1);Xt(()=>h(!0),[]);const u=i||l&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return u?aR.createPortal(m.jsx(je.div,{...s,ref:n}),u):null});Ja.displayName=VR;var hp=0;function od(){T.useEffect(()=>{var n,i;const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(n=e[0])!=null?n:Kb()),document.body.insertAdjacentElement("beforeend",(i=e[1])!=null?i:Kb()),hp++,()=>{hp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),hp--}},[])}function Kb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Cr=function(){return Cr=Object.assign||function(n){for(var i,s=1,l=arguments.length;s<l;s++){i=arguments[s];for(var h in i)Object.prototype.hasOwnProperty.call(i,h)&&(n[h]=i[h])}return n},Cr.apply(this,arguments)};function s1(e,n){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)n.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(i[s[l]]=e[s[l]]);return i}function GR(e,n,i){if(i||arguments.length===2)for(var s=0,l=n.length,h;s<l;s++)(h||!(s in n))&&(h||(h=Array.prototype.slice.call(n,0,s)),h[s]=n[s]);return e.concat(h||Array.prototype.slice.call(n))}var Mu="right-scroll-bar-position",Nu="width-before-scroll-bar",WR="with-scroll-bars-hidden",KR="--removed-body-scroll-bar-size";function fp(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function YR(e,n){var i=T.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(s){var l=i.value;l!==s&&(i.value=s,i.callback(s,l))}}}})[0];return i.callback=n,i.facade}var XR=typeof window<"u"?T.useLayoutEffect:T.useEffect,Yb=new WeakMap;function ZR(e,n){var i=YR(null,function(s){return e.forEach(function(l){return fp(l,s)})});return XR(function(){var s=Yb.get(i);if(s){var l=new Set(s),h=new Set(e),u=i.current;l.forEach(function(o){h.has(o)||fp(o,null)}),h.forEach(function(o){l.has(o)||fp(o,u)})}Yb.set(i,e)},[e]),i}function QR(e){return e}function JR(e,n){n===void 0&&(n=QR);var i=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(h){var u=n(h,s);return i.push(u),function(){i=i.filter(function(o){return o!==u})}},assignSyncMedium:function(h){for(s=!0;i.length;){var u=i;i=[],u.forEach(h)}i={push:function(o){return h(o)},filter:function(){return i}}},assignMedium:function(h){s=!0;var u=[];if(i.length){var o=i;i=[],o.forEach(h),u=i}var c=function(){var g=u;u=[],g.forEach(h)},d=function(){return Promise.resolve().then(c)};d(),i={push:function(g){u.push(g),d()},filter:function(g){return u=u.filter(g),i}}}};return l}function eD(e){e===void 0&&(e={});var n=JR(null);return n.options=Cr({async:!0,ssr:!1},e),n}var a1=function(e){var n=e.sideCar,i=s1(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return T.createElement(s,Cr({},i))};a1.isSideCarExport=!0;function tD(e,n){return e.useMedium(n),a1}var o1=eD(),pp=function(){},ld=T.forwardRef(function(e,n){var i=T.useRef(null),s=T.useState({onScrollCapture:pp,onWheelCapture:pp,onTouchMoveCapture:pp}),l=s[0],h=s[1],u=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,g=e.enabled,f=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,w=e.inert,_=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,E=s1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,R=ZR([i,n]),N=Cr(Cr({},E),l);return T.createElement(T.Fragment,null,g&&T.createElement(M,{sideCar:o1,removeScrollBar:d,shards:f,noRelative:S,noIsolation:k,inert:w,setCallbacks:h,allowPinchZoom:!!_,lockRef:i,gapMode:x}),u?T.cloneElement(T.Children.only(o),Cr(Cr({},N),{ref:R})):T.createElement(v,Cr({},N,{className:c,ref:R}),o))});ld.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ld.classNames={fullWidth:Nu,zeroRight:Mu};var nD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=nD();return n&&e.setAttribute("nonce",n),e}function iD(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function sD(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var aD=function(){var e=0,n=null;return{add:function(i){e==0&&(n=rD())&&(iD(n,i),sD(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},oD=function(){var e=aD();return function(n,i){T.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},l1=function(){var e=oD(),n=function(i){var s=i.styles,l=i.dynamic;return e(s,l),null};return n},lD={left:0,top:0,right:0,gap:0},mp=function(e){return parseInt(e||"",10)||0},cD=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[mp(i),mp(s),mp(l)]},uD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lD;var n=cD(e),i=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-i+n[2]-n[0])}},dD=l1(),Ma="data-scroll-locked",hD=function(e,n,i,s){var l=e.left,h=e.top,u=e.right,o=e.gap;return i===void 0&&(i="margin"),`
|
|
415
|
-
.`.concat(WR,` {
|
|
416
|
-
overflow: hidden `).concat(s,`;
|
|
417
|
-
padding-right: `).concat(o,"px ").concat(s,`;
|
|
418
|
-
}
|
|
419
|
-
body[`).concat(Ma,`] {
|
|
420
|
-
overflow: hidden `).concat(s,`;
|
|
421
|
-
overscroll-behavior: contain;
|
|
422
|
-
`).concat([n&&"position: relative ".concat(s,";"),i==="margin"&&`
|
|
423
|
-
padding-left: `.concat(l,`px;
|
|
424
|
-
padding-top: `).concat(h,`px;
|
|
425
|
-
padding-right: `).concat(u,`px;
|
|
426
|
-
margin-left:0;
|
|
427
|
-
margin-top:0;
|
|
428
|
-
margin-right: `).concat(o,"px ").concat(s,`;
|
|
429
|
-
`),i==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.`).concat(Mu,` {
|
|
433
|
-
right: `).concat(o,"px ").concat(s,`;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.`).concat(Nu,` {
|
|
437
|
-
margin-right: `).concat(o,"px ").concat(s,`;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.`).concat(Mu," .").concat(Mu,` {
|
|
441
|
-
right: 0 `).concat(s,`;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.`).concat(Nu," .").concat(Nu,` {
|
|
445
|
-
margin-right: 0 `).concat(s,`;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
body[`).concat(Ma,`] {
|
|
449
|
-
`).concat(KR,": ").concat(o,`px;
|
|
450
|
-
}
|
|
451
|
-
`)},Xb=function(){var e=parseInt(document.body.getAttribute(Ma)||"0",10);return isFinite(e)?e:0},fD=function(){T.useEffect(function(){return document.body.setAttribute(Ma,(Xb()+1).toString()),function(){var e=Xb()-1;e<=0?document.body.removeAttribute(Ma):document.body.setAttribute(Ma,e.toString())}},[])},pD=function(e){var n=e.noRelative,i=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;fD();var h=T.useMemo(function(){return uD(l)},[l]);return T.createElement(dD,{styles:hD(h,!n,l,i?"":"!important")})},Jp=!1;if(typeof window<"u")try{var vu=Object.defineProperty({},"passive",{get:function(){return Jp=!0,!0}});window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch{Jp=!1}var xa=Jp?{passive:!1}:!1,mD=function(e){return e.tagName==="TEXTAREA"},c1=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!mD(e)&&i[n]==="visible")},gD=function(e){return c1(e,"overflowY")},vD=function(e){return c1(e,"overflowX")},Zb=function(e,n){var i=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=u1(e,s);if(l){var h=d1(e,s),u=h[1],o=h[2];if(u>o)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},_D=function(e){var n=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[n,i,s]},yD=function(e){var n=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[n,i,s]},u1=function(e,n){return e==="v"?gD(n):vD(n)},d1=function(e,n){return e==="v"?_D(n):yD(n)},bD=function(e,n){return e==="h"&&n==="rtl"?-1:1},xD=function(e,n,i,s,l){var h=bD(e,window.getComputedStyle(n).direction),u=h*s,o=i.target,c=n.contains(o),d=!1,g=u>0,f=0,b=0;do{if(!o)break;var S=d1(e,o),k=S[0],w=S[1],_=S[2],y=w-_-h*k;(k||y)&&u1(e,o)&&(f+=y,b+=k);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&o!==document.body||c&&(n.contains(o)||n===o));return(g&&Math.abs(f)<1||!g&&Math.abs(b)<1)&&(d=!0),d},_u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qb=function(e){return[e.deltaX,e.deltaY]},Jb=function(e){return e&&"current"in e?e.current:e},SD=function(e,n){return e[0]===n[0]&&e[1]===n[1]},wD=function(e){return`
|
|
452
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
453
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
454
|
-
`)},CD=0,Sa=[];function kD(e){var n=T.useRef([]),i=T.useRef([0,0]),s=T.useRef(),l=T.useState(CD++)[0],h=T.useState(l1)[0],u=T.useRef(e);T.useEffect(function(){u.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=GR([e.lockRef.current],(e.shards||[]).map(Jb),!0).filter(Boolean);return w.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var o=T.useCallback(function(w,_){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!u.current.allowPinchZoom;var y=_u(w),v=i.current,x="deltaX"in w?w.deltaX:v[0]-y[0],E="deltaY"in w?w.deltaY:v[1]-y[1],M,R=w.target,N=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in w&&N==="h"&&R.type==="range")return!1;var D=window.getSelection(),O=D&&D.anchorNode,P=O?O===R||O.contains(R):!1;if(P)return!1;var $=Zb(N,R);if(!$)return!0;if($?M=N:(M=N==="v"?"h":"v",$=Zb(N,R)),!$)return!1;if(!s.current&&"changedTouches"in w&&(x||E)&&(s.current=M),!M)return!0;var U=s.current||M;return xD(U,_,w,U==="h"?x:E)},[]),c=T.useCallback(function(w){var _=w;if(!(!Sa.length||Sa[Sa.length-1]!==h)){var y="deltaY"in _?Qb(_):_u(_),v=n.current.filter(function(M){return M.name===_.type&&(M.target===_.target||_.target===M.shadowParent)&&SD(M.delta,y)})[0];if(v&&v.should){_.cancelable&&_.preventDefault();return}if(!v){var x=(u.current.shards||[]).map(Jb).filter(Boolean).filter(function(M){return M.contains(_.target)}),E=x.length>0?o(_,x[0]):!u.current.noIsolation;E&&_.cancelable&&_.preventDefault()}}},[]),d=T.useCallback(function(w,_,y,v){var x={name:w,delta:_,target:y,should:v,shadowParent:ED(y)};n.current.push(x),setTimeout(function(){n.current=n.current.filter(function(E){return E!==x})},1)},[]),g=T.useCallback(function(w){i.current=_u(w),s.current=void 0},[]),f=T.useCallback(function(w){d(w.type,Qb(w),w.target,o(w,e.lockRef.current))},[]),b=T.useCallback(function(w){d(w.type,_u(w),w.target,o(w,e.lockRef.current))},[]);T.useEffect(function(){return Sa.push(h),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:b}),document.addEventListener("wheel",c,xa),document.addEventListener("touchmove",c,xa),document.addEventListener("touchstart",g,xa),function(){Sa=Sa.filter(function(w){return w!==h}),document.removeEventListener("wheel",c,xa),document.removeEventListener("touchmove",c,xa),document.removeEventListener("touchstart",g,xa)}},[]);var S=e.removeScrollBar,k=e.inert;return T.createElement(T.Fragment,null,k?T.createElement(h,{styles:wD(l)}):null,S?T.createElement(pD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ED(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const AD=tD(o1,kD);var Pl=T.forwardRef(function(e,n){return T.createElement(ld,Cr({},e,{ref:n,sideCar:AD}))});Pl.classNames=ld.classNames;var TD=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},wa=new WeakMap,yu=new WeakMap,bu={},gp=0,h1=function(e){return e&&(e.host||h1(e.parentNode))},RD=function(e,n){return n.map(function(i){if(e.contains(i))return i;var s=h1(i);return s&&e.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},DD=function(e,n,i,s){var l=RD(n,Array.isArray(e)?e:[e]);bu[i]||(bu[i]=new WeakMap);var h=bu[i],u=[],o=new Set,c=new Set(l),d=function(f){!f||o.has(f)||(o.add(f),d(f.parentNode))};l.forEach(d);var g=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(b){if(o.has(b))g(b);else try{var S=b.getAttribute(s),k=S!==null&&S!=="false",w=(wa.get(b)||0)+1,_=(h.get(b)||0)+1;wa.set(b,w),h.set(b,_),u.push(b),w===1&&k&&yu.set(b,!0),_===1&&b.setAttribute(i,"true"),k||b.setAttribute(s,"true")}catch(y){console.error("aria-hidden: cannot operate on ",b,y)}})};return g(n),o.clear(),gp++,function(){u.forEach(function(f){var b=wa.get(f)-1,S=h.get(f)-1;wa.set(f,b),h.set(f,S),b||(yu.has(f)||f.removeAttribute(s),yu.delete(f)),S||f.removeAttribute(i)}),gp--,gp||(wa=new WeakMap,wa=new WeakMap,yu=new WeakMap,bu={})}},cd=function(e,n,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=TD(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),DD(s,l,i,"aria-hidden")):function(){return null}},ud="Dialog",[f1]=Un(ud),[MD,pr]=f1(ud),p1=e=>{const{__scopeDialog:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:u=!0}=e,o=T.useRef(null),c=T.useRef(null),[d,g]=ri({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:ud});return m.jsx(MD,{scope:n,triggerRef:o,contentRef:c,contentId:Gt(),titleId:Gt(),descriptionId:Gt(),open:d,onOpenChange:g,onOpenToggle:T.useCallback(()=>g(f=>!f),[g]),modal:u,children:i})};p1.displayName=ud;var m1="DialogTrigger",g1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(m1,i),h=Xe(n,l.triggerRef);return m.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Bm(l.open),...s,ref:h,onClick:Ce(e.onClick,l.onOpenToggle)})});g1.displayName=m1;var Lm="DialogPortal",[ND,v1]=f1(Lm,{forceMount:void 0}),_1=e=>{const{__scopeDialog:n,forceMount:i,children:s,container:l}=e,h=pr(Lm,n);return m.jsx(ND,{scope:n,forceMount:i,children:T.Children.map(s,u=>m.jsx(Zt,{present:i||h.open,children:m.jsx(Ja,{asChild:!0,container:l,children:u})}))})};_1.displayName=Lm;var Pu="DialogOverlay",y1=T.forwardRef((e,n)=>{const i=v1(Pu,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=pr(Pu,e.__scopeDialog);return h.modal?m.jsx(Zt,{present:s||h.open,children:m.jsx(OD,{...l,ref:n})}):null});y1.displayName=Pu;var jD=Ui("DialogOverlay.RemoveScroll"),OD=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(Pu,i);return m.jsx(Pl,{as:jD,allowPinchZoom:!0,shards:[l.contentRef],children:m.jsx(je.div,{"data-state":Bm(l.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),ws="DialogContent",b1=T.forwardRef((e,n)=>{const i=v1(ws,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=pr(ws,e.__scopeDialog);return m.jsx(Zt,{present:s||h.open,children:h.modal?m.jsx(LD,{...l,ref:n}):m.jsx(ID,{...l,ref:n})})});b1.displayName=ws;var LD=T.forwardRef((e,n)=>{const i=pr(ws,e.__scopeDialog),s=T.useRef(null),l=Xe(n,i.contentRef,s);return T.useEffect(()=>{const h=s.current;if(h)return cd(h)},[]),m.jsx(x1,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,h=>{var u;h.preventDefault(),(u=i.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,h=>{const u=h.detail.originalEvent,o=u.button===0&&u.ctrlKey===!0;(u.button===2||o)&&h.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,h=>h.preventDefault())})}),ID=T.forwardRef((e,n)=>{const i=pr(ws,e.__scopeDialog),s=T.useRef(!1),l=T.useRef(!1);return m.jsx(x1,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var u,o;(u=e.onCloseAutoFocus)==null||u.call(e,h),h.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),h.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:h=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=h.target;((d=i.triggerRef.current)==null?void 0:d.contains(u))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),x1=T.forwardRef((e,n)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,...u}=e,o=pr(ws,i),c=T.useRef(null),d=Xe(n,c);return od(),m.jsxs(m.Fragment,{children:[m.jsx(zl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:m.jsx(Qa,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Bm(o.open),...u,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(BD,{titleId:o.titleId}),m.jsx(PD,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Im="DialogTitle",S1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(Im,i);return m.jsx(je.h2,{id:l.titleId,...s,ref:n})});S1.displayName=Im;var w1="DialogDescription",C1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(w1,i);return m.jsx(je.p,{id:l.descriptionId,...s,ref:n})});C1.displayName=w1;var k1="DialogClose",E1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(k1,i);return m.jsx(je.button,{type:"button",...s,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});E1.displayName=k1;function Bm(e){return e?"open":"closed"}var A1="DialogTitleWarning",[g9,T1]=mR(A1,{contentName:ws,titleName:Im,docsSlug:"dialog"}),BD=({titleId:e})=>{const n=T1(A1),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
455
|
-
|
|
456
|
-
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
457
|
-
|
|
458
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return T.useEffect(()=>{e&&(document.getElementById(e)||console.error(i))},[i,e]),null},zD="DialogDescriptionWarning",PD=({contentRef:e,descriptionId:n})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${T1(zD).contentName}}.`;return T.useEffect(()=>{var h;const l=(h=e.current)==null?void 0:h.getAttribute("aria-describedby");n&&l&&(document.getElementById(n)||console.warn(s))},[s,e,n]),null},zm=p1,FD=g1,Pm=_1,Fm=y1,Hm=b1,R1=S1,D1=C1,dd=E1;function HD(e){const n=T.useRef({value:e,previous:e});return T.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function UD(e){const[n,i]=T.useState(void 0);return Xt(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const h=l[0];let u,o;if("borderBoxSize"in h){const c=h.borderBoxSize,d=Array.isArray(c)?c[0]:c;u=d.inlineSize,o=d.blockSize}else u=e.offsetWidth,o=e.offsetHeight;i({width:u,height:o})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),n}const $D=["top","right","bottom","left"],$i=Math.min,zn=Math.max,Fu=Math.round,xu=Math.floor,Er=e=>({x:e,y:e}),qD={left:"right",right:"left",bottom:"top",top:"bottom"};function em(e,n,i){return zn(e,$i(n,i))}function ii(e,n){return typeof e=="function"?e(n):e}function si(e){return e.split("-")[0]}function eo(e){return e.split("-")[1]}function Um(e){return e==="x"?"y":"x"}function $m(e){return e==="y"?"height":"width"}function kr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function qm(e){return Um(kr(e))}function VD(e,n,i){i===void 0&&(i=!1);const s=eo(e),l=qm(e),h=$m(l);let u=l==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(u=Hu(u)),[u,Hu(u)]}function GD(e){const n=Hu(e);return[tm(e),n,tm(n)]}function tm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const e0=["left","right"],t0=["right","left"],WD=["top","bottom"],KD=["bottom","top"];function YD(e,n,i){switch(e){case"top":case"bottom":return i?n?t0:e0:n?e0:t0;case"left":case"right":return n?WD:KD;default:return[]}}function XD(e,n,i,s){const l=eo(e);let h=YD(si(e),i==="start",s);return l&&(h=h.map(u=>u+"-"+l),n&&(h=h.concat(h.map(tm)))),h}function Hu(e){const n=si(e);return qD[n]+e.slice(n.length)}function ZD(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?ZD(e):{top:e,right:e,bottom:e,left:e}}function Uu(e){const{x:n,y:i,width:s,height:l}=e;return{width:s,height:l,top:i,left:n,right:n+s,bottom:i+l,x:n,y:i}}function n0(e,n,i){let{reference:s,floating:l}=e;const h=kr(n),u=qm(n),o=$m(u),c=si(n),d=h==="y",g=s.x+s.width/2-l.width/2,f=s.y+s.height/2-l.height/2,b=s[o]/2-l[o]/2;let S;switch(c){case"top":S={x:g,y:s.y-l.height};break;case"bottom":S={x:g,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:f};break;case"left":S={x:s.x-l.width,y:f};break;default:S={x:s.x,y:s.y}}switch(eo(n)){case"start":S[u]-=b*(i&&d?-1:1);break;case"end":S[u]+=b*(i&&d?-1:1);break}return S}async function QD(e,n){var i;n===void 0&&(n={});const{x:s,y:l,platform:h,rects:u,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:f="floating",altBoundary:b=!1,padding:S=0}=ii(n,e),k=M1(S),_=o[b?f==="floating"?"reference":"floating":f],y=Uu(await h.getClippingRect({element:(i=await(h.isElement==null?void 0:h.isElement(_)))==null||i?_:_.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(o.floating)),boundary:d,rootBoundary:g,strategy:c})),v=f==="floating"?{x:s,y:l,width:u.floating.width,height:u.floating.height}:u.reference,x=await(h.getOffsetParent==null?void 0:h.getOffsetParent(o.floating)),E=await(h.isElement==null?void 0:h.isElement(x))?await(h.getScale==null?void 0:h.getScale(x))||{x:1,y:1}:{x:1,y:1},M=Uu(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:c}):v);return{top:(y.top-M.top+k.top)/E.y,bottom:(M.bottom-y.bottom+k.bottom)/E.y,left:(y.left-M.left+k.left)/E.x,right:(M.right-y.right+k.right)/E.x}}const JD=50,eM=async(e,n,i)=>{const{placement:s="bottom",strategy:l="absolute",middleware:h=[],platform:u}=i,o=u.detectOverflow?u:{...u,detectOverflow:QD},c=await(u.isRTL==null?void 0:u.isRTL(n));let d=await u.getElementRects({reference:e,floating:n,strategy:l}),{x:g,y:f}=n0(d,s,c),b=s,S=0;const k={};for(let w=0;w<h.length;w++){const _=h[w];if(!_)continue;const{name:y,fn:v}=_,{x,y:E,data:M,reset:R}=await v({x:g,y:f,initialPlacement:s,placement:b,strategy:l,middlewareData:k,rects:d,platform:o,elements:{reference:e,floating:n}});g=x!=null?x:g,f=E!=null?E:f,k[y]={...k[y],...M},R&&S<JD&&(S++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(d=R.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:l}):R.rects),{x:g,y:f}=n0(d,b,c)),w=-1)}return{x:g,y:f,placement:b,strategy:l,middlewareData:k}},tM=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:s,placement:l,rects:h,platform:u,elements:o,middlewareData:c}=n,{element:d,padding:g=0}=ii(e,n)||{};if(d==null)return{};const f=M1(g),b={x:i,y:s},S=qm(l),k=$m(S),w=await u.getDimensions(d),_=S==="y",y=_?"top":"left",v=_?"bottom":"right",x=_?"clientHeight":"clientWidth",E=h.reference[k]+h.reference[S]-b[S]-h.floating[k],M=b[S]-h.reference[S],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let N=R?R[x]:0;(!N||!await(u.isElement==null?void 0:u.isElement(R)))&&(N=o.floating[x]||h.floating[k]);const D=E/2-M/2,O=N/2-w[k]/2-1,P=$i(f[y],O),$=$i(f[v],O),U=P,q=N-w[k]-$,Y=N/2-w[k]/2+D,K=em(U,Y,q),V=!c.arrow&&eo(l)!=null&&Y!==K&&h.reference[k]/2-(Y<U?P:$)-w[k]/2<0,Q=V?Y<U?Y-U:Y-q:0;return{[S]:b[S]+Q,data:{[S]:K,centerOffset:Y-K-Q,...V&&{alignmentOffset:Q}},reset:V}}}),nM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,s;const{placement:l,middlewareData:h,rects:u,initialPlacement:o,platform:c,elements:d}=n,{mainAxis:g=!0,crossAxis:f=!0,fallbackPlacements:b,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:w=!0,..._}=ii(e,n);if((i=h.arrow)!=null&&i.alignmentOffset)return{};const y=si(l),v=kr(o),x=si(o)===o,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),M=b||(x||!w?[Hu(o)]:GD(o)),R=k!=="none";!b&&R&&M.push(...XD(o,w,k,E));const N=[o,...M],D=await c.detectOverflow(n,_),O=[];let P=((s=h.flip)==null?void 0:s.overflows)||[];if(g&&O.push(D[y]),f){const Y=VD(l,u,E);O.push(D[Y[0]],D[Y[1]])}if(P=[...P,{placement:l,overflows:O}],!O.every(Y=>Y<=0)){var $,U;const Y=((($=h.flip)==null?void 0:$.index)||0)+1,K=N[Y];if(K&&(!(f==="alignment"?v!==kr(K):!1)||P.every(J=>kr(J.placement)===v?J.overflows[0]>0:!0)))return{data:{index:Y,overflows:P},reset:{placement:K}};let V=(U=P.filter(Q=>Q.overflows[0]<=0).sort((Q,J)=>Q.overflows[1]-J.overflows[1])[0])==null?void 0:U.placement;if(!V)switch(S){case"bestFit":{var q;const Q=(q=P.filter(J=>{if(R){const F=kr(J.placement);return F===v||F==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(F=>F>0).reduce((F,j)=>F+j,0)]).sort((J,F)=>J[1]-F[1])[0])==null?void 0:q[0];Q&&(V=Q);break}case"initialPlacement":V=o;break}if(l!==V)return{reset:{placement:V}}}return{}}}};function r0(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function i0(e){return $D.some(n=>e[n]>=0)}const rM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i,platform:s}=n,{strategy:l="referenceHidden",...h}=ii(e,n);switch(l){case"referenceHidden":{const u=await s.detectOverflow(n,{...h,elementContext:"reference"}),o=r0(u,i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:i0(o)}}}case"escaped":{const u=await s.detectOverflow(n,{...h,altBoundary:!0}),o=r0(u,i.floating);return{data:{escapedOffsets:o,escaped:i0(o)}}}default:return{}}}}},N1=new Set(["left","top"]);async function iM(e,n){const{placement:i,platform:s,elements:l}=e,h=await(s.isRTL==null?void 0:s.isRTL(l.floating)),u=si(i),o=eo(i),c=kr(i)==="y",d=N1.has(u)?-1:1,g=h&&c?-1:1,f=ii(n,e);let{mainAxis:b,crossAxis:S,alignmentAxis:k}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof k=="number"&&(S=o==="end"?k*-1:k),c?{x:S*g,y:b*d}:{x:b*d,y:S*g}}const sM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,s;const{x:l,y:h,placement:u,middlewareData:o}=n,c=await iM(n,e);return u===((i=o.offset)==null?void 0:i.placement)&&(s=o.arrow)!=null&&s.alignmentOffset?{}:{x:l+c.x,y:h+c.y,data:{...c,placement:u}}}}},aM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:s,placement:l,platform:h}=n,{mainAxis:u=!0,crossAxis:o=!1,limiter:c={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...d}=ii(e,n),g={x:i,y:s},f=await h.detectOverflow(n,d),b=kr(si(l)),S=Um(b);let k=g[S],w=g[b];if(u){const y=S==="y"?"top":"left",v=S==="y"?"bottom":"right",x=k+f[y],E=k-f[v];k=em(x,k,E)}if(o){const y=b==="y"?"top":"left",v=b==="y"?"bottom":"right",x=w+f[y],E=w-f[v];w=em(x,w,E)}const _=c.fn({...n,[S]:k,[b]:w});return{..._,data:{x:_.x-i,y:_.y-s,enabled:{[S]:u,[b]:o}}}}}},oM=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:i,y:s,placement:l,rects:h,middlewareData:u}=n,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=ii(e,n),g={x:i,y:s},f=kr(l),b=Um(f);let S=g[b],k=g[f];const w=ii(o,n),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const x=b==="y"?"height":"width",E=h.reference[b]-h.floating[x]+_.mainAxis,M=h.reference[b]+h.reference[x]-_.mainAxis;S<E?S=E:S>M&&(S=M)}if(d){var y,v;const x=b==="y"?"width":"height",E=N1.has(si(l)),M=h.reference[f]-h.floating[x]+(E&&((y=u.offset)==null?void 0:y[f])||0)+(E?0:_.crossAxis),R=h.reference[f]+h.reference[x]+(E?0:((v=u.offset)==null?void 0:v[f])||0)-(E?_.crossAxis:0);k<M?k=M:k>R&&(k=R)}return{[b]:S,[f]:k}}}},lM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var i,s;const{placement:l,rects:h,platform:u,elements:o}=n,{apply:c=()=>{},...d}=ii(e,n),g=await u.detectOverflow(n,d),f=si(l),b=eo(l),S=kr(l)==="y",{width:k,height:w}=h.floating;let _,y;f==="top"||f==="bottom"?(_=f,y=b===(await(u.isRTL==null?void 0:u.isRTL(o.floating))?"start":"end")?"left":"right"):(y=f,_=b==="end"?"top":"bottom");const v=w-g.top-g.bottom,x=k-g.left-g.right,E=$i(w-g[_],v),M=$i(k-g[y],x),R=!n.middlewareData.shift;let N=E,D=M;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&(D=x),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(N=v),R&&!b){const P=zn(g.left,0),$=zn(g.right,0),U=zn(g.top,0),q=zn(g.bottom,0);S?D=k-2*(P!==0||$!==0?P+$:zn(g.left,g.right)):N=w-2*(U!==0||q!==0?U+q:zn(g.top,g.bottom))}await c({...n,availableWidth:D,availableHeight:N});const O=await u.getDimensions(o.floating);return k!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function hd(){return typeof window<"u"}function to(e){return j1(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Tr(e){var n;return(n=(j1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function j1(e){return hd()?e instanceof Node||e instanceof Fn(e).Node:!1}function hr(e){return hd()?e instanceof Element||e instanceof Fn(e).Element:!1}function ai(e){return hd()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function s0(e){return!hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}function Fl(e){const{overflow:n,overflowX:i,overflowY:s,display:l}=fr(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+i)&&l!=="inline"&&l!=="contents"}function cM(e){return/^(table|td|th)$/.test(to(e))}function fd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const uM=/transform|translate|scale|rotate|perspective|filter/,dM=/paint|layout|strict|content/,_s=e=>!!e&&e!=="none";let vp;function Vm(e){const n=hr(e)?fr(e):e;return _s(n.transform)||_s(n.translate)||_s(n.scale)||_s(n.rotate)||_s(n.perspective)||!Gm()&&(_s(n.backdropFilter)||_s(n.filter))||uM.test(n.willChange||"")||dM.test(n.contain||"")}function hM(e){let n=qi(e);for(;ai(n)&&!Ia(n);){if(Vm(n))return n;if(fd(n))return null;n=qi(n)}return null}function Gm(){return vp==null&&(vp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vp}function Ia(e){return/^(html|body|#document)$/.test(to(e))}function fr(e){return Fn(e).getComputedStyle(e)}function pd(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qi(e){if(to(e)==="html")return e;const n=e.assignedSlot||e.parentNode||s0(e)&&e.host||Tr(e);return s0(n)?n.host:n}function O1(e){const n=qi(e);return Ia(n)?e.ownerDocument?e.ownerDocument.body:e.body:ai(n)&&Fl(n)?n:O1(n)}function Cl(e,n,i){var s;n===void 0&&(n=[]),i===void 0&&(i=!0);const l=O1(e),h=l===((s=e.ownerDocument)==null?void 0:s.body),u=Fn(l);if(h){const o=nm(u);return n.concat(u,u.visualViewport||[],Fl(l)?l:[],o&&i?Cl(o):[])}else return n.concat(l,Cl(l,[],i))}function nm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L1(e){const n=fr(e);let i=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const l=ai(e),h=l?e.offsetWidth:i,u=l?e.offsetHeight:s,o=Fu(i)!==h||Fu(s)!==u;return o&&(i=h,s=u),{width:i,height:s,$:o}}function Wm(e){return hr(e)?e:e.contextElement}function Na(e){const n=Wm(e);if(!ai(n))return Er(1);const i=n.getBoundingClientRect(),{width:s,height:l,$:h}=L1(n);let u=(h?Fu(i.width):i.width)/s,o=(h?Fu(i.height):i.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!o||!Number.isFinite(o))&&(o=1),{x:u,y:o}}const fM=Er(0);function I1(e){const n=Fn(e);return!Gm()||!n.visualViewport?fM:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function pM(e,n,i){return n===void 0&&(n=!1),!i||n&&i!==Fn(e)?!1:n}function Cs(e,n,i,s){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=e.getBoundingClientRect(),h=Wm(e);let u=Er(1);n&&(s?hr(s)&&(u=Na(s)):u=Na(e));const o=pM(h,i,s)?I1(h):Er(0);let c=(l.left+o.x)/u.x,d=(l.top+o.y)/u.y,g=l.width/u.x,f=l.height/u.y;if(h){const b=Fn(h),S=s&&hr(s)?Fn(s):s;let k=b,w=nm(k);for(;w&&s&&S!==k;){const _=Na(w),y=w.getBoundingClientRect(),v=fr(w),x=y.left+(w.clientLeft+parseFloat(v.paddingLeft))*_.x,E=y.top+(w.clientTop+parseFloat(v.paddingTop))*_.y;c*=_.x,d*=_.y,g*=_.x,f*=_.y,c+=x,d+=E,k=Fn(w),w=nm(k)}}return Uu({width:g,height:f,x:c,y:d})}function md(e,n){const i=pd(e).scrollLeft;return n?n.left+i:Cs(Tr(e)).left+i}function B1(e,n){const i=e.getBoundingClientRect(),s=i.left+n.scrollLeft-md(e,i),l=i.top+n.scrollTop;return{x:s,y:l}}function mM(e){let{elements:n,rect:i,offsetParent:s,strategy:l}=e;const h=l==="fixed",u=Tr(s),o=n?fd(n.floating):!1;if(s===u||o&&h)return i;let c={scrollLeft:0,scrollTop:0},d=Er(1);const g=Er(0),f=ai(s);if((f||!f&&!h)&&((to(s)!=="body"||Fl(u))&&(c=pd(s)),f)){const S=Cs(s);d=Na(s),g.x=S.x+s.clientLeft,g.y=S.y+s.clientTop}const b=u&&!f&&!h?B1(u,c):Er(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-c.scrollLeft*d.x+g.x+b.x,y:i.y*d.y-c.scrollTop*d.y+g.y+b.y}}function gM(e){return Array.from(e.getClientRects())}function vM(e){const n=Tr(e),i=pd(e),s=e.ownerDocument.body,l=zn(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=zn(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let u=-i.scrollLeft+md(e);const o=-i.scrollTop;return fr(s).direction==="rtl"&&(u+=zn(n.clientWidth,s.clientWidth)-l),{width:l,height:h,x:u,y:o}}const a0=25;function _M(e,n){const i=Fn(e),s=Tr(e),l=i.visualViewport;let h=s.clientWidth,u=s.clientHeight,o=0,c=0;if(l){h=l.width,u=l.height;const g=Gm();(!g||g&&n==="fixed")&&(o=l.offsetLeft,c=l.offsetTop)}const d=md(s);if(d<=0){const g=s.ownerDocument,f=g.body,b=getComputedStyle(f),S=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,k=Math.abs(s.clientWidth-f.clientWidth-S);k<=a0&&(h-=k)}else d<=a0&&(h+=d);return{width:h,height:u,x:o,y:c}}function yM(e,n){const i=Cs(e,!0,n==="fixed"),s=i.top+e.clientTop,l=i.left+e.clientLeft,h=ai(e)?Na(e):Er(1),u=e.clientWidth*h.x,o=e.clientHeight*h.y,c=l*h.x,d=s*h.y;return{width:u,height:o,x:c,y:d}}function o0(e,n,i){let s;if(n==="viewport")s=_M(e,i);else if(n==="document")s=vM(Tr(e));else if(hr(n))s=yM(n,i);else{const l=I1(e);s={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return Uu(s)}function z1(e,n){const i=qi(e);return i===n||!hr(i)||Ia(i)?!1:fr(i).position==="fixed"||z1(i,n)}function bM(e,n){const i=n.get(e);if(i)return i;let s=Cl(e,[],!1).filter(o=>hr(o)&&to(o)!=="body"),l=null;const h=fr(e).position==="fixed";let u=h?qi(e):e;for(;hr(u)&&!Ia(u);){const o=fr(u),c=Vm(u);!c&&o.position==="fixed"&&(l=null),(h?!c&&!l:!c&&o.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Fl(u)&&!c&&z1(e,u))?s=s.filter(g=>g!==u):l=o,u=qi(u)}return n.set(e,s),s}function xM(e){let{element:n,boundary:i,rootBoundary:s,strategy:l}=e;const u=[...i==="clippingAncestors"?fd(n)?[]:bM(n,this._c):[].concat(i),s],o=o0(n,u[0],l);let c=o.top,d=o.right,g=o.bottom,f=o.left;for(let b=1;b<u.length;b++){const S=o0(n,u[b],l);c=zn(S.top,c),d=$i(S.right,d),g=$i(S.bottom,g),f=zn(S.left,f)}return{width:d-f,height:g-c,x:f,y:c}}function SM(e){const{width:n,height:i}=L1(e);return{width:n,height:i}}function wM(e,n,i){const s=ai(n),l=Tr(n),h=i==="fixed",u=Cs(e,!0,h,n);let o={scrollLeft:0,scrollTop:0};const c=Er(0);function d(){c.x=md(l)}if(s||!s&&!h)if((to(n)!=="body"||Fl(l))&&(o=pd(n)),s){const S=Cs(n,!0,h,n);c.x=S.x+n.clientLeft,c.y=S.y+n.clientTop}else l&&d();h&&!s&&l&&d();const g=l&&!s&&!h?B1(l,o):Er(0),f=u.left+o.scrollLeft-c.x-g.x,b=u.top+o.scrollTop-c.y-g.y;return{x:f,y:b,width:u.width,height:u.height}}function _p(e){return fr(e).position==="static"}function l0(e,n){if(!ai(e)||fr(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Tr(e)===i&&(i=i.ownerDocument.body),i}function P1(e,n){const i=Fn(e);if(fd(e))return i;if(!ai(e)){let l=qi(e);for(;l&&!Ia(l);){if(hr(l)&&!_p(l))return l;l=qi(l)}return i}let s=l0(e,n);for(;s&&cM(s)&&_p(s);)s=l0(s,n);return s&&Ia(s)&&_p(s)&&!Vm(s)?i:s||hM(e)||i}const CM=async function(e){const n=this.getOffsetParent||P1,i=this.getDimensions,s=await i(e.floating);return{reference:wM(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function kM(e){return fr(e).direction==="rtl"}const EM={convertOffsetParentRelativeRectToViewportRelativeRect:mM,getDocumentElement:Tr,getClippingRect:xM,getOffsetParent:P1,getElementRects:CM,getClientRects:gM,getDimensions:SM,getScale:Na,isElement:hr,isRTL:kM};function F1(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function AM(e,n){let i=null,s;const l=Tr(e);function h(){var o;clearTimeout(s),(o=i)==null||o.disconnect(),i=null}function u(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),h();const d=e.getBoundingClientRect(),{left:g,top:f,width:b,height:S}=d;if(o||n(),!b||!S)return;const k=xu(f),w=xu(l.clientWidth-(g+b)),_=xu(l.clientHeight-(f+S)),y=xu(g),x={rootMargin:-k+"px "+-w+"px "+-_+"px "+-y+"px",threshold:zn(0,$i(1,c))||1};let E=!0;function M(R){const N=R[0].intersectionRatio;if(N!==c){if(!E)return u();N?u(!1,N):s=setTimeout(()=>{u(!1,1e-7)},1e3)}N===1&&!F1(d,e.getBoundingClientRect())&&u(),E=!1}try{i=new IntersectionObserver(M,{...x,root:l.ownerDocument})}catch{i=new IntersectionObserver(M,x)}i.observe(e)}return u(!0),h}function TM(e,n,i,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:h=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=Wm(e),g=l||h?[...d?Cl(d):[],...n?Cl(n):[]]:[];g.forEach(y=>{l&&y.addEventListener("scroll",i,{passive:!0}),h&&y.addEventListener("resize",i)});const f=d&&o?AM(d,i):null;let b=-1,S=null;u&&(S=new ResizeObserver(y=>{let[v]=y;v&&v.target===d&&S&&n&&(S.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(n)})),i()}),d&&!c&&S.observe(d),n&&S.observe(n));let k,w=c?Cs(e):null;c&&_();function _(){const y=Cs(e);w&&!F1(w,y)&&i(),w=y,k=requestAnimationFrame(_)}return i(),()=>{var y;g.forEach(v=>{l&&v.removeEventListener("scroll",i),h&&v.removeEventListener("resize",i)}),f==null||f(),(y=S)==null||y.disconnect(),S=null,c&&cancelAnimationFrame(k)}}const RM=sM,DM=aM,MM=nM,NM=lM,jM=rM,c0=tM,OM=oM,LM=(e,n,i)=>{const s=new Map,l={platform:EM,...i},h={...l.platform,_c:s};return eM(e,n,{...l,platform:h})};var IM=typeof document<"u",BM=function(){},ju=IM?T.useLayoutEffect:BM;function $u(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let i,s,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(s=i;s--!==0;)if(!$u(e[s],n[s]))return!1;return!0}if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(n,l[s]))return!1;for(s=i;s--!==0;){const h=l[s];if(!(h==="_owner"&&e.$$typeof)&&!$u(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function H1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u0(e,n){const i=H1(e);return Math.round(n*i)/i}function yp(e){const n=T.useRef(e);return ju(()=>{n.current=e}),n}function zM(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:l,elements:{reference:h,floating:u}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[g,f]=T.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[b,S]=T.useState(s);$u(b,s)||S(s);const[k,w]=T.useState(null),[_,y]=T.useState(null),v=T.useCallback(J=>{J!==R.current&&(R.current=J,w(J))},[]),x=T.useCallback(J=>{J!==N.current&&(N.current=J,y(J))},[]),E=h||k,M=u||_,R=T.useRef(null),N=T.useRef(null),D=T.useRef(g),O=c!=null,P=yp(c),$=yp(l),U=yp(d),q=T.useCallback(()=>{if(!R.current||!N.current)return;const J={placement:n,strategy:i,middleware:b};$.current&&(J.platform=$.current),LM(R.current,N.current,J).then(F=>{const j={...F,isPositioned:U.current!==!1};Y.current&&!$u(D.current,j)&&(D.current=j,Ll.flushSync(()=>{f(j)}))})},[b,n,i,$,U]);ju(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[d]);const Y=T.useRef(!1);ju(()=>(Y.current=!0,()=>{Y.current=!1}),[]),ju(()=>{if(E&&(R.current=E),M&&(N.current=M),E&&M){if(P.current)return P.current(E,M,q);q()}},[E,M,q,P,O]);const K=T.useMemo(()=>({reference:R,floating:N,setReference:v,setFloating:x}),[v,x]),V=T.useMemo(()=>({reference:E,floating:M}),[E,M]),Q=T.useMemo(()=>{const J={position:i,left:0,top:0};if(!V.floating)return J;const F=u0(V.floating,g.x),j=u0(V.floating,g.y);return o?{...J,transform:"translate("+F+"px, "+j+"px)",...H1(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:F,top:j}},[i,o,V.floating,g.x,g.y]);return T.useMemo(()=>({...g,update:q,refs:K,elements:V,floatingStyles:Q}),[g,q,K,V,Q])}const PM=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:s,padding:l}=typeof e=="function"?e(i):e;return s&&n(s)?s.current!=null?c0({element:s.current,padding:l}).fn(i):{}:s?c0({element:s,padding:l}).fn(i):{}}}},FM=(e,n)=>{const i=RM(e);return{name:i.name,fn:i.fn,options:[e,n]}},HM=(e,n)=>{const i=DM(e);return{name:i.name,fn:i.fn,options:[e,n]}},UM=(e,n)=>({fn:OM(e).fn,options:[e,n]}),$M=(e,n)=>{const i=MM(e);return{name:i.name,fn:i.fn,options:[e,n]}},qM=(e,n)=>{const i=NM(e);return{name:i.name,fn:i.fn,options:[e,n]}},VM=(e,n)=>{const i=jM(e);return{name:i.name,fn:i.fn,options:[e,n]}},GM=(e,n)=>{const i=PM(e);return{name:i.name,fn:i.fn,options:[e,n]}};var WM="Arrow",U1=T.forwardRef((e,n)=>{const{children:i,width:s=10,height:l=5,...h}=e;return m.jsx(je.svg,{...h,ref:n,width:s,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});U1.displayName=WM;var KM=U1,Km="Popper",[$1,Wi]=Un(Km),[YM,q1]=$1(Km),V1=e=>{const{__scopePopper:n,children:i}=e,[s,l]=T.useState(null);return m.jsx(YM,{scope:n,anchor:s,onAnchorChange:l,children:i})};V1.displayName=Km;var G1="PopperAnchor",W1=T.forwardRef((e,n)=>{const{__scopePopper:i,virtualRef:s,...l}=e,h=q1(G1,i),u=T.useRef(null),o=Xe(n,u),c=T.useRef(null);return T.useEffect(()=>{const d=c.current;c.current=(s==null?void 0:s.current)||u.current,d!==c.current&&h.onAnchorChange(c.current)}),s?null:m.jsx(je.div,{...l,ref:o})});W1.displayName=G1;var Ym="PopperContent",[XM,ZM]=$1(Ym),K1=T.forwardRef((e,n)=>{var W,H,re,ae,pe,ce,Oe,Be;const{__scopePopper:i,side:s="bottom",sideOffset:l=0,align:h="center",alignOffset:u=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:f="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:k,...w}=e,_=q1(Ym,i),[y,v]=T.useState(null),x=Xe(n,$e=>v($e)),[E,M]=T.useState(null),R=UD(E),N=(W=R==null?void 0:R.width)!=null?W:0,D=(H=R==null?void 0:R.height)!=null?H:0,O=s+(h!=="center"?"-"+h:""),P=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(d)?d:[d],U=$.length>0,q={padding:P,boundary:$.filter(JM),altBoundary:U},{refs:Y,floatingStyles:K,placement:V,isPositioned:Q,middlewareData:J}=zM({strategy:"fixed",placement:O,whileElementsMounted:(...$e)=>TM(...$e,{animationFrame:S==="always"}),elements:{reference:_.anchor},middleware:[FM({mainAxis:l+D,alignmentAxis:u}),c&&HM({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?UM():void 0,...q}),c&&$M({...q}),qM({...q,apply:({elements:$e,rects:ut,availableWidth:Me,availableHeight:vn})=>{const{width:Wt,height:on}=ut.reference,Kt=$e.floating.style;Kt.setProperty("--radix-popper-available-width",`${Me}px`),Kt.setProperty("--radix-popper-available-height",`${vn}px`),Kt.setProperty("--radix-popper-anchor-width",`${Wt}px`),Kt.setProperty("--radix-popper-anchor-height",`${on}px`)}}),E&&GM({element:E,padding:o}),eN({arrowWidth:N,arrowHeight:D}),b&&VM({strategy:"referenceHidden",...q})]}),[F,j]=Z1(V),I=an(k);Xt(()=>{Q&&(I==null||I())},[Q,I]);const L=(re=J.arrow)==null?void 0:re.x,z=(ae=J.arrow)==null?void 0:ae.y,X=((pe=J.arrow)==null?void 0:pe.centerOffset)!==0,[ee,te]=T.useState();return Xt(()=>{y&&te(window.getComputedStyle(y).zIndex)},[y]),m.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(ce=J.transformOrigin)==null?void 0:ce.x,(Oe=J.transformOrigin)==null?void 0:Oe.y].join(" "),...((Be=J.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(XM,{scope:i,placedSide:F,onArrowChange:M,arrowX:L,arrowY:z,shouldHideArrow:X,children:m.jsx(je.div,{"data-side":F,"data-align":j,...w,ref:x,style:{...w.style,animation:Q?void 0:"none"}})})})});K1.displayName=Ym;var Y1="PopperArrow",QM={top:"bottom",right:"left",bottom:"top",left:"right"},X1=T.forwardRef(function(n,i){const{__scopePopper:s,...l}=n,h=ZM(Y1,s),u=QM[h.placedSide];return m.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:m.jsx(KM,{...l,ref:i,style:{...l.style,display:"block"}})})});X1.displayName=Y1;function JM(e){return e!==null}var eN=e=>({name:"transformOrigin",options:e,fn(n){var _,y,v,x,E;const{placement:i,rects:s,middlewareData:l}=n,u=((_=l.arrow)==null?void 0:_.centerOffset)!==0,o=u?0:e.arrowWidth,c=u?0:e.arrowHeight,[d,g]=Z1(i),f={start:"0%",center:"50%",end:"100%"}[g],b=((v=(y=l.arrow)==null?void 0:y.x)!=null?v:0)+o/2,S=((E=(x=l.arrow)==null?void 0:x.y)!=null?E:0)+c/2;let k="",w="";return d==="bottom"?(k=u?f:`${b}px`,w=`${-c}px`):d==="top"?(k=u?f:`${b}px`,w=`${s.floating.height+c}px`):d==="right"?(k=`${-c}px`,w=u?f:`${S}px`):d==="left"&&(k=`${s.floating.width+c}px`,w=u?f:`${S}px`),{data:{x:k,y:w}}}});function Z1(e){const[n,i="center"]=e.split("-");return[n,i]}var gd=V1,Hl=W1,vd=K1,_d=X1,bp="rovingFocusGroup.onEntryFocus",tN={bubbles:!1,cancelable:!0},Ul="RovingFocusGroup",[rm,Q1,nN]=Mm(Ul),[rN,yd]=Un(Ul,[nN]),[iN,sN]=rN(Ul),J1=T.forwardRef((e,n)=>m.jsx(rm.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(rm.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(aN,{...e,ref:n})})}));J1.displayName=Ul;var aN=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,orientation:s,loop:l=!1,dir:h,currentTabStopId:u,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...f}=e,b=T.useRef(null),S=Xe(n,b),k=Bl(h),[w,_]=ri({prop:u,defaultProp:o!=null?o:null,onChange:c,caller:Ul}),[y,v]=T.useState(!1),x=an(d),E=Q1(i),M=T.useRef(!1),[R,N]=T.useState(0);return T.useEffect(()=>{const D=b.current;if(D)return D.addEventListener(bp,x),()=>D.removeEventListener(bp,x)},[x]),m.jsx(iN,{scope:i,orientation:s,dir:k,loop:l,currentTabStopId:w,onItemFocus:T.useCallback(D=>_(D),[_]),onItemShiftTab:T.useCallback(()=>v(!0),[]),onFocusableItemAdd:T.useCallback(()=>N(D=>D+1),[]),onFocusableItemRemove:T.useCallback(()=>N(D=>D-1),[]),children:m.jsx(je.div,{tabIndex:y||R===0?-1:0,"data-orientation":s,...f,ref:S,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{M.current=!0}),onFocus:Ce(e.onFocus,D=>{const O=!M.current;if(D.target===D.currentTarget&&O&&!y){const P=new CustomEvent(bp,tN);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=E().filter(V=>V.focusable),U=$.find(V=>V.active),q=$.find(V=>V.id===w),K=[U,q,...$].filter(Boolean).map(V=>V.ref.current);nS(K,g)}}M.current=!1}),onBlur:Ce(e.onBlur,()=>v(!1))})})}),eS="RovingFocusGroupItem",tS=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,focusable:s=!0,active:l=!1,tabStopId:h,children:u,...o}=e,c=Gt(),d=h||c,g=sN(eS,i),f=g.currentTabStopId===d,b=Q1(i),{onFocusableItemAdd:S,onFocusableItemRemove:k,currentTabStopId:w}=g;return T.useEffect(()=>{if(s)return S(),()=>k()},[s,S,k]),m.jsx(rm.ItemSlot,{scope:i,id:d,focusable:s,active:l,children:m.jsx(je.span,{tabIndex:f?0:-1,"data-orientation":g.orientation,...o,ref:n,onMouseDown:Ce(e.onMouseDown,_=>{s?g.onItemFocus(d):_.preventDefault()}),onFocus:Ce(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:Ce(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){g.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const y=cN(_,g.orientation,g.dir);if(y!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let x=b().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const E=x.indexOf(_.currentTarget);x=g.loop?uN(x,E+1):x.slice(E+1)}setTimeout(()=>nS(x))}}),children:typeof u=="function"?u({isCurrentTabStop:f,hasTabStop:w!=null}):u})})});tS.displayName=eS;var oN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lN(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cN(e,n,i){const s=lN(e.key,i);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return oN[s]}function nS(e,n=!1){const i=document.activeElement;for(const s of e)if(s===i||(s.focus({preventScroll:n}),document.activeElement!==i))return}function uN(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var rS=J1,iS=tS,im=["Enter"," "],dN=["ArrowDown","PageUp","Home"],sS=["ArrowUp","PageDown","End"],hN=[...dN,...sS],fN={ltr:[...im,"ArrowRight"],rtl:[...im,"ArrowLeft"]},pN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$l="Menu",[kl,mN,gN]=Mm($l),[Rs,aS]=Un($l,[gN,Wi,yd]),bd=Wi(),oS=yd(),[vN,Ds]=Rs($l),[_N,ql]=Rs($l),lS=e=>{const{__scopeMenu:n,open:i=!1,children:s,dir:l,onOpenChange:h,modal:u=!0}=e,o=bd(n),[c,d]=T.useState(null),g=T.useRef(!1),f=an(h),b=Bl(l);return T.useEffect(()=>{const S=()=>{g.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>g.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),m.jsx(gd,{...o,children:m.jsx(vN,{scope:n,open:i,onOpenChange:f,content:c,onContentChange:d,children:m.jsx(_N,{scope:n,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:g,dir:b,modal:u,children:s})})})};lS.displayName=$l;var yN="MenuAnchor",Xm=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=bd(i);return m.jsx(Hl,{...l,...s,ref:n})});Xm.displayName=yN;var Zm="MenuPortal",[bN,cS]=Rs(Zm,{forceMount:void 0}),uS=e=>{const{__scopeMenu:n,forceMount:i,children:s,container:l}=e,h=Ds(Zm,n);return m.jsx(bN,{scope:n,forceMount:i,children:m.jsx(Zt,{present:i||h.open,children:m.jsx(Ja,{asChild:!0,container:l,children:s})})})};uS.displayName=Zm;var rr="MenuContent",[xN,Qm]=Rs(rr),dS=T.forwardRef((e,n)=>{const i=cS(rr,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=Ds(rr,e.__scopeMenu),u=ql(rr,e.__scopeMenu);return m.jsx(kl.Provider,{scope:e.__scopeMenu,children:m.jsx(Zt,{present:s||h.open,children:m.jsx(kl.Slot,{scope:e.__scopeMenu,children:u.modal?m.jsx(SN,{...l,ref:n}):m.jsx(wN,{...l,ref:n})})})})}),SN=T.forwardRef((e,n)=>{const i=Ds(rr,e.__scopeMenu),s=T.useRef(null),l=Xe(n,s);return T.useEffect(()=>{const h=s.current;if(h)return cd(h)},[]),m.jsx(Jm,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),wN=T.forwardRef((e,n)=>{const i=Ds(rr,e.__scopeMenu);return m.jsx(Jm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),CN=Ui("MenuContent.ScrollLock"),Jm=T.forwardRef((e,n)=>{const{__scopeMenu:i,loop:s=!1,trapFocus:l,onOpenAutoFocus:h,onCloseAutoFocus:u,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:b,onDismiss:S,disableOutsideScroll:k,...w}=e,_=Ds(rr,i),y=ql(rr,i),v=bd(i),x=oS(i),E=mN(i),[M,R]=T.useState(null),N=T.useRef(null),D=Xe(n,N,_.onContentChange),O=T.useRef(0),P=T.useRef(""),$=T.useRef(0),U=T.useRef(null),q=T.useRef("right"),Y=T.useRef(0),K=k?Pl:T.Fragment,V=k?{as:CN,allowPinchZoom:!0}:void 0,Q=F=>{var W,H;const j=P.current+F,I=E().filter(re=>!re.disabled),L=document.activeElement,z=(W=I.find(re=>re.ref.current===L))==null?void 0:W.textValue,X=I.map(re=>re.textValue),ee=IN(X,j,z),te=(H=I.find(re=>re.textValue===ee))==null?void 0:H.ref.current;(function re(ae){P.current=ae,window.clearTimeout(O.current),ae!==""&&(O.current=window.setTimeout(()=>re(""),1e3))})(j),te&&setTimeout(()=>te.focus())};T.useEffect(()=>()=>window.clearTimeout(O.current),[]),od();const J=T.useCallback(F=>{var I,L;return q.current===((I=U.current)==null?void 0:I.side)&&zN(F,(L=U.current)==null?void 0:L.area)},[]);return m.jsx(xN,{scope:i,searchRef:P,onItemEnter:T.useCallback(F=>{J(F)&&F.preventDefault()},[J]),onItemLeave:T.useCallback(F=>{var j;J(F)||((j=N.current)==null||j.focus(),R(null))},[J]),onTriggerLeave:T.useCallback(F=>{J(F)&&F.preventDefault()},[J]),pointerGraceTimerRef:$,onPointerGraceIntentChange:T.useCallback(F=>{U.current=F},[]),children:m.jsx(K,{...V,children:m.jsx(zl,{asChild:!0,trapped:l,onMountAutoFocus:Ce(h,F=>{var j;F.preventDefault(),(j=N.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:b,onDismiss:S,children:m.jsx(rS,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:s,currentTabStopId:M,onCurrentTabStopIdChange:R,onEntryFocus:Ce(c,F=>{y.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(vd,{role:"menu","aria-orientation":"vertical","data-state":AS(_.open),"data-radix-menu-content":"",dir:y.dir,...v,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,F=>{const I=F.target.closest("[data-radix-menu-content]")===F.currentTarget,L=F.ctrlKey||F.altKey||F.metaKey,z=F.key.length===1;I&&(F.key==="Tab"&&F.preventDefault(),!L&&z&&Q(F.key));const X=N.current;if(F.target!==X||!hN.includes(F.key))return;F.preventDefault();const te=E().filter(W=>!W.disabled).map(W=>W.ref.current);sS.includes(F.key)&&te.reverse(),ON(te)}),onBlur:Ce(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(O.current),P.current="")}),onPointerMove:Ce(e.onPointerMove,El(F=>{const j=F.target,I=Y.current!==F.clientX;if(F.currentTarget.contains(j)&&I){const L=F.clientX>Y.current?"right":"left";q.current=L,Y.current=F.clientX}}))})})})})})})});dS.displayName=rr;var kN="MenuGroup",eg=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{role:"group",...s,ref:n})});eg.displayName=kN;var EN="MenuLabel",hS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{...s,ref:n})});hS.displayName=EN;var qu="MenuItem",d0="menu.itemSelect",xd=T.forwardRef((e,n)=>{const{disabled:i=!1,onSelect:s,...l}=e,h=T.useRef(null),u=ql(qu,e.__scopeMenu),o=Qm(qu,e.__scopeMenu),c=Xe(n,h),d=T.useRef(!1),g=()=>{const f=h.current;if(!i&&f){const b=new CustomEvent(d0,{bubbles:!0,cancelable:!0});f.addEventListener(d0,S=>s==null?void 0:s(S),{once:!0}),Yx(f,b),b.defaultPrevented?d.current=!1:u.onClose()}};return m.jsx(fS,{...l,ref:c,disabled:i,onClick:Ce(e.onClick,g),onPointerDown:f=>{var b;(b=e.onPointerDown)==null||b.call(e,f),d.current=!0},onPointerUp:Ce(e.onPointerUp,f=>{var b;d.current||(b=f.currentTarget)==null||b.click()}),onKeyDown:Ce(e.onKeyDown,f=>{const b=o.searchRef.current!=="";i||b&&f.key===" "||im.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});xd.displayName=qu;var fS=T.forwardRef((e,n)=>{const{__scopeMenu:i,disabled:s=!1,textValue:l,...h}=e,u=Qm(qu,i),o=oS(i),c=T.useRef(null),d=Xe(n,c),[g,f]=T.useState(!1),[b,S]=T.useState("");return T.useEffect(()=>{var w;const k=c.current;k&&S(((w=k.textContent)!=null?w:"").trim())},[h.children]),m.jsx(kl.ItemSlot,{scope:i,disabled:s,textValue:l!=null?l:b,children:m.jsx(iS,{asChild:!0,...o,focusable:!s,children:m.jsx(je.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...h,ref:d,onPointerMove:Ce(e.onPointerMove,El(k=>{s?u.onItemLeave(k):(u.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,El(k=>u.onItemLeave(k))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))})})})}),AN="MenuCheckboxItem",pS=T.forwardRef((e,n)=>{const{checked:i=!1,onCheckedChange:s,...l}=e;return m.jsx(yS,{scope:e.__scopeMenu,checked:i,children:m.jsx(xd,{role:"menuitemcheckbox","aria-checked":Vu(i)?"mixed":i,...l,ref:n,"data-state":ng(i),onSelect:Ce(l.onSelect,()=>s==null?void 0:s(Vu(i)?!0:!i),{checkForDefaultPrevented:!1})})})});pS.displayName=AN;var mS="MenuRadioGroup",[TN,RN]=Rs(mS,{value:void 0,onValueChange:()=>{}}),gS=T.forwardRef((e,n)=>{const{value:i,onValueChange:s,...l}=e,h=an(s);return m.jsx(TN,{scope:e.__scopeMenu,value:i,onValueChange:h,children:m.jsx(eg,{...l,ref:n})})});gS.displayName=mS;var vS="MenuRadioItem",_S=T.forwardRef((e,n)=>{const{value:i,...s}=e,l=RN(vS,e.__scopeMenu),h=i===l.value;return m.jsx(yS,{scope:e.__scopeMenu,checked:h,children:m.jsx(xd,{role:"menuitemradio","aria-checked":h,...s,ref:n,"data-state":ng(h),onSelect:Ce(s.onSelect,()=>{var u;return(u=l.onValueChange)==null?void 0:u.call(l,i)},{checkForDefaultPrevented:!1})})})});_S.displayName=vS;var tg="MenuItemIndicator",[yS,DN]=Rs(tg,{checked:!1}),bS=T.forwardRef((e,n)=>{const{__scopeMenu:i,forceMount:s,...l}=e,h=DN(tg,i);return m.jsx(Zt,{present:s||Vu(h.checked)||h.checked===!0,children:m.jsx(je.span,{...l,ref:n,"data-state":ng(h.checked)})})});bS.displayName=tg;var MN="MenuSeparator",xS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...s,ref:n})});xS.displayName=MN;var NN="MenuArrow",SS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=bd(i);return m.jsx(_d,{...l,...s,ref:n})});SS.displayName=NN;var jN="MenuSub",[v9,wS]=Rs(jN),fl="MenuSubTrigger",CS=T.forwardRef((e,n)=>{const i=Ds(fl,e.__scopeMenu),s=ql(fl,e.__scopeMenu),l=wS(fl,e.__scopeMenu),h=Qm(fl,e.__scopeMenu),u=T.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=h,d={__scopeMenu:e.__scopeMenu},g=T.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return T.useEffect(()=>g,[g]),T.useEffect(()=>{const f=o.current;return()=>{window.clearTimeout(f),c(null)}},[o,c]),m.jsx(Xm,{asChild:!0,...d,children:m.jsx(fS,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":l.contentId,"data-state":AS(i.open),...e,ref:ni(n,l.onTriggerChange),onClick:f=>{var b;(b=e.onClick)==null||b.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,El(f=>{h.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!i.open&&!u.current&&(h.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{i.onOpenChange(!0),g()},100))})),onPointerLeave:Ce(e.onPointerLeave,El(f=>{var S,k;g();const b=(S=i.content)==null?void 0:S.getBoundingClientRect();if(b){const w=(k=i.content)==null?void 0:k.dataset.side,_=w==="right",y=_?-5:5,v=b[_?"left":"right"],x=b[_?"right":"left"];h.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:v,y:b.top},{x,y:b.top},{x,y:b.bottom},{x:v,y:b.bottom}],side:w}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>h.onPointerGraceIntentChange(null),300)}else{if(h.onTriggerLeave(f),f.defaultPrevented)return;h.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,f=>{var S;const b=h.searchRef.current!=="";e.disabled||b&&f.key===" "||fN[s.dir].includes(f.key)&&(i.onOpenChange(!0),(S=i.content)==null||S.focus(),f.preventDefault())})})})});CS.displayName=fl;var kS="MenuSubContent",ES=T.forwardRef((e,n)=>{const i=cS(rr,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=Ds(rr,e.__scopeMenu),u=ql(rr,e.__scopeMenu),o=wS(kS,e.__scopeMenu),c=T.useRef(null),d=Xe(n,c);return m.jsx(kl.Provider,{scope:e.__scopeMenu,children:m.jsx(Zt,{present:s||h.open,children:m.jsx(kl.Slot,{scope:e.__scopeMenu,children:m.jsx(Jm,{id:o.contentId,"aria-labelledby":o.triggerId,...l,ref:d,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var f;u.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,g=>{g.target!==o.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,g=>{u.onClose(),g.preventDefault()}),onKeyDown:Ce(e.onKeyDown,g=>{var S;const f=g.currentTarget.contains(g.target),b=pN[u.dir].includes(g.key);f&&b&&(h.onOpenChange(!1),(S=o.trigger)==null||S.focus(),g.preventDefault())})})})})})});ES.displayName=kS;function AS(e){return e?"open":"closed"}function Vu(e){return e==="indeterminate"}function ng(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}function ON(e){const n=document.activeElement;for(const i of e)if(i===n||(i.focus(),document.activeElement!==n))return}function LN(e,n){return e.map((i,s)=>e[(n+s)%e.length])}function IN(e,n,i){const l=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let u=LN(e,Math.max(h,0));l.length===1&&(u=u.filter(d=>d!==i));const c=u.find(d=>d.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function BN(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,u=n.length-1;h<n.length;u=h++){const o=n[h],c=n[u],d=o.x,g=o.y,f=c.x,b=c.y;g>s!=b>s&&i<(f-d)*(s-g)/(b-g)+d&&(l=!l)}return l}function zN(e,n){if(!n)return!1;const i={x:e.clientX,y:e.clientY};return BN(i,n)}function El(e){return n=>n.pointerType==="mouse"?e(n):void 0}var PN=lS,FN=Xm,HN=uS,UN=dS,$N=eg,qN=hS,VN=xd,GN=pS,WN=gS,KN=_S,YN=bS,XN=xS,ZN=SS,QN=CS,JN=ES,Sd="DropdownMenu",[e3]=Un(Sd,[aS]),gn=aS(),[t3,TS]=e3(Sd),RS=e=>{const{__scopeDropdownMenu:n,children:i,dir:s,open:l,defaultOpen:h,onOpenChange:u,modal:o=!0}=e,c=gn(n),d=T.useRef(null),[g,f]=ri({prop:l,defaultProp:h!=null?h:!1,onChange:u,caller:Sd});return m.jsx(t3,{scope:n,triggerId:Gt(),triggerRef:d,contentId:Gt(),open:g,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(b=>!b),[f]),modal:o,children:m.jsx(PN,{...c,open:g,onOpenChange:f,dir:s,modal:o,children:i})})};RS.displayName=Sd;var DS="DropdownMenuTrigger",MS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,disabled:s=!1,...l}=e,h=TS(DS,i),u=gn(i);return m.jsx(FN,{asChild:!0,...u,children:m.jsx(je.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...l,ref:ni(n,h.triggerRef),onPointerDown:Ce(e.onPointerDown,o=>{!s&&o.button===0&&o.ctrlKey===!1&&(h.onOpenToggle(),h.open||o.preventDefault())}),onKeyDown:Ce(e.onKeyDown,o=>{s||(["Enter"," "].includes(o.key)&&h.onOpenToggle(),o.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});MS.displayName=DS;var n3="DropdownMenuPortal",NS=e=>{const{__scopeDropdownMenu:n,...i}=e,s=gn(n);return m.jsx(HN,{...s,...i})};NS.displayName=n3;var jS="DropdownMenuContent",OS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=TS(jS,i),h=gn(i),u=T.useRef(!1);return m.jsx(UN,{id:l.contentId,"aria-labelledby":l.triggerId,...h,...s,ref:n,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var c;u.current||(c=l.triggerRef.current)==null||c.focus(),u.current=!1,o.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,g=c.button===2||d;(!l.modal||g)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});OS.displayName=jS;var r3="DropdownMenuGroup",i3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx($N,{...l,...s,ref:n})});i3.displayName=r3;var s3="DropdownMenuLabel",a3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(qN,{...l,...s,ref:n})});a3.displayName=s3;var o3="DropdownMenuItem",LS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(VN,{...l,...s,ref:n})});LS.displayName=o3;var l3="DropdownMenuCheckboxItem",c3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(GN,{...l,...s,ref:n})});c3.displayName=l3;var u3="DropdownMenuRadioGroup",d3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(WN,{...l,...s,ref:n})});d3.displayName=u3;var h3="DropdownMenuRadioItem",f3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(KN,{...l,...s,ref:n})});f3.displayName=h3;var p3="DropdownMenuItemIndicator",m3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(YN,{...l,...s,ref:n})});m3.displayName=p3;var g3="DropdownMenuSeparator",v3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(XN,{...l,...s,ref:n})});v3.displayName=g3;var _3="DropdownMenuArrow",y3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(ZN,{...l,...s,ref:n})});y3.displayName=_3;var b3="DropdownMenuSubTrigger",x3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(QN,{...l,...s,ref:n})});x3.displayName=b3;var S3="DropdownMenuSubContent",w3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=gn(i);return m.jsx(JN,{...l,...s,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});w3.displayName=S3;var C3=RS,k3=MS,E3=NS,A3=OS,T3=LS,R3="Label",IS=T.forwardRef((e,n)=>m.jsx(je.label,{...e,ref:n,onMouseDown:i=>{var l;i.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));IS.displayName=R3;var D3=IS;function sm(e,[n,i]){return Math.min(i,Math.max(n,e))}var wd="Popover",[BS]=Un(wd,[Wi]),Vl=Wi(),[M3,Ki]=BS(wd),zS=e=>{const{__scopePopover:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:u=!1}=e,o=Vl(n),c=T.useRef(null),[d,g]=T.useState(!1),[f,b]=ri({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:wd});return m.jsx(gd,{...o,children:m.jsx(M3,{scope:n,contentId:Gt(),triggerRef:c,open:f,onOpenChange:b,onOpenToggle:T.useCallback(()=>b(S=>!S),[b]),hasCustomAnchor:d,onCustomAnchorAdd:T.useCallback(()=>g(!0),[]),onCustomAnchorRemove:T.useCallback(()=>g(!1),[]),modal:u,children:i})})};zS.displayName=wd;var PS="PopoverAnchor",FS=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Ki(PS,i),h=Vl(i),{onCustomAnchorAdd:u,onCustomAnchorRemove:o}=l;return T.useEffect(()=>(u(),()=>o()),[u,o]),m.jsx(Hl,{...h,...s,ref:n})});FS.displayName=PS;var HS="PopoverTrigger",US=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Ki(HS,i),h=Vl(i),u=Xe(n,l.triggerRef),o=m.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":WS(l.open),...s,ref:u,onClick:Ce(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?o:m.jsx(Hl,{asChild:!0,...h,children:o})});US.displayName=HS;var rg="PopoverPortal",[N3,j3]=BS(rg,{forceMount:void 0}),$S=e=>{const{__scopePopover:n,forceMount:i,children:s,container:l}=e,h=Ki(rg,n);return m.jsx(N3,{scope:n,forceMount:i,children:m.jsx(Zt,{present:i||h.open,children:m.jsx(Ja,{asChild:!0,container:l,children:s})})})};$S.displayName=rg;var Ba="PopoverContent",qS=T.forwardRef((e,n)=>{const i=j3(Ba,e.__scopePopover),{forceMount:s=i.forceMount,...l}=e,h=Ki(Ba,e.__scopePopover);return m.jsx(Zt,{present:s||h.open,children:h.modal?m.jsx(L3,{...l,ref:n}):m.jsx(I3,{...l,ref:n})})});qS.displayName=Ba;var O3=Ui("PopoverContent.RemoveScroll"),L3=T.forwardRef((e,n)=>{const i=Ki(Ba,e.__scopePopover),s=T.useRef(null),l=Xe(n,s),h=T.useRef(!1);return T.useEffect(()=>{const u=s.current;if(u)return cd(u)},[]),m.jsx(Pl,{as:O3,allowPinchZoom:!0,children:m.jsx(VS,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,u=>{var o;u.preventDefault(),h.current||(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,u=>{const o=u.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,d=o.button===2||c;h.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),I3=T.forwardRef((e,n)=>{const i=Ki(Ba,e.__scopePopover),s=T.useRef(!1),l=T.useRef(!1);return m.jsx(VS,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var u,o;(u=e.onCloseAutoFocus)==null||u.call(e,h),h.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),h.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:h=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=h.target;((d=i.triggerRef.current)==null?void 0:d.contains(u))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),VS=T.forwardRef((e,n)=>{const{__scopePopover:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,disableOutsidePointerEvents:u,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:g,...f}=e,b=Ki(Ba,i),S=Vl(i);return od(),m.jsx(zl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>b.onOpenChange(!1),children:m.jsx(vd,{"data-state":WS(b.open),role:"dialog",id:b.contentId,...S,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),GS="PopoverClose",B3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Ki(GS,i);return m.jsx(je.button,{type:"button",...s,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});B3.displayName=GS;var z3="PopoverArrow",P3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Vl(i);return m.jsx(_d,{...l,...s,ref:n})});P3.displayName=z3;function WS(e){return e?"open":"closed"}var F3=zS,H3=FS,U3=US,$3=$S,q3=qS,ig="Progress",sg=100,[V3]=Un(ig),[G3,W3]=V3(ig),KS=T.forwardRef((e,n)=>{const{__scopeProgress:i,value:s=null,max:l,getValueLabel:h=K3,...u}=e;(l||l===0)&&!h0(l)&&console.error(Y3(`${l}`,"Progress"));const o=h0(l)?l:sg;s!==null&&!f0(s,o)&&console.error(X3(`${s}`,"Progress"));const c=f0(s,o)?s:null,d=Gu(c)?h(c,o):void 0;return m.jsx(G3,{scope:i,value:c,max:o,children:m.jsx(je.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":Gu(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":ZS(c,o),"data-value":c!=null?c:void 0,"data-max":o,...u,ref:n})})});KS.displayName=ig;var YS="ProgressIndicator",XS=T.forwardRef((e,n)=>{var h;const{__scopeProgress:i,...s}=e,l=W3(YS,i);return m.jsx(je.div,{"data-state":ZS(l.value,l.max),"data-value":(h=l.value)!=null?h:void 0,"data-max":l.max,...s,ref:n})});XS.displayName=YS;function K3(e,n){return`${Math.round(e/n*100)}%`}function ZS(e,n){return e==null?"indeterminate":e===n?"complete":"loading"}function Gu(e){return typeof e=="number"}function h0(e){return Gu(e)&&!isNaN(e)&&e>0}function f0(e,n){return Gu(e)&&!isNaN(e)&&e<=n&&e>=0}function Y3(e,n){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${n}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${sg}\`.`}function X3(e,n){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${n}\`. The \`value\` prop must be:
|
|
459
|
-
- a positive number
|
|
460
|
-
- less than the value passed to \`max\` (or ${sg} if no \`max\` prop is set)
|
|
461
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
462
|
-
|
|
463
|
-
Defaulting to \`null\`.`}var Z3=KS,Q3=XS;function J3(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var ag="ScrollArea",[QS]=Un(ag),[ej,ir]=QS(ag),JS=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,type:s="hover",dir:l,scrollHideDelay:h=600,...u}=e,[o,c]=T.useState(null),[d,g]=T.useState(null),[f,b]=T.useState(null),[S,k]=T.useState(null),[w,_]=T.useState(null),[y,v]=T.useState(0),[x,E]=T.useState(0),[M,R]=T.useState(!1),[N,D]=T.useState(!1),O=Xe(n,$=>c($)),P=Bl(l);return m.jsx(ej,{scope:i,type:s,dir:P,scrollHideDelay:h,scrollArea:o,viewport:d,onViewportChange:g,content:f,onContentChange:b,scrollbarX:S,onScrollbarXChange:k,scrollbarXEnabled:M,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:N,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:E,children:m.jsx(je.div,{dir:P,...u,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});JS.displayName=ag;var ew="ScrollAreaViewport",tw=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,children:s,nonce:l,...h}=e,u=ir(ew,i),o=T.useRef(null),c=Xe(n,o,u.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),m.jsx(je.div,{"data-radix-scroll-area-viewport":"",...h,ref:c,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});tw.displayName=ew;var Rr="ScrollAreaScrollbar",nw=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=ir(Rr,e.__scopeScrollArea),{onScrollbarXEnabledChange:h,onScrollbarYEnabledChange:u}=l,o=e.orientation==="horizontal";return T.useEffect(()=>(o?h(!0):u(!0),()=>{o?h(!1):u(!1)}),[o,h,u]),l.type==="hover"?m.jsx(tj,{...s,ref:n,forceMount:i}):l.type==="scroll"?m.jsx(nj,{...s,ref:n,forceMount:i}):l.type==="auto"?m.jsx(rw,{...s,ref:n,forceMount:i}):l.type==="always"?m.jsx(og,{...s,ref:n}):null});nw.displayName=Rr;var tj=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=ir(Rr,e.__scopeScrollArea),[h,u]=T.useState(!1);return T.useEffect(()=>{const o=l.scrollArea;let c=0;if(o){const d=()=>{window.clearTimeout(c),u(!0)},g=()=>{c=window.setTimeout(()=>u(!1),l.scrollHideDelay)};return o.addEventListener("pointerenter",d),o.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",d),o.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),m.jsx(Zt,{present:i||h,children:m.jsx(rw,{"data-state":h?"visible":"hidden",...s,ref:n})})}),nj=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=ir(Rr,e.__scopeScrollArea),h=e.orientation==="horizontal",u=kd(()=>c("SCROLL_END"),100),[o,c]=J3("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return T.useEffect(()=>{if(o==="idle"){const d=window.setTimeout(()=>c("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(d)}},[o,l.scrollHideDelay,c]),T.useEffect(()=>{const d=l.viewport,g=h?"scrollLeft":"scrollTop";if(d){let f=d[g];const b=()=>{const S=d[g];f!==S&&(c("SCROLL"),u()),f=S};return d.addEventListener("scroll",b),()=>d.removeEventListener("scroll",b)}},[l.viewport,h,c,u]),m.jsx(Zt,{present:i||o!=="hidden",children:m.jsx(og,{"data-state":o==="hidden"?"hidden":"visible",...s,ref:n,onPointerEnter:Ce(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),rw=T.forwardRef((e,n)=>{const i=ir(Rr,e.__scopeScrollArea),{forceMount:s,...l}=e,[h,u]=T.useState(!1),o=e.orientation==="horizontal",c=kd(()=>{if(i.viewport){const d=i.viewport.offsetWidth<i.viewport.scrollWidth,g=i.viewport.offsetHeight<i.viewport.scrollHeight;u(o?d:g)}},10);return za(i.viewport,c),za(i.content,c),m.jsx(Zt,{present:s||h,children:m.jsx(og,{"data-state":h?"visible":"hidden",...l,ref:n})})}),og=T.forwardRef((e,n)=>{const{orientation:i="vertical",...s}=e,l=ir(Rr,e.__scopeScrollArea),h=T.useRef(null),u=T.useRef(0),[o,c]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=lw(o.viewport,o.content),g={...s,sizes:o,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:b=>h.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function f(b,S){return lj(b,u.current,o,S)}return i==="horizontal"?m.jsx(rj,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const b=l.viewport.scrollLeft,S=p0(b,o,l.dir);h.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollLeft=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollLeft=f(b,l.dir))}}):i==="vertical"?m.jsx(ij,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const b=l.viewport.scrollTop,S=p0(b,o);h.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollTop=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollTop=f(b))}}):null}),rj=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=ir(Rr,e.__scopeScrollArea),[u,o]=T.useState(),c=T.useRef(null),d=Xe(n,c,h.onScrollbarXChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),m.jsx(sw,{"data-orientation":"horizontal",...l,ref:d,sizes:i,style:{bottom:0,left:h.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:h.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cd(i)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,f)=>{if(h.viewport){const b=h.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),uw(b,f)&&g.preventDefault()}},onResize:()=>{c.current&&h.viewport&&u&&s({content:h.viewport.scrollWidth,viewport:h.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ku(u.paddingLeft),paddingEnd:Ku(u.paddingRight)}})}})}),ij=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=ir(Rr,e.__scopeScrollArea),[u,o]=T.useState(),c=T.useRef(null),d=Xe(n,c,h.onScrollbarYChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),m.jsx(sw,{"data-orientation":"vertical",...l,ref:d,sizes:i,style:{top:0,right:h.dir==="ltr"?0:void 0,left:h.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cd(i)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,f)=>{if(h.viewport){const b=h.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),uw(b,f)&&g.preventDefault()}},onResize:()=>{c.current&&h.viewport&&u&&s({content:h.viewport.scrollHeight,viewport:h.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ku(u.paddingTop),paddingEnd:Ku(u.paddingBottom)}})}})}),[sj,iw]=QS(Rr),sw=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,sizes:s,hasThumb:l,onThumbChange:h,onThumbPointerUp:u,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:g,onResize:f,...b}=e,S=ir(Rr,i),[k,w]=T.useState(null),_=Xe(n,O=>w(O)),y=T.useRef(null),v=T.useRef(""),x=S.viewport,E=s.content-s.viewport,M=an(g),R=an(c),N=kd(f,10);function D(O){if(y.current){const P=O.clientX-y.current.left,$=O.clientY-y.current.top;d({x:P,y:$})}}return T.useEffect(()=>{const O=P=>{const $=P.target;(k==null?void 0:k.contains($))&&M(P,E)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[x,k,E,M]),T.useEffect(R,[s,R]),za(k,N),za(S.content,N),m.jsx(sj,{scope:i,scrollbar:k,hasThumb:l,onThumbChange:an(h),onThumbPointerUp:an(u),onThumbPositionChange:R,onThumbPointerDown:an(o),children:m.jsx(je.div,{...b,ref:_,style:{position:"absolute",...b.style},onPointerDown:Ce(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),y.current=k.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),D(O))}),onPointerMove:Ce(e.onPointerMove,D),onPointerUp:Ce(e.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=v.current,S.viewport&&(S.viewport.style.scrollBehavior=""),y.current=null})})})}),Wu="ScrollAreaThumb",aw=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=iw(Wu,e.__scopeScrollArea);return m.jsx(Zt,{present:i||l.hasThumb,children:m.jsx(aj,{ref:n,...s})})}),aj=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,style:s,...l}=e,h=ir(Wu,i),u=iw(Wu,i),{onThumbPositionChange:o}=u,c=Xe(n,f=>u.onThumbChange(f)),d=T.useRef(void 0),g=kd(()=>{d.current&&(d.current(),d.current=void 0)},100);return T.useEffect(()=>{const f=h.viewport;if(f){const b=()=>{if(g(),!d.current){const S=cj(f,o);d.current=S,o()}};return o(),f.addEventListener("scroll",b),()=>f.removeEventListener("scroll",b)}},[h.viewport,g,o]),m.jsx(je.div,{"data-state":u.hasThumb?"visible":"hidden",...l,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Ce(e.onPointerDownCapture,f=>{const S=f.target.getBoundingClientRect(),k=f.clientX-S.left,w=f.clientY-S.top;u.onThumbPointerDown({x:k,y:w})}),onPointerUp:Ce(e.onPointerUp,u.onThumbPointerUp)})});aw.displayName=Wu;var lg="ScrollAreaCorner",ow=T.forwardRef((e,n)=>{const i=ir(lg,e.__scopeScrollArea),s=!!(i.scrollbarX&&i.scrollbarY);return i.type!=="scroll"&&s?m.jsx(oj,{...e,ref:n}):null});ow.displayName=lg;var oj=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,...s}=e,l=ir(lg,i),[h,u]=T.useState(0),[o,c]=T.useState(0),d=!!(h&&o);return za(l.scrollbarX,()=>{var f;const g=((f=l.scrollbarX)==null?void 0:f.offsetHeight)||0;l.onCornerHeightChange(g),c(g)}),za(l.scrollbarY,()=>{var f;const g=((f=l.scrollbarY)==null?void 0:f.offsetWidth)||0;l.onCornerWidthChange(g),u(g)}),d?m.jsx(je.div,{...s,ref:n,style:{width:h,height:o,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ku(e){return e?parseInt(e,10):0}function lw(e,n){const i=e/n;return isNaN(i)?0:i}function Cd(e){const n=lw(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-i)*n;return Math.max(s,18)}function lj(e,n,i,s="ltr"){const l=Cd(i),h=l/2,u=n||h,o=l-u,c=i.scrollbar.paddingStart+u,d=i.scrollbar.size-i.scrollbar.paddingEnd-o,g=i.content-i.viewport,f=s==="ltr"?[0,g]:[g*-1,0];return cw([c,d],f)(e)}function p0(e,n,i="ltr"){const s=Cd(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,h=n.scrollbar.size-l,u=n.content-n.viewport,o=h-s,c=i==="ltr"?[0,u]:[u*-1,0],d=sm(e,c);return cw([0,u],[0,o])(d)}function cw(e,n){return i=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const s=(n[1]-n[0])/(e[1]-e[0]);return n[0]+s*(i-e[0])}}function uw(e,n){return e>0&&e<n}var cj=(e,n=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},s=0;return(function l(){const h={left:e.scrollLeft,top:e.scrollTop},u=i.left!==h.left,o=i.top!==h.top;(u||o)&&n(),i=h,s=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(s)};function kd(e,n){const i=an(e),s=T.useRef(0);return T.useEffect(()=>()=>window.clearTimeout(s.current),[]),T.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(i,n)},[i,n])}function za(e,n){const i=an(n);Xt(()=>{let s=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(i)});return l.observe(e),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}},[e,i])}var uj=JS,dj=tw,hj=ow,fj=[" ","Enter","ArrowUp","ArrowDown"],pj=[" ","Enter"],ks="Select",[Ed,Ad,mj]=Mm(ks),[no]=Un(ks,[mj,Wi]),Td=Wi(),[gj,Yi]=no(ks),[vj,_j]=no(ks),dw=e=>{const{__scopeSelect:n,children:i,open:s,defaultOpen:l,onOpenChange:h,value:u,defaultValue:o,onValueChange:c,dir:d,name:g,autoComplete:f,disabled:b,required:S,form:k}=e,w=Td(n),[_,y]=T.useState(null),[v,x]=T.useState(null),[E,M]=T.useState(!1),R=Bl(d),[N,D]=ri({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:ks}),[O,P]=ri({prop:u,defaultProp:o,onChange:c,caller:ks}),$=T.useRef(null),U=_?k||!!_.closest("form"):!0,[q,Y]=T.useState(new Set),K=Array.from(q).map(V=>V.props.value).join(";");return m.jsx(gd,{...w,children:m.jsxs(gj,{required:S,scope:n,trigger:_,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:M,contentId:Gt(),value:O,onValueChange:P,open:N,onOpenChange:D,dir:R,triggerPointerDownPosRef:$,disabled:b,children:[m.jsx(Ed.Provider,{scope:n,children:m.jsx(vj,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(V=>{Y(Q=>new Set(Q).add(V))},[]),onNativeOptionRemove:T.useCallback(V=>{Y(Q=>{const J=new Set(Q);return J.delete(V),J})},[]),children:i})}),U?m.jsxs(Lw,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:f,value:O,onChange:V=>P(V.target.value),disabled:b,form:k,children:[O===void 0?m.jsx("option",{value:""}):null,Array.from(q)]},K):null]})})};dw.displayName=ks;var hw="SelectTrigger",fw=T.forwardRef((e,n)=>{const{__scopeSelect:i,disabled:s=!1,...l}=e,h=Td(i),u=Yi(hw,i),o=u.disabled||s,c=Xe(n,u.onTriggerChange),d=Ad(i),g=T.useRef("touch"),[f,b,S]=Bw(w=>{const _=d().filter(x=>!x.disabled),y=_.find(x=>x.value===u.value),v=zw(_,w,y);v!==void 0&&u.onValueChange(v.value)}),k=w=>{o||(u.onOpenChange(!0),S()),w&&(u.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return m.jsx(Hl,{asChild:!0,...h,children:m.jsx(je.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Iw(u.value)?"":void 0,...l,ref:c,onClick:Ce(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&k(w)}),onPointerDown:Ce(l.onPointerDown,w=>{g.current=w.pointerType;const _=w.target;_.hasPointerCapture(w.pointerId)&&_.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(k(w),w.preventDefault())}),onKeyDown:Ce(l.onKeyDown,w=>{const _=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&b(w.key),!(_&&w.key===" ")&&fj.includes(w.key)&&(k(),w.preventDefault())})})})});fw.displayName=hw;var pw="SelectValue",mw=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,children:h,placeholder:u="",...o}=e,c=Yi(pw,i),{onValueNodeHasChildrenChange:d}=c,g=h!==void 0,f=Xe(n,c.onValueNodeChange);return Xt(()=>{d(g)},[d,g]),m.jsx(je.span,{...o,ref:f,style:{pointerEvents:"none"},children:Iw(c.value)?m.jsx(m.Fragment,{children:u}):h})});mw.displayName=pw;var yj="SelectIcon",gw=T.forwardRef((e,n)=>{const{__scopeSelect:i,children:s,...l}=e;return m.jsx(je.span,{"aria-hidden":!0,...l,ref:n,children:s||"▼"})});gw.displayName=yj;var bj="SelectPortal",vw=e=>m.jsx(Ja,{asChild:!0,...e});vw.displayName=bj;var Es="SelectContent",_w=T.forwardRef((e,n)=>{const i=Yi(Es,e.__scopeSelect),[s,l]=T.useState();if(Xt(()=>{l(new DocumentFragment)},[]),!i.open){const h=s;return h?Ll.createPortal(m.jsx(yw,{scope:e.__scopeSelect,children:m.jsx(Ed.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),h):null}return m.jsx(bw,{...e,ref:n})});_w.displayName=Es;var ur=10,[yw,Xi]=no(Es),xj="SelectContentImpl",Sj=Ui("SelectContent.RemoveScroll"),bw=T.forwardRef((e,n)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:h,onPointerDownOutside:u,side:o,sideOffset:c,align:d,alignOffset:g,arrowPadding:f,collisionBoundary:b,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_,...y}=e,v=Yi(Es,i),[x,E]=T.useState(null),[M,R]=T.useState(null),N=Xe(n,W=>E(W)),[D,O]=T.useState(null),[P,$]=T.useState(null),U=Ad(i),[q,Y]=T.useState(!1),K=T.useRef(!1);T.useEffect(()=>{if(x)return cd(x)},[x]),od();const V=T.useCallback(W=>{const[H,...re]=U().map(ce=>ce.ref.current),[ae]=re.slice(-1),pe=document.activeElement;for(const ce of W)if(ce===pe||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===H&&M&&(M.scrollTop=0),ce===ae&&M&&(M.scrollTop=M.scrollHeight),ce==null||ce.focus(),document.activeElement!==pe))return},[U,M]),Q=T.useCallback(()=>V([D,x]),[V,D,x]);T.useEffect(()=>{q&&Q()},[q,Q]);const{onOpenChange:J,triggerPointerDownPosRef:F}=v;T.useEffect(()=>{if(x){let W={x:0,y:0};const H=ae=>{var pe,ce,Oe,Be;W={x:Math.abs(Math.round(ae.pageX)-((ce=(pe=F.current)==null?void 0:pe.x)!=null?ce:0)),y:Math.abs(Math.round(ae.pageY)-((Be=(Oe=F.current)==null?void 0:Oe.y)!=null?Be:0))}},re=ae=>{W.x<=10&&W.y<=10?ae.preventDefault():x.contains(ae.target)||J(!1),document.removeEventListener("pointermove",H),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",re,{capture:!0})}}},[x,J,F]),T.useEffect(()=>{const W=()=>J(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[J]);const[j,I]=Bw(W=>{const H=U().filter(pe=>!pe.disabled),re=H.find(pe=>pe.ref.current===document.activeElement),ae=zw(H,W,re);ae&&setTimeout(()=>ae.ref.current.focus())}),L=T.useCallback((W,H,re)=>{const ae=!K.current&&!re;(v.value!==void 0&&v.value===H||ae)&&(O(W),ae&&(K.current=!0))},[v.value]),z=T.useCallback(()=>x==null?void 0:x.focus(),[x]),X=T.useCallback((W,H,re)=>{const ae=!K.current&&!re;(v.value!==void 0&&v.value===H||ae)&&$(W)},[v.value]),ee=s==="popper"?am:xw,te=ee===am?{side:o,sideOffset:c,align:d,alignOffset:g,arrowPadding:f,collisionBoundary:b,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_}:{};return m.jsx(yw,{scope:i,content:x,viewport:M,onViewportChange:R,itemRefCallback:L,selectedItem:D,onItemLeave:z,itemTextRefCallback:X,focusSelectedItem:Q,selectedItemText:P,position:s,isPositioned:q,searchRef:j,children:m.jsx(Pl,{as:Sj,allowPinchZoom:!0,children:m.jsx(zl,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Ce(l,W=>{var H;(H=v.trigger)==null||H.focus({preventScroll:!0}),W.preventDefault()}),children:m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:u,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:m.jsx(ee,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...y,...te,onPlaced:()=>Y(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,W=>{const H=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!H&&W.key.length===1&&I(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ae=U().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const pe=W.target,ce=ae.indexOf(pe);ae=ae.slice(ce+1)}setTimeout(()=>V(ae)),W.preventDefault()}})})})})})})});bw.displayName=xj;var wj="SelectItemAlignedPosition",xw=T.forwardRef((e,n)=>{const{__scopeSelect:i,onPlaced:s,...l}=e,h=Yi(Es,i),u=Xi(Es,i),[o,c]=T.useState(null),[d,g]=T.useState(null),f=Xe(n,N=>g(N)),b=Ad(i),S=T.useRef(!1),k=T.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:y,focusSelectedItem:v}=u,x=T.useCallback(()=>{if(h.trigger&&h.valueNode&&o&&d&&w&&_&&y){const N=h.trigger.getBoundingClientRect(),D=d.getBoundingClientRect(),O=h.valueNode.getBoundingClientRect(),P=y.getBoundingClientRect();if(h.dir!=="rtl"){const pe=P.left-D.left,ce=O.left-pe,Oe=N.left-ce,Be=N.width+Oe,$e=Math.max(Be,D.width),ut=window.innerWidth-ur,Me=sm(ce,[ur,Math.max(ur,ut-$e)]);o.style.minWidth=Be+"px",o.style.left=Me+"px"}else{const pe=D.right-P.right,ce=window.innerWidth-O.right-pe,Oe=window.innerWidth-N.right-ce,Be=N.width+Oe,$e=Math.max(Be,D.width),ut=window.innerWidth-ur,Me=sm(ce,[ur,Math.max(ur,ut-$e)]);o.style.minWidth=Be+"px",o.style.right=Me+"px"}const $=b(),U=window.innerHeight-ur*2,q=w.scrollHeight,Y=window.getComputedStyle(d),K=parseInt(Y.borderTopWidth,10),V=parseInt(Y.paddingTop,10),Q=parseInt(Y.borderBottomWidth,10),J=parseInt(Y.paddingBottom,10),F=K+V+q+J+Q,j=Math.min(_.offsetHeight*5,F),I=window.getComputedStyle(w),L=parseInt(I.paddingTop,10),z=parseInt(I.paddingBottom,10),X=N.top+N.height/2-ur,ee=U-X,te=_.offsetHeight/2,W=_.offsetTop+te,H=K+V+W,re=F-H;if(H<=X){const pe=$.length>0&&_===$[$.length-1].ref.current;o.style.bottom="0px";const ce=d.clientHeight-w.offsetTop-w.offsetHeight,Oe=Math.max(ee,te+(pe?z:0)+ce+Q),Be=H+Oe;o.style.height=Be+"px"}else{const pe=$.length>0&&_===$[0].ref.current;o.style.top="0px";const Oe=Math.max(X,K+w.offsetTop+(pe?L:0)+te)+re;o.style.height=Oe+"px",w.scrollTop=H-X+w.offsetTop}o.style.margin=`${ur}px 0`,o.style.minHeight=j+"px",o.style.maxHeight=U+"px",s==null||s(),requestAnimationFrame(()=>S.current=!0)}},[b,h.trigger,h.valueNode,o,d,w,_,y,h.dir,s]);Xt(()=>x(),[x]);const[E,M]=T.useState();Xt(()=>{d&&M(window.getComputedStyle(d).zIndex)},[d]);const R=T.useCallback(N=>{N&&k.current===!0&&(x(),v==null||v(),k.current=!1)},[x,v]);return m.jsx(kj,{scope:i,contentWrapper:o,shouldExpandOnScrollRef:S,onScrollButtonChange:R,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m.jsx(je.div,{...l,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});xw.displayName=wj;var Cj="SelectPopperPosition",am=T.forwardRef((e,n)=>{const{__scopeSelect:i,align:s="start",collisionPadding:l=ur,...h}=e,u=Td(i);return m.jsx(vd,{...u,...h,ref:n,align:s,collisionPadding:l,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});am.displayName=Cj;var[kj,cg]=no(Es,{}),om="SelectViewport",Sw=T.forwardRef((e,n)=>{const{__scopeSelect:i,nonce:s,...l}=e,h=Xi(om,i),u=cg(om,i),o=Xe(n,h.onViewportChange),c=T.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),m.jsx(Ed.Slot,{scope:i,children:m.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,d=>{const g=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:b}=u;if(b!=null&&b.current&&f){const S=Math.abs(c.current-g.scrollTop);if(S>0){const k=window.innerHeight-ur*2,w=parseFloat(f.style.minHeight),_=parseFloat(f.style.height),y=Math.max(w,_);if(y<k){const v=y+S,x=Math.min(k,v),E=v-x;f.style.height=x+"px",f.style.bottom==="0px"&&(g.scrollTop=E>0?E:0,f.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});Sw.displayName=om;var ww="SelectGroup",[Ej,Aj]=no(ww),Cw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Gt();return m.jsx(Ej,{scope:i,id:l,children:m.jsx(je.div,{role:"group","aria-labelledby":l,...s,ref:n})})});Cw.displayName=ww;var kw="SelectLabel",Ew=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Aj(kw,i);return m.jsx(je.div,{id:l.id,...s,ref:n})});Ew.displayName=kw;var Yu="SelectItem",[Tj,Aw]=no(Yu),Tw=T.forwardRef((e,n)=>{const{__scopeSelect:i,value:s,disabled:l=!1,textValue:h,...u}=e,o=Yi(Yu,i),c=Xi(Yu,i),d=o.value===s,[g,f]=T.useState(h!=null?h:""),[b,S]=T.useState(!1),k=Xe(n,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,s,l)}),w=Gt(),_=T.useRef("touch"),y=()=>{l||(o.onValueChange(s),o.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(Tj,{scope:i,value:s,disabled:l,textId:w,isSelected:d,onItemTextChange:T.useCallback(v=>{f(x=>{var E;return x||((E=v==null?void 0:v.textContent)!=null?E:"").trim()})},[]),children:m.jsx(Ed.ItemSlot,{scope:i,value:s,disabled:l,textValue:g,children:m.jsx(je.div,{role:"option","aria-labelledby":w,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...u,ref:k,onFocus:Ce(u.onFocus,()=>S(!0)),onBlur:Ce(u.onBlur,()=>S(!1)),onClick:Ce(u.onClick,()=>{_.current!=="mouse"&&y()}),onPointerUp:Ce(u.onPointerUp,()=>{_.current==="mouse"&&y()}),onPointerDown:Ce(u.onPointerDown,v=>{_.current=v.pointerType}),onPointerMove:Ce(u.onPointerMove,v=>{var x;_.current=v.pointerType,l?(x=c.onItemLeave)==null||x.call(c):_.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(u.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:Ce(u.onKeyDown,v=>{var E;((E=c.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(pj.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Tw.displayName=Yu;var pl="SelectItemText",Rw=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,...h}=e,u=Yi(pl,i),o=Xi(pl,i),c=Aw(pl,i),d=_j(pl,i),[g,f]=T.useState(null),b=Xe(n,y=>f(y),c.onItemTextChange,y=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,y,c.value,c.disabled)}),S=g==null?void 0:g.textContent,k=T.useMemo(()=>m.jsx("option",{value:c.value,disabled:c.disabled,children:S},c.value),[c.disabled,c.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:_}=d;return Xt(()=>(w(k),()=>_(k)),[w,_,k]),m.jsxs(m.Fragment,{children:[m.jsx(je.span,{id:c.textId,...h,ref:b}),c.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Ll.createPortal(h.children,u.valueNode):null]})});Rw.displayName=pl;var Dw="SelectItemIndicator",Mw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return Aw(Dw,i).isSelected?m.jsx(je.span,{"aria-hidden":!0,...s,ref:n}):null});Mw.displayName=Dw;var lm="SelectScrollUpButton",Nw=T.forwardRef((e,n)=>{const i=Xi(lm,e.__scopeSelect),s=cg(lm,e.__scopeSelect),[l,h]=T.useState(!1),u=Xe(n,s.onScrollButtonChange);return Xt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const d=c.scrollTop>0;h(d)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?m.jsx(Ow,{...e,ref:u,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});Nw.displayName=lm;var cm="SelectScrollDownButton",jw=T.forwardRef((e,n)=>{const i=Xi(cm,e.__scopeSelect),s=cg(cm,e.__scopeSelect),[l,h]=T.useState(!1),u=Xe(n,s.onScrollButtonChange);return Xt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<d;h(g)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?m.jsx(Ow,{...e,ref:u,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});jw.displayName=cm;var Ow=T.forwardRef((e,n)=>{const{__scopeSelect:i,onAutoScroll:s,...l}=e,h=Xi("SelectScrollButton",i),u=T.useRef(null),o=Ad(i),c=T.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return T.useEffect(()=>()=>c(),[c]),Xt(()=>{var g;const d=o().find(f=>f.ref.current===document.activeElement);(g=d==null?void 0:d.ref.current)==null||g.scrollIntoView({block:"nearest"})},[o]),m.jsx(je.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(s,50))}),onPointerMove:Ce(l.onPointerMove,()=>{var d;(d=h.onItemLeave)==null||d.call(h),u.current===null&&(u.current=window.setInterval(s,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{c()})})}),Rj="SelectSeparator",Dj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return m.jsx(je.div,{"aria-hidden":!0,...s,ref:n})});Dj.displayName=Rj;var um="SelectArrow",Mj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Td(i),h=Yi(um,i),u=Xi(um,i);return h.open&&u.position==="popper"?m.jsx(_d,{...l,...s,ref:n}):null});Mj.displayName=um;var Nj="SelectBubbleInput",Lw=T.forwardRef(({__scopeSelect:e,value:n,...i},s)=>{const l=T.useRef(null),h=Xe(s,l),u=HD(n);return T.useEffect(()=>{const o=l.current;if(!o)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(u!==n&&g){const f=new Event("change",{bubbles:!0});g.call(o,n),o.dispatchEvent(f)}},[u,n]),m.jsx(je.select,{...i,style:{...Xx,...i.style},ref:h,defaultValue:n})});Lw.displayName=Nj;function Iw(e){return e===""||e===void 0}function Bw(e){const n=an(e),i=T.useRef(""),s=T.useRef(0),l=T.useCallback(u=>{const o=i.current+u;n(o),(function c(d){i.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(o)},[n]),h=T.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,l,h]}function zw(e,n,i){const l=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let u=jj(e,Math.max(h,0));l.length===1&&(u=u.filter(d=>d!==i));const c=u.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function jj(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var Oj=dw,Lj=fw,Ij=mw,Bj=gw,zj=vw,Pj=_w,Fj=Sw,Hj=Cw,Uj=Ew,$j=Tw,qj=Rw,Vj=Mw,Gj=Nw,Wj=jw,Kj="Separator",m0="horizontal",Yj=["horizontal","vertical"],Pw=T.forwardRef((e,n)=>{const{decorative:i,orientation:s=m0,...l}=e,h=Xj(s)?s:m0,o=i?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return m.jsx(je.div,{"data-orientation":h,...o,...l,ref:n})});Pw.displayName=Kj;function Xj(e){return Yj.includes(e)}var Zj=Pw,Rd="Tabs",[Qj]=Un(Rd,[yd]),Fw=yd(),[Jj,ug]=Qj(Rd),Hw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,onValueChange:l,defaultValue:h,orientation:u="horizontal",dir:o,activationMode:c="automatic",...d}=e,g=Bl(o),[f,b]=ri({prop:s,onChange:l,defaultProp:h!=null?h:"",caller:Rd});return m.jsx(Jj,{scope:i,baseId:Gt(),value:f,onValueChange:b,orientation:u,dir:g,activationMode:c,children:m.jsx(je.div,{dir:g,"data-orientation":u,...d,ref:n})})});Hw.displayName=Rd;var Uw="TabsList",$w=T.forwardRef((e,n)=>{const{__scopeTabs:i,loop:s=!0,...l}=e,h=ug(Uw,i),u=Fw(i);return m.jsx(rS,{asChild:!0,...u,orientation:h.orientation,dir:h.dir,loop:s,children:m.jsx(je.div,{role:"tablist","aria-orientation":h.orientation,...l,ref:n})})});$w.displayName=Uw;var qw="TabsTrigger",Vw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,disabled:l=!1,...h}=e,u=ug(qw,i),o=Fw(i),c=Kw(u.baseId,s),d=Yw(u.baseId,s),g=s===u.value;return m.jsx(iS,{asChild:!0,...o,focusable:!l,active:g,children:m.jsx(je.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":d,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...h,ref:n,onMouseDown:Ce(e.onMouseDown,f=>{!l&&f.button===0&&f.ctrlKey===!1?u.onValueChange(s):f.preventDefault()}),onKeyDown:Ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&u.onValueChange(s)}),onFocus:Ce(e.onFocus,()=>{const f=u.activationMode!=="manual";!g&&!l&&f&&u.onValueChange(s)})})})});Vw.displayName=qw;var Gw="TabsContent",Ww=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,forceMount:l,children:h,...u}=e,o=ug(Gw,i),c=Kw(o.baseId,s),d=Yw(o.baseId,s),g=s===o.value,f=T.useRef(g);return T.useEffect(()=>{const b=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(b)},[]),m.jsx(Zt,{present:l||g,children:({present:b})=>m.jsx(je.div,{"data-state":g?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:d,tabIndex:0,...u,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:b&&h})})});Ww.displayName=Gw;function Kw(e,n){return`${e}-trigger-${n}`}function Yw(e,n){return`${e}-content-${n}`}var e5=Hw,t5=$w,n5=Vw,r5=Ww,[Dd]=Un("Tooltip",[Wi]),Md=Wi(),Xw="TooltipProvider",i5=700,dm="tooltip.open",[s5,dg]=Dd(Xw),Zw=e=>{const{__scopeTooltip:n,delayDuration:i=i5,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:h}=e,u=T.useRef(!0),o=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.jsx(s5,{scope:n,isOpenDelayedRef:u,delayDuration:i,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),u.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>u.current=!0,s)},[s]),isPointerInTransitRef:o,onPointerInTransitChange:T.useCallback(d=>{o.current=d},[]),disableHoverableContent:l,children:h})};Zw.displayName=Xw;var Al="Tooltip",[a5,Gl]=Dd(Al),Qw=e=>{const{__scopeTooltip:n,children:i,open:s,defaultOpen:l,onOpenChange:h,disableHoverableContent:u,delayDuration:o}=e,c=dg(Al,e.__scopeTooltip),d=Md(n),[g,f]=T.useState(null),b=Gt(),S=T.useRef(0),k=u!=null?u:c.disableHoverableContent,w=o!=null?o:c.delayDuration,_=T.useRef(!1),[y,v]=ri({prop:s,defaultProp:l!=null?l:!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(dm))):c.onClose(),h==null||h(N)},caller:Al}),x=T.useMemo(()=>y?_.current?"delayed-open":"instant-open":"closed",[y]),E=T.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_.current=!1,v(!0)},[v]),M=T.useCallback(()=>{window.clearTimeout(S.current),S.current=0,v(!1)},[v]),R=T.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{_.current=!0,v(!0),S.current=0},w)},[w,v]);return T.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),m.jsx(gd,{...d,children:m.jsx(a5,{scope:n,contentId:b,open:y,stateAttribute:x,trigger:g,onTriggerChange:f,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?R():E()},[c.isOpenDelayedRef,R,E]),onTriggerLeave:T.useCallback(()=>{k?M():(window.clearTimeout(S.current),S.current=0)},[M,k]),onOpen:E,onClose:M,disableHoverableContent:k,children:i})})};Qw.displayName=Al;var hm="TooltipTrigger",Jw=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=Gl(hm,i),h=dg(hm,i),u=Md(i),o=T.useRef(null),c=Xe(n,o,l.onTriggerChange),d=T.useRef(!1),g=T.useRef(!1),f=T.useCallback(()=>d.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(Hl,{asChild:!0,...u,children:m.jsx(je.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...s,ref:c,onPointerMove:Ce(e.onPointerMove,b=>{b.pointerType!=="touch"&&!g.current&&!h.isPointerInTransitRef.current&&(l.onTriggerEnter(),g.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{l.onTriggerLeave(),g.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{l.open&&l.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ce(e.onFocus,()=>{d.current||l.onOpen()}),onBlur:Ce(e.onBlur,l.onClose),onClick:Ce(e.onClick,l.onClose)})})});Jw.displayName=hm;var hg="TooltipPortal",[o5,l5]=Dd(hg,{forceMount:void 0}),eC=e=>{const{__scopeTooltip:n,forceMount:i,children:s,container:l}=e,h=Gl(hg,n);return m.jsx(o5,{scope:n,forceMount:i,children:m.jsx(Zt,{present:i||h.open,children:m.jsx(Ja,{asChild:!0,container:l,children:s})})})};eC.displayName=hg;var Pa="TooltipContent",tC=T.forwardRef((e,n)=>{const i=l5(Pa,e.__scopeTooltip),{forceMount:s=i.forceMount,side:l="top",...h}=e,u=Gl(Pa,e.__scopeTooltip);return m.jsx(Zt,{present:s||u.open,children:u.disableHoverableContent?m.jsx(nC,{side:l,...h,ref:n}):m.jsx(c5,{side:l,...h,ref:n})})}),c5=T.forwardRef((e,n)=>{const i=Gl(Pa,e.__scopeTooltip),s=dg(Pa,e.__scopeTooltip),l=T.useRef(null),h=Xe(n,l),[u,o]=T.useState(null),{trigger:c,onClose:d}=i,g=l.current,{onPointerInTransitChange:f}=s,b=T.useCallback(()=>{o(null),f(!1)},[f]),S=T.useCallback((k,w)=>{const _=k.currentTarget,y={x:k.clientX,y:k.clientY},v=f5(y,_.getBoundingClientRect()),x=p5(y,v),E=m5(w.getBoundingClientRect()),M=v5([...x,...E]);o(M),f(!0)},[f]);return T.useEffect(()=>()=>b(),[b]),T.useEffect(()=>{if(c&&g){const k=_=>S(_,g),w=_=>S(_,c);return c.addEventListener("pointerleave",k),g.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",k),g.removeEventListener("pointerleave",w)}}},[c,g,S,b]),T.useEffect(()=>{if(u){const k=w=>{const _=w.target,y={x:w.clientX,y:w.clientY},v=(c==null?void 0:c.contains(_))||(g==null?void 0:g.contains(_)),x=!g5(y,u);v?b():x&&(b(),d())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[c,g,u,d,b]),m.jsx(nC,{...e,ref:h})}),[u5,d5]=Dd(Al,{isInside:!1}),h5=lR("TooltipContent"),nC=T.forwardRef((e,n)=>{const{__scopeTooltip:i,children:s,"aria-label":l,onEscapeKeyDown:h,onPointerDownOutside:u,...o}=e,c=Gl(Pa,i),d=Md(i),{onClose:g}=c;return T.useEffect(()=>(document.addEventListener(dm,g),()=>document.removeEventListener(dm,g)),[g]),T.useEffect(()=>{if(c.trigger){const f=b=>{const S=b.target;S!=null&&S.contains(c.trigger)&&g()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,g]),m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:u,onFocusOutside:f=>f.preventDefault(),onDismiss:g,children:m.jsxs(vd,{"data-state":c.stateAttribute,...d,...o,ref:n,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(h5,{children:s}),m.jsx(u5,{scope:i,isInside:!0,children:m.jsx(pR,{id:c.contentId,role:"tooltip",children:l||s})})]})})});tC.displayName=Pa;var rC="TooltipArrow",iC=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=Md(i);return d5(rC,i).isInside?null:m.jsx(_d,{...l,...s,ref:n})});iC.displayName=rC;function f5(e,n){const i=Math.abs(n.top-e.y),s=Math.abs(n.bottom-e.y),l=Math.abs(n.right-e.x),h=Math.abs(n.left-e.x);switch(Math.min(i,s,l,h)){case h:return"left";case l:return"right";case i:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function p5(e,n,i=5){const s=[];switch(n){case"top":s.push({x:e.x-i,y:e.y+i},{x:e.x+i,y:e.y+i});break;case"bottom":s.push({x:e.x-i,y:e.y-i},{x:e.x+i,y:e.y-i});break;case"left":s.push({x:e.x+i,y:e.y-i},{x:e.x+i,y:e.y+i});break;case"right":s.push({x:e.x-i,y:e.y-i},{x:e.x-i,y:e.y+i});break}return s}function m5(e){const{top:n,right:i,bottom:s,left:l}=e;return[{x:l,y:n},{x:i,y:n},{x:i,y:s},{x:l,y:s}]}function g5(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,u=n.length-1;h<n.length;u=h++){const o=n[h],c=n[u],d=o.x,g=o.y,f=c.x,b=c.y;g>s!=b>s&&i<(f-d)*(s-g)/(b-g)+d&&(l=!l)}return l}function v5(e){const n=e.slice();return n.sort((i,s)=>i.x<s.x?-1:i.x>s.x?1:i.y<s.y?-1:i.y>s.y?1:0),_5(n)}function _5(e){if(e.length<=1)return e.slice();const n=[];for(let s=0;s<e.length;s++){const l=e[s];for(;n.length>=2;){const h=n[n.length-1],u=n[n.length-2];if((h.x-u.x)*(l.y-u.y)>=(h.y-u.y)*(l.x-u.x))n.pop();else break}n.push(l)}n.pop();const i=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;i.length>=2;){const h=i[i.length-1],u=i[i.length-2];if((h.x-u.x)*(l.y-u.y)>=(h.y-u.y)*(l.x-u.x))i.pop();else break}i.push(l)}return i.pop(),n.length===1&&i.length===1&&n[0].x===i[0].x&&n[0].y===i[0].y?n:n.concat(i)}var y5=Zw,b5=Qw,x5=Jw,S5=eC,w5=tC,C5=iC;const k5=(e,n)=>{const i=new Array(e.length+n.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<n.length;s++)i[e.length+s]=n[s];return i},E5=(e,n)=>({classGroupId:e,validator:n}),sC=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Xu="-",g0=[],A5="arbitrary..",T5=e=>{const n=D5(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return R5(u);const o=u.split(Xu),c=o[0]===""&&o.length>1?1:0;return aC(o,c,n)},getConflictingClassGroupIds:(u,o)=>{if(o){const c=s[u],d=i[u];return c?d?k5(d,c):c:d||g0}return i[u]||g0}}},aC=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],h=i.nextPart.get(l);if(h){const d=aC(e,n+1,h);if(d)return d}const u=i.validators;if(u===null)return;const o=n===0?e.join(Xu):e.slice(n).join(Xu),c=u.length;for(let d=0;d<c;d++){const g=u[d];if(g.validator(o))return g.classGroupId}},R5=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),s=n.slice(0,i);return s?A5+s:void 0})(),D5=e=>{const{theme:n,classGroups:i}=e;return M5(i,n)},M5=(e,n)=>{const i=sC();for(const s in e){const l=e[s];fg(l,i,s,n)}return i},fg=(e,n,i,s)=>{const l=e.length;for(let h=0;h<l;h++){const u=e[h];N5(u,n,i,s)}},N5=(e,n,i,s)=>{if(typeof e=="string"){j5(e,n,i);return}if(typeof e=="function"){O5(e,n,i,s);return}L5(e,n,i,s)},j5=(e,n,i)=>{const s=e===""?n:oC(n,e);s.classGroupId=i},O5=(e,n,i,s)=>{if(I5(e)){fg(e(s),n,i,s);return}n.validators===null&&(n.validators=[]),n.validators.push(E5(i,e))},L5=(e,n,i,s)=>{const l=Object.entries(e),h=l.length;for(let u=0;u<h;u++){const[o,c]=l[u];fg(c,oC(n,o),i,s)}},oC=(e,n)=>{let i=e;const s=n.split(Xu),l=s.length;for(let h=0;h<l;h++){const u=s[h];let o=i.nextPart.get(u);o||(o=sC(),i.nextPart.set(u,o)),i=o}return i},I5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,B5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),s=Object.create(null);const l=(h,u)=>{i[h]=u,n++,n>e&&(n=0,s=i,i=Object.create(null))};return{get(h){let u=i[h];if(u!==void 0)return u;if((u=s[h])!==void 0)return l(h,u),u},set(h,u){h in i?i[h]=u:l(h,u)}}},fm="!",v0=":",z5=[],_0=(e,n,i,s,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s,isExternal:l}),P5=e=>{const{prefix:n,experimentalParseClassName:i}=e;let s=l=>{const h=[];let u=0,o=0,c=0,d;const g=l.length;for(let w=0;w<g;w++){const _=l[w];if(u===0&&o===0){if(_===v0){h.push(l.slice(c,w)),c=w+1;continue}if(_==="/"){d=w;continue}}_==="["?u++:_==="]"?u--:_==="("?o++:_===")"&&o--}const f=h.length===0?l:l.slice(c);let b=f,S=!1;f.endsWith(fm)?(b=f.slice(0,-1),S=!0):f.startsWith(fm)&&(b=f.slice(1),S=!0);const k=d&&d>c?d-c:void 0;return _0(h,S,b,k)};if(n){const l=n+v0,h=s;s=u=>u.startsWith(l)?h(u.slice(l.length)):_0(z5,!1,u,void 0,!0)}if(i){const l=s;s=h=>i({className:h,parseClassName:l})}return s},F5=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{n.set(i,1e6+s)}),i=>{const s=[];let l=[];for(let h=0;h<i.length;h++){const u=i[h],o=u[0]==="[",c=n.has(u);o||c?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(u)):l.push(u)}return l.length>0&&(l.sort(),s.push(...l)),s}},H5=e=>({cache:B5(e.cacheSize),parseClassName:P5(e),sortModifiers:F5(e),...T5(e)}),U5=/\s+/,$5=(e,n)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:h}=n,u=[],o=e.trim().split(U5);let c="";for(let d=o.length-1;d>=0;d-=1){const g=o[d],{isExternal:f,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:w}=i(g);if(f){c=g+(c.length>0?" "+c:c);continue}let _=!!w,y=s(_?k.substring(0,w):k);if(!y){if(!_){c=g+(c.length>0?" "+c:c);continue}if(y=s(k),!y){c=g+(c.length>0?" "+c:c);continue}_=!1}const v=b.length===0?"":b.length===1?b[0]:h(b).join(":"),x=S?v+fm:v,E=x+y;if(u.indexOf(E)>-1)continue;u.push(E);const M=l(y,_);for(let R=0;R<M.length;++R){const N=M[R];u.push(x+N)}c=g+(c.length>0?" "+c:c)}return c},q5=(...e)=>{let n=0,i,s,l="";for(;n<e.length;)(i=e[n++])&&(s=lC(i))&&(l&&(l+=" "),l+=s);return l},lC=e=>{if(typeof e=="string")return e;let n,i="";for(let s=0;s<e.length;s++)e[s]&&(n=lC(e[s]))&&(i&&(i+=" "),i+=n);return i},V5=(e,...n)=>{let i,s,l,h;const u=c=>{const d=n.reduce((g,f)=>f(g),e());return i=H5(d),s=i.cache.get,l=i.cache.set,h=o,o(c)},o=c=>{const d=s(c);if(d)return d;const g=$5(c,i);return l(c,g),g};return h=u,(...c)=>h(q5(...c))},G5=[],Vt=e=>{const n=i=>i[e]||G5;return n.isThemeGetter=!0,n},cC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,K5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y5=/\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$/,X5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Z5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Q5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ii=e=>W5.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),Bi=e=>!!e&&Number.isInteger(Number(e)),xp=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),Yr=e=>K5.test(e),dC=()=>!0,J5=e=>Y5.test(e)&&!X5.test(e),pg=()=>!1,e4=e=>Z5.test(e),t4=e=>Q5.test(e),n4=e=>!Te(e)&&!De(e),r4=e=>Zi(e,pC,pg),Te=e=>cC.test(e),ys=e=>Zi(e,mC,J5),y0=e=>Zi(e,d4,Ye),i4=e=>Zi(e,vC,dC),s4=e=>Zi(e,gC,pg),b0=e=>Zi(e,hC,pg),a4=e=>Zi(e,fC,t4),Su=e=>Zi(e,_C,e4),De=e=>uC.test(e),ol=e=>Ms(e,mC),o4=e=>Ms(e,gC),x0=e=>Ms(e,hC),l4=e=>Ms(e,pC),c4=e=>Ms(e,fC),wu=e=>Ms(e,_C,!0),u4=e=>Ms(e,vC,!0),Zi=(e,n,i)=>{const s=cC.exec(e);return s?s[1]?n(s[1]):i(s[2]):!1},Ms=(e,n,i=!1)=>{const s=uC.exec(e);return s?s[1]?n(s[1]):i:!1},hC=e=>e==="position"||e==="percentage",fC=e=>e==="image"||e==="url",pC=e=>e==="length"||e==="size"||e==="bg-size",mC=e=>e==="length",d4=e=>e==="number",gC=e=>e==="family-name",vC=e=>e==="number"||e==="weight",_C=e=>e==="shadow",h4=()=>{const e=Vt("color"),n=Vt("font"),i=Vt("text"),s=Vt("font-weight"),l=Vt("tracking"),h=Vt("leading"),u=Vt("breakpoint"),o=Vt("container"),c=Vt("spacing"),d=Vt("radius"),g=Vt("shadow"),f=Vt("inset-shadow"),b=Vt("text-shadow"),S=Vt("drop-shadow"),k=Vt("blur"),w=Vt("perspective"),_=Vt("aspect"),y=Vt("ease"),v=Vt("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...E(),De,Te],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],D=()=>[De,Te,c],O=()=>[Ii,"full","auto",...D()],P=()=>[Bi,"none","subgrid",De,Te],$=()=>["auto",{span:["full",Bi,De,Te]},Bi,De,Te],U=()=>[Bi,"auto",De,Te],q=()=>["auto","min","max","fr",De,Te],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...D()],Q=()=>[Ii,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],J=()=>[Ii,"screen","full","dvw","lvw","svw","min","max","fit",...D()],F=()=>[Ii,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],j=()=>[e,De,Te],I=()=>[...E(),x0,b0,{position:[De,Te]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",l4,r4,{size:[De,Te]}],X=()=>[xp,ol,ys],ee=()=>["","none","full",d,De,Te],te=()=>["",Ye,ol,ys],W=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ye,xp,x0,b0],ae=()=>["","none",k,De,Te],pe=()=>["none",Ye,De,Te],ce=()=>["none",Ye,De,Te],Oe=()=>[Ye,De,Te],Be=()=>[Ii,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yr],breakpoint:[Yr],color:[dC],container:[Yr],"drop-shadow":[Yr],ease:["in","out","in-out"],font:[n4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yr],shadow:[Yr],spacing:["px",Ye],text:[Yr],"text-shadow":[Yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ii,Te,De,_]}],container:["container"],columns:[{columns:[Ye,Te,De,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:M()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Bi,"auto",De,Te]}],basis:[{basis:[Ii,"full","auto",o,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Ii,"auto","initial","none",Te]}],grow:[{grow:["",Ye,De,Te]}],shrink:[{shrink:["",Ye,De,Te]}],order:[{order:[Bi,"first","last","none",De,Te]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[o,"screen",...Q()]}],"min-w":[{"min-w":[o,"screen","none",...Q()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[u]},...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",i,ol,ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,u4,i4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xp,Te]}],"font-family":[{font:[o4,s4,n]}],"font-features":[{"font-features":[Te]}],"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:[l,De,Te]}],"line-clamp":[{"line-clamp":[Ye,"none",De,y0]}],leading:[{leading:[h,...D()]}],"list-image":[{"list-image":["none",De,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",De,ys]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Ye,"auto",De,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Te]}],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",De,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bi,De,Te],radial:["",De,Te],conic:[Bi,De,Te]},c4,a4]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,De,Te]}],"outline-w":[{outline:["",Ye,ol,ys]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",g,wu,Su]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",f,wu,Su]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Ye,ys]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",b,wu,Su]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Ye,De,Te]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"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":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[De,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Te]}],filter:[{filter:["","none",De,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[Ye,De,Te]}],contrast:[{contrast:[Ye,De,Te]}],"drop-shadow":[{"drop-shadow":["","none",S,wu,Su]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Ye,De,Te]}],"hue-rotate":[{"hue-rotate":[Ye,De,Te]}],invert:[{invert:["",Ye,De,Te]}],saturate:[{saturate:[Ye,De,Te]}],sepia:[{sepia:["",Ye,De,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,De,Te]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,De,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,De,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,De,Te]}],"backdrop-invert":[{"backdrop-invert":["",Ye,De,Te]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,De,Te]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,De,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,De,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",De,Te]}],ease:[{ease:["linear","initial",y,De,Te]}],delay:[{delay:[Ye,De,Te]}],animate:[{animate:["none",v,De,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,De,Te]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[De,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",De,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",De,Te]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Ye,ol,ys,y0]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},f4=V5(h4);function _e(...e){return f4(sd(e))}const p4=Za("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ke({className:e,variant:n="default",size:i="default",asChild:s=!1,...l}){const h=s?Il:"button";return m.jsx(h,{"data-slot":"button","data-variant":n,"data-size":i,className:_e(p4({variant:n,size:i,className:e})),...l})}function Wl(){return{fetchWithAuth:T.useCallback(async(n,i={},s)=>{const{serverUrl:l,token:h}=s||{};let u=n;n.startsWith("/")&&l&&(u=`http://${l}${n}`);const o=new Headers(i.headers||{});return h&&o.set("Authorization",`Bearer ${h}`),fetch(u,{...i,headers:o})},[])}}function ro({...e}){return m.jsx(zm,{"data-slot":"dialog",...e})}function m4({...e}){return m.jsx(Pm,{"data-slot":"dialog-portal",...e})}function g4({...e}){return m.jsx(dd,{"data-slot":"dialog-close",...e})}function v4({className:e,...n}){return m.jsx(Fm,{"data-slot":"dialog-overlay",className:_e("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function io({className:e,children:n,showCloseButton:i=!0,...s}){return m.jsxs(m4,{children:[m.jsx(v4,{}),m.jsxs(Hm,{"data-slot":"dialog-content",className:_e("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[n,i&&m.jsx(dd,{"data-slot":"dialog-close",asChild:!0,children:m.jsxs(ke,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[m.jsx(Qr,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function so({className:e,...n}){return m.jsx("div",{"data-slot":"dialog-header",className:_e("flex flex-col gap-2",e),...n})}function Nd({className:e,showCloseButton:n=!1,children:i,...s}){return m.jsxs("div",{"data-slot":"dialog-footer",className:_e("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...s,children:[i,n&&m.jsx(dd,{asChild:!0,children:m.jsx(ke,{variant:"outline",children:"Close"})})]})}function ao({className:e,...n}){return m.jsx(R1,{"data-slot":"dialog-title",className:_e("text-base leading-none font-medium",e),...n})}function Kl({className:e,...n}){return m.jsx(D1,{"data-slot":"dialog-description",className:_e("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}function Ou({className:e,type:n,...i}){return m.jsx("input",{type:n,"data-slot":"input",className:_e("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}const Vi=T.forwardRef(({className:e,children:n,...i},s)=>m.jsxs(uj,{"data-slot":"scroll-area",className:_e("relative overflow-hidden",e),...i,children:[m.jsx(dj,{ref:s,"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] outline-none",style:{WebkitOverflowScrolling:"touch"},children:n}),m.jsx(_4,{}),m.jsx(hj,{})]}));Vi.displayName="ScrollArea";function _4({className:e,orientation:n="vertical",...i}){return m.jsx(nw,{"data-slot":"scroll-area-scrollbar","data-orientation":n,orientation:n,className:_e("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",e),...i,children:m.jsx(aw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function y4(e){const i=e.replace(/\\/g,"/").split("/");return i.pop(),i.join("/")||"/"}function b4({open:e,onOpenChange:n,onSelect:i,initialPath:s,title:l="Select Folder"}){const[h,u]=T.useState(s||""),[o,c]=T.useState([]),[d,g]=T.useState(!1),[f,b]=T.useState(0),[S,k]=T.useState(null),[w,_]=T.useState(""),y=T.useRef(null),v=T.useRef(null),{fetchWithAuth:x}=Wl(),{activeServer:E}=Xa(),M=T.useCallback(async U=>{g(!0),k(null),b(0),_("");try{const q=await x(`/api/fs/browse?path=${encodeURIComponent(U)}`,{},{serverUrl:E==null?void 0:E.url,token:E==null?void 0:E.token}),Y=await q.json();if(!q.ok)throw new Error(Y.message||"Failed to browse directory");const K=Y.files.filter(V=>V.type==="directory");c(K),u(Y.currentPath)}catch(q){k(q instanceof Error?q.message:"Failed to load directory"),c([])}finally{g(!1)}},[x,E]);T.useEffect(()=>{e&&M(s||"")},[e,s,M]),T.useEffect(()=>{b(0)},[w]);const R=o.filter(U=>U.name.toLowerCase().includes(w.toLowerCase())),N=()=>{const U=y4(h);U!==h&&M(U)},D=()=>{h&&(i(h),n(!1))},O=U=>{const q=h?`${h}/${U.name}`:U.name;M(q)},P=U=>{if(R.length!==0)switch(U.key){case"ArrowDown":U.preventDefault(),b(q=>Math.min(q+1,R.length-1));break;case"ArrowUp":U.preventDefault(),b(q=>Math.max(q-1,0));break;case"Enter":U.preventDefault(),R[f]&&O(R[f]);break;case"Escape":w&&(U.preventDefault(),_(""));break}};T.useEffect(()=>{if(v.current&&R.length>0){const U=v.current.children[f];U&&U.scrollIntoView({block:"nearest"})}},[f,R.length]),T.useEffect(()=>{e&&setTimeout(()=>{var U;return(U=y.current)==null?void 0:U.focus()},100)},[e]);const $=(U,q=50)=>{if(U.length<=q)return U;const Y=U.split("/");return Y.length<=2?U:".../"+Y.slice(-2).join("/")};return m.jsx(ro,{open:e,onOpenChange:n,children:m.jsxs(io,{className:"sm:max-w-lg",onKeyDown:P,children:[m.jsx(so,{children:m.jsx(ao,{children:l})}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[m.jsx(ke,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:N,disabled:d||!h,children:m.jsx(bA,{className:"w-4 h-4"})}),m.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:h,children:$(h)||"Home"})]}),m.jsxs("div",{className:"relative",children:[m.jsx(Dm,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(Ou,{ref:y,placeholder:"Filter folders...",value:w,onChange:U=>_(U.target.value),className:"pl-8"})]}),m.jsx(Vi,{className:"h-64 border rounded-md",children:d?m.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):S?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[m.jsx("span",{className:"text-destructive",children:S}),m.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>M(h),className:"mt-2",children:"Retry"})]}):R.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[m.jsx(Hi,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):m.jsx("div",{className:"p-1",ref:v,children:R.map((U,q)=>m.jsxs("button",{onClick:()=>{b(q)},onDoubleClick:()=>O(U),className:_e("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",q===f&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(Hi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:U.name}),q===f&&m.jsx(ei,{className:"w-4 h-4 text-primary"})]},U.path))})}),S&&m.jsx("p",{className:"text-xs text-destructive",children:S})]}),m.jsxs(Nd,{children:[m.jsx(ke,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),m.jsx(ke,{onClick:D,disabled:!h||d,children:"Use This Folder"})]})]})})}var S0=1,x4=.9,S4=.8,w4=.17,Sp=.1,wp=.999,C4=.9999,k4=.99,E4=/[\\\/_+.#"@\[\(\{&]/,A4=/[\\\/_+.#"@\[\(\{&]/g,T4=/[\s-]/,yC=/[\s-]/g;function pm(e,n,i,s,l,h,u){if(h===n.length)return l===e.length?S0:k4;var o=`${l},${h}`;if(u[o]!==void 0)return u[o];for(var c=s.charAt(h),d=i.indexOf(c,l),g=0,f,b,S,k;d>=0;)f=pm(e,n,i,s,d+1,h+1,u),f>g&&(d===l?f*=S0:E4.test(e.charAt(d-1))?(f*=S4,S=e.slice(l,d-1).match(A4),S&&l>0&&(f*=Math.pow(wp,S.length))):T4.test(e.charAt(d-1))?(f*=x4,k=e.slice(l,d-1).match(yC),k&&l>0&&(f*=Math.pow(wp,k.length))):(f*=w4,l>0&&(f*=Math.pow(wp,d-l))),e.charAt(d)!==n.charAt(h)&&(f*=C4)),(f<Sp&&i.charAt(d-1)===s.charAt(h+1)||s.charAt(h+1)===s.charAt(h)&&i.charAt(d-1)!==s.charAt(h))&&(b=pm(e,n,i,s,d+1,h+2,u),b*Sp>f&&(f=b*Sp)),f>g&&(g=f),d=i.indexOf(c,d+1);return u[o]=g,g}function w0(e){return e.toLowerCase().replace(yC," ")}function R4(e,n,i){return e=i&&i.length>0?`${e+" "+i.join(" ")}`:e,pm(e,n,w0(e),w0(n),0,0,{})}var ll='[cmdk-group=""]',Cp='[cmdk-group-items=""]',D4='[cmdk-group-heading=""]',bC='[cmdk-item=""]',C0=`${bC}:not([aria-disabled="true"])`,mm="cmdk-item-select",Ea="data-value",M4=(e,n,i)=>R4(e,n,i),xC=T.createContext(void 0),Yl=()=>T.useContext(xC),SC=T.createContext(void 0),mg=()=>T.useContext(SC),wC=T.createContext(void 0),CC=T.forwardRef((e,n)=>{let i=Aa(()=>{var L,z;return{search:"",value:(z=(L=e.value)!=null?L:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Aa(()=>new Set),l=Aa(()=>new Map),h=Aa(()=>new Map),u=Aa(()=>new Set),o=kC(e),{label:c,children:d,value:g,onValueChange:f,filter:b,shouldFilter:S,loop:k,disablePointerSelection:w=!1,vimBindings:_=!0,...y}=e,v=Gt(),x=Gt(),E=Gt(),M=T.useRef(null),R=U4();As(()=>{if(g!==void 0){let L=g.trim();i.current.value=L,N.emit()}},[g]),As(()=>{R(6,q)},[]);let N=T.useMemo(()=>({subscribe:L=>(u.current.add(L),()=>u.current.delete(L)),snapshot:()=>i.current,setState:(L,z,X)=>{var ee,te,W,H;if(!Object.is(i.current[L],z)){if(i.current[L]=z,L==="search")U(),P(),R(1,$);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(E);re?re.focus():(ee=document.getElementById(v))==null||ee.focus()}if(R(7,()=>{var re;i.current.selectedItemId=(re=Y())==null?void 0:re.id,N.emit()}),X||R(5,q),((te=o.current)==null?void 0:te.value)!==void 0){let re=z!=null?z:"";(H=(W=o.current).onValueChange)==null||H.call(W,re);return}}N.emit()}},emit:()=>{u.current.forEach(L=>L())}}),[]),D=T.useMemo(()=>({value:(L,z,X)=>{var ee;z!==((ee=h.current.get(L))==null?void 0:ee.value)&&(h.current.set(L,{value:z,keywords:X}),i.current.filtered.items.set(L,O(z,X)),R(2,()=>{P(),N.emit()}))},item:(L,z)=>(s.current.add(L),z&&(l.current.has(z)?l.current.get(z).add(L):l.current.set(z,new Set([L]))),R(3,()=>{U(),P(),i.current.value||$(),N.emit()}),()=>{h.current.delete(L),s.current.delete(L),i.current.filtered.items.delete(L);let X=Y();R(4,()=>{U(),(X==null?void 0:X.getAttribute("id"))===L&&$(),N.emit()})}),group:L=>(l.current.has(L)||l.current.set(L,new Set),()=>{h.current.delete(L),l.current.delete(L)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:E,labelId:x,listInnerRef:M}),[]);function O(L,z){var X,ee;let te=(ee=(X=o.current)==null?void 0:X.filter)!=null?ee:M4;return L?te(L,i.current.search,z):0}function P(){if(!i.current.search||o.current.shouldFilter===!1)return;let L=i.current.filtered.items,z=[];i.current.filtered.groups.forEach(ee=>{let te=l.current.get(ee),W=0;te.forEach(H=>{let re=L.get(H);W=Math.max(re,W)}),z.push([ee,W])});let X=M.current;K().sort((ee,te)=>{var W,H;let re=ee.getAttribute("id"),ae=te.getAttribute("id");return((W=L.get(ae))!=null?W:0)-((H=L.get(re))!=null?H:0)}).forEach(ee=>{let te=ee.closest(Cp);te?te.appendChild(ee.parentElement===te?ee:ee.closest(`${Cp} > *`)):X.appendChild(ee.parentElement===X?ee:ee.closest(`${Cp} > *`))}),z.sort((ee,te)=>te[1]-ee[1]).forEach(ee=>{var te;let W=(te=M.current)==null?void 0:te.querySelector(`${ll}[${Ea}="${encodeURIComponent(ee[0])}"]`);W==null||W.parentElement.appendChild(W)})}function $(){let L=K().find(X=>X.getAttribute("aria-disabled")!=="true"),z=L==null?void 0:L.getAttribute(Ea);N.setState("value",z||void 0)}function U(){var L,z,X,ee;if(!i.current.search||o.current.shouldFilter===!1){i.current.filtered.count=s.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let W of s.current){let H=(z=(L=h.current.get(W))==null?void 0:L.value)!=null?z:"",re=(ee=(X=h.current.get(W))==null?void 0:X.keywords)!=null?ee:[],ae=O(H,re);i.current.filtered.items.set(W,ae),ae>0&&te++}for(let[W,H]of l.current)for(let re of H)if(i.current.filtered.items.get(re)>0){i.current.filtered.groups.add(W);break}i.current.filtered.count=te}function q(){var L,z,X;let ee=Y();ee&&(((L=ee.parentElement)==null?void 0:L.firstChild)===ee&&((X=(z=ee.closest(ll))==null?void 0:z.querySelector(D4))==null||X.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function Y(){var L;return(L=M.current)==null?void 0:L.querySelector(`${bC}[aria-selected="true"]`)}function K(){var L;return Array.from(((L=M.current)==null?void 0:L.querySelectorAll(C0))||[])}function V(L){let z=K()[L];z&&N.setState("value",z.getAttribute(Ea))}function Q(L){var z;let X=Y(),ee=K(),te=ee.findIndex(H=>H===X),W=ee[te+L];(z=o.current)!=null&&z.loop&&(W=te+L<0?ee[ee.length-1]:te+L===ee.length?ee[0]:ee[te+L]),W&&N.setState("value",W.getAttribute(Ea))}function J(L){let z=Y(),X=z==null?void 0:z.closest(ll),ee;for(;X&&!ee;)X=L>0?F4(X,ll):H4(X,ll),ee=X==null?void 0:X.querySelector(C0);ee?N.setState("value",ee.getAttribute(Ea)):Q(L)}let F=()=>V(K().length-1),j=L=>{L.preventDefault(),L.metaKey?F():L.altKey?J(1):Q(1)},I=L=>{L.preventDefault(),L.metaKey?V(0):L.altKey?J(-1):Q(-1)};return T.createElement(je.div,{ref:n,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:L=>{var z;(z=y.onKeyDown)==null||z.call(y,L);let X=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||X))switch(L.key){case"n":case"j":{_&&L.ctrlKey&&j(L);break}case"ArrowDown":{j(L);break}case"p":case"k":{_&&L.ctrlKey&&I(L);break}case"ArrowUp":{I(L);break}case"Home":{L.preventDefault(),V(0);break}case"End":{L.preventDefault(),F();break}case"Enter":{L.preventDefault();let ee=Y();if(ee){let te=new Event(mm);ee.dispatchEvent(te)}}}}},T.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:q4},c),jd(e,L=>T.createElement(SC.Provider,{value:N},T.createElement(xC.Provider,{value:D},L))))}),N4=T.forwardRef((e,n)=>{var i,s;let l=Gt(),h=T.useRef(null),u=T.useContext(wC),o=Yl(),c=kC(e),d=(s=(i=c.current)==null?void 0:i.forceMount)!=null?s:u==null?void 0:u.forceMount;As(()=>{if(!d)return o.item(l,u==null?void 0:u.id)},[d]);let g=EC(l,h,[e.value,e.children,h],e.keywords),f=mg(),b=Gi(R=>R.value&&R.value===g.current),S=Gi(R=>d||o.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);T.useEffect(()=>{let R=h.current;if(!(!R||e.disabled))return R.addEventListener(mm,k),()=>R.removeEventListener(mm,k)},[S,e.onSelect,e.disabled]);function k(){var R,N;w(),(N=(R=c.current).onSelect)==null||N.call(R,g.current)}function w(){f.setState("value",g.current,!0)}if(!S)return null;let{disabled:_,value:y,onSelect:v,forceMount:x,keywords:E,...M}=e;return T.createElement(je.div,{ref:ni(h,n),...M,id:l,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!b,"data-disabled":!!_,"data-selected":!!b,onPointerMove:_||o.getDisablePointerSelection()?void 0:w,onClick:_?void 0:k},e.children)}),j4=T.forwardRef((e,n)=>{let{heading:i,children:s,forceMount:l,...h}=e,u=Gt(),o=T.useRef(null),c=T.useRef(null),d=Gt(),g=Yl(),f=Gi(S=>l||g.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);As(()=>g.group(u),[]),EC(u,o,[e.value,e.heading,c]);let b=T.useMemo(()=>({id:u,forceMount:l}),[l]);return T.createElement(je.div,{ref:ni(o,n),...h,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},i&&T.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},i),jd(e,S=>T.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?d:void 0},T.createElement(wC.Provider,{value:b},S))))}),O4=T.forwardRef((e,n)=>{let{alwaysRender:i,...s}=e,l=T.useRef(null),h=Gi(u=>!u.search);return!i&&!h?null:T.createElement(je.div,{ref:ni(l,n),...s,"cmdk-separator":"",role:"separator"})}),L4=T.forwardRef((e,n)=>{let{onValueChange:i,...s}=e,l=e.value!=null,h=mg(),u=Gi(d=>d.search),o=Gi(d=>d.selectedItemId),c=Yl();return T.useEffect(()=>{e.value!=null&&h.setState("search",e.value)},[e.value]),T.createElement(je.input,{ref:n,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:l?e.value:u,onChange:d=>{l||h.setState("search",d.target.value),i==null||i(d.target.value)}})}),I4=T.forwardRef((e,n)=>{let{children:i,label:s="Suggestions",...l}=e,h=T.useRef(null),u=T.useRef(null),o=Gi(d=>d.selectedItemId),c=Yl();return T.useEffect(()=>{if(u.current&&h.current){let d=u.current,g=h.current,f,b=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let S=d.offsetHeight;g.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(d),()=>{cancelAnimationFrame(f),b.unobserve(d)}}},[]),T.createElement(je.div,{ref:ni(h,n),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":s,id:c.listId},jd(e,d=>T.createElement("div",{ref:ni(u,c.listInnerRef),"cmdk-list-sizer":""},d)))}),B4=T.forwardRef((e,n)=>{let{open:i,onOpenChange:s,overlayClassName:l,contentClassName:h,container:u,...o}=e;return T.createElement(zm,{open:i,onOpenChange:s},T.createElement(Pm,{container:u},T.createElement(Fm,{"cmdk-overlay":"",className:l}),T.createElement(Hm,{"aria-label":e.label,"cmdk-dialog":"",className:h},T.createElement(CC,{ref:n,...o}))))}),z4=T.forwardRef((e,n)=>Gi(i=>i.filtered.count===0)?T.createElement(je.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),P4=T.forwardRef((e,n)=>{let{progress:i,children:s,label:l="Loading...",...h}=e;return T.createElement(je.div,{ref:n,...h,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},jd(e,u=>T.createElement("div",{"aria-hidden":!0},u)))}),Ns=Object.assign(CC,{List:I4,Item:N4,Input:L4,Group:j4,Separator:O4,Dialog:B4,Empty:z4,Loading:P4});function F4(e,n){let i=e.nextElementSibling;for(;i;){if(i.matches(n))return i;i=i.nextElementSibling}}function H4(e,n){let i=e.previousElementSibling;for(;i;){if(i.matches(n))return i;i=i.previousElementSibling}}function kC(e){let n=T.useRef(e);return As(()=>{n.current=e}),n}var As=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Aa(e){let n=T.useRef();return n.current===void 0&&(n.current=e()),n}function Gi(e){let n=mg(),i=()=>e(n.snapshot());return T.useSyncExternalStore(n.subscribe,i,i)}function EC(e,n,i,s=[]){let l=T.useRef(),h=Yl();return As(()=>{var u;let o=(()=>{var d;for(let g of i){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(d=g.current.textContent)==null?void 0:d.trim():l.current}})(),c=s.map(d=>d.trim());h.value(e,o,c),(u=n.current)==null||u.setAttribute(Ea,o),l.current=o}),l}var U4=()=>{let[e,n]=T.useState(),i=Aa(()=>new Map);return As(()=>{i.current.forEach(s=>s()),i.current=new Map},[e]),(s,l)=>{i.current.set(s,l),n({})}};function $4(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function jd({asChild:e,children:n},i){return e&&T.isValidElement(n)?T.cloneElement($4(n),{ref:n.ref},i(n.props.children)):i(n)}var q4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function V4({className:e,...n}){return m.jsx("textarea",{"data-slot":"textarea",className:_e("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function G4({className:e,...n}){return m.jsx("div",{"data-slot":"input-group",role:"group",className:_e("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...n})}const W4=Za("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function K4({className:e,align:n="inline-start",...i}){return m.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:_e(W4({align:n}),e),onClick:s=>{var l,h;s.target.closest("button")||(h=(l=s.currentTarget.parentElement)==null?void 0:l.querySelector("input"))==null||h.focus()},...i})}function gg({className:e,...n}){return m.jsx(Ns,{"data-slot":"command",className:_e("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...n})}function AC({className:e,...n}){return m.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:m.jsxs(G4,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[m.jsx(Ns.Input,{"data-slot":"command-input",className:_e("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n}),m.jsx(K4,{children:m.jsx(Dm,{className:"size-4 shrink-0 opacity-50"})})]})})}function vg({className:e,...n}){return m.jsx(Ns.List,{"data-slot":"command-list",className:_e("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...n})}function _g({className:e,...n}){return m.jsx(Ns.Empty,{"data-slot":"command-empty",className:_e("py-6 text-center text-sm",e),...n})}function Tl({className:e,...n}){return m.jsx(Ns.Group,{"data-slot":"command-group",className:_e("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...n})}function TC({className:e,...n}){return m.jsx(Ns.Separator,{"data-slot":"command-separator",className:_e("-mx-1 h-px bg-border",e),...n})}function ja({className:e,children:n,...i}){return m.jsxs(Ns.Item,{"data-slot":"command-item",className:_e("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...i,children:[n,m.jsx(ei,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function Od({...e}){return m.jsx(F3,{"data-slot":"popover",...e})}function yg({...e}){return m.jsx(U3,{"data-slot":"popover-trigger",...e})}function Ld({className:e,align:n="center",sideOffset:i=4,...s}){return m.jsx($3,{children:m.jsx(q3,{"data-slot":"popover-content",align:n,sideOffset:i,className:_e("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})})}function Y4({...e}){return m.jsx(H3,{"data-slot":"popover-anchor",...e})}function X4({workspaces:e,activeWorkspace:n,onSelectWorkspace:i,onCreateVirtualWorkspace:s,onCreatePhysicalWorkspace:l,isWorkspaceFavorited:h,onToggleFavorite:u}){const[o,c]=T.useState(!1),[d,g]=T.useState(!1);return m.jsxs(m.Fragment,{children:[m.jsxs(Od,{open:o,onOpenChange:c,children:[m.jsx(yg,{asChild:!0,children:m.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n!=null&&n.isVirtual?m.jsx(Yp,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(Hi,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:(n==null?void 0:n.name)||"Select workspace"})]}),m.jsx(Bx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),m.jsx(Ld,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(gg,{children:[m.jsx(AC,{placeholder:"Search workspace..."}),m.jsxs(vg,{className:"max-h-[50vh] overflow-y-auto",children:[m.jsx(_g,{children:"No workspace found."}),m.jsx(Tl,{heading:"Workspaces",children:e.map(f=>m.jsxs(ja,{onSelect:()=>{i(f),c(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[f.isVirtual?m.jsx(Yp,{className:"size-4 text-muted-foreground"}):m.jsx(Hi,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:f.name})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:b=>{b.stopPropagation(),u(f.id,f.name)},title:h(f.id)?"Remove from favorites":"Add to favorites",children:h(f.id)?m.jsx(Lb,{className:"size-4 fill-primary text-primary"}):m.jsx(Lb,{className:"size-4 text-muted-foreground"})}),m.jsx(ei,{className:_e("size-4",(n==null?void 0:n.id)===f.id?"opacity-100":"opacity-0")})]})]},f.id))}),m.jsx(TC,{}),m.jsxs(Tl,{children:[m.jsxs(ja,{onSelect:()=>{s(),c(!1)},children:[m.jsx(Ya,{className:"size-4","data-icon":"inline-start"}),"Create virtual workspace"]}),m.jsxs(ja,{onSelect:()=>{c(!1),g(!0)},children:[m.jsx(Hi,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]})]})]})]})})]}),m.jsx(b4,{open:d,onOpenChange:g,onSelect:f=>{l(f),g(!1)},title:"Select Workspace Folder"})]})}function Z4({onOpenAddServer:e,onServerSwitch:n}){const[i,s]=T.useState(!1),{servers:l,activeServer:h,switchServer:u}=Xa();return m.jsxs(Od,{open:i,onOpenChange:s,children:[m.jsx(yg,{asChild:!0,children:m.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":i,"aria-label":"Select server",className:"w-full justify-between h-9",children:[m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[m.jsx(Ss,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:(h==null?void 0:h.name)||"Select server"})]}),m.jsx(Bx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),m.jsx(Ld,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(gg,{children:[m.jsx(AC,{placeholder:"Search server..."}),m.jsxs(vg,{className:"max-h-[50vh] overflow-y-auto",children:[m.jsx(_g,{children:"No server found."}),m.jsx(Tl,{heading:"Servers",children:l.map(o=>m.jsxs(ja,{onSelect:()=>{u(o.id),n==null||n(),s(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ss,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:o.name})]}),m.jsx(ei,{className:_e("size-4",(h==null?void 0:h.id)===o.id?"opacity-100":"opacity-0")})]},o.id))}),m.jsx(TC,{}),m.jsx(Tl,{children:m.jsxs(ja,{onSelect:()=>{e(),s(!1)},children:[m.jsx(Ya,{className:"size-4","data-icon":"inline-start"}),"Add Server..."]})})]})]})})]})}const kp=640;function Xl(){const[e,n]=T.useState(void 0);return T.useEffect(()=>{const i=window.matchMedia(`(max-width: ${kp-1}px)`),s=()=>{n(window.innerWidth<kp)};return i.addEventListener("change",s),n(window.innerWidth<kp),()=>i.removeEventListener("change",s)},[]),!!e}function ml({className:e,orientation:n="horizontal",decorative:i=!0,...s}){return m.jsx(Zj,{"data-slot":"separator",decorative:i,orientation:n,className:_e("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}function Id({...e}){return m.jsx(zm,{"data-slot":"sheet",...e})}function Q4({...e}){return m.jsx(FD,{"data-slot":"sheet-trigger",...e})}function J4({...e}){return m.jsx(Pm,{"data-slot":"sheet-portal",...e})}function eO({className:e,...n}){return m.jsx(Fm,{"data-slot":"sheet-overlay",className:_e("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function Bd({className:e,children:n,side:i="right",showCloseButton:s=!0,style:l,...h}){return m.jsxs(J4,{children:[m.jsx(eO,{}),m.jsxs(Hm,{"data-slot":"sheet-content","data-side":i,className:_e("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",e),style:(()=>{const u=i==="left"||i==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:i==="top"?{top:"env(safe-area-inset-top, 0px)"}:i==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0;return u?{...u,...l}:l})(),...h,children:[n,s&&m.jsx(dd,{"data-slot":"sheet-close",asChild:!0,children:m.jsxs(ke,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[m.jsx(Qr,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function zd({className:e,...n}){return m.jsx("div",{"data-slot":"sheet-header",className:_e("flex flex-col gap-0.5 p-4",e),...n})}function Pd({className:e,...n}){return m.jsx(R1,{"data-slot":"sheet-title",className:_e("text-base font-medium text-foreground",e),...n})}function tO({className:e,...n}){return m.jsx(D1,{"data-slot":"sheet-description",className:_e("text-sm text-muted-foreground",e),...n})}function Rl({delayDuration:e=0,...n}){return m.jsx(y5,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function Fa({...e}){return m.jsx(b5,{"data-slot":"tooltip",...e})}function Ha({...e}){return m.jsx(x5,{"data-slot":"tooltip-trigger",...e})}function Ua({className:e,sideOffset:n=0,children:i,...s}){return m.jsx(S5,{children:m.jsxs(w5,{"data-slot":"tooltip-content",sideOffset:n,className:_e("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[i,m.jsx(C5,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const nO="sidebar_state",rO=3600*24*7,iO="16rem",sO="18rem",aO="3rem",oO="b",RC=T.createContext(null);function bg(){const e=T.useContext(RC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function lO({defaultOpen:e=!0,open:n,onOpenChange:i,className:s,style:l,children:h,...u}){const o=Xl(),[c,d]=T.useState(!1),[g,f]=T.useState(e),b=n!=null?n:g,S=T.useCallback(y=>{const v=typeof y=="function"?y(b):y;i?i(v):f(v),document.cookie=`${nO}=${v}; path=/; max-age=${rO}`},[i,b]),k=T.useCallback(()=>o?d(y=>!y):S(y=>!y),[o,S,d]);T.useEffect(()=>{const y=v=>{v.key===oO&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[k]);const w=b?"expanded":"collapsed",_=T.useMemo(()=>({state:w,open:b,setOpen:S,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:k}),[w,b,S,o,c,d,k]);return m.jsx(RC.Provider,{value:_,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":iO,"--sidebar-width-icon":aO,...l},className:_e("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",s),...u,children:h})})}function cO({side:e="left",variant:n="sidebar",collapsible:i="offcanvas",className:s,children:l,dir:h,...u}){const{isMobile:o,state:c,openMobile:d,setOpenMobile:g}=bg();return i==="none"?m.jsx("div",{"data-slot":"sidebar",className:_e("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",s),...u,children:l}):o?m.jsx(Id,{open:d,onOpenChange:g,...u,children:m.jsxs(Bd,{dir:h,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":sO},side:e,children:[m.jsxs(zd,{className:"sr-only",children:[m.jsx(Pd,{children:"Sidebar"}),m.jsx(tO,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):m.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?i:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[m.jsx("div",{"data-slot":"sidebar-gap",className:_e("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),m.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:_e("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),style:{top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},...u,children:m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:l})})]})}function k0({className:e,onClick:n,...i}){const{toggleSidebar:s}=bg();return m.jsxs(ke,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:_e(e),onClick:l=>{n==null||n(l),s()},...i,children:[m.jsx(gT,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function uO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:_e("flex flex-col gap-2 p-2",e),...n})}function dO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:_e("flex flex-col gap-2 p-2",e),...n})}function hO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:_e("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function vl({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:_e("relative flex w-full min-w-0 flex-col p-2",e),...n})}function _l({className:e,asChild:n=!1,...i}){const s=n?Il:"div";return m.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:_e("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e),...i})}function yl({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:_e("w-full text-sm",e),...n})}function Ra({className:e,...n}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:_e("flex w-full min-w-0 flex-col gap-0",e),...n})}function xs({className:e,...n}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:_e("group/menu-item relative",e),...n})}const fO=Za("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Oa({asChild:e=!1,isActive:n=!1,variant:i="default",size:s="default",tooltip:l,className:h,...u}){const o=e?Il:"button",{isMobile:c,state:d}=bg(),g=m.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:_e(fO({variant:i,size:s}),h),...u});return l?(typeof l=="string"&&(l={children:l}),m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:g}),m.jsx(Ua,{side:"right",align:"center",hidden:d!=="collapsed"||c,...l})]})):g}function pO({className:e,asChild:n=!1,showOnHover:i=!1,...s}){const l=n?Il:"button";return m.jsx(l,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:_e("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",i&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",e),...s})}function mO({className:e,...n}){return m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:_e("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...n})}function $a({...e}){return m.jsx(TR,{"data-slot":"collapsible",...e})}function qa({...e}){return m.jsx(e1,{"data-slot":"collapsible-trigger",...e})}function Va({...e}){return m.jsx(t1,{"data-slot":"collapsible-content",...e})}function gO({...e}){return m.jsx(C3,{"data-slot":"dropdown-menu",...e})}function vO({...e}){return m.jsx(k3,{"data-slot":"dropdown-menu-trigger",...e})}function _O({className:e,align:n="start",sideOffset:i=4,...s}){return m.jsx(E3,{children:m.jsx(A3,{"data-slot":"dropdown-menu-content",sideOffset:i,align:n,className:_e("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})})}function Ep({className:e,inset:n,variant:i="default",...s}){return m.jsx(T3,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":i,className:_e("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...s})}const E0=er.memo(function({isClosed:n,onReopen:i,onClose:s,onDelete:l}){return m.jsxs(gO,{children:[m.jsx(vO,{asChild:!0,children:m.jsxs(pO,{showOnHover:!0,children:[m.jsx(LA,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Session actions"})]})}),m.jsx(_O,{align:"end",children:n?m.jsxs(m.Fragment,{children:[m.jsxs(Ep,{onClick:i,children:[m.jsx(CT,{className:"size-4"}),"Restore"]}),m.jsxs(Ep,{onClick:l,className:"text-destructive focus:text-destructive",children:[m.jsx(Ol,{className:"size-4"}),"Delete permanently"]})]}):m.jsxs(Ep,{onClick:s,children:[m.jsx(Qr,{className:"size-4"}),"Archive"]})})]})}),A0=er.memo(function({status:n,isStreaming:i,runningAt:s}){return i||n==="running"||!!s?m.jsx(Pn,{className:"size-3.5 animate-spin shrink-0"}):n==="error"?m.jsx(id,{className:"size-3.5 shrink-0"}):m.jsx(jl,{className:"size-3.5 shrink-0"})}),gm=er.memo(function e({session:n,allSessions:i,isActive:s,currentSessionId:l,streamingSessionId:h,onResumeSession:u,onCloseSession:o,onReopenSession:c,onDeleteSession:d}){const g=T.useMemo(()=>i.filter(w=>w.parentId===n.id),[i,n.id]),f=g.length>0,b=n.status==="closed",S=T.useMemo(()=>g.some(w=>w.id===l),[g,l]),k=n.id===h;return f?m.jsx(Rl,{delayDuration:300,children:m.jsx($a,{defaultOpen:s||S,className:"group/collapsible",children:m.jsxs(xs,{children:[m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx(qa,{asChild:!0,children:m.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:m.jsx(ti,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),m.jsx(Oa,{isActive:s,onClick:()=>u(n.id),className:"flex-1 min-w-0",children:m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(A0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),m.jsx(Ua,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),m.jsx(E0,{isClosed:b,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>d(n.id)})]}),m.jsx(Va,{children:m.jsx(mO,{children:g.map(w=>m.jsx(e,{session:w,allSessions:i,isActive:l===w.id,currentSessionId:l,streamingSessionId:h,onResumeSession:u,onCloseSession:o,onReopenSession:c,onDeleteSession:d},w.id))})})]})})}):m.jsx(Rl,{delayDuration:300,children:m.jsx(xs,{children:m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx("div",{className:"shrink-0 size-7 p-1"}),m.jsx(Oa,{isActive:s,onClick:()=>u(n.id),className:"flex-1 min-w-0",children:m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(A0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),m.jsx(Ua,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),m.jsx(E0,{isClosed:b,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>d(n.id)})]})})})}),yO=Za("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function un({className:e,variant:n="default",asChild:i=!1,...s}){const l=i?Il:"span";return m.jsx(l,{"data-slot":"badge","data-variant":n,className:_e(yO({variant:n}),e),...s})}const bO=er.memo(function({allSessions:n,currentSession:i,currentSessionId:s,streamingSessionId:l,favoritedWorkspaceIds:h,workspaces:u,activeWorkspace:o,onSelectWorkspace:c,onResumeSession:d,onCloseSession:g,onReopenSession:f,onDeleteSession:b,onCreateSessionInWorkspace:S,connected:k}){const w=T.useMemo(()=>{const y=new Map(u.map(v=>[v.id,v]));return h.map(v=>y.get(v)).filter(v=>v!==void 0)},[u,h]),_=T.useMemo(()=>{const y=new Map;for(const v of w){const x=n.filter(E=>E.workspaceId===v.id&&E.status==="active"&&E.parentId===null).sort((E,M)=>new Date(M.updatedAt).getTime()-new Date(E.updatedAt).getTime());y.set(v.id,x)}return y},[n,w]);return w.length===0?m.jsxs(vl,{children:[m.jsx(_l,{children:"Overview"}),m.jsx(yl,{children:m.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}):m.jsxs(vl,{children:[m.jsx(_l,{children:"Overview"}),m.jsx(yl,{children:w.map(y=>{const v=y.id===(o==null?void 0:o.id),x=_.get(y.id)||[];return m.jsx($a,{defaultOpen:v,className:"group/collapsible",children:m.jsxs(vl,{children:[m.jsx(_l,{asChild:!0,children:m.jsxs(qa,{className:"flex items-center justify-between w-full",onClick:()=>c(y),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ti,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),y.isVirtual?m.jsx(Yp,{className:"size-3.5"}):m.jsx(Hi,{className:"size-3.5"}),m.jsx("span",{className:"truncate",children:y.name})]}),m.jsx(un,{variant:"secondary",children:x.length})]})}),m.jsx(Va,{children:m.jsxs(yl,{children:[m.jsx(Ra,{children:m.jsx(xs,{children:m.jsxs(Oa,{onClick:()=>S(y.id),disabled:!k,className:"w-full",children:[m.jsx(Ya,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),m.jsx(Ra,{children:x.length===0?m.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):x.map(E=>m.jsx(gm,{session:E,allSessions:n,isActive:(i==null?void 0:i.id)===E.id,currentSessionId:s,streamingSessionId:l,onResumeSession:d,onCloseSession:g,onReopenSession:f,onDeleteSession:b},E.id))})]})})]})},y.id)})})]})});function xO({sessions:e,currentSession:n,currentSessionId:i,streamingSessionId:s,connected:l,workspaces:h,activeWorkspace:u,allSessions:o,viewMode:c,favoritedWorkspaceIds:d,onCreateSession:g,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:y,onCreateSessionInWorkspace:v,onOpenSettings:x,onOpenMCP:E,onOpenAddServer:M,onServerSwitch:R}){const{quickConnections:N,addToQuickConnections:D,removeFromQuickConnections:O,activeServer:P}=Xa(),{activeSessions:$,archivedSessions:U}=T.useMemo(()=>{const K=e.filter(V=>!V.parentId);return{activeSessions:K.filter(V=>V.status==="active"),archivedSessions:K.filter(V=>V.status==="closed")}},[e]),q=K=>N.some(V=>V.workspaceId===K&&V.serverId===(P==null?void 0:P.id)),Y=(K,V)=>{if(!P)return;const Q=N.find(J=>J.workspaceId===K&&J.serverId===P.id);Q?O(Q.id):D(P.id,P.name,K,V)};return m.jsxs(cO,{collapsible:"offcanvas",children:[m.jsxs(uO,{children:[m.jsxs("div",{className:"p-2 space-y-2",children:[m.jsx(Z4,{onOpenAddServer:M,onServerSwitch:R}),c!=="overview"&&m.jsx(X4,{workspaces:h,activeWorkspace:u,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:y,isWorkspaceFavorited:q,onToggleFavorite:Y})]}),c!=="overview"&&m.jsx(Ra,{children:m.jsx(xs,{children:m.jsxs(Oa,{onClick:g,disabled:!l,className:"w-full",children:[m.jsx(Ya,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})})]}),m.jsx(hO,{children:c==="overview"?m.jsx(bO,{allSessions:o,currentSession:n,currentSessionId:i,streamingSessionId:s,favoritedWorkspaceIds:d,workspaces:h,activeWorkspace:u,onSelectWorkspace:w,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k,onCreateSessionInWorkspace:v,connected:l}):m.jsxs(m.Fragment,{children:[$.length>0&&m.jsx($a,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(vl,{children:[m.jsx(_l,{asChild:!0,children:m.jsxs(qa,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ti,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),m.jsx(un,{variant:"secondary",children:$.length})]})}),m.jsx(Va,{children:m.jsx(yl,{children:m.jsx(Ra,{children:$.map(K=>m.jsx(gm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),U.length>0&&m.jsx($a,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(vl,{children:[m.jsx(_l,{asChild:!0,children:m.jsxs(qa,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ti,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),m.jsx(un,{variant:"secondary",children:U.length})]})}),m.jsx(Va,{children:m.jsx(yl,{children:m.jsx(Ra,{children:U.map(K=>m.jsx(gm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),$.length===0&&U.length===0&&m.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",m.jsx("br",{}),"Start a new chat to begin."]})]})}),m.jsx(dO,{className:"pb-4",children:m.jsxs(Ra,{children:[m.jsx(xs,{children:m.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[l?m.jsx(GT,{className:"size-3.5 text-success"}):m.jsx($x,{className:"size-3.5 text-destructive"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:l?"Connected":"Disconnected"})]})}),m.jsx(xs,{children:m.jsxs(Oa,{onClick:E,children:[m.jsx(Ss,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"MCP Servers"})]})}),m.jsx(xs,{children:m.jsx("div",{className:"flex items-center gap-1",children:m.jsxs(Oa,{onClick:x,children:[m.jsx(Px,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"Settings"})]})})})]})})]})}const SO={".ts":{icon:Sr,color:"text-blue-500"},".tsx":{icon:Sr,color:"text-blue-500"},".js":{icon:Sr,color:"text-yellow-500"},".jsx":{icon:Sr,color:"text-yellow-500"},".json":{icon:Sr,color:"text-yellow-600"},".md":{icon:Sr,color:"text-gray-500"},".css":{icon:Sr,color:"text-purple-500"},".html":{icon:Sr,color:"text-orange-500"}};function DC({entry:e,workspaceId:n,parentPath:i,depth:s,onFileSelect:l,showHidden:h=!0,serverUrl:u,apiToken:o}){const{fetchWithAuth:c}=Wl(),[d,g]=T.useState(!1),[f,b]=T.useState([]),[S,k]=T.useState(!1),[w,_]=T.useState(!1),y=i?`${i}/${e.path}`:e.path,v=e.type==="directory",x=async()=>{if(!(w||S)){k(!0);try{const P=await(await c(`/api/workspaces/${n}/files?path=${encodeURIComponent(y)}&showHidden=${h}`,{},{serverUrl:u,token:o})).json();b(P.files||[]),_(!0)}catch(O){console.error("Failed to load children:",O)}finally{k(!1)}}},E=O=>{g(O),O&&v&&x()},M=()=>{!v&&l&&l({...e,path:y})},R=e.extension?SO[e.extension]:null,N=v?d?Zp:Hi:(R==null?void 0:R.icon)||Sr,D=v?"text-amber-500":(R==null?void 0:R.color)||"text-muted-foreground";return v?m.jsxs($a,{open:d,onOpenChange:E,children:[m.jsx(qa,{asChild:!0,children:m.jsxs("button",{className:_e("flex items-center gap-1.5 w-full px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${s*12+6}px`},children:[S?m.jsx(Pn,{className:"w-3 h-3 animate-spin flex-shrink-0"}):m.jsx(ti,{className:_e("w-3 h-3 flex-shrink-0 transition-transform",d&&"rotate-90")}),m.jsx(N,{className:_e("w-4 h-4 flex-shrink-0",D)}),m.jsx("span",{className:"truncate",children:e.name})]})}),m.jsx(Va,{children:f.map(O=>m.jsx(DC,{entry:O,workspaceId:n,parentPath:y,depth:s+1,onFileSelect:l,showHidden:h,serverUrl:u,apiToken:o},`${y}/${O.path}`))})]}):m.jsxs("button",{onClick:M,className:_e("flex items-center gap-1.5 w-full px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${s*12+6}px`},children:[m.jsx(N,{className:_e("w-4 h-4 flex-shrink-0",D)}),m.jsx("span",{className:"truncate",children:e.name})]})}function T0({workspaceId:e,serverUrl:n,apiToken:i,onFileSelect:s,showHidden:l=!0}){const[h,u]=T.useState([]),[o,c]=T.useState(""),[d,g]=T.useState(!0),[f,b]=T.useState(null),{fetchWithAuth:S}=Wl(),k=T.useCallback(async()=>{g(!0),b(null);try{const w=await S(`/api/workspaces/${e}/files?showHidden=${l}`,{},{serverUrl:n,token:i}),_=await w.json();if(!w.ok)throw new Error(_.message||"Failed to load files");u(_.files),c(_.currentPath)}catch(w){b(w instanceof Error?w.message:"Failed to load files")}finally{g(!1)}},[e,l,S,n,i]);return T.useEffect(()=>{k()},[k]),d?m.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):f?m.jsxs("div",{className:"p-4 text-sm text-destructive",children:[f,m.jsx(ke,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:m.jsx(Da,{className:"w-3 h-3"})})]}):h.length===0?m.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",m.jsx(ke,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:m.jsx(Da,{className:"w-3 h-3"})})]}):m.jsx(Vi,{className:"h-full",children:m.jsxs("div",{className:"p-2",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:k,children:m.jsx(Da,{className:"w-3 h-3"})})]}),m.jsx("div",{className:"space-y-0.5",children:h.map(w=>m.jsx(DC,{entry:w,workspaceId:e,parentPath:o,depth:0,onFileSelect:s,showHidden:l,serverUrl:n,apiToken:i},w.path))})]})})}function wO({workspaceId:e,searchQuery:n,selectedIndex:i,onSelect:s,onFilesChange:l,showHidden:h=!0,serverUrl:u,apiToken:o}){const[c,d]=T.useState([]),[g,f]=T.useState(!1),[b,S]=T.useState(n),{fetchWithAuth:k}=Wl();return T.useEffect(()=>{const w=setTimeout(()=>{S(n)},150);return()=>clearTimeout(w)},[n]),T.useEffect(()=>{if(!b||b.length<2){d([]),l([]);return}f(!0);const w=new AbortController;return k(`/api/workspaces/${e}/files?search=${encodeURIComponent(b)}&showHidden=${h}`,{signal:w.signal},{serverUrl:u,token:o}).then(_=>_.json()).then(_=>{const y=_.files||[];d(y),l(y)}).catch(_=>{_.name!=="AbortError"&&console.error("File search failed:",_)}).finally(()=>f(!1)),()=>w.abort()},[e,b,l,h,k,u,o]),!n||n.length<2?m.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}):g?m.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}):c.length===0?m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',n,'"']}):m.jsxs("div",{className:"p-1",children:[c.map((w,_)=>m.jsxs("button",{onClick:()=>s(w),className:_e("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",_===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[w.type==="directory"?m.jsx(Hi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):m.jsx(Sr,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:w.path}),w.extension&&m.jsx("span",{className:"text-xs text-muted-foreground",children:w.extension})]},w.path)),m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," result",c.length!==1?"s":""," •",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function CO({workspaceId:e,serverUrl:n,apiToken:i,isOpen:s,onClose:l}){const h=Xl();return e?h?m.jsx(Id,{open:s,onOpenChange:u=>!u&&l(),children:m.jsxs(Bd,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[m.jsx(zd,{className:"sr-only",children:m.jsx(Pd,{children:"Files"})}),m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(Qr,{className:"w-4 h-4"})})]}),m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",style:{paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0))"},children:m.jsx(Vi,{className:"flex-1 min-h-0 pb-8",children:m.jsx(T0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})})]})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:_e("relative w-64 bg-transparent transition-[width] duration-200 ease-linear",!s&&"w-0")}),m.jsxs("div",{className:_e("fixed right-0 z-10 w-64 bg-sidebar border-l border-border flex flex-col overflow-hidden","transform transition-transform duration-200 ease-linear",!s&&"translate-x-full"),style:{top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},children:[m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(Qr,{className:"w-4 h-4"})})]}),m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",style:{paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0))"},children:m.jsx(Vi,{className:"flex-1 min-h-0",children:m.jsx(T0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})})]})]}):null}var Ap={exports:{}},R0;function kO(){return R0||(R0=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,M){var R,N=arguments.length,D=N<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(N<3?R(D):N>3?R(x,E,D):R(x,E))||D);return N>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=c(9042),b=c(9924),S=c(844),k=c(4725),w=c(2585),_=c(3656);let y=o.AccessibilityManager=class extends S.Disposable{constructor(v,x,E,M){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
464
|
-
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let x=0;x<v;x++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
|
|
465
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,x){this._liveRegionDebouncer.refresh(v,x,this._terminal.rows)}_renderRows(v,x){const E=this._terminal.buffer,M=E.lines.length.toString();for(let R=v;R<=x;R++){const N=E.lines.get(E.ydisp+R),D=[],O=(N==null?void 0:N.translateToString(!0,void 0,void 0,D))||"",P=(E.ydisp+R+1).toString(),$=this._rowElements[R];$&&(O.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=O,this._rowColumns.set($,D)),$.setAttribute("aria-posinset",P),$.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,x){const E=v.target,M=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==M)return;let R,N;if(x===0?(R=E,N=this._rowElements.pop(),this._rowContainer.removeChild(N)):(R=this._rowElements.shift(),N=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),N.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const D=this._createAccessibilityTreeNode();this._rowElements.unshift(D),this._rowContainer.insertAdjacentElement("afterbegin",D)}else{const D=this._createAccessibilityTreeNode();this._rowElements.push(D),this._rowContainer.appendChild(D)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){var O,P;if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((x.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===E.node&&x.offset>E.offset)&&([x,E]=[E,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const M=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:M,offset:(P=(O=M.textContent)==null?void 0:O.length)!=null?P:0}),!this._rowContainer.contains(E.node))return;const R=({node:$,offset:U})=>{const q=$ instanceof Text?$.parentNode:$;let Y=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(Y))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(q);if(!K)return console.warn("columns is null. Race condition?"),null;let V=U<K.length?K[U]:K.slice(-1)[0]+1;return V>=this._terminal.cols&&(++Y,V=0),{row:Y,column:V}},N=R(x),D=R(E);if(N&&D){if(N.row>D.row||N.row===D.row&&N.column>=D.column)throw new Error("invalid range");this._terminal.select(N.column,N.row,(D.row-N.row)*this._terminal.cols-N.column+D.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=y=d([g(1,w.IInstantiationService),g(2,k.ICoreBrowserService),g(3,k.IRenderService)],y)},3614:(u,o)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function d(b,S){return S?"\x1B[200~"+b+"\x1B[201~":b}function g(b,S,k,w){b=d(b=c(b),k.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),S.value=""}function f(b,S,k){const w=k.getBoundingClientRect(),_=b.clientX-w.left-10,y=b.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${_}px`,S.style.top=`${y}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=d,o.copyHandler=function(b,S){b.clipboardData&&b.clipboardData.setData("text/plain",S.selectionText),b.preventDefault()},o.handlePasteEvent=function(b,S,k,w){b.stopPropagation(),b.clipboardData&&g(b.clipboardData.getData("text/plain"),S,k,w)},o.paste=g,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(b,S,k,w,_){f(b,S,k),_&&w.rightClickSelect(b),S.value=w.selectionText,S.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=c(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,f,b){this._css.set(g,f,b)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,b){this._color.set(g,f,b)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,d,g,f){c.addEventListener(d,g,f);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(d,g,f))}}}},3551:function(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var M,R=arguments.length,N=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(M=y[D])&&(N=(R<3?M(N):R>3?M(v,x,N):M(v,x))||N);return R>3&&N&&Object.defineProperty(v,x,N),N},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=c(3656),b=c(8460),S=c(844),k=c(2585),w=c(4725);let _=o.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(y,v,x,E,M){super(),this._element=y,this._mouseService=v,this._renderService=x,this._bufferService=E,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const x=y.composedPath();for(let E=0;E<x.length;E++){const M=x[E];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,v){var E,M;this._activeProviderReplies&&v||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((N=>{N.link.dispose&&N.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let x=!1;for(const[R,N]of this._linkProviderService.linkProviders.entries())v?(M=this._activeProviderReplies)!=null&&M.get(R)&&(x=this._checkLinkProviderResult(R,y,x)):N.provideLinks(y.y,(D=>{var P,$;if(this._isMouseOut)return;const O=D==null?void 0:D.map((U=>({link:U})));(P=this._activeProviderReplies)==null||P.set(R,O),x=this._checkLinkProviderResult(R,y,x),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,v){const x=new Set;for(let E=0;E<v.size;E++){const M=v.get(E);if(M)for(let R=0;R<M.length;R++){const N=M[R],D=N.link.range.start.y<y?0:N.link.range.start.x,O=N.link.range.end.y>y?this._bufferService.cols:N.link.range.end.x;for(let P=D;P<=O;P++){if(x.has(P)){M.splice(R--,1);break}x.add(P)}}}}_checkLinkProviderResult(y,v,x){var R;if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(y);let M=!1;for(let N=0;N<y;N++)this._activeProviderReplies.has(N)&&!this._activeProviderReplies.get(N)||(M=!0);if(!M&&E){const N=E.find((D=>this._linkAtPosition(D.link,v)));N&&(x=!0,this._handleNewLink(N))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let N=0;N<this._activeProviderReplies.size;N++){const D=(R=this._activeProviderReplies.get(N))==null?void 0:R.find((O=>this._linkAtPosition(O.link,v)));if(D){x=!0,this._handleNewLink(D);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,v){this._currentLink&&this._lastMouseEvent&&(!y||!v||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(y.link,v)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.pointerCursor},set:x=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.underline},set:x=>{var E,M,R;(E=this._currentLink)!=null&&E.state&&((R=(M=this._currentLink)==null?void 0:M.state)==null?void 0:R.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const E=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(E,M),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,v,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(x,v.text)}_fireUnderlineEvent(y,v){const x=y.range,E=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-E-1,x.end.x,x.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(y,v,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(x,v.text)}_linkAtPosition(y,v){const x=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,M=v.y*this._bufferService.cols+v.x;return x<=M&&M<=E}_positionFromMouseEvent(y,v,x){const E=x.getCoords(y,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,v,x,E,M){return{x1:y,y1:v,x2:x,y2:E,cols:this._bufferService.cols,fg:M}}};o.Linkifier=_=d([g(1,w.IMouseService),g(2,w.IRenderService),g(3,k.IBufferService),g(4,w.ILinkProviderService)],_)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,y,M):x(_,y))||M);return E>3&&M&&Object.defineProperty(_,y,M),M},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=c(511),b=c(2585);let S=o.OscLinkProvider=class{constructor(w,_,y){this._bufferService=w,this._optionsService=_,this._oscLinkService=y}provideLinks(w,_){var O;const y=this._bufferService.buffer.lines.get(w-1);if(!y)return void _(void 0);const v=[],x=this._optionsService.rawOptions.linkHandler,E=new f.CellData,M=y.getTrimmedLength();let R=-1,N=-1,D=!1;for(let P=0;P<M;P++)if(N!==-1||y.hasContent(P)){if(y.loadCell(P,E),E.hasExtendedAttrs()&&E.extended.urlId){if(N===-1){N=P,R=E.extended.urlId;continue}D=E.extended.urlId!==R}else N!==-1&&(D=!0);if(D||N!==-1&&P===M-1){const $=(O=this._oscLinkService.getLinkData(R))==null?void 0:O.uri;if($){const U={start:{x:N+1,y:w},end:{x:P+(D||P!==M-1?0:1),y:w}};let q=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const Y=new URL($);["http:","https:"].includes(Y.protocol)||(q=!0)}catch{q=!0}q||v.push({text:$,range:U,activate:(Y,K)=>x?x.activate(Y,K,U):k(0,K),hover:(Y,K)=>{var V;return(V=x==null?void 0:x.hover)==null?void 0:V.call(x,Y,K,U)},leave:(Y,K)=>{var V;return(V=x==null?void 0:x.leave)==null?void 0:V.call(x,Y,K,U)}})}D=!1,E.hasExtendedAttrs()&&E.extended.urlId?(N=P,R=E.extended.urlId):(N=-1,R=-1)}}_(v)}};function k(w,_){if(confirm(`Do you want to navigate to ${_}?
|
|
466
|
-
|
|
467
|
-
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=S=d([g(0,b.IBufferService),g(1,b.IOptionsService),g(2,b.IOscLinkService)],S)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,d,g){this._rowCount=g,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=c(3614),g=c(3656),f=c(3551),b=c(9042),S=c(3730),k=c(1680),w=c(3107),_=c(5744),y=c(2950),v=c(1296),x=c(428),E=c(4269),M=c(5114),R=c(8934),N=c(3230),D=c(9312),O=c(4725),P=c(6731),$=c(8055),U=c(8969),q=c(8460),Y=c(844),K=c(6114),V=c(8437),Q=c(2584),J=c(7399),F=c(5941),j=c(9074),I=c(2585),L=c(5435),z=c(4567),X=c(779);class ee extends U.CoreTerminal{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}constructor(W={}){super(W),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,re)=>this.refresh(H,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,Y.toDisposable)((()=>{var H,re;this._customKeyEventHandler=void 0,(re=(H=this.element)==null?void 0:H.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const H of W){let re,ae="";switch(H.index){case 256:re="foreground",ae="10";break;case 257:re="background",ae="11";break;case 258:re="cursor",ae="12";break;default:re="ansi",ae="4;"+H.index}switch(H.type){case 0:const pe=$.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ae};${(0,F.toRgbString)(pe)}${Q.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((ce=>ce.ansi[H.index]=$.channels.toColor(...H.color)));else{const ce=re;this._themeService.modifyColors((Oe=>Oe[ce]=$.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const W=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(W);if(!H)return;const re=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=H.getWidth(re),ce=this._renderService.dimensions.css.cell.width*pe,Oe=this.buffer.y*this._renderService.dimensions.css.cell.height,Be=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Be+"px",this.textarea.style.top=Oe+"px",this.textarea.style.width=ce+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,d.copyHandler)(H,this._selectionService)})));const W=H=>(0,d.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,g.addDisposableDomListener)(this.element,"paste",W)),K.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,d.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var re,ae,pe;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),K.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,(ae=W.ownerDocument.defaultView)!=null?ae:window,((pe=this._document)!=null?pe:typeof window<"u")?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(D.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),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(z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,H=this.element;function re(ce){const Oe=W._mouseService.getMouseReportCoords(ce,W.screenElement);if(!Oe)return!1;let Be,$e;switch(ce.overrideType||ce.type){case"mousemove":$e=32,ce.buttons===void 0?(Be=3,ce.button!==void 0&&(Be=ce.button<3?ce.button:3)):Be=1&ce.buttons?0:4&ce.buttons?1:2&ce.buttons?2:3;break;case"mouseup":$e=0,Be=ce.button<3?ce.button:3;break;case"mousedown":$e=1,Be=ce.button<3?ce.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ce)===!1||W.viewport.getLinesScrolled(ce)===0)return!1;$e=ce.deltaY<0?0:1,Be=4;break;default:return!1}return!($e===void 0||Be===void 0||Be>4)&&W.coreMouseService.triggerMouseEvent({col:Oe.col,row:Oe.row,x:Oe.x,y:Oe.y,button:Be,action:$e,ctrl:ce.ctrlKey,alt:ce.altKey,shift:ce.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:ce=>(re(ce),ce.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(ce)),wheel:ce=>(re(ce),this.cancel(ce,!0)),mousedrag:ce=>{ce.buttons&&re(ce)},mousemove:ce=>{ce.buttons||re(ce)}};this.register(this.coreMouseService.onProtocolChange((ce=>{ce?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ce)),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()),8&ce?ae.mousemove||(H.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(H.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&ce?ae.wheel||(H.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(H.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&ce?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&ce?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(H,"mousedown",(ce=>{if(ce.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ce))return re(ce),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(ce)}))),this.register((0,g.addDisposableDomListener)(H,"wheel",(ce=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ce)===!1)return!1;if(!this.buffer.hasScrollback){const Oe=this.viewport.getLinesScrolled(ce);if(Oe===0)return;const Be=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ce.deltaY<0?"A":"B");let $e="";for(let ut=0;ut<Math.abs(Oe);ut++)$e+=Be;return this.coreService.triggerDataEvent($e,!0),this.cancel(ce,!0)}return this.viewport.handleWheel(ce)?this.cancel(ce):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(H,"touchstart",(ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ce),this.cancel(ce)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(H,"touchmove",(ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ce)?void 0:this.cancel(ce)}),{passive:!1}))}refresh(W,H){var re;(re=this._renderService)==null||re.refreshRows(W,H)}updateCursorStyle(W){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(W)?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(W,H,re=0){var ae;re===1?(super.scrollLines(W,H,re),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(W)}paste(W){(0,d.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,H,re){this._selectionService.setSelection(W,H,re)}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(){var W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,H){var re;(re=this._selectionService)==null||re.selectLines(W,H)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!H&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,J.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),re.type===3||re.type===2){const ae=this.rows-1;return this.scrollLines(re.type===2?-ae:ae),this.cancel(W,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(re.cancel&&this.cancel(W,!0),!re.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==Q.C0.ETX&&re.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,H){const re=W.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||W.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||W.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?re:re&&(!H.keyCode||H.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)H=W.charCode;else if(W.which===null||W.which===void 0)H=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;H=W.which}return!(!H||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=W.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(W),!0}return!1}resize(W,H){W!==this.cols||H!==this.rows?super.resize(W,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,H){var re,ae;(re=this._charSizeService)==null||re.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var W;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var H,re;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case L.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${re};${H}t`);break;case L.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${pe};${ae}t`)}}cancel(W,H){if(this.options.cancelEvents||H)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=ee},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,g){this._rowCount=g,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=f-this._lastRefreshMs,S=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var M,R=arguments.length,N=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(M=y[D])&&(N=(R<3?M(N):R>3?M(v,x,N):M(v,x))||N);return R>3&&N&&Object.defineProperty(v,x,N),N},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=c(3656),b=c(4725),S=c(8460),k=c(844),w=c(2585);let _=o.Viewport=class extends k.Disposable{constructor(y,v,x,E,M,R,N,D){super(),this._viewportElement=y,this._scrollArea=v,this._bufferService=x,this._optionsService=E,this._charSizeService=M,this._renderService=R,this._coreBrowserService=N,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(D.colors),this.register(D.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const v=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==v&&(this._lastRecordedBufferHeight=v,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const v=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,v){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&x<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const v=this._getPixelsScrolled(y);return v!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+v:this._smoothScrollState.target+=v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=v,this._bubbleScroll(y,v))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(y,v){var D;let x,E="";const M=[],R=v!=null?v:this._bufferService.buffer.lines.length,N=this._bufferService.buffer.lines;for(let O=y;O<R;O++){const P=N.get(O);if(!P)continue;const $=(D=N.get(O+1))==null?void 0:D.isWrapped;if(E+=P.translateToString(!$),!$||O===N.length-1){const U=document.createElement("div");U.textContent=E,M.push(U),E.length>0&&(x=U),E=""}}return{bufferElements:M,cursorElement:x}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(v/=this._currentRowHeight+0,this._wheelPartialScroll+=v,v=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(y,v){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&v.altKey||x==="ctrl"&&v.ctrlKey||x==="shift"&&v.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const v=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(y,v))}};o.Viewport=_=d([g(2,w.IBufferService),g(3,w.IOptionsService),g(4,b.ICharSizeService),g(5,b.IRenderService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],_)},3107:function(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,y,M):x(_,y))||M);return E>3&&M&&Object.defineProperty(_,y,M),M},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=c(4725),b=c(844),S=c(2585);let k=o.BufferDecorationRenderer=class extends b.Disposable{constructor(w,_,y,v,x){super(),this._screenElement=w,this._bufferService=_,this._coreBrowserService=y,this._decorationService=v,this._renderService=x,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((E=>this._removeDecoration(E)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var v,x;const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((v=w==null?void 0:w.options)==null?void 0:v.layer)==="top"),_.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=(x=w.options.x)!=null?x:0;return y&&y>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(w,_),_}_refreshStyle(w){const _=w.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let y=this._decorationElements.get(w);y||(y=this._createElement(w),w.element=y,this._decorationElements.set(w,y),this._container.appendChild(y),w.onDispose((()=>{this._decorationElements.delete(w),y.remove()}))),y.style.top=_*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(y)}}_refreshXPosition(w,_=w.element){var v;if(!_)return;const y=(v=w.options.x)!=null?v:0;(w.options.anchor||"left")==="right"?_.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var _;(_=this._decorationElements.get(w))==null||_.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=k=d([g(1,S.IBufferService),g(2,f.ICoreBrowserService),g(3,S.IDecorationService),g(4,f.IRenderService)],k)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=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(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,g){return d>=c.startBufferLine-this._linePadding[g||"full"]&&d<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(u,o,c){var d=this&&this.__decorate||function(x,E,M,R){var N,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,M,R);else for(var P=x.length-1;P>=0;P--)(N=x[P])&&(O=(D<3?N(O):D>3?N(E,M,O):N(E,M))||O);return D>3&&O&&Object.defineProperty(E,M,O),O},g=this&&this.__param||function(x,E){return function(M,R){E(M,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=c(5871),b=c(4725),S=c(844),k=c(2585),w={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let v=o.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,E,M,R,N,D,O){var $;super(),this._viewportElement=x,this._screenElement=E,this._bufferService=M,this._decorationService=R,this._renderService=N,this._optionsService=D,this._coreBrowserService=O,this._colorZoneStore=new f.ColorZoneStore,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)==null||$.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const x=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=x,_.center=E,_.right=x,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=_.left,y.right=_.left+_.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const E of x)E.position!=="full"&&this._renderColorZone(E);for(const E of x)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(y[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-w[x.position||"full"]/2),_[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[x.position||"full"]))}_queueRefresh(x,E){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=v=d([g(2,k.IBufferService),g(3,k.IDecorationService),g(4,b.IRenderService),g(5,k.IOptionsService),g(6,b.ICoreBrowserService)],v)},2950:function(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,y,M):x(_,y))||M);return E>3&&M&&Object.defineProperty(_,y,M),M},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=c(4725),b=c(2585),S=c(2584);let k=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,_,y,v,x,E){this._textarea=w,this._compositionView=_,this._bufferService=y,this._optionsService=v,this._coreService=x,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,y=_.replace(w,"");this._dataAlreadySent=y,_.length>w.length?this._coreService.triggerDataEvent(y,!0):_.length<w.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):_.length===w.length&&_!==w&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=v+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=k=d([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,b.ICoreService),g(5,f.IRenderService)],k)},9806:(u,o)=>{function c(d,g,f){const b=f.getBoundingClientRect(),S=d.getComputedStyle(f),k=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-b.left-k,g.clientY-b.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(d,g,f,b,S,k,w,_,y){if(!k)return;const v=c(d,g,f);return v?(v[0]=Math.ceil((v[0]+(y?w/2:0))/w),v[1]=Math.ceil(v[1]/_),v[0]=Math.min(Math.max(v[0],1),b+(y?1:0)),v[1]=Math.min(Math.max(v[1],1),S),v):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=c(2584);function g(_,y,v,x){const E=_-f(_,v),M=y-f(y,v),R=Math.abs(E-M)-(function(N,D,O){let P=0;const $=N-f(N,O),U=D-f(D,O);for(let q=0;q<Math.abs($-U);q++){const Y=b(N,D)==="A"?-1:1,K=O.buffer.lines.get($+Y*q);K!=null&&K.isWrapped&&P++}return P})(_,y,v);return w(R,k(b(_,y),x))}function f(_,y){let v=0,x=y.buffer.lines.get(_),E=x==null?void 0:x.isWrapped;for(;E&&_>=0&&_<y.rows;)v++,x=y.buffer.lines.get(--_),E=x==null?void 0:x.isWrapped;return v}function b(_,y){return _>y?"A":"B"}function S(_,y,v,x,E,M){let R=_,N=y,D="";for(;R!==v||N!==x;)R+=E?1:-1,E&&R>M.cols-1?(D+=M.buffer.translateBufferLineToString(N,!1,_,R),R=0,_=0,N++):!E&&R<0&&(D+=M.buffer.translateBufferLineToString(N,!1,0,_+1),R=M.cols-1,_=R,N--);return D+M.buffer.translateBufferLineToString(N,!1,_,R)}function k(_,y){const v=y?"O":"[";return d.C0.ESC+v+_}function w(_,y){_=Math.floor(_);let v="";for(let x=0;x<_;x++)v+=y;return v}o.moveToCellSequence=function(_,y,v,x){const E=v.buffer.x,M=v.buffer.y;if(!v.buffer.hasScrollback)return(function(D,O,P,$,U,q){return g(O,$,U,q).length===0?"":w(S(D,O,D,O-f(O,U),!1,U).length,k("D",q))})(E,M,0,y,v,x)+g(M,y,v,x)+(function(D,O,P,$,U,q){let Y;Y=g(O,$,U,q).length>0?$-f($,U):O;const K=$,V=(function(Q,J,F,j,I,L){let z;return z=g(F,j,I,L).length>0?j-f(j,I):J,Q<F&&z<=j||Q>=F&&z<j?"C":"D"})(D,O,P,$,U,q);return w(S(D,Y,P,K,V==="C",U).length,k(V,q))})(E,M,_,y,v,x);let R;if(M===y)return R=E>_?"D":"C",w(Math.abs(E-_),k(R,x));R=M>y?"D":"C";const N=Math.abs(M-y);return w((function(D,O){return O.cols-D})(M>y?_:E,v)+(N-1)*v.cols+1+((M>y?E:_)-1),k(R,x))}},1296:function(u,o,c){var d=this&&this.__decorate||function(q,Y,K,V){var Q,J=arguments.length,F=J<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,K):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(q,Y,K,V);else for(var j=q.length-1;j>=0;j--)(Q=q[j])&&(F=(J<3?Q(F):J>3?Q(Y,K,F):Q(Y,K))||F);return J>3&&F&&Object.defineProperty(Y,K,F),F},g=this&&this.__param||function(q,Y){return function(K,V){Y(K,V,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=c(3787),b=c(2550),S=c(2223),k=c(6171),w=c(6052),_=c(4725),y=c(8055),v=c(8460),x=c(844),E=c(2585),M="xterm-dom-renderer-owner-",R="xterm-rows",N="xterm-fg-",D="xterm-bg-",O="xterm-focus",P="xterm-selection";let $=1,U=o.DomRenderer=class extends x.Disposable{constructor(q,Y,K,V,Q,J,F,j,I,L,z,X,ee){super(),this._terminal=q,this._document=Y,this._element=K,this._screenElement=V,this._viewportElement=Q,this._helperContainer=J,this._linkifier2=F,this._charSizeService=I,this._optionsService=L,this._bufferService=z,this._coreBrowserService=X,this._themeService=ee,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),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(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((te=>this._injectCss(te)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((te=>this._handleLinkHover(te)))),this.register(this._linkifier2.onHideLinkUnderline((te=>this._handleLinkLeave(te)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.WidthCache(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(){const q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),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/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),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(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${R} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(q.foreground,.5).css};}`,Y+=`${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;}`;const K=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${Q} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,Y+=`${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[J,F]of q.ansi.entries())Y+=`${this._terminalSelector} .${N}${J} { color: ${F.css}; }${this._terminalSelector} .${N}${J}.xterm-dim { color: ${y.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${D}${J} { background-color: ${F.css}; }`;Y+=`${this._terminalSelector} .${N}${S.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(q.background).css}; }${this._terminalSelector} .${N}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,Y){for(let K=this._rowElements.length;K<=Y;K++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,Y){this._refreshRowElements(q,Y),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(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,Y,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,Y,K),this.renderRows(0,this._bufferService.rows-1),!q||!Y)return;this._selectionRenderModel.update(this._terminal,q,Y,K);const V=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,F=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||F<0)return;const j=this._document.createDocumentFragment();if(K){const I=q[0]>Y[0];j.appendChild(this._createSelectionElement(J,I?Y[0]:q[0],I?q[0]:Y[0],F-J+1))}else{const I=V===J?q[0]:0,L=J===Q?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(J,I,L));const z=F-J-1;if(j.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,z)),J!==F){const X=Q===F?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(F,0,X))}}this._selectionContainer.appendChild(j)}_createSelectionElement(q,Y,K,V=1){const Q=this._document.createElement("div"),J=Y*this.dimensions.css.cell.width;let F=this.dimensions.css.cell.width*(K-Y);return J+F>this.dimensions.css.canvas.width&&(F=this.dimensions.css.canvas.width-J),Q.style.height=V*this.dimensions.css.cell.height+"px",Q.style.top=q*this.dimensions.css.cell.height+"px",Q.style.left=`${J}px`,Q.style.width=`${F}px`,Q}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(const q of this._rowElements)q.replaceChildren()}renderRows(q,Y){const K=this._bufferService.buffer,V=K.ybase+K.y,Q=Math.min(K.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=q;I<=Y;I++){const L=I+K.ydisp,z=this._rowElements[I],X=K.lines.get(L);if(!z||!X)break;z.replaceChildren(...this._rowFactory.createRow(X,L,L===V,F,j,Q,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,Y,K,V,Q,J){K<0&&(q=0),V<0&&(Y=0);const F=this._bufferService.rows-1;K=Math.max(Math.min(K,F),0),V=Math.max(Math.min(V,F),0),Q=Math.min(Q,this._bufferService.cols);const j=this._bufferService.buffer,I=j.ybase+j.y,L=Math.min(j.x,Q-1),z=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let te=K;te<=V;++te){const W=te+j.ydisp,H=this._rowElements[te],re=j.lines.get(W);if(!H||!re)break;H.replaceChildren(...this._rowFactory.createRow(re,W,W===I,X,ee,L,z,this.dimensions.css.cell.width,this._widthCache,J?te===K?q:0:-1,J?(te===V?Y:Q)-1:-1))}}};o.DomRenderer=U=d([g(7,E.IInstantiationService),g(8,_.ICharSizeService),g(9,E.IOptionsService),g(10,E.IBufferService),g(11,_.ICoreBrowserService),g(12,_.IThemeService)],U)},3787:function(u,o,c){var d=this&&this.__decorate||function(R,N,D,O){var P,$=arguments.length,U=$<3?N:O===null?O=Object.getOwnPropertyDescriptor(N,D):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(R,N,D,O);else for(var q=R.length-1;q>=0;q--)(P=R[q])&&(U=($<3?P(U):$>3?P(N,D,U):P(N,D))||U);return $>3&&U&&Object.defineProperty(N,D,U),U},g=this&&this.__param||function(R,N){return function(D,O){N(D,O,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=c(2223),b=c(643),S=c(511),k=c(2585),w=c(8055),_=c(4725),y=c(4269),v=c(6171),x=c(3734);let E=o.DomRendererRowFactory=class{constructor(R,N,D,O,P,$,U){this._document=R,this._characterJoinerService=N,this._optionsService=D,this._coreBrowserService=O,this._coreService=P,this._decorationService=$,this._themeService=U,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,N,D){this._selectionStart=R,this._selectionEnd=N,this._columnSelectMode=D}createRow(R,N,D,O,P,$,U,q,Y,K,V){const Q=[],J=this._characterJoinerService.getJoinedCharacters(N),F=this._themeService.colors;let j,I=R.getNoBgTrimmedLength();D&&I<$+1&&(I=$+1);let L=0,z="",X=0,ee=0,te=0,W=!1,H=0,re=!1,ae=0;const pe=[],ce=K!==-1&&V!==-1;for(let Oe=0;Oe<I;Oe++){R.loadCell(Oe,this._workCell);let Be=this._workCell.getWidth();if(Be===0)continue;let $e=!1,ut=Oe,Me=this._workCell;if(J.length>0&&Oe===J[0][0]){$e=!0;const nt=J.shift();Me=new y.JoinedCellData(this._workCell,R.translateToString(!0,nt[0],nt[1]),nt[1]-nt[0]),ut=nt[1]-1,Be=Me.getWidth()}const vn=this._isCellInSelection(Oe,N),Wt=D&&Oe===$,on=ce&&Oe>=K&&Oe<=V;let Kt=!1;this._decorationService.forEachDecorationAtCell(Oe,N,void 0,(nt=>{Kt=!0}));let $n=Me.getChars()||b.WHITESPACE_CELL_CHAR;if($n===" "&&(Me.isUnderline()||Me.isOverline())&&($n=" "),ae=Be*q-Y.get($n,Me.isBold(),Me.isItalic()),j){if(L&&(vn&&re||!vn&&!re&&Me.bg===X)&&(vn&&re&&F.selectionForeground||Me.fg===ee)&&Me.extended.ext===te&&on===W&&ae===H&&!Wt&&!$e&&!Kt){Me.isInvisible()?z+=b.WHITESPACE_CELL_CHAR:z+=$n,L++;continue}L&&(j.textContent=z),j=this._document.createElement("span"),L=0,z=""}else j=this._document.createElement("span");if(X=Me.bg,ee=Me.fg,te=Me.extended.ext,W=on,H=ae,re=vn,$e&&$>=Oe&&$<=ut&&($=Oe),!this._coreService.isCursorHidden&&Wt&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&pe.push("xterm-cursor-blink"),pe.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(Me.isBold()&&pe.push("xterm-bold"),Me.isItalic()&&pe.push("xterm-italic"),Me.isDim()&&pe.push("xterm-dim"),z=Me.isInvisible()?b.WHITESPACE_CELL_CHAR:Me.getChars()||b.WHITESPACE_CELL_CHAR,Me.isUnderline()&&(pe.push(`xterm-underline-${Me.extended.underlineStyle}`),z===" "&&(z=" "),!Me.isUnderlineColorDefault()))if(Me.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(Me.getUnderlineColor()).join(",")})`;else{let nt=Me.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Me.isBold()&&nt<8&&(nt+=8),j.style.textDecorationColor=F.ansi[nt].css}Me.isOverline()&&(pe.push("xterm-overline"),z===" "&&(z=" ")),Me.isStrikethrough()&&pe.push("xterm-strikethrough"),on&&(j.style.textDecoration="underline");let Dt=Me.getFgColor(),Et=Me.getFgColorMode(),Qt=Me.getBgColor(),he=Me.getBgColorMode();const Se=!!Me.isInverse();if(Se){const nt=Dt;Dt=Qt,Qt=nt;const At=Et;Et=he,he=At}let Re,He,Ve,xt=!1;switch(this._decorationService.forEachDecorationAtCell(Oe,N,void 0,(nt=>{nt.options.layer!=="top"&&xt||(nt.backgroundColorRGB&&(he=50331648,Qt=nt.backgroundColorRGB.rgba>>8&16777215,Re=nt.backgroundColorRGB),nt.foregroundColorRGB&&(Et=50331648,Dt=nt.foregroundColorRGB.rgba>>8&16777215,He=nt.foregroundColorRGB),xt=nt.options.layer==="top")})),!xt&&vn&&(Re=this._coreBrowserService.isFocused?F.selectionBackgroundOpaque:F.selectionInactiveBackgroundOpaque,Qt=Re.rgba>>8&16777215,he=50331648,xt=!0,F.selectionForeground&&(Et=50331648,Dt=F.selectionForeground.rgba>>8&16777215,He=F.selectionForeground)),xt&&pe.push("xterm-decoration-top"),he){case 16777216:case 33554432:Ve=F.ansi[Qt],pe.push(`xterm-bg-${Qt}`);break;case 50331648:Ve=w.channels.toColor(Qt>>16,Qt>>8&255,255&Qt),this._addStyle(j,`background-color:#${M((Qt>>>0).toString(16),"0",6)}`);break;default:Se?(Ve=F.foreground,pe.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Ve=F.background}switch(Re||Me.isDim()&&(Re=w.color.multiplyOpacity(Ve,.5)),Et){case 16777216:case 33554432:Me.isBold()&&Dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Dt+=8),this._applyMinimumContrast(j,Ve,F.ansi[Dt],Me,Re,void 0)||pe.push(`xterm-fg-${Dt}`);break;case 50331648:const nt=w.channels.toColor(Dt>>16&255,Dt>>8&255,255&Dt);this._applyMinimumContrast(j,Ve,nt,Me,Re,He)||this._addStyle(j,`color:#${M(Dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ve,F.foreground,Me,Re,He)||Se&&pe.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}pe.length&&(j.className=pe.join(" "),pe.length=0),Wt||$e||Kt?j.textContent=z:L++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),Q.push(j),Oe=ut}return j&&L&&(j.textContent=z),Q}_applyMinimumContrast(R,N,D,O,P,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const U=this._getContrastCache(O);let q;if(P||$||(q=U.getColor(N.rgba,D.rgba)),q===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);q=w.color.ensureContrastRatio(P||N,$||D,Y),U.setColor((P||N).rgba,($||D).rgba,q!=null?q:null)}return!!q&&(this._addStyle(R,`color:${q.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,N){R.setAttribute("style",`${R.getAttribute("style")||""}${N};`)}_isCellInSelection(R,N){const D=this._selectionStart,O=this._selectionEnd;return!(!D||!O)&&(this._columnSelectMode?D[0]<=O[0]?R>=D[0]&&N>=D[1]&&R<O[0]&&N<=O[1]:R<D[0]&&N>=D[1]&&R>=O[0]&&N<=O[1]:N>D[1]&&N<O[1]||D[1]===O[1]&&N===D[1]&&R>=D[0]&&R<O[0]||D[1]<O[1]&&N===O[1]&&R<O[0]||D[1]<O[1]&&N===D[1]&&R>=D[0])}};function M(R,N,D){for(;R.length<D;)R=N+R;return R}o.DomRendererRowFactory=E=d([g(1,_.ICharacterJoinerService),g(2,k.IOptionsService),g(3,_.ICoreBrowserService),g(4,k.ICoreService),g(5,k.IDecorationService),g(6,_.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,f,b,S],this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(b),this._container.appendChild(S),d.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(c,d,g,f){c===this._font&&d===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=d,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,d,g){let f=0;if(!d&&!g&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(c,0);return k>0&&(this._flat[f]=k),k}let b=c;d&&(b+="B"),g&&(b+="I");let S=this._holey.get(b);if(S===void 0){let k=0;d&&(k|=1),g&&(k|=2),S=this._measure(c,k),S>0&&this._holey.set(b,S)}return S}_measure(c,d){const g=this._measureElements[d];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=d,o.allowRescaling=function(g,f,b,S){return f===1&&b>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!d(g)&&!c(g)&&!(function(k){return 57344<=k&&k<=63743})(g)},o.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(f){return 9472<=f&&f<=9631})(g)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(g,f,b=0){return(g-(2*Math.round(f)-b))%(2*Math.round(f))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(g,f,b,S=!1){if(this.selectionStart=f,this.selectionEnd=b,!f||!b||f[0]===b[0]&&f[1]===b[1])return void this.clear();const k=g.buffers.active.ydisp,w=f[1]-k,_=b[1]-k,y=Math.max(w,0),v=Math.min(_,g.rows-1);y>=g.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=_,this.viewportCappedStartRow=y,this.viewportCappedEndRow=v,this.startCol=f[0],this.endCol=b[0])}isCellSelected(g,f,b){return!!this.hasSelection&&(b-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&b>=this.viewportCappedStartRow&&f<this.endCol&&b<=this.viewportCappedEndRow:f<this.startCol&&b>=this.viewportCappedStartRow&&f>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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.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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,M){var R,N=arguments.length,D=N<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(N<3?R(D):N>3?R(x,E,D):R(x,E))||D);return N>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=c(2585),b=c(8460),S=c(844);let k=o.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,x,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new _(v,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())}};o.CharSizeService=k=d([g(2,f.IOptionsService)],k);class w extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,E){x!==void 0&&x>0&&E!==void 0&&E>0&&(this._result.width=x,this._result.height=E)}}class _ extends w{constructor(x,E,M){super(),this._document=x,this._parentElement=E,this._optionsService=M,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}}class y extends w{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var M,R=arguments.length,N=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(M=y[D])&&(N=(R<3?M(N):R>3?M(v,x,N):M(v,x))||N);return R>3&&N&&Object.defineProperty(v,x,N),N},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=c(3734),b=c(643),S=c(511),k=c(2585);class w extends f.AttributeData{constructor(v,x,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=x,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(v){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let _=o.CharacterJoinerService=class MC{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(v){const x={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(x),x.id}deregister(v){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===v)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(v);if(!x||x.length===0)return[];const E=[],M=x.translateToString(!0);let R=0,N=0,D=0,O=x.getFg(0),P=x.getBg(0);for(let $=0;$<x.getTrimmedLength();$++)if(x.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==P){if($-R>1){const U=this._getJoinedRanges(M,D,N,x,R);for(let q=0;q<U.length;q++)E.push(U[q])}R=$,D=N,O=this._workCell.fg,P=this._workCell.bg}N+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const $=this._getJoinedRanges(M,D,N,x,R);for(let U=0;U<$.length;U++)E.push($[U])}return E}_getJoinedRanges(v,x,E,M,R){const N=v.substring(x,E);let D=[];try{D=this._characterJoiners[0].handler(N)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const P=this._characterJoiners[O].handler(N);for(let $=0;$<P.length;$++)MC._mergeRanges(D,P[$])}catch(P){console.error(P)}return this._stringRangesToCellRanges(D,M,R),D}_stringRangesToCellRanges(v,x,E){let M=0,R=!1,N=0,D=v[M];if(D){for(let O=E;O<this._bufferService.cols;O++){const P=x.getWidth(O),$=x.getString(O).length||b.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!R&&D[0]<=N&&(D[0]=O,R=!0),D[1]<=N){if(D[1]=O,D=v[++M],!D)break;D[0]<=N?(D[0]=O,R=!0):R=!1}N+=$}}D&&(D[1]=this._bufferService.cols)}}static _mergeRanges(v,x){let E=!1;for(let M=0;M<v.length;M++){const R=v[M];if(E){if(x[1]<=R[0])return v[M-1][1]=x[1],v;if(x[1]<=R[1])return v[M-1][1]=Math.max(x[1],R[1]),v.splice(M,1),v;v.splice(M,1),M--}else{if(x[1]<=R[0])return v.splice(M,0,x),v;if(x[1]<=R[1])return R[0]=Math.min(x[0],R[0]),v;x[0]<R[1]&&(R[0]=Math.min(x[0],R[0]),E=!0)}}return E?v[v.length-1][1]=x[1]:v.push(x),v}};o.CharacterJoinerService=_=d([g(0,k.IBufferService)],_)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=c(844),g=c(8460),f=c(3656);class b extends d.Disposable{constructor(w,_,y){super(),this._textarea=w,this._window=_,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,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}}o.CoreBrowserService=b;class S extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=c(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const S=this.linkProviders.indexOf(b);S!==-1&&this.linkProviders.splice(S,1)}}}}o.LinkProviderService=g},8934:function(u,o,c){var d=this&&this.__decorate||function(k,w,_,y){var v,x=arguments.length,E=x<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(k,w,_,y);else for(var M=k.length-1;M>=0;M--)(v=k[M])&&(E=(x<3?v(E):x>3?v(w,_,E):v(w,_))||E);return x>3&&E&&Object.defineProperty(w,_,E),E},g=this&&this.__param||function(k,w){return function(_,y){w(_,y,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=c(4725),b=c(9806);let S=o.MouseService=class{constructor(k,w){this._renderService=k,this._charSizeService=w}getCoords(k,w,_,y,v){return(0,b.getCoords)(window,k,w,_,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(k,w){const _=(0,b.getCoordsRelativeToElement)(window,k,w);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};o.MouseService=S=d([g(0,f.IRenderService),g(1,f.ICharSizeService)],S)},3230:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,M){var R,N=arguments.length,D=N<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(N<3?R(D):N>3?R(x,E,D):R(x,E))||D);return N>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=c(6193),b=c(4725),S=c(8460),k=c(844),w=c(7226),_=c(2585);let y=o.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,x,E,M,R,N,D,O){super(),this._rowCount=v,this._charSizeService=M,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((P,$)=>this._renderRows(P,$)),D),this.register(this._renderDebouncer),this.register(D.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(N.onResize((()=>this._fullRefresh()))),this.register(N.buffers.onBufferActivate((()=>{var P;return(P=this._renderer.value)==null?void 0:P.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(N.cols,N.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(N.buffer.y,N.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(D.window,x),this.register(D.onWindowChange((P=>this._registerIntersectionObserver(P,x))))}_registerIntersectionObserver(v,x){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});E.observe(x),this._observerDisposable.value=(0,k.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.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(v,x,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,x,this._rowCount))}_renderRows(v,x){this._renderer.value&&(v=Math.min(v,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(v,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:x}),this._onRender.fire({start:v,end:x}),this._isNextRenderRedrawOnly=!0)}resize(v,x){this._rowCount=x,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(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var v,x;this._renderer.value&&((x=(v=this._renderer.value).clearTextureAtlas)==null||x.call(v),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(v,x)})):this._renderer.value.handleResize(v,x),this._fullRefresh())}handleCharSizeChanged(){var v;(v=this._renderer.value)==null||v.handleCharSizeChanged()}handleBlur(){var v;(v=this._renderer.value)==null||v.handleBlur()}handleFocus(){var v;(v=this._renderer.value)==null||v.handleFocus()}handleSelectionChanged(v,x,E){var M;this._selectionState.start=v,this._selectionState.end=x,this._selectionState.columnSelectMode=E,(M=this._renderer.value)==null||M.handleSelectionChanged(v,x,E)}handleCursorMove(){var v;(v=this._renderer.value)==null||v.handleCursorMove()}clear(){var v;(v=this._renderer.value)==null||v.clear()}};o.RenderService=y=d([g(2,_.IOptionsService),g(3,b.ICharSizeService),g(4,_.IDecorationService),g(5,_.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],y)},9312:function(u,o,c){var d=this&&this.__decorate||function(D,O,P,$){var U,q=arguments.length,Y=q<3?O:$===null?$=Object.getOwnPropertyDescriptor(O,P):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(D,O,P,$);else for(var K=D.length-1;K>=0;K--)(U=D[K])&&(Y=(q<3?U(Y):q>3?U(O,P,Y):U(O,P))||Y);return q>3&&Y&&Object.defineProperty(O,P,Y),Y},g=this&&this.__param||function(D,O){return function(P,$){O(P,$,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=c(9806),b=c(9504),S=c(456),k=c(4725),w=c(8460),_=c(844),y=c(6114),v=c(4841),x=c(511),E=c(2585),M=" ",R=new RegExp(M,"g");let N=o.SelectionService=class extends _.Disposable{constructor(D,O,P,$,U,q,Y,K,V){super(),this._element=D,this._screenElement=O,this._linkifier=P,this._bufferService=$,this._coreService=U,this._mouseService=q,this._optionsService=Y,this._renderService=K,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!D||!O||D[0]===O[0]&&D[1]===O[1])}get selectionText(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!D||!O)return"";const P=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(D[0]===O[0])return"";const U=D[0]<O[0]?D[0]:O[0],q=D[0]<O[0]?O[0]:D[0];for(let Y=D[1];Y<=O[1];Y++){const K=P.translateBufferLineToString(Y,!0,U,q);$.push(K)}}else{const U=D[1]===O[1]?O[0]:void 0;$.push(P.translateBufferLineToString(D[1],!0,D[0],U));for(let q=D[1]+1;q<=O[1]-1;q++){const Y=P.lines.get(q),K=P.translateBufferLineToString(q,!0);Y!=null&&Y.isWrapped?$[$.length-1]+=K:$.push(K)}if(D[1]!==O[1]){const q=P.lines.get(O[1]),Y=P.translateBufferLineToString(O[1],!0,0,O[0]);q&&q.isWrapped?$[$.length-1]+=Y:$.push(Y)}}return $.map((U=>U.replace(R," "))).join(y.isWindows?`\r
|
|
468
|
-
`:`
|
|
469
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(D){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&D&&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(D){const O=this._getMouseBufferCoords(D),P=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(P&&$&&O)&&this._areCoordsInSelection(O,P,$)}isCellInSelection(D,O){const P=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!P||!$)&&this._areCoordsInSelection([D,O],P,$)}_areCoordsInSelection(D,O,P){return D[1]>O[1]&&D[1]<P[1]||O[1]===P[1]&&D[1]===O[1]&&D[0]>=O[0]&&D[0]<P[0]||O[1]<P[1]&&D[1]===P[1]&&D[0]<P[0]||O[1]<P[1]&&D[1]===O[1]&&D[0]>=O[0]}_selectWordAtCursor(D,O){var U,q;const P=(q=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:q.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(D);return!!$&&(this._selectWordAt($,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(D,O){this._model.clearSelection(),D=Math.max(D,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,D],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(D){this._model.handleTrim(D)&&this.refresh()}_getMouseBufferCoords(D){const O=this._mouseService.getCoords(D,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(D){let O=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,D,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=P?0:(O>P&&(O-=P),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(D){return y.isMac?D.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:D.shiftKey}handleMouseDown(D){if(this._mouseDownTimeStamp=D.timeStamp,(D.button!==2||!this.hasSelection)&&D.button===0){if(!this._enabled){if(!this.shouldForceSelection(D))return;D.stopPropagation()}D.preventDefault(),this._dragScrollAmount=0,this._enabled&&D.shiftKey?this._handleIncrementalClick(D):D.detail===1?this._handleSingleClick(D):D.detail===2?this._handleDoubleClick(D):D.detail===3&&this._handleTripleClick(D),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()),50)}_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(D){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(D))}_handleSingleClick(D){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(D)?3:0,this._model.selectionStart=this._getMouseBufferCoords(D),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(D){this._selectWordAtCursor(D,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(D){const O=this._getMouseBufferCoords(D);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(D){return D.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(D){if(D.stopImmediatePropagation(),!this._model.selectionStart)return;const O=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(D),!this._model.selectionEnd)return void this.refresh(!0);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(D),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const $=P.lines.get(this._model.selectionEnd[1]);$&&$.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[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});const D=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(D.ydisp+this._bufferService.rows,D.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=D.ydisp),this.refresh()}}_handleMouseUp(D){const O=D.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&D.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(D,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const $=(0,b.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,P=!(!D||!O||D[0]===O[0]&&D[1]===O[1]);P?D&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&D[0]===this._oldSelectionStart[0]&&D[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(D,O,P)):this._oldHasSelection&&this._fireOnSelectionChange(D,O,P)}_fireOnSelectionChange(D,O,P){this._oldSelectionStart=D,this._oldSelectionEnd=O,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(D){this.clearSelection(),this._trimListener.dispose(),this._trimListener=D.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(D,O){let P=O;for(let $=0;O>=$;$++){const U=D.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:U>1&&O!==$&&(P+=U-1)}return P}setSelection(D,O,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[D,O],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(D){this._isClickInSelection(D)||(this._selectWordAtCursor(D,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(D,O,P=!0,$=!0){if(D[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,q=U.lines.get(D[1]);if(!q)return;const Y=U.translateBufferLineToString(D[1],!1);let K=this._convertViewportColToCharacterIndex(q,D[0]),V=K;const Q=D[0]-K;let J=0,F=0,j=0,I=0;if(Y.charAt(K)===" "){for(;K>0&&Y.charAt(K-1)===" ";)K--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let X=D[0],ee=D[0];q.getWidth(X)===0&&(J++,X--),q.getWidth(ee)===2&&(F++,ee++);const te=q.getString(ee).length;for(te>1&&(I+=te-1,V+=te-1);X>0&&K>0&&!this._isCharWordSeparator(q.loadCell(X-1,this._workCell));){q.loadCell(X-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,X--):W>1&&(j+=W-1,K-=W-1),K--,X--}for(;ee<q.length&&V+1<Y.length&&!this._isCharWordSeparator(q.loadCell(ee+1,this._workCell));){q.loadCell(ee+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(F++,ee++):W>1&&(I+=W-1,V+=W-1),V++,ee++}}V++;let L=K+Q-J+j,z=Math.min(this._bufferService.cols,V-K+J+F-j-I);if(O||Y.slice(K,V).trim()!==""){if(P&&L===0&&q.getCodePoint(0)!==32){const X=U.lines.get(D[1]-1);if(X&&q.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,D[1]-1],!1,!0,!1);if(ee){const te=this._bufferService.cols-ee.start;L-=te,z+=te}}}if($&&L+z===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const X=U.lines.get(D[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const ee=this._getWordAt([0,D[1]+1],!1,!1,!0);ee&&(z+=ee.length)}}return{start:L,length:z}}}_selectWordAt(D,O){const P=this._getWordAt(D,O);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,D[1]--;this._model.selectionStart=[P.start,D[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(D){const O=this._getWordAt(D,!0);if(O){let P=D[1];for(;O.start<0;)O.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,P]}}_isCharWordSeparator(D){return D.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(D.getChars())>=0}_selectLineAt(D){const O=this._bufferService.buffer.getWrappedRangeForLine(D),P={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(P,this._bufferService.cols)}};o.SelectionService=N=d([g(3,E.IBufferService),g(4,E.ICoreService),g(5,k.IMouseService),g(6,E.IOptionsService),g(7,k.IRenderService),g(8,k.ICoreBrowserService)],N)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const d=c(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(u,o,c){var d=this&&this.__decorate||function(N,D,O,P){var $,U=arguments.length,q=U<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,O):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(N,D,O,P);else for(var Y=N.length-1;Y>=0;Y--)($=N[Y])&&(q=(U<3?$(q):U>3?$(D,O,q):$(D,O))||q);return U>3&&q&&Object.defineProperty(D,O,q),q},g=this&&this.__param||function(N,D){return function(O,P){D(O,P,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),b=c(8055),S=c(8460),k=c(844),w=c(2585),_=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),v=b.css.toColor("#ffffff"),x=b.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],D=[0,95,135,175,215,255];for(let O=0;O<216;O++){const P=D[O/36%6|0],$=D[O/6%6|0],U=D[O%6];N.push({css:b.channels.toCss(P,$,U),rgba:b.channels.toRgba(P,$,U)})}for(let O=0;O<24;O++){const P=8+10*O;N.push({css:b.channels.toCss(P,P,P),rgba:b.channels.toRgba(P,P,P)})}return N})());let M=o.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:y,cursor:v,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:b.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:b.color.blend(y,E),ansi:o.DEFAULT_ANSI_COLORS.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))))}_setTheme(N={}){const D=this._colors;if(D.foreground=R(N.foreground,_),D.background=R(N.background,y),D.cursor=R(N.cursor,v),D.cursorAccent=R(N.cursorAccent,x),D.selectionBackgroundTransparent=R(N.selectionBackground,E),D.selectionBackgroundOpaque=b.color.blend(D.background,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundTransparent=R(N.selectionInactiveBackground,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundOpaque=b.color.blend(D.background,D.selectionInactiveBackgroundTransparent),D.selectionForeground=N.selectionForeground?R(N.selectionForeground,b.NULL_COLOR):void 0,D.selectionForeground===b.NULL_COLOR&&(D.selectionForeground=void 0),b.color.isOpaque(D.selectionBackgroundTransparent)&&(D.selectionBackgroundTransparent=b.color.opacity(D.selectionBackgroundTransparent,.3)),b.color.isOpaque(D.selectionInactiveBackgroundTransparent)&&(D.selectionInactiveBackgroundTransparent=b.color.opacity(D.selectionInactiveBackgroundTransparent,.3)),D.ansi=o.DEFAULT_ANSI_COLORS.slice(),D.ansi[0]=R(N.black,o.DEFAULT_ANSI_COLORS[0]),D.ansi[1]=R(N.red,o.DEFAULT_ANSI_COLORS[1]),D.ansi[2]=R(N.green,o.DEFAULT_ANSI_COLORS[2]),D.ansi[3]=R(N.yellow,o.DEFAULT_ANSI_COLORS[3]),D.ansi[4]=R(N.blue,o.DEFAULT_ANSI_COLORS[4]),D.ansi[5]=R(N.magenta,o.DEFAULT_ANSI_COLORS[5]),D.ansi[6]=R(N.cyan,o.DEFAULT_ANSI_COLORS[6]),D.ansi[7]=R(N.white,o.DEFAULT_ANSI_COLORS[7]),D.ansi[8]=R(N.brightBlack,o.DEFAULT_ANSI_COLORS[8]),D.ansi[9]=R(N.brightRed,o.DEFAULT_ANSI_COLORS[9]),D.ansi[10]=R(N.brightGreen,o.DEFAULT_ANSI_COLORS[10]),D.ansi[11]=R(N.brightYellow,o.DEFAULT_ANSI_COLORS[11]),D.ansi[12]=R(N.brightBlue,o.DEFAULT_ANSI_COLORS[12]),D.ansi[13]=R(N.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),D.ansi[14]=R(N.brightCyan,o.DEFAULT_ANSI_COLORS[14]),D.ansi[15]=R(N.brightWhite,o.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const O=Math.min(D.ansi.length-16,N.extendedAnsi.length);for(let P=0;P<O;P++)D.ansi[P+16]=R(N.extendedAnsi[P],o.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){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[N]=this._restoreColors.ansi[N]}else for(let D=0;D<this._restoreColors.ansi.length;++D)this._colors.ansi[D]=this._restoreColors.ansi[D]}modifyColors(N){N(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()}}};function R(N,D){if(N!==void 0)try{return b.css.toColor(N)}catch{}return D}o.ThemeService=M=d([g(0,w.IOptionsService)],M)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=c(8460),g=c(844);class f extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const k=new Array(S);for(let w=0;w<Math.min(S,this.length);w++)k[w]=this._array[this._getCyclicIndex(w)];this._array=k,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let k=this._length;k<S;k++)this._array[k]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,k){this._array[this._getCyclicIndex(S)]=k}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,k,...w){if(k){for(let _=S;_<this._length-k;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+k)];this._length-=k,this.onDeleteEmitter.fire({index:S,amount:k})}for(let _=this._length-1;_>=S;_--)this._array[this._getCyclicIndex(_+w.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<w.length;_++)this._array[this._getCyclicIndex(S+_)]=w[_];if(w.length&&this.onInsertEmitter.fire({index:S,amount:w.length}),this._length+w.length>this._maxLength){const _=this._length+w.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=w.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,k,w){if(!(k<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let y=k-1;y>=0;y--)this.set(S+y+w,this.get(S+y));const _=S+k+w-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<k;_++)this.set(S+_+w,this.get(S+_))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}o.CircularList=f},1439:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(d,g=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const b in d)f[b]=g<=1?d[b]:d[b]&&c(d[b],g-1);return f}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,d=0,g=0,f=0;var b,S,k,w,_;function y(x){const E=x.toString(16);return E.length<2?"0"+E:E}function v(x,E){return x<E?(E+.05)/(x+.05):(x+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(E,M,R,N){return N!==void 0?`#${y(E)}${y(M)}${y(R)}${y(N)}`:`#${y(E)}${y(M)}${y(R)}`},x.toRgba=function(E,M,R,N=255){return(E<<24|M<<16|R<<8|N)>>>0},x.toColor=function(E,M,R,N){return{css:x.toCss(E,M,R,N),rgba:x.toRgba(E,M,R,N)}}})(b||(o.channels=b={})),(function(x){function E(M,R){return f=Math.round(255*R),[c,d,g]=_.toChannels(M.rgba),{css:b.toCss(c,d,g,f),rgba:b.toRgba(c,d,g,f)}}x.blend=function(M,R){if(f=(255&R.rgba)/255,f===1)return{css:R.css,rgba:R.rgba};const N=R.rgba>>24&255,D=R.rgba>>16&255,O=R.rgba>>8&255,P=M.rgba>>24&255,$=M.rgba>>16&255,U=M.rgba>>8&255;return c=P+Math.round((N-P)*f),d=$+Math.round((D-$)*f),g=U+Math.round((O-U)*f),{css:b.toCss(c,d,g),rgba:b.toRgba(c,d,g)}},x.isOpaque=function(M){return(255&M.rgba)==255},x.ensureContrastRatio=function(M,R,N){const D=_.ensureContrastRatio(M.rgba,R.rgba,N);if(D)return b.toColor(D>>24&255,D>>16&255,D>>8&255)},x.opaque=function(M){const R=(255|M.rgba)>>>0;return[c,d,g]=_.toChannels(R),{css:b.toCss(c,d,g),rgba:R}},x.opacity=E,x.multiplyOpacity=function(M,R){return f=255&M.rgba,E(M,f*R/255)},x.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(S||(o.color=S={})),(function(x){let E,M;try{const R=document.createElement("canvas");R.width=1,R.height=1;const N=R.getContext("2d",{willReadFrequently:!0});N&&(E=N,E.globalCompositeOperation="copy",M=E.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),b.toColor(c,d,g);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),f=parseInt(R.slice(4,5).repeat(2),16),b.toColor(c,d,g,f);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const N=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return c=parseInt(N[1]),d=parseInt(N[2]),g=parseInt(N[3]),f=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(c,d,g,f);if(!E||!M)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=M,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,d,g,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,d,g,f),css:R}}})(k||(o.css=k={})),(function(x){function E(M,R,N){const D=M/255,O=R/255,P=N/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}x.relativeLuminance=function(M){return E(M>>16&255,M>>8&255,255&M)},x.relativeLuminance2=E})(w||(o.rgb=w={})),(function(x){function E(R,N,D){const O=R>>24&255,P=R>>16&255,$=R>>8&255;let U=N>>24&255,q=N>>16&255,Y=N>>8&255,K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));for(;K<D&&(U>0||q>0||Y>0);)U-=Math.max(0,Math.ceil(.1*U)),q-=Math.max(0,Math.ceil(.1*q)),Y-=Math.max(0,Math.ceil(.1*Y)),K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));return(U<<24|q<<16|Y<<8|255)>>>0}function M(R,N,D){const O=R>>24&255,P=R>>16&255,$=R>>8&255;let U=N>>24&255,q=N>>16&255,Y=N>>8&255,K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));for(;K<D&&(U<255||q<255||Y<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),q=Math.min(255,q+Math.ceil(.1*(255-q))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));return(U<<24|q<<16|Y<<8|255)>>>0}x.blend=function(R,N){if(f=(255&N)/255,f===1)return N;const D=N>>24&255,O=N>>16&255,P=N>>8&255,$=R>>24&255,U=R>>16&255,q=R>>8&255;return c=$+Math.round((D-$)*f),d=U+Math.round((O-U)*f),g=q+Math.round((P-q)*f),b.toRgba(c,d,g)},x.ensureContrastRatio=function(R,N,D){const O=w.relativeLuminance(R>>8),P=w.relativeLuminance(N>>8);if(v(O,P)<D){if(P<O){const q=E(R,N,D),Y=v(O,w.relativeLuminance(q>>8));if(Y<D){const K=M(R,N,D);return Y>v(O,w.relativeLuminance(K>>8))?q:K}return q}const $=M(R,N,D),U=v(O,w.relativeLuminance($>>8));if(U<D){const q=E(R,N,D);return U>v(O,w.relativeLuminance(q>>8))?$:q}return $}},x.reduceLuminance=E,x.increaseLuminance=M,x.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(_||(o.rgba=_={})),o.toPaddedHex=y,o.contrastRatio=v},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=c(844),g=c(2585),f=c(4348),b=c(7866),S=c(744),k=c(7302),w=c(6975),_=c(8460),y=c(1753),v=c(1480),x=c(7994),E=c(9282),M=c(5435),R=c(5981),N=c(2660);let D=!1;class O extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event(($=>{var U;(U=this._onScrollApi)==null||U.fire($.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($){for(const U in $)this.optionsService.options[U]=$[U]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(N.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((U,q)=>this._inputHandler.parse(U,q)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,U){this._writeBuffer.write($,U)}writeSync($,U){this._logService.logLevel<=g.LogLevelEnum.WARN&&!D&&(this._logService.warn("writeSync is unreliable and will be removed soon."),D=!0),this._writeBuffer.writeSync($,U)}input($,U=!0){this.coreService.triggerDataEvent($,U)}resize($,U){isNaN($)||isNaN(U)||($=Math.max($,S.MINIMUM_COLS),U=Math.max(U,S.MINIMUM_ROWS),this._bufferService.resize($,U))}scroll($,U=!1){this._bufferService.scroll($,U)}scrollLines($,U,q){this._bufferService.scrollLines($,U,q)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const U=$-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler($,U){return this._inputHandler.registerEscHandler($,U)}registerDcsHandler($,U){return this._inputHandler.registerDcsHandler($,U)}registerCsiHandler($,U){return this._inputHandler.registerCsiHandler($,U)}registerOscHandler($,U){return this._inputHandler.registerOscHandler($,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?$=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const U of $)U.dispose()}))}}}o.CoreTerminal=O},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,d){return c((g=>d.fire(g)))},o.runAndSubscribe=function(c,d){return d(void 0),c((g=>d(g)))}},5435:function(u,o,c){var d=this&&this.__decorate||function(J,F,j,I){var L,z=arguments.length,X=z<3?F:I===null?I=Object.getOwnPropertyDescriptor(F,j):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(J,F,j,I);else for(var ee=J.length-1;ee>=0;ee--)(L=J[ee])&&(X=(z<3?L(X):z>3?L(F,j,X):L(F,j))||X);return z>3&&X&&Object.defineProperty(F,j,X),X},g=this&&this.__param||function(J,F){return function(j,I){F(j,I,J)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=c(2584),b=c(7116),S=c(2015),k=c(844),w=c(482),_=c(8437),y=c(8460),v=c(643),x=c(511),E=c(3734),M=c(2585),R=c(1480),N=c(6242),D=c(6351),O=c(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function U(J,F){if(J>24)return F.setWinLines||!1;switch(J){case 1:return!!F.restoreWin;case 2:return!!F.minimizeWin;case 3:return!!F.setWinPosition;case 4:return!!F.setWinSizePixels;case 5:return!!F.raiseWin;case 6:return!!F.lowerWin;case 7:return!!F.refreshWin;case 8:return!!F.setWinSizeChars;case 9:return!!F.maximizeWin;case 10:return!!F.fullscreenWin;case 11:return!!F.getWinState;case 13:return!!F.getWinPosition;case 14:return!!F.getWinSizePixels;case 15:return!!F.getScreenSizePixels;case 16:return!!F.getCellSizePixels;case 18:return!!F.getWinSizeChars;case 19:return!!F.getScreenSizeChars;case 20:return!!F.getIconTitle;case 21:return!!F.getWinTitle;case 22:return!!F.pushTitle;case 23:return!!F.popTitle;case 24:return!!F.setWinLines}return!1}var q;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let Y=0;class K extends k.Disposable{getAttrData(){return this._curAttrData}constructor(F,j,I,L,z,X,ee,te,W=new S.EscapeSequenceParser){super(),this._bufferService=F,this._charsetService=j,this._coreService=I,this._logService=L,this._optionsService=z,this._oscLinkService=X,this._coreMouseService=ee,this._unicodeService=te,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:re.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,re,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:re,data:ae})})),this._parser.setDcsHandlerFallback(((H,re,ae)=>{re==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:re,payload:ae})})),this._parser.setPrintHandler(((H,re,ae)=>this.print(H,re,ae))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new N.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new N.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new N.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new N.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new N.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new N.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new N.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new N.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new N.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new N.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new N.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new N.OscHandler((H=>this.restoreCursorColor(H)))),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(const H in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new D.DcsHandler(((H,re)=>this.requestStatusString(H,re))))}_preserveStack(F,j,I,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=F,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=I,this._parseStack.position=L}_logSlowResolvingAsync(F){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([F,new Promise(((j,I)=>setTimeout((()=>I("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(F,j){let I,L=this._activeBuffer.x,z=this._activeBuffer.y,X=0;const ee=this._parseStack.paused;if(ee){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(I),I;L=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,F.length>$&&(X=this._parseStack.position+$)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof F=="string"?` "${F}"`:` "${Array.prototype.map.call(F,(H=>String.fromCharCode(H))).join("")}"`),typeof F=="string"?F.split("").map((H=>H.charCodeAt(0))):F),this._parseBuffer.length<F.length&&this._parseBuffer.length<$&&(this._parseBuffer=new Uint32Array(Math.min(F.length,$))),ee||this._dirtyRowTracker.clearRange(),F.length>$)for(let H=X;H<F.length;H+=$){const re=H+$<F.length?H+$:F.length,ae=typeof F=="string"?this._stringDecoder.decode(F.substring(H,re),this._parseBuffer):this._utf8Decoder.decode(F.subarray(H,re),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(L,z,ae,H),this._logSlowResolvingAsync(I),I}else if(!ee){const H=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,H))return this._preserveStack(L,z,H,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===L&&this._activeBuffer.y===z||this._onCursorMove.fire();const te=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(te,this._bufferService.rows-1))}print(F,j,I){let L,z;const X=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,re=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-j>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let pe=this._parser.precedingJoinState;for(let ce=j;ce<I;++ce){if(L=F[ce],L<127&&X){const ut=X[String.fromCharCode(L)];ut&&(L=ut.charCodeAt(0))}const Oe=this._unicodeService.charProperties(L,pe);z=R.UnicodeService.extractWidth(Oe);const Be=R.UnicodeService.extractShouldJoin(Oe),$e=Be?R.UnicodeService.extractWidth(pe):0;if(pe=Oe,ee&&this._onA11yChar.fire((0,w.stringFromCodePoint)(L)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+z-$e>te){if(W){const ut=ae;let Me=this._activeBuffer.x-$e;for(this._activeBuffer.x=$e,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),$e>0&&ae instanceof _.BufferLine&&ae.copyCellsFrom(ut,Me,0,$e,!1);Me<te;)ut.setCellFromCodepoint(Me++,0,1,re)}else if(this._activeBuffer.x=te-1,z===2)continue}if(Be&&this._activeBuffer.x){const ut=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-ut,L,z);for(let Me=z-$e;--Me>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(H&&(ae.insertCells(this._activeBuffer.x,z-$e,this._activeBuffer.getNullCell(re)),ae.getWidth(te-1)===2&&ae.setCellFromCodepoint(te-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,re)),ae.setCellFromCodepoint(this._activeBuffer.x++,L,z,re),z>0)for(;--z;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=pe,this._activeBuffer.x<te&&I-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(F,j){return F.final!=="t"||F.prefix||F.intermediates?this._parser.registerCsiHandler(F,j):this._parser.registerCsiHandler(F,(I=>!U(I.params[0],this._optionsService.rawOptions.windowOptions)||j(I)))}registerDcsHandler(F,j){return this._parser.registerDcsHandler(F,new D.DcsHandler(j))}registerEscHandler(F,j){return this._parser.registerEscHandler(F,j)}registerOscHandler(F,j){return this._parser.registerOscHandler(F,new N.OscHandler(j))}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(){var F;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&&((F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&F.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const F=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-F),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(F=this._bufferService.cols-1){this._activeBuffer.x=Math.min(F,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(F,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=F,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=F,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(F,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+F,this._activeBuffer.y+j)}cursorUp(F){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1)),!0}cursorDown(F){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,F.params[0]||1)):this._moveCursor(0,F.params[0]||1),!0}cursorForward(F){return this._moveCursor(F.params[0]||1,0),!0}cursorBackward(F){return this._moveCursor(-(F.params[0]||1),0),!0}cursorNextLine(F){return this.cursorDown(F),this._activeBuffer.x=0,!0}cursorPrecedingLine(F){return this.cursorUp(F),this._activeBuffer.x=0,!0}cursorCharAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(F){return this._setCursor(F.length>=2?(F.params[1]||1)-1:0,(F.params[0]||1)-1),!0}charPosAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(F){return this._moveCursor(F.params[0]||1,0),!0}linePosAbsolute(F){return this._setCursor(this._activeBuffer.x,(F.params[0]||1)-1),!0}vPositionRelative(F){return this._moveCursor(0,F.params[0]||1),!0}hVPosition(F){return this.cursorPosition(F),!0}tabClear(F){const j=F.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=F.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=F.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(F){const j=F.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(F,j,I,L=!1,z=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);X.replaceCells(j,I,this._activeBuffer.getNullCell(this._eraseAttrData()),z),L&&(X.isWrapped=!1)}_resetBufferLine(F,j=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+F),I.isWrapped=!1)}eraseInDisplay(F,j=!1){let I;switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);I<this._bufferService.rows;I++)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(0);break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(F,j=!1){switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(F){this._restrictCursor();let j=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-L+1;for(;j--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(F){this._restrictCursor();let j=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let L;for(L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,L=this._bufferService.rows-1+this._activeBuffer.ybase-L;j--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(F){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.insertCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(F){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(F){let j=F.params[0]||1;for(;j--;)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(F){let j=F.params[0]||1;for(;j--;)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(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(F){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(F.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(F){const j=this._parser.precedingJoinState;if(!j)return!0;const I=F.params[0]||1,L=R.UnicodeService.extractWidth(j),z=this._activeBuffer.x-L,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(z),ee=new Uint32Array(X.length*I);let te=0;for(let H=0;H<X.length;){const re=X.codePointAt(H)||0;ee[te++]=re,H+=re>65535?2:1}let W=te;for(let H=1;H<I;++H)ee.copyWithin(W,0,te),W+=te;return this.print(ee,0,W),!0}sendDeviceAttributesPrimary(F){return F.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(F){return F.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(F.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(F){return(this._optionsService.rawOptions.termName+"").indexOf(F)===0}setMode(F){for(let j=0;j<F.length;j++)switch(F.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(F){for(let j=0;j<F.length;j++)switch(F.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(F){for(let j=0;j<F.length;j++)switch(F.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(F){for(let j=0;j<F.length;j++)switch(F.params[j]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),F.params[j]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(F,j){const I=this._coreService.decPrivateModes,{activeProtocol:L,activeEncoding:z}=this._coreMouseService,X=this._coreService,{buffers:ee,cols:te}=this._bufferService,{active:W,alt:H}=ee,re=this._optionsService.rawOptions,ae=Be=>Be?1:2,pe=F.params[0];return ce=pe,Oe=j?pe===2?4:pe===4?ae(X.modes.insertMode):pe===12?3:pe===20?ae(re.convertEol):0:pe===1?ae(I.applicationCursorKeys):pe===3?re.windowOptions.setWinLines?te===80?2:te===132?1:0:0:pe===6?ae(I.origin):pe===7?ae(I.wraparound):pe===8?3:pe===9?ae(L==="X10"):pe===12?ae(re.cursorBlink):pe===25?ae(!X.isCursorHidden):pe===45?ae(I.reverseWraparound):pe===66?ae(I.applicationKeypad):pe===67?4:pe===1e3?ae(L==="VT200"):pe===1002?ae(L==="DRAG"):pe===1003?ae(L==="ANY"):pe===1004?ae(I.sendFocus):pe===1005?4:pe===1006?ae(z==="SGR"):pe===1015?4:pe===1016?ae(z==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ae(W===H):pe===2004?ae(I.bracketedPasteMode):0,X.triggerDataEvent(`${f.C0.ESC}[${j?"":"?"}${ce};${Oe}$y`),!0;var ce,Oe}_updateAttrColor(F,j,I,L,z){return j===2?(F|=50331648,F&=-16777216,F|=E.AttributeData.fromColorRGB([I,L,z])):j===5&&(F&=-50331904,F|=33554432|255&I),F}_extractColor(F,j,I){const L=[0,0,-1,0,0,0];let z=0,X=0;do{if(L[X+z]=F.params[j+X],F.hasSubParams(j+X)){const ee=F.getSubParams(j+X);let te=0;do L[1]===5&&(z=1),L[X+te+1+z]=ee[te];while(++te<ee.length&&te+X+1+z<L.length);break}if(L[1]===5&&X+z>=2||L[1]===2&&X+z>=5)break;L[1]&&(z=1)}while(++X+j<F.length&&X+z<L.length);for(let ee=2;ee<L.length;++ee)L[ee]===-1&&(L[ee]=0);switch(L[0]){case 38:I.fg=this._updateAttrColor(I.fg,L[1],L[3],L[4],L[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,L[1],L[3],L[4],L[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,L[1],L[3],L[4],L[5])}return X}_processUnderline(F,j){j.extended=j.extended.clone(),(!~F||F>5)&&(F=1),j.extended.underlineStyle=F,j.fg|=268435456,F===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(F){F.fg=_.DEFAULT_ATTR_DATA.fg,F.bg=_.DEFAULT_ATTR_DATA.bg,F.extended=F.extended.clone(),F.extended.underlineStyle=0,F.extended.underlineColor&=-67108864,F.updateExtended()}charAttributes(F){if(F.length===1&&F.params[0]===0)return this._processSGR0(this._curAttrData),!0;const j=F.length;let I;const L=this._curAttrData;for(let z=0;z<j;z++)I=F.params[z],I>=30&&I<=37?(L.fg&=-50331904,L.fg|=16777216|I-30):I>=40&&I<=47?(L.bg&=-50331904,L.bg|=16777216|I-40):I>=90&&I<=97?(L.fg&=-50331904,L.fg|=16777224|I-90):I>=100&&I<=107?(L.bg&=-50331904,L.bg|=16777224|I-100):I===0?this._processSGR0(L):I===1?L.fg|=134217728:I===3?L.bg|=67108864:I===4?(L.fg|=268435456,this._processUnderline(F.hasSubParams(z)?F.getSubParams(z)[0]:1,L)):I===5?L.fg|=536870912:I===7?L.fg|=67108864:I===8?L.fg|=1073741824:I===9?L.fg|=2147483648:I===2?L.bg|=134217728:I===21?this._processUnderline(2,L):I===22?(L.fg&=-134217729,L.bg&=-134217729):I===23?L.bg&=-67108865:I===24?(L.fg&=-268435457,this._processUnderline(0,L)):I===25?L.fg&=-536870913:I===27?L.fg&=-67108865:I===28?L.fg&=-1073741825:I===29?L.fg&=2147483647:I===39?(L.fg&=-67108864,L.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):I===49?(L.bg&=-67108864,L.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?z+=this._extractColor(F,z,L):I===53?L.bg|=1073741824:I===55?L.bg&=-1073741825:I===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):I===100?(L.fg&=-67108864,L.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${j};${I}R`)}return!0}deviceStatusPrivate(F){if(F.params[0]===6){const j=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${j};${I}R`)}return!0}softReset(F){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.DEFAULT_ATTR_DATA.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(F){const j=F.params[0]||1;switch(j){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=j%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(F){const j=F.params[0]||1;let I;return(F.length<2||(I=F.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(F){if(!U(F.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(F){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(F){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(F){return this._windowTitle=F,this._onTitleChange.fire(F),!0}setIconName(F){return this._iconName=F,!0}setOrReportIndexedColor(F){const j=[],I=F.split(";");for(;I.length>1;){const L=I.shift(),z=I.shift();if(/^\d+$/.exec(L)){const X=parseInt(L);if(Q(X))if(z==="?")j.push({type:0,index:X});else{const ee=(0,O.parseColor)(z);ee&&j.push({type:1,index:X,color:ee})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(F){const j=F.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(F,j){this._getCurrentLinkId()&&this._finishHyperlink();const I=F.split(":");let L;const z=I.findIndex((X=>X.startsWith("id=")));return z!==-1&&(L=I[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(F,j){const I=F.split(";");for(let L=0;L<I.length&&!(j>=this._specialColors.length);++L,++j)if(I[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const z=(0,O.parseColor)(I[L]);z&&this._onColor.fire([{type:1,index:this._specialColors[j],color:z}])}return!0}setOrReportFgColor(F){return this._setOrReportSpecialColor(F,0)}setOrReportBgColor(F){return this._setOrReportSpecialColor(F,1)}setOrReportCursorColor(F){return this._setOrReportSpecialColor(F,2)}restoreIndexedColor(F){if(!F)return this._onColor.fire([{type:2}]),!0;const j=[],I=F.split(";");for(let L=0;L<I.length;++L)if(/^\d+$/.exec(I[L])){const z=parseInt(I[L]);Q(z)&&j.push({type:2,index:z})}return j.length&&this._onColor.fire(j),!0}restoreFgColor(F){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(F){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(F){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,b.DEFAULT_CHARSET),!0}selectCharset(F){return F.length!==2?(this.selectDefaultCharset(),!0):(F[0]==="/"||this._charsetService.setgCharset(P[F[0]],b.CHARSETS[F[1]]||b.DEFAULT_CHARSET),!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){const F=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,F,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=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(F){return this._charsetService.setgLevel(F),!0}screenAlignmentPattern(){const F=new x.CellData;F.content=4194373,F.fg=this._curAttrData.fg,F.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const I=this._activeBuffer.ybase+this._activeBuffer.y+j,L=this._activeBuffer.lines.get(I);L&&(L.fill(F),L.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(F,j){const I=this._bufferService.buffer,L=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${z}${f.C0.ESC}\\`),!0))(F==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:F==='"p'?'P1$r61;1"p':F==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:F==="m"?"P1$r0m":F===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(F,j){this._dirtyRowTracker.markRangeDirty(F,j)}}o.InputHandler=K;let V=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){J<this.start?this.start=J:J>this.end&&(this.end=J)}markRangeDirty(J,F){J>F&&(Y=J,J=F,F=Y),J<this.start&&(this.start=J),F>this.end&&(this.end=F)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(J){return 0<=J&&J<256}V=d([g(0,M.IBufferService)],V)},844:(u,o)=>{function c(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=c,o.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,f,b){this._data[g]||(this._data[g]={}),this._data[g][f]=b}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(d,g,f,b,S){this._data.get(d,g)||this._data.set(d,g,new c),this._data.get(d,g).set(f,b,S)}get(d,g,f,b){var S;return(S=this._data.get(d,g))==null?void 0:S.get(f,b)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,g){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let g=0,f=this._array.length-1;for(;f>=g;){let b=g+f>>1;const S=this._getKey(this._array[b]);if(S>d)f=b-1;else{if(!(S<d)){for(;b>0&&this._getKey(this._array[b-1])===d;)b--;return b}g=b+1}}return g}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let k=0,w=0,_=S.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),w=Math.max(k,w),y=S.timeRemaining(),1.5*w>y)return _-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-k))}ms`),void this._start();_=y}this.clear()}}class f extends g{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=c(643);o.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),b=f==null?void 0:f.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&b&&(S.isWrapped=b[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&b[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,b=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=b}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=c(6349),g=c(7226),f=c(3734),b=c(8437),S=c(4634),k=c(511),w=c(643),_=c(4863),y=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(v,x,E){this._hasScrollback=v,this._optionsService=x,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,x){return new b.BufferLine(this._bufferService.cols,this.getNullCell(v),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const x=v+this._optionsService.rawOptions.scrollback;return x>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:x}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=b.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,x){const E=this.getNullCell(b.DEFAULT_ATTR_DATA);let M=0;const R=this._getCorrectBufferLength(x);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<v)for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(v,E);let N=0;if(this._rows<x)for(let D=this._rows;D<x;D++)this.lines.length<x+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(v,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+N+1?(this.ybase--,N++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(v,E)));else for(let D=this._rows;D>x;D--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const D=this.lines.length-R;D>0&&(this.lines.trimStart(D),this.ybase=Math.max(this.ybase-D,0),this.ydisp=Math.max(this.ydisp-D,0),this.savedY=Math.max(this.savedY-D,0)),this.lines.maxLength=R}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,x-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(v,x),this._cols>v))for(let N=0;N<this.lines.length;N++)M+=+this.lines.get(N).resize(v,E);this._cols=v,this._rows=x,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,x){this._cols!==v&&(v>this._cols?this._reflowLarger(v,x):this._reflowSmaller(v,x))}_reflowLarger(v,x){const E=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(E.length>0){const M=(0,S.reflowLargerCreateNewLayout)(this.lines,E);(0,S.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(v,x,M.countRemoved)}}_reflowLargerAdjustViewport(v,x,E){const M=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new b.BufferLine(v,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,x){const E=this.getNullCell(b.DEFAULT_ATTR_DATA),M=[];let R=0;for(let N=this.lines.length-1;N>=0;N--){let D=this.lines.get(N);if(!D||!D.isWrapped&&D.getTrimmedLength()<=v)continue;const O=[D];for(;D.isWrapped&&N>0;)D=this.lines.get(--N),O.unshift(D);const P=this.ybase+this.y;if(P>=N&&P<N+O.length)continue;const $=O[O.length-1].getTrimmedLength(),U=(0,S.reflowSmallerGetNewLineLengths)(O,this._cols,v),q=U.length-O.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+q):Math.max(0,this.lines.length-this.lines.maxLength+q);const K=[];for(let I=0;I<q;I++){const L=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);K.push(L)}K.length>0&&(M.push({start:N+O.length+R,newLines:K}),R+=K.length),O.push(...K);let V=U.length-1,Q=U[V];Q===0&&(V--,Q=U[V]);let J=O.length-q-1,F=$;for(;J>=0;){const I=Math.min(F,Q);if(O[V]===void 0)break;if(O[V].copyCellsFrom(O[J],F-I,Q-I,I,!0),Q-=I,Q===0&&(V--,Q=U[V]),F-=I,F===0){J--;const L=Math.max(J,0);F=(0,S.getWrappedLineTrimmedLength)(O,L,this._cols)}}for(let I=0;I<O.length;I++)U[I]<v&&O[I].setCell(U[I],E);let j=q-Y;for(;j-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+q,this.ybase+x-1)}if(M.length>0){const N=[],D=[];for(let V=0;V<this.lines.length;V++)D.push(this.lines.get(V));const O=this.lines.length;let P=O-1,$=0,U=M[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let q=0;for(let V=Math.min(this.lines.maxLength-1,O+R-1);V>=0;V--)if(U&&U.start>P+q){for(let Q=U.newLines.length-1;Q>=0;Q--)this.lines.set(V--,U.newLines[Q]);V++,N.push({index:P+1,amount:U.newLines.length}),q+=U.newLines.length,U=M[++$]}else this.lines.set(V,D[P--]);let Y=0;for(let V=N.length-1;V>=0;V--)N[V].index+=Y,this.lines.onInsertEmitter.fire(N[V]),Y+=N[V].amount;const K=Math.max(0,O+R-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(v,x,E=0,M){const R=this.lines.get(v);return R?R.translateToString(x,E,M):""}getWrappedRangeForLine(v){let x=v,E=v;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:x,last:E}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===v&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const x=new _.Marker(v);return this.markers.push(x),x.register(this.lines.onTrim((E=>{x.line-=E,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((E=>{x.line>=E.index&&(x.line+=E.amount)}))),x.register(this.lines.onDelete((E=>{x.line>=E.index&&x.line<E.index+E.amount&&x.dispose(),x.line>E.index&&(x.line-=E.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=c(3734),g=c(511),f=c(643),b=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class k{constructor(_,y,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const x=y||g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<_;++E)this.setCell(E,x);this.length=_}get(_){const y=this._data[3*_+0],v=2097151&y;return[this._data[3*_+1],2097152&y?this._combined[_]:v?(0,b.stringFromCodePoint)(v):"",y>>22,2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):v]}set(_,y){this._data[3*_+1]=y[f.CHAR_DATA_ATTR_INDEX],y[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=y[1],this._data[3*_+0]=2097152|_|y[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&y}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_]:2097151&y?(0,b.stringFromCodePoint)(2097151&y):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,y){return S=3*_,y.content=this._data[S+0],y.fg=this._data[S+1],y.bg=this._data[S+2],2097152&y.content&&(y.combinedData=this._combined[_]),268435456&y.bg&&(y.extended=this._extendedAttrs[_]),y}setCell(_,y){2097152&y.content&&(this._combined[_]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[_]=y.extended),this._data[3*_+0]=y.content,this._data[3*_+1]=y.fg,this._data[3*_+2]=y.bg}setCellFromCodepoint(_,y,v,x){268435456&x.bg&&(this._extendedAttrs[_]=x.extended),this._data[3*_+0]=y|v<<22,this._data[3*_+1]=x.fg,this._data[3*_+2]=x.bg}addCodepointToCell(_,y,v){let x=this._data[3*_+0];2097152&x?this._combined[_]+=(0,b.stringFromCodePoint)(y):2097151&x?(this._combined[_]=(0,b.stringFromCodePoint)(2097151&x)+(0,b.stringFromCodePoint)(y),x&=-2097152,x|=2097152):x=y|4194304,v&&(x&=-12582913,x|=v<<22),this._data[3*_+0]=x}insertCells(_,y,v){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length-_){const x=new g.CellData;for(let E=this.length-_-y-1;E>=0;--E)this.setCell(_+y+E,this.loadCell(_+E,x));for(let E=0;E<y;++E)this.setCell(_+E,v)}else for(let x=_;x<this.length;++x)this.setCell(x,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(_,y,v){if(_%=this.length,y<this.length-_){const x=new g.CellData;for(let E=0;E<this.length-_-y;++E)this.setCell(_+E,this.loadCell(_+y+E,x));for(let E=this.length-y;E<this.length;++E)this.setCell(E,v)}else for(let x=_;x<this.length;++x)this.setCell(x,v);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,v)}replaceCells(_,y,v,x=!1){if(x)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.isProtected(_)||this.setCell(_,v),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.setCell(_++,v)}resize(_,y){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const x=new Uint32Array(v);x.set(this._data),this._data=x}for(let x=this.length;x<_;++x)this.setCell(x,y)}else{this._data=this._data.subarray(0,v);const x=Object.keys(this._combined);for(let M=0;M<x.length;M++){const R=parseInt(x[M],10);R>=_&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let M=0;M<E.length;M++){const R=parseInt(E[M],10);R>=_&&delete this._extendedAttrs[R]}}return this.length=_,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,y=!1){if(y)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,_);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const y in _._combined)this._combined[y]=_._combined[y];this._extendedAttrs={};for(const y in _._extendedAttrs)this._extendedAttrs[y]=_._extendedAttrs[y];this.isWrapped=_.isWrapped}clone(){const _=new k(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const y in this._combined)_._combined[y]=this._combined[y];for(const y in this._extendedAttrs)_._extendedAttrs[y]=this._extendedAttrs[y];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,y,v,x,E){const M=_._data;if(E)for(let N=x-1;N>=0;N--){for(let D=0;D<3;D++)this._data[3*(v+N)+D]=M[3*(y+N)+D];268435456&M[3*(y+N)+2]&&(this._extendedAttrs[v+N]=_._extendedAttrs[y+N])}else for(let N=0;N<x;N++){for(let D=0;D<3;D++)this._data[3*(v+N)+D]=M[3*(y+N)+D];268435456&M[3*(y+N)+2]&&(this._extendedAttrs[v+N]=_._extendedAttrs[y+N])}const R=Object.keys(_._combined);for(let N=0;N<R.length;N++){const D=parseInt(R[N],10);D>=y&&(this._combined[D-y+v]=_._combined[D])}}translateToString(_,y,v,x){y=y!=null?y:0,v=v!=null?v:this.length,_&&(v=Math.min(v,this.getTrimmedLength())),x&&(x.length=0);let E="";for(;y<v;){const M=this._data[3*y+0],R=2097151&M,N=2097152&M?this._combined[y]:R?(0,b.stringFromCodePoint)(R):f.WHITESPACE_CELL_CHAR;if(E+=N,x)for(let D=0;D<N.length;++D)x.push(y);y+=M>>22||1}return x&&x.push(y),E}}o.BufferLine=k},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(d,g,f){if(g===d.length-1)return d[g].getTrimmedLength();const b=!d[g].hasContent(f-1)&&d[g].getWidth(f-1)===1,S=d[g+1].getWidth(0)===2;return b&&S?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(d,g,f,b,S){const k=[];for(let w=0;w<d.length-1;w++){let _=w,y=d.get(++_);if(!y.isWrapped)continue;const v=[d.get(w)];for(;_<d.length&&y.isWrapped;)v.push(y),y=d.get(++_);if(b>=w&&b<_){w+=v.length-1;continue}let x=0,E=c(v,x,g),M=1,R=0;for(;M<v.length;){const D=c(v,M,g),O=D-R,P=f-E,$=Math.min(O,P);v[x].copyCellsFrom(v[M],R,E,$,!1),E+=$,E===f&&(x++,E=0),R+=$,R===D&&(M++,R=0),E===0&&x!==0&&v[x-1].getWidth(f-1)===2&&(v[x].copyCellsFrom(v[x-1],f-1,E++,1,!1),v[x-1].setCell(f-1,S))}v[x].replaceCells(E,f,S);let N=0;for(let D=v.length-1;D>0&&(D>x||v[D].getTrimmedLength()===0);D--)N++;N>0&&(k.push(w+v.length-N),k.push(N)),w+=v.length-1}return k},o.reflowLargerCreateNewLayout=function(d,g){const f=[];let b=0,S=g[b],k=0;for(let w=0;w<d.length;w++)if(S===w){const _=g[++b];d.onDeleteEmitter.fire({index:w-k,amount:_}),w+=_-1,k+=_,S=g[++b]}else f.push(w);return{layout:f,countRemoved:k}},o.reflowLargerApplyNewLayout=function(d,g){const f=[];for(let b=0;b<g.length;b++)f.push(d.get(g[b]));for(let b=0;b<f.length;b++)d.set(b,f[b]);d.length=g.length},o.reflowSmallerGetNewLineLengths=function(d,g,f){const b=[],S=d.map(((y,v)=>c(d,v,g))).reduce(((y,v)=>y+v));let k=0,w=0,_=0;for(;_<S;){if(S-_<f){b.push(S-_);break}k+=f;const y=c(d,w,g);k>y&&(k-=y,w++);const v=d[w].getWidth(k-1)===2;v&&k--;const x=v?f-1:f;b.push(x),_+=x}return b},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=c(8460),g=c(844),f=c(9092);class b extends g.Disposable{constructor(k,w){super(),this._optionsService=k,this._bufferService=w,this._onBufferActivate=this.register(new d.EventEmitter),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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,w){this._normal.resize(k,w),this._alt.resize(k,w),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}o.BufferSet=b},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=c(482),g=c(643),f=c(3734);class b extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const w=new b;return w.setFromCharData(k),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(k[g.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(k[g.CHAR_DATA_CHAR_INDEX].length===2){const _=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const y=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(_-55296)+y-56320+65536|k[g.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[g.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=k[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=b},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=c(8460),g=c(844);class f{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}o.Marker=f,f._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,d,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
470
|
-
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(o.C0=c={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(d||(o.C1=d={})),(function(f){f.ST=`${c.ESC}\\`})(g||(o.C1_ESCAPED=g={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=c(2584),g={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:["'",'"']};o.evaluateKeyboardEvent=function(f,b,S,k){const w={type:0,cancel:!1,key:void 0},_=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=b?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=b?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=b?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=b?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,f.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(S?"b":"[1;5D"))):w.key=b?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(S?"f":"[1;5C"))):w.key=b?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"A",S||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=b?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"B",S||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=b?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=_?d.C0.ESC+"[3;"+(_+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=_?d.C0.ESC+"[1;"+(_+1)+"H":b?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=_?d.C0.ESC+"[1;"+(_+1)+"F":b?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=d.C0.ESC+"[5;"+(_+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=d.C0.ESC+"[6;"+(_+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=_?d.C0.ESC+"[1;"+(_+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=_?d.C0.ESC+"[1;"+(_+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=_?d.C0.ESC+"[1;"+(_+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=_?d.C0.ESC+"[1;"+(_+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=_?d.C0.ESC+"[15;"+(_+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=_?d.C0.ESC+"[17;"+(_+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=_?d.C0.ESC+"[18;"+(_+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=_?d.C0.ESC+"[19;"+(_+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=_?d.C0.ESC+"[20;"+(_+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=_?d.C0.ESC+"[21;"+(_+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=_?d.C0.ESC+"[23;"+(_+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=_?d.C0.ESC+"[24;"+(_+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(S&&!k||!f.altKey||f.metaKey)!S||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=d.C0.US),f.key==="@"&&(w.key=d.C0.NUL)):f.keyCode===65&&(w.type=1);else{const y=g[f.keyCode],v=y==null?void 0:y[f.shiftKey?1:0];if(v)w.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const x=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(x);f.shiftKey&&(E=E.toUpperCase()),w.key=d.C0.ESC+E}else if(f.keyCode===32)w.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let x=f.code.slice(3,4);f.shiftKey||(x=x.toLowerCase()),w.key=d.C0.ESC+x,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=d.C0.DEL:f.keyCode===219?w.key=d.C0.ESC:f.keyCode===220?w.key=d.C0.FS:f.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,d=0,g=c.length){let f="";for(let b=d;b<g;++b){let S=c[b];S>65535?(S-=65536,f+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):f+=String.fromCharCode(S)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const g=c.length;if(!g)return 0;let f=0,b=0;if(this._interim){const S=c.charCodeAt(b++);56320<=S&&S<=57343?d[f++]=1024*(this._interim-55296)+S-56320+65536:(d[f++]=this._interim,d[f++]=S),this._interim=0}for(let S=b;S<g;++S){const k=c.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=g)return this._interim=k,f;const w=c.charCodeAt(S);56320<=w&&w<=57343?d[f++]=1024*(k-55296)+w-56320+65536:(d[f++]=k,d[f++]=w)}else k!==65279&&(d[f++]=k)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const g=c.length;if(!g)return 0;let f,b,S,k,w=0,_=0,y=0;if(this.interim[0]){let E=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let R,N=0;for(;(R=63&this.interim[++N])&&N<4;)M<<=6,M|=R;const D=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=D-N;for(;y<O;){if(y>=g)return 0;if(R=c[y++],(192&R)!=128){y--,E=!0;break}this.interim[N++]=R,M<<=6,M|=63&R}E||(D===2?M<128?y--:d[w++]=M:D===3?M<2048||M>=55296&&M<=57343||M===65279||(d[w++]=M):M<65536||M>1114111||(d[w++]=M)),this.interim.fill(0)}const v=g-4;let x=y;for(;x<g;){for(;!(!(x<v)||128&(f=c[x])||128&(b=c[x+1])||128&(S=c[x+2])||128&(k=c[x+3]));)d[w++]=f,d[w++]=b,d[w++]=S,d[w++]=k,x+=4;if(f=c[x++],f<128)d[w++]=f;else if((224&f)==192){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(_=(31&f)<<6|63&b,_<128){x--;continue}d[w++]=_}else if((240&f)==224){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,w;if(S=c[x++],(192&S)!=128){x--;continue}if(_=(15&f)<<12|(63&b)<<6|63&S,_<2048||_>=55296&&_<=57343||_===65279)continue;d[w++]=_}else if((248&f)==240){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,w;if(S=c[x++],(192&S)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,this.interim[2]=S,w;if(k=c[x++],(192&k)!=128){x--;continue}if(_=(7&f)<<18|(63&b)<<12|(63&S)<<6|63&k,_<65536||_>1114111)continue;d[w++]=_}}return w}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=c(1480),g=[[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]],f=[[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]];let b;o.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let S=0;S<g.length;++S)b.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?b[S]:(function(k,w){let _,y=0,v=w.length-1;if(k<w[0][0]||k>w[v][1])return!1;for(;v>=y;)if(_=y+v>>1,k>w[_][1])y=_+1;else{if(!(k<w[_][0]))return!0;v=_-1}return!1})(S,f)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,k){let w=this.wcwidth(S),_=w===0&&k!==0;if(_){const y=d.UnicodeService.extractWidth(k);y===0?_=!1:y>w&&(w=y)}return d.UnicodeService.createPropertyValue(0,w,_)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=c(8460),g=c(844);class f extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k)}_innerWrite(S=0,k=!0){const w=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],y=this._action(_,k);if(y){const x=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(x)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}o.WriteBuffer=f},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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})$/,d=/^[\da-f]+$/;function g(f,b){const S=f.toString(16),k=S.length<2?"0"+S:S;switch(b){case 4:return S[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}o.parseColor=function(f){if(!f)return;let b=f.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const S=c.exec(b);if(S){const k=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/k*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/k*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/k*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),d.exec(b)&&[3,6,9,12].includes(b.length))){const S=b.length/3,k=[0,0,0];for(let w=0;w<3;++w){const _=parseInt(b.slice(S*w,S*w+S),16);k[w]=S===1?_<<4:S===2?_:S===3?_>>4:_>>8}return k}},o.toRgbString=function(f,b=16){const[S,k,w]=f;return`rgb:${g(S,b)}/${g(k,b)}/${g(w,b)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=c(482),g=c(8742),f=c(5770),b=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,w){this._handlers[k]===void 0&&(this._handlers[k]=[]);const _=this._handlers[k];return _.push(w),{dispose:()=>{const y=_.indexOf(w);y!==-1&&_.splice(y,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(k,w){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(k,w,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(k,w,_);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,w,_))}unhook(k,w=!0){if(this._active.length){let _=!1,y=this._active.length-1,v=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;y>=0&&(_=this._active[y].unhook(k),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const S=new g.Params;S.addParam(0),o.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=S,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():S,this._data="",this._hitLimit=!1}put(k,w,_){this._hitLimit||(this._data+=(0,d.utf32ToString)(k,w,_),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let w=!1;if(this._hitLimit)w=!1;else if(k&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((_=>(this._params=S,this._data="",this._hitLimit=!1,_)));return this._params=S,this._data="",this._hitLimit=!1,w}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=c(844),g=c(8742),f=c(6242),b=c(6351);class S{constructor(y){this.table=new Uint8Array(y)}setDefault(y,v){this.table.fill(y<<4|v)}add(y,v,x,E){this.table[v<<8|y]=x<<4|E}addMany(y,v,x,E){for(let M=0;M<y.length;M++)this.table[v<<8|y[M]]=x<<4|E}}o.TransitionTable=S;const k=160;o.VT500_TRANSITION_TABLE=(function(){const _=new S(4095),y=Array.apply(null,Array(256)).map(((N,D)=>D)),v=(N,D)=>y.slice(N,D),x=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const M=v(0,14);let R;for(R in _.setDefault(1,0),_.addMany(x,0,2,0),M)_.addMany([24,26,153,154],R,3,0),_.addMany(v(128,144),R,3,0),_.addMany(v(144,152),R,3,0),_.add(156,R,0,0),_.add(27,R,11,1),_.add(157,R,4,8),_.addMany([152,158,159],R,0,7),_.add(155,R,11,3),_.add(144,R,11,9);return _.addMany(E,0,3,0),_.addMany(E,1,3,1),_.add(127,1,0,1),_.addMany(E,8,0,8),_.addMany(E,3,3,3),_.add(127,3,0,3),_.addMany(E,4,3,4),_.add(127,4,0,4),_.addMany(E,6,3,6),_.addMany(E,5,3,5),_.add(127,5,0,5),_.addMany(E,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(x,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(v(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(x,7,0,7),_.addMany(E,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(v(64,127),3,7,0),_.addMany(v(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(v(48,60),4,8,4),_.addMany(v(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(v(32,64),6,0,6),_.add(127,6,0,6),_.addMany(v(64,127),6,0,0),_.addMany(v(32,48),3,9,5),_.addMany(v(32,48),5,9,5),_.addMany(v(48,64),5,0,6),_.addMany(v(64,127),5,7,0),_.addMany(v(32,48),4,9,5),_.addMany(v(32,48),1,9,2),_.addMany(v(32,48),2,9,2),_.addMany(v(48,127),2,10,0),_.addMany(v(48,80),1,10,0),_.addMany(v(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(v(96,127),1,10,0),_.add(80,1,11,9),_.addMany(E,9,0,9),_.add(127,9,0,9),_.addMany(v(28,32),9,0,9),_.addMany(v(32,48),9,9,12),_.addMany(v(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(E,11,0,11),_.addMany(v(32,128),11,0,11),_.addMany(v(28,32),11,0,11),_.addMany(E,10,0,10),_.add(127,10,0,10),_.addMany(v(28,32),10,0,10),_.addMany(v(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(v(32,48),10,9,12),_.addMany(E,12,0,12),_.add(127,12,0,12),_.addMany(v(28,32),12,0,12),_.addMany(v(32,48),12,9,12),_.addMany(v(48,64),12,0,11),_.addMany(v(64,127),12,12,13),_.addMany(v(64,127),10,12,13),_.addMany(v(64,127),9,12,13),_.addMany(E,13,13,13),_.addMany(x,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(k,0,2,0),_.add(k,8,5,8),_.add(k,6,0,6),_.add(k,11,0,11),_.add(k,13,13,13),_})();class w extends d.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,x,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,x)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,v=[64,126]){let x=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=y.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<y.intermediates.length;++M){const R=y.intermediates.charCodeAt(M);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return x<<=8,x|=E,x}identToString(y){const v=[];for(;y;)v.push(String.fromCharCode(255&y)),y>>=8;return v.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,v){const x=this._identifier(y,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const E=this._escHandlers[x];return E.push(v),{dispose:()=>{const M=E.indexOf(v);M!==-1&&E.splice(M,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,v){this._executeHandlers[y.charCodeAt(0)]=v}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,v){const x=this._identifier(y);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const E=this._csiHandlers[x];return E.push(v),{dispose:()=>{const M=E.indexOf(v);M!==-1&&E.splice(M,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,v){return this._dcsParser.registerHandler(this._identifier(y),v)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,v){return this._oscParser.registerHandler(y,v)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,v,x,E,M){this._parseStack.state=y,this._parseStack.handlers=v,this._parseStack.handlerPos=x,this._parseStack.transition=E,this._parseStack.chunkPos=M}parse(y,v,x){let E,M=0,R=0,N=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,N=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const D=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&O>-1){for(;O>=0&&(E=D[O](this._params),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 4:if(x===!1&&O>-1){for(;O>=0&&(E=D[O](),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 6:if(M=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(M!==24&&M!==26,x),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=y[this._parseStack.chunkPos],E=this._oscParser.end(M!==24&&M!==26,x),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,N=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let D=N;D<v;++D){switch(M=y[D],R=this._transitions.table[this.currentState<<8|(M<160?M:k)],R>>4){case 2:for(let q=D+1;;++q){if(q>=v||(M=y[q])<32||M>126&&M<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(M=y[q])<32||M>126&&M<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(M=y[q])<32||M>126&&M<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(M=y[q])<32||M>126&&M<k){this._printHandler(y,D,q),D=q-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:D,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|M];let P=O?O.length-1:-1;for(;P>=0&&(E=O[P](this._params),E!==!0);P--)if(E instanceof Promise)return this._preserveStack(3,O,P,R,D),E;P<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++D<v&&(M=y[D])>47&&M<60);D--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const $=this._escHandlers[this._collect<<8|M];let U=$?$.length-1:-1;for(;U>=0&&(E=$[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,$,U,R,D),E;U<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let q=D+1;;++q)if(q>=v||(M=y[q])===24||M===26||M===27||M>127&&M<k){this._dcsParser.put(y,D,q),D=q-1;break}break;case 14:if(E=this._dcsParser.unhook(M!==24&&M!==26),E)return this._preserveStack(6,[],0,R,D),E;M===27&&(R|=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 q=D+1;;q++)if(q>=v||(M=y[q])<32||M>127&&M<k){this._oscParser.put(y,D,q),D=q-1;break}break;case 6:if(E=this._oscParser.end(M!==24&&M!==26),E)return this._preserveStack(5,[],0,R,D),E;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=w},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=c(5770),g=c(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,S){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(S),{dispose:()=>{const w=k.indexOf(S);w!==-1&&k.splice(w,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,S,k){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(b,S,k);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(b,S,k))}start(){this.reset(),this._state=1}put(b,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const w=b[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&k-S>0&&this._put(b,S,k)}}end(b,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,w=this._active.length-1,_=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,k=S,_=this._stack.fallThrough,this._stack.paused=!1),!_&&k===!1){for(;w>=0&&(k=this._active[w].end(b),k!==!0);w--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,k;w--}for(;w>=0;w--)if(k=this._active[w].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",b);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,S,k){this._hitLimit||(this._data+=(0,g.utf32ToString)(b,S,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let S=!1;if(this._hitLimit)S=!1;else if(b&&(S=this._handler(this._data),S instanceof Promise))return S.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,S}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class d{static fromArray(f){const b=new d;if(!f.length)return b;for(let S=Array.isArray(f[0])?1:0;S<f.length;++S){const k=f[S];if(Array.isArray(k))for(let w=0;w<k.length;++w)b.addSubParam(k[w]);else b.addParam(k)}return b}constructor(f=32,b=32){if(this.maxLength=f,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let b=0;b<this.length;++b){f.push(this.params[b]);const S=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-S>0&&f.push(Array.prototype.slice.call(this._subParams,S,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const b=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];return S-b>0?this._subParams.subarray(b,S):null}getSubParamsAll(){const f={};for(let b=0;b<this.length;++b){const S=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-S>0&&(f[b]=this._subParams.slice(S,k))}return f}addDigit(f){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[b-1];S[b-1]=~k?Math.min(10*k+f,c):f}}o.Params=d},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=c(3785),g=c(511);o.BufferApiView=class{constructor(f,b){this._buffer=f,this.type=b}init(f){return this._buffer=f,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(f){const b=this._buffer.lines.get(f);if(b)return new d.BufferLineApiView(b)}getNullCell(){return new g.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new d.CellData)}translateToString(g,f,b){return this._line.translateToString(g,f,b)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=c(8771),g=c(8460),f=c(844);class b extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(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)}}o.BufferNamespaceApi=b},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(g=>d(g.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((g,f)=>d(g,f.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var d=this&&this.__decorate||function(_,y,v,x){var E,M=arguments.length,R=M<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,v,x);else for(var N=_.length-1;N>=0;N--)(E=_[N])&&(R=(M<3?E(R):M>3?E(y,v,R):E(y,v))||R);return M>3&&R&&Object.defineProperty(y,v,R),R},g=this&&this.__param||function(_,y){return function(v,x){y(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=c(8460),b=c(844),S=c(5295),k=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(_){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(_.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(_,this))}resize(_,y){this.cols=_,this.rows=y,this.buffers.resize(_,y),this._onResize.fire({cols:_,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,y=!1){const v=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===_.fg&&x.getBg(0)===_.bg||(x=v.getBlankLine(_,y),this._cachedBlankLine=x),x.isWrapped=y;const E=v.ybase+v.scrollTop,M=v.ybase+v.scrollBottom;if(v.scrollTop===0){const R=v.lines.isFull;M===v.lines.length-1?R?v.lines.recycle().copyFrom(x):v.lines.push(x.clone()):v.lines.splice(M+1,0,x.clone()),R?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const R=M-E+1;v.lines.shiftElements(E+1,R-1,-1),v.lines.set(M,x.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(_,y,v){const x=this.buffer;if(_<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else _+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const E=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+_,x.ybase),0),E!==x.ydisp&&(y||this._onScroll.fire(x.ydisp))}};o.BufferService=w=d([g(0,k.IOptionsService)],w)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(u,o,c){var d=this&&this.__decorate||function(x,E,M,R){var N,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,M,R);else for(var P=x.length-1;P>=0;P--)(N=x[P])&&(O=(D<3?N(O):D>3?N(E,M,O):N(E,M))||O);return D>3&&O&&Object.defineProperty(E,M,O),O},g=this&&this.__param||function(x,E){return function(M,R){E(M,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=c(2585),b=c(8460),S=c(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function w(x,E){let M=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(M|=64,M|=x.action):(M|=3&x.button,4&x.button&&(M|=64),8&x.button&&(M|=128),x.action===32?M|=32:x.action!==0||E||(M|=3)),M}const _=String.fromCharCode,y={DEFAULT:x=>{const E=[w(x,!1)+32,x.col+32,x.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${_(E[0])}${_(E[1])}${_(E[2])}`},SGR:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.col};${x.row}${E}`},SGR_PIXELS:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.x};${x.y}${E}`}};let v=o.CoreMouseService=class extends S.Disposable{constructor(x,E){super(),this._bufferService=x,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(k))this.addProtocol(M,k[M]);for(const M of Object.keys(y))this.addEncoding(M,y[M]);this.reset()}addProtocol(x,E){this._protocols[x]=E}addEncoding(x,E){this._encodings[x]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const E=this._encodings[this._activeEncoding](x);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,E,M){if(M){if(x.x!==E.x||x.y!==E.y)return!1}else if(x.col!==E.col||x.row!==E.row)return!1;return x.button===E.button&&x.action===E.action&&x.ctrl===E.ctrl&&x.alt===E.alt&&x.shift===E.shift}};o.CoreMouseService=v=d([g(0,f.IBufferService),g(1,f.ICoreService)],v)},6975:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,M){var R,N=arguments.length,D=N<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(N<3?R(D):N>3?R(x,E,D):R(x,E))||D);return N>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=c(1439),b=c(8460),S=c(844),k=c(2585),w=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends S.Disposable{constructor(v,x,E){super(),this._bufferService=v,this._logService=x,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}triggerDataEvent(v,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(v))}};o.CoreService=y=d([g(0,k.IBufferService),g(1,k.ILogService),g(2,k.IOptionsService)],y)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=c(8055),g=c(8460),f=c(844),b=c(6106);let S=0,k=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((v=>v==null?void 0:v.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const x=new _(v);if(x){const E=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),E.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,x,E){var N,D,O;let M=0,R=0;for(const P of this._decorations.getKeyIterator(x))M=(N=P.options.x)!=null?N:0,R=M+((D=P.options.width)!=null?D:1),v>=M&&v<R&&(!E||((O=P.options.layer)!=null?O:"bottom")===E)&&(yield P)}forEachDecorationAtCell(v,x,E,M){this._decorations.forEachByKey(x,(R=>{var N,D,O;S=(N=R.options.x)!=null?N:0,k=S+((D=R.options.width)!=null?D:1),v>=S&&v<k&&(!E||((O=R.options.layer)!=null?O:"bottom")===E)&&M(R)}))}}o.DecorationService=w;class _ extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=c(2585),g=c(8343);class f{constructor(...S){this._entries=new Map;for(const[k,w]of S)this.set(k,w)}set(S,k){const w=this._entries.get(S);return this._entries.set(S,k),w}forEach(S){for(const[k,w]of this._entries.entries())S(k,w)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(b,S){this._services.set(b,S)}getService(b){return this._services.get(b)}createInstance(b,...S){const k=(0,g.getServiceDependencies)(b).sort(((y,v)=>y.index-v.index)),w=[];for(const y of k){const v=this._services.get(y.id);if(!v)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${y.id}.`);w.push(v)}const _=k.length>0?k[0].index:S.length;if(S.length!==_)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${_+1} conflicts with ${S.length} static arguments`);return new b(...S,...w)}}},7866:function(u,o,c){var d=this&&this.__decorate||function(_,y,v,x){var E,M=arguments.length,R=M<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,v,x);else for(var N=_.length-1;N>=0;N--)(E=_[N])&&(R=(M<3?E(R):M>3?E(y,v,R):E(y,v))||R);return M>3&&R&&Object.defineProperty(y,v,R),R},g=this&&this.__param||function(_,y){return function(v,x){y(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=c(844),b=c(2585),S={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let y=0;y<_.length;y++)typeof _[y]=="function"&&(_[y]=_[y]())}_log(_,y,v){this._evalLazyOptionalParams(v),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...v)}trace(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.TRACE&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))!=null?x:console.log,_,y)}debug(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))!=null?x:console.log,_,y)}info(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.INFO&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))!=null?x:console.info,_,y)}warn(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.WARN&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))!=null?x:console.warn,_,y)}error(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.ERROR&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))!=null?x:console.error,_,y)}};o.LogService=w=d([g(0,b.IOptionsService)],w),o.setTraceLogger=function(_){k=_},o.traceCall=function(_,y,v){if(typeof v.value!="function")throw new Error("not supported");const x=v.value;v.value=function(...E){if(k.logLevel!==b.LogLevelEnum.TRACE)return x.apply(this,E);k.trace(`GlyphRenderer#${x.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const M=x.apply(this,E);return k.trace(`GlyphRenderer#${x.name} return`,M),M}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=c(8460),g=c(844),f=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...o.DEFAULT_OPTIONS};for(const y in w)if(y in _)try{const v=w[y];_[y]=this._sanitizeAndValidateOption(y,v)}catch(v){console.error(v)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,_){return this.onOptionChange((y=>{y===w&&_(this.rawOptions[w])}))}onMultipleOptionChange(w,_){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&_()}))}_setupOptions(){const w=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},_=(y,v)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);v=this._sanitizeAndValidateOption(y,v),this.rawOptions[y]!==v&&(this.rawOptions[y]=v,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const v={get:w.bind(this,y),set:_.bind(this,y)};Object.defineProperty(this.options,y,v)}}_sanitizeAndValidateOption(w,_){switch(w){case"cursorStyle":if(_||(_=o.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${w}`);break;case"wordSeparator":_||(_=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=b.includes(_)?_:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${w} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${w} must be numeric, value: ${_}`);break;case"windowsPty":_=_!=null?_:{}}return _}}o.OptionsService=S},2660:function(u,o,c){var d=this&&this.__decorate||function(S,k,w,_){var y,v=arguments.length,x=v<3?k:_===null?_=Object.getOwnPropertyDescriptor(k,w):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,k,w,_);else for(var E=S.length-1;E>=0;E--)(y=S[E])&&(x=(v<3?y(x):v>3?y(k,w,x):y(k,w))||x);return v>3&&x&&Object.defineProperty(k,w,x),x},g=this&&this.__param||function(S,k){return function(w,_){k(w,_,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=c(2585);let b=o.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const k=this._bufferService.buffer;if(S.id===void 0){const E=k.addMarker(k.ybase+k.y),M={data:S,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(M,E))),this._dataByLinkId.set(M.id,M),M.id}const w=S,_=this._getEntryIdKey(w),y=this._entriesWithId.get(_);if(y)return this.addLineToLink(y.id,k.ybase+k.y),y.id;const v=k.addMarker(k.ybase+k.y),x={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(x,v))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(S,k){const w=this._dataByLinkId.get(S);if(w&&w.lines.every((_=>_.line!==k))){const _=this._bufferService.buffer.addMarker(k);w.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(w,_)))}}getLinkData(S){var k;return(k=this._dataByLinkId.get(S))==null?void 0:k.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,k){const w=S.lines.indexOf(k);w!==-1&&(S.lines.splice(w,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};o.OscLinkService=b=d([g(0,f.IBufferService)],b)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[d]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const f=function(b,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,_,y){_[c]===_?_[d].push({id:w,index:y}):(_[d]=[{id:w,index:y}],_[c]=_)})(f,b,k)};return f.toString=()=>g,o.serviceRegistry.set(g,f),f}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=c(8343);var g;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(g||(o.LogLevelEnum=g={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=c(8460),g=c(225);class f{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,k,w=!1){return(16777215&S)<<3|(3&k)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let k=0,w=0;const _=S.length;for(let y=0;y<_;++y){let v=S.charCodeAt(y);if(55296<=v&&v<=56319){if(++y>=_)return k+this.wcwidth(v);const M=S.charCodeAt(y);56320<=M&&M<=57343?v=1024*(v-55296)+M-56320+65536:k+=this.wcwidth(M)}const x=this.charProperties(v,w);let E=f.extractWidth(x);f.extractShouldJoin(x)&&(E-=f.extractWidth(w)),k+=E,w=x}return k}charProperties(S,k){return this._activeProvider.charProperties(S,k)}}o.UnicodeService=f}},s={};function l(u){var o=s[u];if(o!==void 0)return o.exports;var c=s[u]={exports:{}};return i[u].call(c.exports,c,c.exports,l),c.exports}var h={};return(()=>{var u=h;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=l(9042),c=l(3236),d=l(844),g=l(5741),f=l(8285),b=l(7975),S=l(7090),k=["cols","rows"];class w extends d.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],x=(E,M)=>{this._checkReadonlyOptions(E),this._core.options[E]=M};for(const E in this._core.options){const M={get:v.bind(this,E),set:x.bind(this,E)};Object.defineProperty(this._publicOptions,E,M)}}_checkReadonlyOptions(y){if(k.includes(y))throw new Error(`Option "${y}" 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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const v in y)this._publicOptions[v]=y[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,v=!0){this._core.input(y,v)}resize(y,v){this._verifyIntegers(y,v),this._core.resize(y,v)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){var v,x,E;return this._checkProposedApi(),this._verifyPositiveIntegers((v=y.x)!=null?v:0,(x=y.width)!=null?x:0,(E=y.height)!=null?E:0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,v,x){this._verifyIntegers(y,v,x),this._core.select(y,v,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,v){this._verifyIntegers(y,v),this._core.selectLines(y,v)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,v){this._core.write(y,v)}writeln(y,v){this._core.write(y),this._core.write(`\r
|
|
471
|
-
`,v)}paste(y){this._core.paste(y)}refresh(y,v){this._verifyIntegers(y,v),this._core.refresh(y,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const v of y)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const v of y)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}u.Terminal=w})(),h})()))})(Ap)),Ap.exports}var EO=kO(),Tp={exports:{}},D0;function AO(){return D0||(D0=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const h=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(h._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,h=l._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),f=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),b=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(b/h.css.cell.width)),rows:Math.max(1,Math.floor(f/h.css.cell.height))}}}})(),i})()))})(Tp)),Tp.exports}var TO=AO(),Rp={exports:{}},M0;function RO(){return M0||(M0=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={6:(u,o)=>{function c(g){try{const f=new URL(g),b=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return g.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,f,b,S={}){this._terminal=g,this._regex=f,this._handler=b,this._options=S}provideLinks(g,f){const b=d.computeLink(g,this._regex,this._terminal,this._handler);f(this._addCallbacks(b))}_addCallbacks(g){return g.map((f=>(f.leave=this._options.leave,f.hover=(b,S)=>{if(this._options.hover){const{range:k}=f;this._options.hover(b,S,k)}},f)))}};class d{static computeLink(f,b,S,k){const w=new RegExp(b.source,(b.flags||"")+"g"),[_,y]=d._getWindowedLineStrings(f-1,S),v=_.join("");let x;const E=[];for(;x=w.exec(v);){const M=x[0];if(!c(M))continue;const[R,N]=d._mapStrIdx(S,y,0,x.index),[D,O]=d._mapStrIdx(S,R,N,M.length);if(R===-1||N===-1||D===-1||O===-1)continue;const P={start:{x:N+1,y:R+1},end:{x:O,y:D+1}};E.push({range:P,text:M,activate:k})}return E}static _getWindowedLineStrings(f,b){let S,k=f,w=f,_=0,y="";const v=[];if(S=b.buffer.active.getLine(f)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(_=0;(S=b.buffer.active.getLine(--k))&&_<2048&&(y=S.translateToString(!0),_+=y.length,v.push(y),S.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(x),_=0;(S=b.buffer.active.getLine(++w))&&S.isWrapped&&_<2048&&(y=S.translateToString(!0),_+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,k]}static _mapStrIdx(f,b,S,k){const w=f.buffer.active,_=w.getNullCell();let y=S;for(;k;){const v=w.getLine(b);if(!v)return[-1,-1];for(let x=y;x<v.length;++x){v.getCell(x,_);const E=_.getChars();if(_.getWidth()&&(k-=E.length||1,x===v.length-1&&E==="")){const M=w.getLine(b+1);M&&M.isWrapped&&(M.getCell(0,_),_.getWidth()===2&&(k+=1))}if(k<0)return[b,x]}b++,y=0}return[b,y]}}o.LinkComputer=d}},s={};function l(u){var o=s[u];if(o!==void 0)return o.exports;var c=s[u]={exports:{}};return i[u](c,c.exports,l),c.exports}var h={};return(()=>{var u=h;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const o=l(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,f){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(g=d,f={}){this._handler=g,this._options=f}activate(g){this._terminal=g;const f=this._options,b=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,b,this._handler,f))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})()))})(Rp)),Rp.exports}var DO=RO();const zi={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function Dp(e,n){const i=new Uint8Array(1+n.length);return i[0]=e,i.set(n,1),i}function MO(e,n){const{serverUrl:i,apiToken:s,cwd:l}=n,h=T.useRef(null),u=T.useRef(null),o=T.useRef(null),c=T.useRef("disconnected"),d=T.useRef(!1),g=T.useRef(0),f=T.useRef(n.onStatusChange),b=T.useRef(n.onExit),S=T.useRef(n.onSessionInit),k=T.useRef(n.onTitleChange);T.useEffect(()=>{f.current=n.onStatusChange,b.current=n.onExit,S.current=n.onSessionInit,k.current=n.onTitleChange});const w=T.useRef(i),_=T.useRef(s),y=T.useRef(l),v=T.useRef(n.serverSessionId);T.useEffect(()=>{w.current=i,_.current=s,y.current=l,v.current=n.serverSessionId});const x=T.useCallback(O=>{var P;c.current=O,(P=f.current)==null||P.call(f,O)},[]),E=T.useCallback(()=>{if(d.current)return;const O=++g.current,P=o.current;P&&(P.onopen=null,P.onclose=null,P.onmessage=null,P.onerror=null,P.close(),o.current=null),x("connecting");const $=v.current,U=$?`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(y.current)}&sessionId=${$}`:`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(y.current)}`,q=new WebSocket(U);q.binaryType="arraybuffer",q.onopen=()=>{if(g.current!==O){q.close();return}if(o.current=q,h.current&&u.current)try{u.current.fit()}catch{}},q.onmessage=Y=>{var J,F,j,I,L,z,X,ee;if(g.current!==O||!(Y.data instanceof ArrayBuffer))return;const K=new Uint8Array(Y.data);if(K.length<1)return;const V=K[0],Q=K.slice(1);switch(V){case zi.OUTPUT:{const te=new TextDecoder().decode(Q);(J=h.current)==null||J.write(te);break}case zi.EXIT:{const{exitCode:te}=JSON.parse(new TextDecoder().decode(Q));x("exited"),(F=h.current)==null||F.writeln(`\r
|
|
472
|
-
[Process exited with code ${te}]`),(j=b.current)==null||j.call(b,te),q.close();break}case zi.ERROR:{const{message:te}=JSON.parse(new TextDecoder().decode(Q));x("disconnected"),(I=h.current)==null||I.writeln(`\r
|
|
473
|
-
[Error: ${te}]`);break}case zi.INIT_ACK:{const te=JSON.parse(new TextDecoder().decode(Q));(L=S.current)==null||L.call(S,te),te.isReconnect&&te.status==="exited"?(x("exited"),(z=h.current)==null||z.writeln(`\r
|
|
474
|
-
[Process exited with code ${te.exitCode} while disconnected]`),(X=b.current)==null||X.call(b,te.exitCode)):x("connected");break}case zi.TITLE:{const{title:te}=JSON.parse(new TextDecoder().decode(Q));(ee=k.current)==null||ee.call(k,te);break}}},q.onclose=()=>{var Y;g.current===O&&(o.current=null,c.current==="connecting"?(x("disconnected"),(Y=h.current)==null||Y.writeln(`\r
|
|
475
|
-
[Connection failed]`)):c.current==="connected"&&x("disconnected"))},q.onerror=()=>{}},[x]);T.useEffect(()=>{const O=e();if(!O){console.log("[useTerminal] MAIN EFFECT: no container, returning early");return}M.current=!0,d.current=!1;const P=new EO.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:13,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",scrollback:1e3,allowProposedApi:!0,theme:{background:"var(--background)",foreground:"var(--foreground)",cursor:"var(--foreground)",selectionBackground:"var(--accent)"}}),$=new TO.FitAddon,U=new DO.WebLinksAddon;P.loadAddon($),P.loadAddon(U);let q=!1;const Y=requestAnimationFrame(()=>{if(!(q||!O.isConnected))if(P.open(O),P.cols<=1||P.rows<=1){const K=()=>{if(!q){try{if($.fit(),P.cols>1&&P.rows>1)return}catch{}requestAnimationFrame(K)}};requestAnimationFrame(K)}else try{$.fit()}catch{}});return h.current=P,u.current=$,P.onData(K=>{const V=o.current;if(!V||V.readyState!==WebSocket.OPEN)return;const Q=new TextEncoder().encode(K);V.send(Dp(zi.INPUT,Q))}),P.onResize(({cols:K,rows:V})=>{const Q=o.current;if(!Q||Q.readyState!==WebSocket.OPEN)return;const J=new TextEncoder().encode(JSON.stringify({cols:K,rows:V}));Q.send(Dp(zi.RESIZE,J))}),E(),()=>{q=!0,cancelAnimationFrame(Y),d.current=!0;const K=o.current;K&&(K.onopen=null,K.onclose=null,K.onmessage=null,K.onerror=null,K.close(),o.current=null),P.dispose(),h.current=null,u.current=null}},[e,E]);const M=T.useRef(!0);T.useEffect(()=>{if(M.current){M.current=!1;return}const O=o.current;O&&(O.close(),o.current=null),!d.current&&h.current&&E()},[i,s,l,E]);const R=T.useCallback(()=>{var O;try{(O=u.current)==null||O.fit()}catch{}},[]),N=T.useCallback(()=>{var O;(O=h.current)==null||O.focus()},[]),D=T.useCallback(()=>{var P;const O=o.current;if(O){try{O.send(Dp(zi.CLOSE,new Uint8Array(0)))}catch{}O.close(),o.current=null}(P=h.current)==null||P.dispose(),h.current=null,u.current=null,d.current=!0},[]);return{fit:R,focus:N,destroy:D}}function NO({serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:u,onTitleChange:o}){const c=T.useRef(null),d=T.useCallback(()=>c.current,[]),{fit:g,focus:f}=MO(d,{serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:u,onTitleChange:o});return T.useEffect(()=>{const b=c.current;if(!b)return;const S=new ResizeObserver(()=>{requestAnimationFrame(()=>g())});return S.observe(b),()=>{S.disconnect()}},[g]),T.useEffect(()=>{const b=c.current;if(!b)return;let S=0;const k=10,w=setInterval(()=>{if(S++,S>k){clearInterval(w);return}b.offsetParent!==null&&(clearInterval(w),requestAnimationFrame(()=>g()))},100);return()=>{clearInterval(w)}},[g]),m.jsx("div",{ref:c,className:"w-full h-full",onFocus:f})}function jO(){const[e,n]=T.useState(()=>({height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}));return T.useEffect(()=>{const i=window.visualViewport;if(!i)return;const s=()=>{n({height:i.height,offsetTop:i.offsetTop,scale:i.scale})};return s(),i.addEventListener("resize",s),i.addEventListener("scroll",s),()=>{i.removeEventListener("resize",s),i.removeEventListener("scroll",s)}},[]),e}const OO=5,LO=300,IO=200,BO=.7;function zO({workspaceId:e,workspacePath:n,workspaceName:i,serverUrl:s,apiToken:l,isOpen:h,onClose:u}){var F,j,I;const o=Xl(),c=jO(),[d,g]=T.useState(new Map),[f,b]=T.useState(new Map),[S,k]=T.useState(LO),w=T.useRef(!1),_=T.useRef(0),y=T.useRef(0),v=T.useRef(new Set),x=e?(F=d.get(e))!=null?F:[]:[],E=e?f.get(e):void 0,R=(e&&(I=(j=d.get(e))==null?void 0:j.length)!=null?I:0)<OO,N=T.useCallback(async L=>{if(!(!s||!l||v.current.has(L))){v.current.add(L);try{const z=await fetch(`http://${s}/api/workspaces/${L}/terminals`,{headers:{Authorization:`Bearer ${l}`}});if(!z.ok)return;const X=await z.json();if(!X.sessions||X.sessions.length===0)return;const ee=X.sessions.map(te=>({id:crypto.randomUUID(),serverSessionId:te.id,workspaceId:L,workspacePath:te.cwd,title:te.title,status:"disconnected"}));g(te=>{var pe;const W=(pe=te.get(L))!=null?pe:[],H=new Set(W.map(ce=>ce.serverSessionId).filter(Boolean)),re=ee.filter(ce=>!H.has(ce.serverSessionId));if(re.length===0)return te;if(W.length>0){for(const ce of re)fetch(`http://${s}/api/workspaces/${L}/terminals/${ce.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{});return te}const ae=new Map(te);return ae.set(L,[...W,...re]),ae}),b(te=>{const W=new Map(te);return W.has(L)||W.set(L,ee[0].id),W})}catch(z){console.log("[TerminalPanel] fetchExistingSessions FAILED",z)}finally{v.current.delete(L)}}},[s,l]);T.useEffect(()=>{!e||!h||N(e)},[e,h,N]);const D=T.useCallback((L,z)=>{g(X=>{const ee=new Map(X);for(const[te,W]of ee.entries()){const H=W.map(re=>re.id===L?{...re,status:z}:re);H.some(re=>re.id===L)&&ee.set(te,H)}return ee})},[]),O=T.useCallback((L,z)=>{g(X=>{const ee=new Map(X);for(const[te,W]of ee.entries()){const H=W.map(re=>re.id===L?{...re,serverSessionId:z.sessionId,title:z.title||re.title}:re);H.some(re=>re.id===L)&&ee.set(te,H)}return ee})},[]),P=T.useCallback((L,z)=>{g(X=>{const ee=new Map(X);for(const[te,W]of ee.entries()){const H=W.map(re=>re.id===L?{...re,title:z}:re);H.some(re=>re.id===L)&&ee.set(te,H)}return ee})},[]),$=T.useCallback(()=>{if(!e||!n||!R)return;const L={id:crypto.randomUUID(),serverSessionId:null,workspaceId:e,workspacePath:n,title:"main",status:"connecting"};g(z=>{var te;const X=new Map(z),ee=(te=X.get(e))!=null?te:[];return X.set(e,[...ee,L]),X}),b(z=>{const X=new Map(z);return X.set(e,L.id),X})},[e,n,R]),U=T.useCallback(L=>{const z=[...d.values()].flat().find(X=>X.id===L);z!=null&&z.serverSessionId&&s&&l&&fetch(`http://${s}/api/workspaces/${z.workspaceId}/terminals/${z.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{}),g(X=>{const ee=new Map(X);for(const[te,W]of ee.entries()){const H=W.filter(re=>re.id!==L);H.length<W.length&&ee.set(te,H)}return ee}),b(X=>{var te,W;const ee=new Map(X);for(const[H,re]of ee.entries())if(re===L){const ae=(W=(te=d.get(H))==null?void 0:te.filter(pe=>pe.id!==L))!=null?W:[];ae.length>0?ee.set(H,ae[ae.length-1].id):ee.delete(H)}return ee})},[d,s,l]),q=T.useCallback(L=>{L.preventDefault(),w.current=!0;const z="touches"in L?L.touches[0].clientY:L.clientY;_.current=z,y.current=S;const X=te=>{if(!w.current)return;const W="touches"in te?te.touches[0].clientY:te.clientY,H=_.current-W,re=window.innerHeight*BO,ae=Math.min(Math.max(y.current+H,IO),re);k(ae)},ee=()=>{w.current=!1,document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",ee),document.removeEventListener("touchmove",X),document.removeEventListener("touchend",ee)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",ee),document.addEventListener("touchmove",X,{passive:!1}),document.addEventListener("touchend",ee)},[S]);if(!e||!n||!s||!l)return m.jsx("div",{className:"flex items-center justify-center h-[300px] border-t border-border bg-background text-muted-foreground text-sm",children:"Select a workspace to use the terminal."});const K=`[${i||n.split("/").pop()||"ws"}]`,V=L=>{switch(L){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},Q=()=>m.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[x.map(L=>m.jsxs("div",{className:_e("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",L.id===E?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>b(z=>{const X=new Map(z);return X.set(e,L.id),X}),children:[m.jsx("span",{className:_e("w-1.5 h-1.5 rounded-full shrink-0",V(L.status))}),m.jsxs("span",{children:[K," ",L.title]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:z=>{z.stopPropagation(),U(L.id)},children:m.jsx(Qr,{className:"w-3 h-3"})})]},L.id)),R&&m.jsx(ke,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:$,title:"New terminal tab",children:m.jsx(Ya,{className:"w-3.5 h-3.5"})})]}),J=()=>m.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:[x.map(L=>m.jsx("div",{className:_e("w-full h-full",L.id!==E?"invisible absolute inset-0 pointer-events-none":"relative"),children:m.jsx(PO,{tab:L,serverUrl:s,apiToken:l,onStatusChange:z=>D(L.id,z),onSessionInit:z=>O(L.id,z),onTitleChange:z=>P(L.id,z)},L.id)},L.id)),x.length===0&&m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})]});if(o){const z=c.height<window.innerHeight*.85?`calc(${c.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,c.height);return h?m.jsx(Id,{open:h,onOpenChange:X=>!X&&u(),children:m.jsxs(Bd,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:z},children:[m.jsx(zd,{className:"sr-only",children:m.jsx(Pd,{children:"Terminal"})}),m.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ib,{className:"w-4 h-4"}),m.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:u,children:m.jsx(Qr,{className:"w-4 h-4"})})]}),Q(),J()]})}):null}return m.jsxs("div",{className:_e(!h&&"hidden"),children:[m.jsx("div",{className:"w-full cursor-ns-resize flex items-center justify-center border-t border-border bg-background select-none shrink-0",style:{height:4},onMouseDown:q,onTouchStart:q,children:m.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),m.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:S},children:[m.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ib,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:u,children:m.jsx(Qr,{className:"w-3.5 h-3.5"})})]}),Q(),J()]})]})}function PO({tab:e,serverUrl:n,apiToken:i,onStatusChange:s,onSessionInit:l,onTitleChange:h}){const u=T.useRef(s),o=T.useRef(l),c=T.useRef(h);T.useEffect(()=>{u.current=s,o.current=l,c.current=h});const d=T.useCallback(b=>{u.current(b)},[]),g=T.useCallback(b=>{o.current(b)},[]),f=T.useCallback(b=>{c.current(b)},[]);return m.jsx(NO,{serverUrl:n,apiToken:i,cwd:e.workspacePath,serverSessionId:e.serverSessionId,onStatusChange:d,onSessionInit:g,onTitleChange:f})}const FO=Za("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function Lu({className:e,variant:n,...i}){return m.jsx("div",{"data-slot":"alert",role:"alert",className:_e(FO({variant:n}),e),...i})}function Iu({className:e,...n}){return m.jsx("div",{"data-slot":"alert-description",className:_e("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),...n})}function HO({className:e,value:n,...i}){return m.jsx(Z3,{"data-slot":"progress",className:_e("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),...i,children:m.jsx(Q3,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})})}function Cu(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function UO(e){return e>=60?"critical":e>=40?"warning":"normal"}function $O({totalTokens:e=0,contextWindow:n=0,modelName:i="",compact:s=!1}){const l=e===0?0:n,h=l===0?0:Math.min(100,Math.round(e/l*100)),u=UO(h);return s?m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsxs("span",{className:"text-xs font-mono",children:[Cu(e),"/",Cu(l)]}),m.jsx(Rl,{children:m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:m.jsx(jb,{className:"size-3 text-muted-foreground cursor-help"})}),m.jsxs(Ua,{side:"bottom",children:[m.jsxs("p",{className:"text-xs",children:["Model: ",i]}),m.jsxs("p",{className:"text-xs",children:[h,"% of context window used"]})]})]})})]}):m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),m.jsxs("span",{className:"text-xs font-mono",children:[Cu(e),"/",Cu(l)]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(HO,{value:h,className:_e("h-1 w-20",u==="critical"&&"[&>div]:bg-destructive",u==="warning"&&"[&>div]:bg-warning",u==="normal"&&"[&>div]:bg-primary")}),m.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",h,"%)"]})]})]}),m.jsx(Rl,{children:m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:m.jsx(jb,{className:"size-3.5 text-muted-foreground cursor-help"})}),m.jsx(Ua,{side:"bottom",children:m.jsxs("p",{className:"text-xs",children:["Model: ",i]})})]})})]})}function xg({...e}){return m.jsx(Oj,{"data-slot":"select",...e})}function qO({className:e,...n}){return m.jsx(Hj,{"data-slot":"select-group",className:_e("scroll-my-1 p-1",e),...n})}function Ga({...e}){return m.jsx(Ij,{"data-slot":"select-value",...e})}function Sg({className:e,size:n="default",children:i,...s}){return m.jsxs(Lj,{"data-slot":"select-trigger","data-size":n,className:_e("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[i,m.jsx(Bj,{asChild:!0,children:m.jsx(Ka,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function wg({className:e,children:n,position:i="item-aligned",align:s="center",...l}){return m.jsx(zj,{children:m.jsxs(Pj,{"data-slot":"select-content","data-align-trigger":i==="item-aligned",className:_e("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,align:s,...l,children:[m.jsx(GO,{}),m.jsx(Fj,{"data-position":i,className:_e("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",i==="popper"&&""),children:n}),m.jsx(WO,{})]})})}function VO({className:e,...n}){return m.jsx(Uj,{"data-slot":"select-label",className:_e("px-1.5 py-1 text-xs text-muted-foreground",e),...n})}function Zu({className:e,children:n,...i}){return m.jsxs($j,{"data-slot":"select-item",className:_e("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...i,children:[m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:m.jsx(Vj,{children:m.jsx(ei,{className:"pointer-events-none"})})}),m.jsx(qj,{children:n})]})}function GO({className:e,...n}){return m.jsx(Gj,{"data-slot":"select-scroll-up-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:m.jsx(wA,{})})}function WO({className:e,...n}){return m.jsx(Wj,{"data-slot":"select-scroll-down-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:m.jsx(Ka,{})})}function Jr({className:e,...n}){return m.jsx(D3,{"data-slot":"label",className:_e("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function KO(e){switch(e){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function YO({models:e,selectedModelId:n,onChangeModel:i,disabled:s,iconOnly:l=!1,connectedProviderIds:h,connectableProviderIds:u}){const o=e.reduce((d,g)=>(d[g.providerName]||(d[g.providerName]=[]),d[g.providerName].push(g),d),{}),c=d=>{const g=e.find(f=>f.id===d);g&&i(d,g.providerId)};return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(Jr,{className:"text-xs text-muted-foreground",children:"Model:"}),m.jsxs(xg,{value:n||"",onValueChange:c,disabled:s,children:[m.jsx(Sg,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[180px] h-8 text-sm",children:l?m.jsxs(m.Fragment,{children:[m.jsx(jA,{className:"size-4"}),m.jsx(Ga,{className:"sr-only"})]}):m.jsx(Ga,{placeholder:"Select model"})}),m.jsx(wg,{children:Object.entries(o).map(([d,g])=>m.jsxs(qO,{children:[m.jsx(VO,{children:d}),g.map(f=>m.jsx(Zu,{value:f.id,disabled:(u==null?void 0:u.has(f.providerId))&&!(h!=null&&h.has(f.providerId)),children:m.jsxs("span",{className:"flex items-center gap-2",children:[f.name,m.jsx("span",{className:"text-muted-foreground text-xs",children:KO(f.tier)}),(u==null?void 0:u.has(f.providerId))&&(h==null?void 0:h.has(f.providerId))&&m.jsx(un,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"Sub"}),(u==null?void 0:u.has(f.providerId))&&!(h!=null&&h.has(f.providerId))&&m.jsx(un,{variant:"outline",className:"text-[10px] px-1 py-0 h-4",children:"OAuth"})]})},f.id))]},d))})]})]})}const XO={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function ZO(e){return XO[e]||e.charAt(0).toUpperCase()+e.slice(1)}function QO({variants:e,selectedVariant:n,onChangeVariant:i,disabled:s,iconOnly:l=!1}){if(!e||Object.keys(e).length===0)return null;const h=Object.keys(e),u=o=>{i(o==="__none__"?null:o)};return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(Jr,{className:"text-xs text-muted-foreground",children:"Thinking:"}),m.jsxs(xg,{value:n||"__none__",onValueChange:u,disabled:s,children:[m.jsx(Sg,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[120px] h-8 text-sm",children:l?m.jsxs(m.Fragment,{children:[m.jsx(gA,{className:"size-4"}),m.jsx(Ga,{className:"sr-only"})]}):m.jsx(Ga,{placeholder:"Default"})}),m.jsxs(wg,{children:[m.jsx(Zu,{value:"__none__",children:"Default"}),h.map(o=>m.jsx(Zu,{value:o,children:ZO(o)},o))]})]})]})}function JO({preconfigs:e,selectedPreconfigId:n,onChangePreconfig:i,disabled:s,iconOnly:l=!1}){return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(Jr,{className:"text-xs text-muted-foreground",children:"Config:"}),m.jsxs(xg,{value:n||"",onValueChange:i,disabled:s,children:[m.jsx(Sg,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[140px] h-8 text-sm",children:l?m.jsxs(m.Fragment,{children:[m.jsx(Px,{className:"size-4"}),m.jsx(Ga,{className:"sr-only"})]}):m.jsx(Ga,{placeholder:"Select config"})}),m.jsx(wg,{children:e.map(h=>m.jsxs(Zu,{value:h.id,children:[h.name,h.isDefault&&m.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},h.id))})]})]})}function eL({session:e,preconfigs:n,models:i,usage:s,modelName:l,onChangePreconfig:h,onChangeModel:u,onChangeVariant:o,onRename:c,onNavigateBack:d,isStreaming:g,onInterrupt:f,onCompact:b,isCompacting:S,canCompact:k,connectedProviderIds:w,connectableProviderIds:_,selectedVariant:y,variants:v}){var K;const[x,E]=T.useState(!1),[M,R]=T.useState(e.title||""),N=T.useRef(null),D=Xl();T.useEffect(()=>{x&&N.current&&(N.current.focus(),N.current.select())},[x]);const O=()=>{R(e.title||""),E(!0)},P=()=>{const V=M.trim();V&&V!==e.title&&c(e.id,V),E(!1)},$=V=>{V.key==="Enter"?P():V.key==="Escape"&&(R(e.title||""),E(!1))},U=e.selectedModel||((K=n.find(V=>V.id===e.preconfigId))==null?void 0:K.model)||l,q=i.find(V=>V.id===U),Y=q==null?void 0:q.contextWindow;return m.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[m.jsx("div",{className:"flex items-center justify-start px-4 py-2",children:m.jsxs("div",{className:"flex items-center gap-3",children:[e.parentId&&d&&m.jsxs(ke,{variant:"ghost",size:"sm",onClick:d,className:"h-7",children:[m.jsx(dA,{className:"size-4","data-icon":"inline-start"}),"Back"]}),x?m.jsx("input",{ref:N,type:"text",value:M,onChange:V=>R(V.target.value),onBlur:P,onKeyDown:$,className:"text-lg font-semibold bg-background border border-primary rounded px-2 py-0.5 outline-none min-w-0 flex-1",autoFocus:!0}):m.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors",onDoubleClick:O,children:e.title||"Untitled Session"}),m.jsx(un,{variant:"outline",className:"font-mono text-xs",children:e.id.slice(0,8)}),e.status==="closed"&&m.jsxs(un,{variant:"secondary",children:[m.jsx(cA,{className:"size-3","data-icon":"inline-start"}),"Archived"]})]})}),m.jsx(ml,{}),m.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[m.jsx($O,{promptTokens:s.promptTokens,completionTokens:s.completionTokens,totalTokens:s.totalTokens,contextWindow:Y,modelName:l,compact:D}),m.jsx(ml,{orientation:"vertical",className:"hidden sm:block"}),m.jsx(YO,{models:i,selectedModelId:U,onChangeModel:u,disabled:e.status==="closed"||!!e.parentId,iconOnly:D,connectedProviderIds:w,connectableProviderIds:_}),m.jsx(QO,{variants:v,selectedVariant:y,onChangeVariant:o,disabled:e.status==="closed"||!!e.parentId,iconOnly:D}),m.jsx(JO,{preconfigs:n,selectedPreconfigId:e.preconfigId,onChangePreconfig:h,disabled:e.status==="closed"||!!e.parentId,iconOnly:D}),m.jsx(ml,{orientation:"vertical",className:"hidden sm:block"}),b&&m.jsxs(m.Fragment,{children:[m.jsxs(ke,{variant:"outline",size:D?"icon":"sm",onClick:b,disabled:g||S||!k,title:S?"Compacting...":"Compact older messages",children:[m.jsx(lT,{className:"size-4"}),!D&&m.jsx("span",{className:"ml-1",children:S?"Compacting...":"Compact"})]}),m.jsx(ml,{orientation:"vertical",className:"hidden sm:block"})]}),m.jsxs(ke,{variant:g?"destructive":"outline",size:D?"icon":"sm",onClick:f,disabled:!f,className:g?"":"opacity-60 hover:opacity-100",title:g?"Interrupt operation":"Interrupt (no active operation)",children:[m.jsx(Hx,{className:"size-4"}),!D&&m.jsx("span",{className:"ml-1",children:"Stop"})]})]})]})}function N0({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",onConfirm:u,variant:o="default"}){const c=()=>{u(),n(!1)};return m.jsx(ro,{open:e,onOpenChange:n,children:m.jsxs(io,{showCloseButton:!1,children:[m.jsxs(so,{children:[m.jsx(ao,{children:i}),m.jsx(Kl,{children:s})]}),m.jsxs(Nd,{children:[m.jsx(g4,{asChild:!0,children:m.jsx(ke,{variant:"outline",children:h})}),m.jsx(ke,{onClick:c,variant:o==="destructive"?"destructive":"default",children:l})]})]})})}function tL({message:e,textContent:n,children:i,isQueued:s=!1,onRemove:l,onRevert:h,canRevert:u=!1,onFork:o,canFork:c=!1}){const[d,g]=T.useState(!1),[f,b]=T.useState(!1),[S,k]=T.useState(!1),w=e.role==="user",_=async()=>{const y=n||"";await navigator.clipboard.writeText(y),g(!0),setTimeout(()=>g(!1),2e3)};return m.jsxs("div",{className:_e("flex flex-col gap-1 mb-4 animate-slide-up min-w-0",w?"items-end":"items-start"),children:[m.jsx("div",{className:_e("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",w?"mr-3":"ml-3"),children:w?m.jsxs(m.Fragment,{children:[!s&&m.jsxs(m.Fragment,{children:[u&&h&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>b(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:m.jsx(FT,{className:"size-3"})}),c&&o&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>k(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:m.jsx(KA,{className:"size-3"})}),m.jsx(ke,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:d?m.jsx(ei,{className:"size-3"}):m.jsx(wl,{className:"size-3"})})]}),m.jsx(Ux,{className:"size-3"}),e.role]}):m.jsxs(m.Fragment,{children:[m.jsx(fA,{className:"size-3"}),e.role,m.jsx(ke,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:d?m.jsx(ei,{className:"size-3"}):m.jsx(wl,{className:"size-3"})})]})}),m.jsxs("div",{className:_e("rounded-2xl px-4 py-3 max-w-full relative group min-w-0 overflow-hidden",s?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":w?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md"),children:[s&&m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(zx,{className:"size-3 animate-pulse"}),m.jsx("span",{children:"Pending"})]}),l&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:l,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:m.jsx(Qr,{className:"size-3"})})]}),m.jsx("div",{className:"min-w-0",children:i})]}),m.jsx(N0,{open:f,onOpenChange:b,title:"Revert Conversation",description:"This will delete this message and all messages after it. Are you sure you want to continue?",confirmLabel:"Revert",cancelLabel:"Cancel",onConfirm:()=>{h==null||h()},variant:"destructive"}),m.jsx(N0,{open:S,onOpenChange:k,title:"Fork Conversation",description:"This will create a new session with messages up to and including this point. The original session will be unchanged.",confirmLabel:"Fork",cancelLabel:"Cancel",onConfirm:()=>{o==null||o()}})]})}var nL=Object.create,Fd=Object.defineProperty,rL=Object.defineProperties,iL=Object.getOwnPropertyDescriptor,sL=Object.getOwnPropertyDescriptors,NC=Object.getOwnPropertyNames,Qu=Object.getOwnPropertySymbols,aL=Object.getPrototypeOf,Cg=Object.prototype.hasOwnProperty,jC=Object.prototype.propertyIsEnumerable,j0=(e,n,i)=>n in e?Fd(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,Ar=(e,n)=>{for(var i in n||(n={}))Cg.call(n,i)&&j0(e,i,n[i]);if(Qu)for(var i of Qu(n))jC.call(n,i)&&j0(e,i,n[i]);return e},Hd=(e,n)=>rL(e,sL(n)),OC=(e,n)=>{var i={};for(var s in e)Cg.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&Qu)for(var s of Qu(e))n.indexOf(s)<0&&jC.call(e,s)&&(i[s]=e[s]);return i},oL=(e,n)=>function(){return n||(0,e[NC(e)[0]])((n={exports:{}}).exports,n),n.exports},lL=(e,n)=>{for(var i in n)Fd(e,i,{get:n[i],enumerable:!0})},cL=(e,n,i,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of NC(n))!Cg.call(e,l)&&l!==i&&Fd(e,l,{get:()=>n[l],enumerable:!(s=iL(n,l))||s.enumerable});return e},uL=(e,n,i)=>(i=e!=null?nL(aL(e)):{},cL(!e||!e.__esModule?Fd(i,"default",{value:e,enumerable:!0}):i,e)),dL=oL({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,n){var i=(function(){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},u={util:{encode:function k(w){return w instanceof o?new o(w.type,k(w.content),w.alias):Array.isArray(w)?w.map(k):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(w,_){_=_||{};var y,v;switch(u.util.type(w)){case"Object":if(v=u.util.objId(w),_[v])return _[v];y={},_[v]=y;for(var x in w)w.hasOwnProperty(x)&&(y[x]=k(w[x],_));return y;case"Array":return v=u.util.objId(w),_[v]?_[v]:(y=[],_[v]=y,w.forEach(function(E,M){y[M]=k(E,_)}),y);default:return w}},getLanguage:function(k){for(;k;){var w=s.exec(k.className);if(w)return w[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,w){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+w)},isActive:function(k,w,_){for(var y="no-"+w;k;){var v=k.classList;if(v.contains(w))return!0;if(v.contains(y))return!1;k=k.parentElement}return!!_}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(k,w){var _=u.util.clone(u.languages[k]);for(var y in w)_[y]=w[y];return _},insertBefore:function(k,w,_,y){y=y||u.languages;var v=y[k],x={};for(var E in v)if(v.hasOwnProperty(E)){if(E==w)for(var M in _)_.hasOwnProperty(M)&&(x[M]=_[M]);_.hasOwnProperty(E)||(x[E]=v[E])}var R=y[k];return y[k]=x,u.languages.DFS(u.languages,function(N,D){D===R&&N!=k&&(this[N]=x)}),x},DFS:function k(w,_,y,v){v=v||{};var x=u.util.objId;for(var E in w)if(w.hasOwnProperty(E)){_.call(w,E,w[E],y||E);var M=w[E],R=u.util.type(M);R==="Object"&&!v[x(M)]?(v[x(M)]=!0,k(M,_,null,v)):R==="Array"&&!v[x(M)]&&(v[x(M)]=!0,k(M,_,E,v))}}},plugins:{},highlight:function(k,w,_){var y={code:k,grammar:w,language:_};if(u.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=u.tokenize(y.code,y.grammar),u.hooks.run("after-tokenize",y),o.stringify(u.util.encode(y.tokens),y.language)},tokenize:function(k,w){var _=w.rest;if(_){for(var y in _)w[y]=_[y];delete w.rest}var v=new g;return f(v,v.head,k),d(k,v,w,v.head,0),S(v)},hooks:{all:{},add:function(k,w){var _=u.hooks.all;_[k]=_[k]||[],_[k].push(w)},run:function(k,w){var _=u.hooks.all[k];if(!(!_||!_.length))for(var y=0,v;v=_[y++];)v(w)}},Token:o};function o(k,w,_,y){this.type=k,this.content=w,this.alias=_,this.length=(y||"").length|0}o.stringify=function k(w,_){if(typeof w=="string")return w;if(Array.isArray(w)){var y="";return w.forEach(function(R){y+=k(R,_)}),y}var v={type:w.type,content:k(w.content,_),tag:"span",classes:["token",w.type],attributes:{},language:_},x=w.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(v.classes,x):v.classes.push(x)),u.hooks.run("wrap",v);var E="";for(var M in v.attributes)E+=" "+M+'="'+(v.attributes[M]||"").replace(/"/g,""")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+E+">"+v.content+"</"+v.tag+">"};function c(k,w,_,y){k.lastIndex=w;var v=k.exec(_);if(v&&y&&v[1]){var x=v[1].length;v.index+=x,v[0]=v[0].slice(x)}return v}function d(k,w,_,y,v,x){for(var E in _)if(!(!_.hasOwnProperty(E)||!_[E])){var M=_[E];M=Array.isArray(M)?M:[M];for(var R=0;R<M.length;++R){if(x&&x.cause==E+","+R)return;var N=M[R],D=N.inside,O=!!N.lookbehind,P=!!N.greedy,$=N.alias;if(P&&!N.pattern.global){var U=N.pattern.toString().match(/[imsuy]*$/)[0];N.pattern=RegExp(N.pattern.source,U+"g")}for(var q=N.pattern||N,Y=y.next,K=v;Y!==w.tail&&!(x&&K>=x.reach);K+=Y.value.length,Y=Y.next){var V=Y.value;if(w.length>k.length)return;if(!(V instanceof o)){var Q=1,J;if(P){if(J=c(q,K,k,O),!J||J.index>=k.length)break;var L=J.index,F=J.index+J[0].length,j=K;for(j+=Y.value.length;L>=j;)Y=Y.next,j+=Y.value.length;if(j-=Y.value.length,K=j,Y.value instanceof o)continue;for(var I=Y;I!==w.tail&&(j<F||typeof I.value=="string");I=I.next)Q++,j+=I.value.length;Q--,V=k.slice(K,j),J.index-=K}else if(J=c(q,0,V,O),!J)continue;var L=J.index,z=J[0],X=V.slice(0,L),ee=V.slice(L+z.length),te=K+V.length;x&&te>x.reach&&(x.reach=te);var W=Y.prev;X&&(W=f(w,W,X),K+=X.length),b(w,W,Q);var H=new o(E,D?u.tokenize(z,D):z,$,z);if(Y=f(w,W,H),ee&&f(w,Y,ee),Q>1){var re={cause:E+","+R,reach:te};d(k,w,_,Y.prev,K,re),x&&re.reach>x.reach&&(x.reach=re.reach)}}}}}}function g(){var k={value:null,prev:null,next:null},w={value:null,prev:k,next:null};k.next=w,this.head=k,this.tail=w,this.length=0}function f(k,w,_){var y=w.next,v={value:_,prev:w,next:y};return w.next=v,y.prev=v,k.length++,v}function b(k,w,_){for(var y=w.next,v=0;v<_&&y!==k.tail;v++)y=y.next;w.next=y,y.prev=w,k.length-=v}function S(k){for(var w=[],_=k.head.next;_!==k.tail;)w.push(_.value),_=_.next;return w}return u})();n.exports=i,i.default=i}}),ve=uL(dL());ve.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ve.languages.markup.tag.inside["attr-value"].inside.entity=ve.languages.markup.entity,ve.languages.markup.doctype.inside["internal-subset"].inside=ve.languages.markup,ve.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ve.languages.markup.tag,"addInlined",{value:function(e,s){var i={},i=(i["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ve.languages[s]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),s=(i["language-"+s]={pattern:/[\s\S]+/,inside:ve.languages[s]},{});s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},ve.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(ve.languages.markup.tag,"addAttribute",{value:function(e,n){ve.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:ve.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ve.languages.html=ve.languages.markup,ve.languages.mathml=ve.languages.markup,ve.languages.svg=ve.languages.markup,ve.languages.xml=ve.languages.extend("markup",{}),ve.languages.ssml=ve.languages.xml,ve.languages.atom=ve.languages.xml,ve.languages.rss=ve.languages.xml,(function(e){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s="(?:[^\\\\-]|"+i.source+")",s=RegExp(s+"-"+s),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":n,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":l}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ve),ve.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ve.languages.javascript=ve.languages.extend("clike",{"class-name":[ve.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ve.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ve.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ve.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ve.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ve.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ve.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ve.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ve.languages.markup&&(ve.languages.markup.tag.addInlined("script","javascript"),ve.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ve.languages.js=ve.languages.javascript,ve.languages.actionscript=ve.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ve.languages.actionscript["class-name"].alias="function",delete ve.languages.actionscript.parameter,delete ve.languages.actionscript["literal-property"],ve.languages.markup&&ve.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ve.languages.markup}}),(function(e){var n=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:i}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(ve),(function(e){var n=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(n,"addSupport",{value:function(i,s){(i=typeof i=="string"?[i]:i).forEach(function(l){var h=function(f){f.inside||(f.inside={}),f.inside.rest=s},u="doc-comment";if(o=e.languages[l]){var o,c=o[u];if((c=c||(o=e.languages.insertBefore(l,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[u])instanceof RegExp&&(c=o[u]={pattern:c}),Array.isArray(c))for(var d=0,g=c.length;d<g;d++)c[d]instanceof RegExp&&(c[d]={pattern:c[d]}),h(c[d]);else h(c)}})}}),n.addSupport(["java","javascript","php"],n)})(ve),(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,n=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(ve),(function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=n,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,number:i})})(ve),(function(e){var n=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+i.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+i.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),h=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function u(o,c){c=(c||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return o});return RegExp(d,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+h+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:u(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:u(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:u(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:u(h),lookbehind:!0,greedy:!0},number:{pattern:u(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(ve),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(d){return d=d.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),h=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,u=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+h+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+h+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+h+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(g){d!==g&&(e.languages.markdown[d].inside.content.inside[g]=e.languages.markdown[g])})}),e.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function g(f){if(f&&typeof f!="string")for(var b=0,S=f.length;b<S;b++){var k,w=f[b];w.type!=="code"?g(w.content):(k=w.content[1],w=w.content[3],k&&w&&k.type==="code-language"&&w.type==="code-block"&&typeof k.content=="string"&&(k=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),k="language-"+(k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,k]:w.alias.push(k):w.alias=[k]))}})(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var g="",f=0,b=d.classes.length;f<b;f++){var S=d.classes[f],S=/language-(.+)/.exec(S);if(S){g=S[1];break}}var k,w=e.languages[g];w?d.content=e.highlight((function(_){return _=_.replace(u,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(y,v){var x;return(v=v.toLowerCase())[0]==="#"?(x=v[1]==="x"?parseInt(v.slice(2),16):Number(v.slice(1)),c(x)):o[v]||y})})(d.content),w,g):g&&g!=="none"&&e.plugins.autoloader&&(k="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=k,e.plugins.autoloader.loadLanguages(g,function(){var _=document.getElementById(k);_&&(_.innerHTML=e.highlight(_.textContent,e.languages[g],g))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),o={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(ve),ve.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ve.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ve.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var n=e.tokens.filter(function(k){return typeof k!="string"&&k.type!=="comment"&&k.type!=="scalar"}),i=0;i<n.length;){var s=n[i++];if(s.type==="keyword"&&s.content==="mutation"){var l=[];if(f(["definition-mutation","punctuation"])&&g(1).content==="("){i+=2;var h=b(/^\($/,/^\)$/);if(h===-1)continue;for(;i<h;i++){var u=g(0);u.type==="variable"&&(S(u,"variable-input"),l.push(u.content))}i=h+1}if(f(["punctuation","property-query"])&&g(0).content==="{"&&(i++,S(g(0),"property-mutation"),0<l.length)){var o=b(/^\{$/,/^\}$/);if(o!==-1)for(var c=i;c<o;c++){var d=n[c];d.type==="variable"&&0<=l.indexOf(d.content)&&S(d,"variable-input")}}}}function g(k){return n[i+k]}function f(k,w){w=w||0;for(var _=0;_<k.length;_++){var y=g(_+w);if(!y||y.type!==k[_])return}return 1}function b(k,w){for(var _=1,y=i;y<n.length;y++){var v=n[y],x=v.content;if(v.type==="punctuation"&&typeof x=="string"){if(k.test(x))_++;else if(w.test(x)&&--_===0)return y}}return-1}function S(k,w){var _=k.alias;_?Array.isArray(_)||(k.alias=_=[_]):k.alias=_=[],_.push(w)}}),ve.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var n=e.languages.javascript["template-string"],i=n.pattern.source,s=n.inside.interpolation,l=s.inside["interpolation-punctuation"],h=s.pattern.source;function u(f,b){if(e.languages[f])return{pattern:RegExp("((?:"+b+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function o(f,b,S){return f={code:f,grammar:b,language:S},e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(f.code,f.grammar),e.hooks.run("after-tokenize",f),f.tokens}function c(f,b,S){var _=e.tokenize(f,{interpolation:{pattern:RegExp(h),lookbehind:!0}}),k=0,w={},_=o(_.map(function(v){if(typeof v=="string")return v;for(var x,E,v=v.content;f.indexOf((E=k++,x="___"+S.toUpperCase()+"_"+E+"___"))!==-1;);return w[x]=v,x}).join(""),b,S),y=Object.keys(w);return k=0,(function v(x){for(var E=0;E<x.length;E++){if(k>=y.length)return;var M,R,N,D,O,P,$,U=x[E];typeof U=="string"||typeof U.content=="string"?(M=y[k],($=(P=typeof U=="string"?U:U.content).indexOf(M))!==-1&&(++k,R=P.substring(0,$),O=w[M],N=void 0,(D={})["interpolation-punctuation"]=l,(D=e.tokenize(O,D)).length===3&&((N=[1,1]).push.apply(N,o(D[1],e.languages.javascript,"javascript")),D.splice.apply(D,N)),N=new e.Token("interpolation",D,s.alias,O),D=P.substring($+M.length),O=[],R&&O.push(R),O.push(N),D&&(v(P=[D]),O.push.apply(O,P)),typeof U=="string"?(x.splice.apply(x,[E,1].concat(O)),E+=O.length-1):U.content=O)):($=U.content,Array.isArray($)?v($):v([$]))}})(_),new e.Token(S,_,"language-"+S,f)}e.languages.javascript["template-string"]=[u("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),u("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),u("svg",/\bsvg/.source),u("markdown",/\b(?:markdown|md)/.source),u("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),u("sql",/\bsql/.source),n].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function g(f){return typeof f=="string"?f:Array.isArray(f)?f.map(g).join(""):g(f.content)}e.hooks.add("after-tokenize",function(f){f.language in d&&(function b(S){for(var k=0,w=S.length;k<w;k++){var _,y,v,x=S[k];typeof x!="string"&&(_=x.content,Array.isArray(_)?x.type==="template-string"?(x=_[1],_.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(y=g(x),x=x.alias,x=Array.isArray(x)?x[0]:x,v=e.languages[x])&&(_[1]=c(y,v,x))):b(_):typeof _!="string"&&b([_]))}})(f.tokens)})})(ve),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(ve),(function(e){var n=e.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,s="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(s+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(s+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(ve),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ve),ve.languages.n4js=ve.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ve.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ve.languages.n4jsd=ve.languages.n4js,(function(e){function n(u,o){return RegExp(u.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),o)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],s=0;s<i.length;s++){var h=i[s],l=e.languages.javascript[h],h=(l=e.util.type(l)==="RegExp"?e.languages.javascript[h]={pattern:l}:l).inside||{};(l.inside=h)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ve),(function(e){var n=e.util.clone(e.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,l=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function h(c,d){return c=c.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return l}),RegExp(c,d)}l=h(l).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=h(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:h(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:h(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function u(c){for(var d=[],g=0;g<c.length;g++){var f=c[g],b=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===o(f.content[0].content[1])&&d.pop():f.content[f.content.length-1].content!=="/>"&&d.push({tagName:o(f.content[0].content[1]),openedBraces:0}):0<d.length&&f.type==="punctuation"&&f.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?d[d.length-1].openedBraces--:b=!0),(b||typeof f=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(b=o(f),g<c.length-1&&(typeof c[g+1]=="string"||c[g+1].type==="plain-text")&&(b+=o(c[g+1]),c.splice(g+1,1)),0<g&&(typeof c[g-1]=="string"||c[g-1].type==="plain-text")&&(b=o(c[g-1])+b,c.splice(g-1,1),g--),c[g]=new e.Token("plain-text",b,null,b)),f.content&&typeof f.content!="string"&&u(f.content)}}var o=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(o).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||u(c.tokens)})})(ve),(function(e){var n=e.util.clone(e.languages.typescript),n=(e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(ve),ve.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ve.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ve.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(ve),ve.languages.c=ve.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ve.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ve.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ve.languages.c.string],char:ve.languages.c.char,comment:ve.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ve.languages.c}}}}),ve.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ve.languages.c.boolean,ve.languages.objectivec=ve.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ve.languages.objectivec["class-name"],ve.languages.objc=ve.languages.objectivec,ve.languages.reason=ve.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ve.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ve.languages.reason.function,(function(e){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(ve),ve.languages.go=ve.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ve.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ve.languages.go["class-name"],(function(e){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(ve),ve.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ve.languages.python["string-interpolation"].inside.interpolation.inside.rest=ve.languages.python,ve.languages.py=ve.languages.python,ve.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ve.languages.webmanifest=ve.languages.json;var Dl={};lL(Dl,{dracula:()=>fL,duotoneDark:()=>mL,duotoneLight:()=>vL,github:()=>yL,gruvboxMaterialDark:()=>KL,gruvboxMaterialLight:()=>XL,jettwaveDark:()=>FL,jettwaveLight:()=>UL,nightOwl:()=>xL,nightOwlLight:()=>wL,oceanicNext:()=>kL,okaidia:()=>AL,oneDark:()=>qL,oneLight:()=>GL,palenight:()=>RL,shadesOfPurple:()=>ML,synthwave84:()=>jL,ultramin:()=>LL,vsDark:()=>LC,vsLight:()=>zL});var hL={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},fL=hL,pL={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},mL=pL,gL={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},vL=gL,_L={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},yL=_L,bL={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},xL=bL,SL={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},wL=SL,In={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},CL={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:In.keyword}},{types:["attr-value"],style:{color:In.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:In.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:In.primitive}},{types:["boolean"],style:{color:In.boolean}},{types:["tag"],style:{color:In.tag}},{types:["string"],style:{color:In.string}},{types:["punctuation"],style:{color:In.string}},{types:["selector","char","builtin","inserted"],style:{color:In.char}},{types:["function"],style:{color:In.function}},{types:["operator","entity","url","variable"],style:{color:In.variable}},{types:["keyword"],style:{color:In.keyword}},{types:["atrule","class-name"],style:{color:In.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},kL=CL,EL={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},AL=EL,TL={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},RL=TL,DL={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},ML=DL,NL={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},jL=NL,OL={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},LL=OL,IL={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},LC=IL,BL={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},zL=BL,PL={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},FL=PL,HL={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},UL=HL,$L={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},qL=$L,VL={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},GL=VL,WL={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},KL=WL,YL={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},XL=YL,ZL=e=>T.useCallback(n=>{var i=n,{className:s,style:l,line:h}=i,u=OC(i,["className","style","line"]);const o=Hd(Ar({},u),{className:sd("token-line",s)});return typeof e=="object"&&"plain"in e&&(o.style=e.plain),typeof l=="object"&&(o.style=Ar(Ar({},o.style||{}),l)),o},[e]),QL=e=>{const n=T.useCallback(({types:i,empty:s})=>{if(e!=null){{if(i.length===1&&i[0]==="plain")return s!=null?{display:"inline-block"}:void 0;if(i.length===1&&s!=null)return e[i[0]]}return Object.assign(s!=null?{display:"inline-block"}:{},...i.map(l=>e[l]))}},[e]);return T.useCallback(i=>{var s=i,{token:l,className:h,style:u}=s,o=OC(s,["token","className","style"]);const c=Hd(Ar({},o),{className:sd("token",...l.types,h),children:l.content,style:n(l)});return u!=null&&(c.style=Ar(Ar({},c.style||{}),u)),c},[n])},JL=/\r\n|\r|\n/,O0=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
476
|
-
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
477
|
-
`,e[0].empty=!0)},L0=(e,n)=>{const i=e.length;return i>0&&e[i-1]===n?e:e.concat(n)},e6=e=>{const n=[[]],i=[e],s=[0],l=[e.length];let h=0,u=0,o=[];const c=[o];for(;u>-1;){for(;(h=s[u]++)<l[u];){let d,g=n[u];const b=i[u][h];if(typeof b=="string"?(g=u>0?g:["plain"],d=b):(g=L0(g,b.type),b.alias&&(g=L0(g,b.alias)),d=b.content),typeof d!="string"){u++,n.push(g),i.push(d),s.push(0),l.push(d.length);continue}const S=d.split(JL),k=S.length;o.push({types:g,content:S[0]});for(let w=1;w<k;w++)O0(o),c.push(o=[]),o.push({types:g,content:S[w]})}u--,n.pop(),i.pop(),s.pop(),l.pop()}return O0(o),c},I0=e6,t6=({prism:e,code:n,grammar:i,language:s})=>T.useMemo(()=>{if(i==null)return I0([n]);const l={code:n,grammar:i,language:s,tokens:[]};return e.hooks.run("before-tokenize",l),l.tokens=e.tokenize(n,i),e.hooks.run("after-tokenize",l),I0(l.tokens)},[n,i,s,e]),n6=(e,n)=>{const{plain:i}=e,s=e.styles.reduce((l,h)=>{const{languages:u,style:o}=h;return u&&!u.includes(n)||h.types.forEach(c=>{const d=Ar(Ar({},l[c]),o);l[c]=d}),l},{});return s.root=i,s.plain=Hd(Ar({},i),{backgroundColor:void 0}),s},r6=n6,i6=({children:e,language:n,code:i,theme:s,prism:l})=>{const h=n.toLowerCase(),u=r6(s,h),o=ZL(u),c=QL(u),d=l.languages[h],g=t6({prism:l,language:h,code:i,grammar:d});return e({tokens:g,className:`prism-code language-${h}`,style:u!=null?u.root:{},getLineProps:o,getTokenProps:c})},kg=e=>T.createElement(i6,Hd(Ar({},e),{prism:e.prism||ve,theme:e.theme||LC,code:e.code,language:e.language}));/*! Bundled license information:
|
|
478
|
-
|
|
479
|
-
prismjs/prism.js:
|
|
480
|
-
(**
|
|
481
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
482
|
-
*
|
|
483
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
484
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
485
|
-
* @namespace
|
|
486
|
-
* @public
|
|
487
|
-
*)
|
|
488
|
-
*/function s6(e){var s;const n=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[n||""]||n||"text"}function a6({type:e,content:n,lineNumber:i,newLineNumber:s,language:l}){const h=_e("flex font-mono text-xs",e==="added"&&"bg-green-500/20",e==="removed"&&"bg-red-500/20",e==="context"&&"bg-muted/30"),u=_e("font-bold w-4 select-none",e==="added"&&"text-green-400",e==="removed"&&"text-red-400",e==="context"&&"text-muted-foreground/50");return m.jsxs("div",{className:h,children:[m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:i!=null?i:""}),m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:s!=null?s:""}),m.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[m.jsxs("span",{className:u,children:[e==="added"&&"+",e==="removed"&&"-",e==="context"&&" "]}),m.jsx(kg,{theme:Dl.oneDark,code:n,language:l,children:({tokens:o,getTokenProps:c})=>m.jsx(m.Fragment,{children:o.map((d,g)=>m.jsx("span",{children:d.map((f,b)=>m.jsx("span",{...c({token:f})},b))},g))})})]})]})}function B0({hunks:e,path:n,language:i,additions:s,deletions:l}){const[h,u]=T.useState(!0),o=i||s6(n);return m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[m.jsx("button",{onClick:()=>u(!h),className:"px-1 py-1 hover:bg-muted rounded",children:h?m.jsx(Ka,{className:"size-3"}):m.jsx(ti,{className:"size-3"})}),m.jsx(Rm,{className:"size-3"}),m.jsx("span",{className:"font-mono pr-2",children:n}),s!==void 0&&l!==void 0&&m.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",s," -",l]})]}),h&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:e.map((c,d)=>m.jsx("div",{className:"divide-y divide-white/5",children:c.changes.map((g,f)=>m.jsx(a6,{...g,language:o},f))},d))})]})})}function o6(e){var s;const n=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[n||""]||n||"text"}const l6=({content:e,path:n,language:i,created:s,highlightLines:l=[]})=>{const[h,u]=T.useState(!0),o=i||o6(n),c=new Set(l);return m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[m.jsx("button",{onClick:()=>u(!h),className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:h?m.jsx(Ka,{className:"size-3"}):m.jsx(ti,{className:"size-3"})}),m.jsx(Rm,{className:"size-3"}),m.jsx("span",{className:"font-mono pr-2",children:n}),s===!1?m.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[m.jsx(gl,{className:"size-3"}),"Overwrote"]}):m.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[m.jsx(ei,{className:"size-3"}),"Created"]})]}),h&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:m.jsx(kg,{theme:Dl.oneDark,code:e,language:o,children:({tokens:d,getTokenProps:g})=>m.jsx(m.Fragment,{children:d.map((f,b)=>m.jsxs("div",{className:`flex font-mono text-xs ${c.has(b+1)?"bg-yellow-500/20":""}`,children:[m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:b+1}),m.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:f.map((S,k)=>m.jsx("span",{...g({token:S})},k))})]},b))})})})]})})};function c6({message:e="Success"}){return m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(jl,{className:"size-4"}),m.jsx("span",{className:"break-all",children:e})]})}const u6={edit:UA,plus:Ya,trash:Ol,search:Dm};function d6({text:e}){const[n,i]=T.useState(!1),s=async()=>{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)};return m.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:n?m.jsx("span",{className:"text-success text-xs",children:"Copied!"}):m.jsx(wl,{className:"size-3"})})}function h6({title:e,groups:n,files:i,total:s}){const h=n||(i?[{label:"Files",files:i||[],icon:void 0}]:[]);return h.length===0?null:m.jsxs("div",{className:"flex flex-col gap-3",children:[e&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e,s!==void 0&&m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",s," files)"]})]}),h.map((u,o)=>m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.icon&&m.jsx("span",{className:"flex items-center",children:(()=>{const c=u6[u.icon];return m.jsx(c,{className:"size-3"})})()}),m.jsx("span",{children:u.label}),m.jsxs("span",{className:"text-muted-foreground/50",children:["(",u.files.length,")"]})]}),m.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:u.files.map((c,d)=>m.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[m.jsx(Rm,{className:"size-3 text-muted-foreground shrink-0"}),m.jsx("span",{className:"font-mono text-foreground/80 truncate",children:c.path}),c.line!==void 0&&m.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",c.line]}),c.action&&m.jsx("span",{className:_e("text-xs px-1 rounded shrink-0",c.action==="created"&&"bg-success/20 text-success",c.action==="modified"&&"bg-warning/20 text-warning",c.action==="deleted"&&"bg-destructive/20 text-destructive"),children:c.action}),m.jsx(d6,{text:c.path})]},d))})]},o))]})}function f6({command:e,stdout:n,stderr:i,exitCode:s}){const l=s===0;return m.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[m.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[m.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[m.jsx("span",{className:"text-muted-foreground",children:"$ "}),m.jsx("span",{className:"text-foreground",children:e})]}),m.jsxs("span",{className:`text-xs font-mono px-2 py-0.5 rounded ${l?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`,children:["[",s,"]"]})]}),(n||i)&&m.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[n&&m.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:n}),i&&m.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:i})]})]})}const p6={pending:{icon:RA,color:"text-muted-foreground"},in_progress:{icon:Pn,color:"text-warning",animate:!0},completed:{icon:jl,color:"text-success"},cancelled:{icon:id,color:"text-destructive"}},m6={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function g6({title:e,items:n}){if(n.length===0)return null;const i=n.filter(s=>s.status==="completed").length;return n.filter(s=>s.status==="in_progress").length,n.filter(s=>s.status==="pending").length,m.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[(e||n.length>0)&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e||"Todo List",m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.length,")"]}),i>0&&m.jsxs("span",{className:"ml-2 text-success text-xs",children:[i," completed"]})]}),m.jsx("div",{className:"flex flex-col gap-1 w-full",children:n.map((s,l)=>{const h=p6[s.status],u=h.icon,o=m6[s.priority];return m.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[m.jsx(u,{className:_e("size-4 shrink-0",h.color,h.animate&&"animate-spin")}),m.jsx("span",{className:_e("flex-1 break-all",s.status==="completed"&&"line-through text-muted-foreground",s.status==="cancelled"&&"text-muted-foreground"),children:s.content}),o.label&&s.priority==="high"&&m.jsx("span",{className:_e("text-xs px-1.5 py-0.5 rounded shrink-0",o.className),children:o.label}),s.priority==="low"&&s.status!=="completed"&&s.status!=="cancelled"&&m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o.label})]},l)})})]})}function v6({visualization:e}){if(!e)return null;switch(e.type){case"diff":return m.jsx(B0,{path:e.path,hunks:e.hunks,language:e.language,additions:e.additions,deletions:e.deletions,matchInfo:e.matchInfo});case"diffs":return m.jsx("div",{className:"space-y-3",children:e.items.map((n,i)=>m.jsx(B0,{path:n.path,hunks:n.hunks,language:n.language,additions:n.additions,deletions:n.deletions,matchInfo:n.matchInfo},`${n.path}-${i}`))});case"code":return m.jsx(l6,{path:e.path,content:e.content,language:e.language,created:e.created,highlightLines:e.highlightLines});case"file-list":return m.jsx(h6,{title:e.title,groups:e.groups,files:e.files,total:e.total});case"table":return m.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:JSON.stringify(e.rows,null,2)});case"markdown":return m.jsx("div",{className:"prose prose-sm dark:prose-invert",children:e.content});case"none":return m.jsx(c6,{message:e.message});case"shell-output":return m.jsx(f6,{command:e.command,stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode});case"todo-list":return m.jsx(g6,{title:e.title,items:e.items});default:return null}}function _6(e){switch(e){case"pending":return m.jsx(zx,{className:"size-3 text-warning"});case"running":return m.jsx(Pn,{className:"size-3 text-warning animate-spin"});case"completed":return m.jsx(jl,{className:"size-3 text-success"});case"error":return m.jsx(id,{className:"size-3 text-destructive"});default:return null}}function y6(e){if(e&&typeof e=="object"&&"_visualization"in e)return e._visualization}function b6({part:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s}){const[l,h]=T.useState(!1),[u,o]=T.useState(!1),c=e.state,d=c.status,g=d==="completed"&&"output"in c?y6(c.output):void 0,f=d==="pending"?n.find(w=>w.toolCallId===e.callId):void 0;let b=null;if(e.name==="task"){if("childSessionId"in c&&c.childSessionId)b=c.childSessionId;else if(d==="completed"&&"output"in c){const _=(typeof c.output=="string"?c.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);_&&(b=_[1])}}const S=async()=>{if("output"in c){const w=typeof c.output=="string"?c.output:JSON.stringify(c.output,null,2);await navigator.clipboard.writeText(w),o(!0),setTimeout(()=>o(!1),2e3)}},k=(()=>{try{const w=JSON.stringify(c.input);return w.length>50?w.slice(0,47)+"...":w}catch{return String(c.input)}})();return m.jsxs("div",{className:"my-1",children:[m.jsxs($a,{open:l,onOpenChange:h,children:[m.jsx(qa,{asChild:!0,children:m.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[l?m.jsx(Ka,{className:"size-4 text-muted-foreground"}):m.jsx(ti,{className:"size-4 text-muted-foreground"}),m.jsx(KT,{className:"size-3"}),m.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!l&&m.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate flex-1 min-w-0 sm:max-w-[200px] hidden sm:block",children:k}),m.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[_6(d),b&&s&&m.jsxs(ke,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:w=>{w.stopPropagation(),s(b)},title:"View session",children:[m.jsx(Xp,{className:"size-3"}),m.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),m.jsx(Va,{children:m.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),m.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words",children:JSON.stringify(c.input,null,2)})]}),(d==="running"||d==="completed")&&b&&s&&m.jsxs(ke,{variant:"outline",className:"w-full",size:"sm",onClick:()=>s(b),children:[m.jsx(Xp,{className:"size-4","data-icon":"inline-start"}),d==="running"?"Watch Subagent":"View Session"]}),d==="completed"&&"output"in c&&m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),m.jsx(ke,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:u?m.jsx(ei,{className:"size-3 text-success"}):m.jsx(wl,{className:"size-3"})})]}),m.jsx("pre",{className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words",children:typeof c.output=="string"?c.output:JSON.stringify(c.output,null,2)})]}),d==="error"&&"error"in c&&m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),m.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words text-destructive",children:c.error})]})]})})]}),d==="pending"&&f&&m.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Bb,{className:"size-4 text-warning"}),m.jsx(un,{variant:"outline",className:"text-warning border-warning",children:f.permissionType}),m.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:f.permissionKey})]}),f.message&&m.jsx("p",{className:"text-sm",children:f.message}),f.dangerous&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[m.jsx(Bb,{className:"size-4"}),"This operation is marked as dangerous"]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(ke,{variant:"outline",size:"sm",onClick:()=>i(e.callId,!1,!1),children:"Deny"}),m.jsx(ke,{variant:"secondary",size:"sm",onClick:()=>i(e.callId,!0,!1),children:"Approve"}),m.jsx(ke,{size:"sm",onClick:()=>i(e.callId,!0,!0),children:"Always Allow"})]})]}),d==="completed"&&g&&m.jsx("div",{className:"mt-2",children:m.jsx(v6,{visualization:g})})]})}function x6({prompts:e,query:n,selectedIndex:i,onSelect:s}){const l=e.filter(h=>h.name.toLowerCase().includes(n.toLowerCase()));return l.length===0?m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',n,'"']}):m.jsxs("div",{className:"p-1",children:[l.map((h,u)=>m.jsxs("button",{onClick:()=>s(h),className:_e("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",u===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(aT,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"font-mono text-xs",children:["/",h.name]}),m.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]})]},h.name)),m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[l.length," prompt",l.length!==1?"s":""," •",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function S6({workspaceId:e,debounceMs:n=150}){const[i,s]=T.useState(""),[l,h]=T.useState(!1),[u,o]=T.useState([]),c=T.useCallback(f=>{const b={type:"file",path:f.path,display:f.name};return o(S=>[...S,b]),h(!1),s(""),b},[]),d=T.useCallback((f,b,S)=>{const k=f.lastIndexOf("@",b);if(k===-1)return{text:f,cursorPos:b};const w=f.slice(0,k)+`@${S.path}`+f.slice(b),_=k+S.path.length+1;return{text:w,cursorPos:_}},[]),g=T.useCallback(f=>{const b=/@([^\s@]+)/g,S=[];let k;for(;(k=b.exec(f))!==null;){const w=k[1];u.some(_=>_.path===w)&&!S.some(_=>_.path===w)&&S.push({type:"file",path:w,display:w.split("/").pop()||w})}return S},[u]);return{query:i,setQuery:s,showAutocomplete:l,setShowAutocomplete:h,mentions:u,handleFileSelect:c,insertMention:d,extractMentions:g}}function w6(e,n){return n?e.content.includes("ARG")?e.content.replace("ARG",n):`${e.content}
|
|
489
|
-
${n}`:e.content}function C6(e){const n=e.trimStart();if(!n.startsWith("/"))return null;const i=n.indexOf(" ");return i===-1?{command:n.slice(1),rest:""}:{command:n.slice(1,i),rest:n.slice(i+1).trim()}}function k6({onSendMessage:e,disabled:n,isStreaming:i,onStopStreaming:s,placeholder:l="Type a message...",workspaceId:h,serverUrl:u,apiToken:o,prompts:c=[]}){const[d,g]=T.useState(""),[f,b]=T.useState(0),[S,k]=T.useState([]),[w,_]=T.useState(0),[y,v]=T.useState("none"),[x,E]=T.useState(""),M=T.useRef(null),{query:R,setQuery:N,showAutocomplete:D,setShowAutocomplete:O,handleFileSelect:P,insertMention:$}=S6({workspaceId:h||""});T.useEffect(()=>{_(0)},[S,x,c]),T.useEffect(()=>{const I=M.current;I&&(I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,150)}px`)},[d]);const U=c.filter(I=>I.name.toLowerCase().includes(x.toLowerCase())),q=y==="prompts"&&c.length>0,Y=y==="files"&&D&&!!h,K=T.useCallback(I=>{const L=I.target.value,z=I.target.selectionStart||0;g(L),b(z);const X=L.lastIndexOf("/",z);if(X!==-1){const te=X>0?L[X-1]:`
|
|
490
|
-
`,W=L.slice(X+1,z);if((te===`
|
|
491
|
-
`||te===" "||te==="")&&!W.includes(" ")){E(W),v("prompts");return}}const ee=L.lastIndexOf("@",z);if(ee!==-1){const te=L.slice(ee+1,z);if(!te.includes(" ")){N(te),O(!0),v("files");return}}v("none"),O(!1)},[N,O]),V=T.useCallback(I=>{const L=P(I),z=$(d,f,L);g(z.text),v("none"),O(!1),k([]),setTimeout(()=>{M.current&&(M.current.focus(),M.current.setSelectionRange(z.cursorPos,z.cursorPos))},0)},[d,f,P,$,O]),Q=T.useCallback(I=>{const L=d.lastIndexOf("/",f),z=d.slice(0,L),X=d.slice(L+1),ee=X.indexOf(" "),te=ee!==-1?X.slice(ee):"",W=`${z}/${I.name}${te}`,H=L+1+I.name.length+0;g(W),v("none"),setTimeout(()=>{M.current&&(M.current.focus(),M.current.setSelectionRange(H,H))},0)},[d,f]),J=I=>{if(I==null||I.preventDefault(),!d.trim()||n)return;const L=C6(d);if(L){const z=c.find(X=>X.name===L.command);if(z){const X=w6(z,L.rest);e(X),g("");return}}e(d.trim()),g("")},F=I=>{if(q&&U.length>0)switch(I.key){case"ArrowDown":I.preventDefault(),_(L=>Math.min(L+1,U.length-1));return;case"ArrowUp":I.preventDefault(),_(L=>Math.max(L-1,0));return;case"Enter":if(I.shiftKey)return;I.preventDefault(),U[w]&&Q(U[w]);return;case"Tab":I.preventDefault(),U[w]&&Q(U[w]);return;case"Escape":I.preventDefault(),v("none");return}if(Y&&S.length>0)switch(I.key){case"ArrowDown":I.preventDefault(),_(L=>Math.min(L+1,S.length-1));return;case"ArrowUp":I.preventDefault(),_(L=>Math.max(L-1,0));return;case"Enter":I.preventDefault(),S[w]&&V(S[w]);return;case"Escape":I.preventDefault(),O(!1),v("none");return;case"Tab":I.preventDefault(),S[w]&&V(S[w]);return}I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),J())},j=T.useCallback(I=>{k(I)},[]);return i&&s?m.jsx("div",{className:"p-4 border-t border-border bg-card",children:m.jsxs("div",{className:"flex items-center justify-center gap-3",children:[m.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),m.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),m.jsxs(ke,{variant:"outline",size:"sm",onClick:s,children:[m.jsx(Hx,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})}):m.jsxs("form",{onSubmit:J,className:"p-4 border-t border-border bg-card",children:[m.jsxs("div",{className:"flex gap-3 items-end",children:[m.jsx("div",{className:"flex-1 relative",children:m.jsxs(Od,{open:q||Y,onOpenChange:I=>{I||(v("none"),O(!1))},children:[m.jsx(Y4,{asChild:!0,children:m.jsx(V4,{ref:M,value:d,onChange:K,onKeyDown:F,placeholder:l,disabled:n,className:_e("min-h-[44px] max-h-[150px] resize-none pr-12","focus-visible:ring-1"),rows:1})}),m.jsx(Ld,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:I=>I.preventDefault(),onCloseAutoFocus:I=>I.preventDefault(),children:Y?m.jsx(wO,{workspaceId:h||"",searchQuery:R,selectedIndex:w,onSelect:V,onFilesChange:j,serverUrl:u,apiToken:o}):m.jsx(x6,{prompts:c,query:x,selectedIndex:w,onSelect:Q})})]})}),m.jsx(ke,{type:"submit",disabled:!d.trim()||n,size:"default",className:"h-11",children:m.jsx(AT,{className:"size-4"})})]}),m.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center flex items-center justify-center gap-1",children:[m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),m.jsx("span",{children:"prompts"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),m.jsx("span",{children:"to send"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),m.jsx("span",{children:"for new line"})]})]})}function E6(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const A6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R6={};function z0(e,n){return(R6.jsx?T6:A6).test(e)}const D6=/[ \t\n\f\r]/g;function M6(e){return typeof e=="object"?e.type==="text"?P0(e.value):!1:P0(e)}function P0(e){return e.replace(D6,"")===""}class Zl{constructor(n,i,s){this.normal=i,this.property=n,s&&(this.space=s)}}Zl.prototype.normal={};Zl.prototype.property={};Zl.prototype.space=void 0;function IC(e,n){const i={},s={};for(const l of e)Object.assign(i,l.property),Object.assign(s,l.normal);return new Zl(i,s,n)}function vm(e){return e.toLowerCase()}class En{constructor(n,i){this.attribute=i,this.property=n}}En.prototype.attribute="";En.prototype.booleanish=!1;En.prototype.boolean=!1;En.prototype.commaOrSpaceSeparated=!1;En.prototype.commaSeparated=!1;En.prototype.defined=!1;En.prototype.mustUseProperty=!1;En.prototype.number=!1;En.prototype.overloadedBoolean=!1;En.prototype.property="";En.prototype.spaceSeparated=!1;En.prototype.space=void 0;let N6=0;const Ke=js(),Ft=js(),_m=js(),xe=js(),bt=js(),La=js(),Bn=js();function js(){return 2**++N6}const ym=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Ft,commaOrSpaceSeparated:Bn,commaSeparated:La,number:xe,overloadedBoolean:_m,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Mp=Object.keys(ym);class Eg extends En{constructor(n,i,s,l){let h=-1;if(super(n,i),F0(this,"space",l),typeof s=="number")for(;++h<Mp.length;){const u=Mp[h];F0(this,Mp[h],(s&ym[u])===ym[u])}}}Eg.prototype.defined=!0;function F0(e,n,i){i&&(e[n]=i)}function oo(e){const n={},i={};for(const[s,l]of Object.entries(e.properties)){const h=new Eg(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(h.mustUseProperty=!0),n[s]=h,i[vm(s)]=s,i[vm(h.attribute)]=s}return new Zl(n,i,e.space)}const BC=oo({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:bt,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:xe,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:bt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ft,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function zC(e,n){return n in e?e[n]:n}function PC(e,n){return zC(e,n.toLowerCase())}const j6=oo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:La,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:bt,autoFocus:Ke,autoPlay:Ke,blocking:bt,capture:null,charSet:null,checked:Ke,cite:null,className:bt,cols:xe,colSpan:null,content:null,contentEditable:Ft,controls:Ke,controlsList:bt,coords:xe|La,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:_m,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:bt,height:xe,hidden:_m,high:xe,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ke,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ke,optimum:xe,pattern:null,ping:bt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:bt,required:Ke,reversed:Ke,rows:xe,rowSpan:xe,sandbox:bt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Ft,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:PC}),O6=oo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Bn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:La,g2:La,glyphName:La,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:Bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:Bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zC}),FC=oo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),HC=oo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:PC}),UC=oo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),L6={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},I6=/[A-Z]/g,H0=/-[a-z]/g,B6=/^data[-\w.:]+$/i;function z6(e,n){const i=vm(n);let s=n,l=En;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&B6.test(n)){if(n.charAt(4)==="-"){const h=n.slice(5).replace(H0,F6);s="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=n.slice(4);if(!H0.test(h)){let u=h.replace(I6,P6);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}l=Eg}return new l(s,n)}function P6(e){return"-"+e.toLowerCase()}function F6(e){return e.charAt(1).toUpperCase()}const H6=IC([BC,j6,FC,HC,UC],"html"),Ag=IC([BC,O6,FC,HC,UC],"svg");function U6(e){return e.join(" ").trim()}var Ca={},Np,U0;function $6(){if(U0)return Np;U0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
492
|
-
`,d="/",g="*",f="",b="comment",S="declaration";function k(_,y){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];y=y||{};var v=1,x=1;function E(Y){var K=Y.match(n);K&&(v+=K.length);var V=Y.lastIndexOf(c);x=~V?Y.length-V:x+Y.length}function M(){var Y={line:v,column:x};return function(K){return K.position=new R(Y),O(),K}}function R(Y){this.start=Y,this.end={line:v,column:x},this.source=y.source}R.prototype.content=_;function N(Y){var K=new Error(y.source+":"+v+":"+x+": "+Y);if(K.reason=Y,K.filename=y.source,K.line=v,K.column=x,K.source=_,!y.silent)throw K}function D(Y){var K=Y.exec(_);if(K){var V=K[0];return E(V),_=_.slice(V.length),K}}function O(){D(i)}function P(Y){var K;for(Y=Y||[];K=$();)K!==!1&&Y.push(K);return Y}function $(){var Y=M();if(!(d!=_.charAt(0)||g!=_.charAt(1))){for(var K=2;f!=_.charAt(K)&&(g!=_.charAt(K)||d!=_.charAt(K+1));)++K;if(K+=2,f===_.charAt(K-1))return N("End of comment missing");var V=_.slice(2,K-2);return x+=2,E(V),_=_.slice(K),x+=2,Y({type:b,comment:V})}}function U(){var Y=M(),K=D(s);if(K){if($(),!D(l))return N("property missing ':'");var V=D(h),Q=Y({type:S,property:w(K[0].replace(e,f)),value:V?w(V[0].replace(e,f)):f});return D(u),Q}}function q(){var Y=[];P(Y);for(var K;K=U();)K!==!1&&(Y.push(K),P(Y));return Y}return O(),q()}function w(_){return _?_.replace(o,f):f}return Np=k,Np}var $0;function q6(){if($0)return Ca;$0=1;var e=Ca&&Ca.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.default=i;const n=e($6());function i(s,l){let h=null;if(!s||typeof s!="string")return h;const u=(0,n.default)(s),o=typeof l=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:g}=c;o?l(d,g,c):g&&(h=h||{},h[d]=g)}),h}return Ca}var cl={},q0;function V6(){if(q0)return cl;q0=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,h=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},o=function(d,g){return"".concat(g,"-")},c=function(d,g){return g===void 0&&(g={}),h(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(l,o):d=d.replace(s,o),d.replace(n,u))};return cl.camelCase=c,cl}var ul,V0;function G6(){if(V0)return ul;V0=1;var e=ul&&ul.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(q6()),i=V6();function s(l,h){var u={};return!l||typeof l!="string"||(0,n.default)(l,function(o,c){o&&c&&(u[(0,i.camelCase)(o,h)]=c)}),u}return s.default=s,ul=s,ul}var W6=G6();const K6=rd(W6),$C=qC("end"),Tg=qC("start");function qC(e){return n;function n(i){const s=i&&i.position&&i.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function Y6(e){const n=Tg(e),i=$C(e);if(n&&i)return{start:n,end:i}}function bl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?G0(e.position):"start"in e||"end"in e?G0(e):"line"in e||"column"in e?bm(e):""}function bm(e){return W0(e&&e.line)+":"+W0(e&&e.column)}function G0(e){return bm(e&&e.start)+"-"+bm(e&&e.end)}function W0(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(n,i,s){super(),typeof i=="string"&&(s=i,i=void 0);let l="",h={},u=!1;if(i&&("line"in i&&"column"in i?h={place:i}:"start"in i&&"end"in i?h={place:i}:"type"in i?h={ancestors:[i],place:i.position}:h={...i}),typeof n=="string"?l=n:!h.cause&&n&&(u=!0,l=n.message,h.cause=n),!h.ruleId&&!h.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?h.ruleId=s:(h.source=s.slice(0,c),h.ruleId=s.slice(c+1))}if(!h.place&&h.ancestors&&h.ancestors){const c=h.ancestors[h.ancestors.length-1];c&&(h.place=c.position)}const o=h.place&&"start"in h.place?h.place.start:h.place;this.ancestors=h.ancestors||void 0,this.cause=h.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=o?o.line:void 0,this.name=bl(h.place)||"1:1",this.place=h.place||void 0,this.reason=this.message,this.ruleId=h.ruleId||void 0,this.source=h.source||void 0,this.stack=u&&h.cause&&typeof h.cause.stack=="string"?h.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const Rg={}.hasOwnProperty,X6=new Map,Z6=/[A-Z]/g,Q6=new Set(["table","tbody","thead","tfoot","tr"]),J6=new Set(["td","th"]),VC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eI(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let s;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=lI(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=oI(i,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:s,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Ag:H6,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},h=GC(l,e,void 0);return h&&typeof h!="string"?h:l.create(e,l.Fragment,{children:h||void 0},void 0)}function GC(e,n,i){if(n.type==="element")return tI(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return nI(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return iI(e,n,i);if(n.type==="mdxjsEsm")return rI(e,n);if(n.type==="root")return sI(e,n,i);if(n.type==="text")return aI(e,n)}function tI(e,n,i){const s=e.schema;let l=s;n.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=Ag,e.schema=l),e.ancestors.push(n);const h=KC(e,n.tagName,!1),u=cI(e,n);let o=Mg(e,n);return Q6.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!M6(c):!0})),WC(e,u,h,n),Dg(u,o),e.ancestors.pop(),e.schema=s,e.create(n,h,u,i)}function nI(e,n){if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Ml(e,n.position)}function rI(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ml(e,n.position)}function iI(e,n,i){const s=e.schema;let l=s;n.name==="svg"&&s.space==="html"&&(l=Ag,e.schema=l),e.ancestors.push(n);const h=n.name===null?e.Fragment:KC(e,n.name,!0),u=uI(e,n),o=Mg(e,n);return WC(e,u,h,n),Dg(u,o),e.ancestors.pop(),e.schema=s,e.create(n,h,u,i)}function sI(e,n,i){const s={};return Dg(s,Mg(e,n)),e.create(n,e.Fragment,s,i)}function aI(e,n){return n.value}function WC(e,n,i,s){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=s)}function Dg(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function oI(e,n,i){return s;function s(l,h,u,o){const d=Array.isArray(u.children)?i:n;return o?d(h,u,o):d(h,u)}}function lI(e,n){return i;function i(s,l,h,u){const o=Array.isArray(h.children),c=Tg(s);return n(l,h,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cI(e,n){const i={};let s,l;for(l in n.properties)if(l!=="children"&&Rg.call(n.properties,l)){const h=dI(e,l,n.properties[l]);if(h){const[u,o]=h;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&J6.has(n.tagName)?s=o:i[u]=o}}if(s){const h=i.style||(i.style={});h[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return i}function uI(e,n){const i={};for(const s of n.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const h=s.data.estree.body[0];h.type;const u=h.expression;u.type;const o=u.properties[0];o.type,Object.assign(i,e.evaluater.evaluateExpression(o.argument))}else Ml(e,n.position);else{const l=s.name;let h;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,h=e.evaluater.evaluateExpression(o.expression)}else Ml(e,n.position);else h=s.value===null?!0:s.value;i[l]=h}return i}function Mg(e,n){const i=[];let s=-1;const l=e.passKeys?new Map:X6;for(;++s<n.children.length;){const h=n.children[s];let u;if(e.passKeys){const c=h.type==="element"?h.tagName:h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement"?h.name:void 0;if(c){const d=l.get(c)||0;u=c+"-"+d,l.set(c,d+1)}}const o=GC(e,h,u);o!==void 0&&i.push(o)}return i}function dI(e,n,i){const s=z6(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=s.commaSeparated?E6(i):U6(i)),s.property==="style"){let l=typeof i=="object"?i:hI(e,String(i));return e.stylePropertyNameCase==="css"&&(l=fI(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?L6[s.property]||s.property:s.attribute,i]}}function hI(e,n){try{return K6(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const s=i,l=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=VC+"#cannot-parse-style-attribute",l}}function KC(e,n,i){let s;if(!i)s={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let h=-1,u;for(;++h<l.length;){const o=z0(l[h])?{type:"Identifier",name:l[h]}:{type:"Literal",value:l[h]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(h&&o.type==="Literal"),optional:!1}:o}s=u}else s=z0(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(s.type==="Literal"){const l=s.value;return Rg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ml(e)}function Ml(e,n){const i=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=VC+"#cannot-handle-mdx-estrees-without-createevaluater",i}function fI(e){const n={};let i;for(i in e)Rg.call(e,i)&&(n[pI(i)]=e[i]);return n}function pI(e){let n=e.replace(Z6,mI);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function mI(e){return"-"+e.toLowerCase()}const jp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},gI={};function Ng(e,n){const i=gI,s=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,l=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return YC(e,s,l)}function YC(e,n,i){if(vI(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return K0(e.children,n,i)}return Array.isArray(e)?K0(e,n,i):""}function K0(e,n,i){const s=[];let l=-1;for(;++l<e.length;)s[l]=YC(e[l],n,i);return s.join("")}function vI(e){return!!(e&&typeof e=="object")}const Y0=document.createElement("i");function jg(e){const n="&"+e+";";Y0.innerHTML=n;const i=Y0.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function Hn(e,n,i,s){const l=e.length;let h=0,u;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,i=i>0?i:0,s.length<1e4)u=Array.from(s),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);h<s.length;)u=s.slice(h,h+1e4),u.unshift(n,0),e.splice(...u),h+=1e4,n+=1e4}function tr(e,n){return e.length>0?(Hn(e,e.length,0,n),e):n}const X0={}.hasOwnProperty;function XC(e){const n={};let i=-1;for(;++i<e.length;)_I(n,e[i]);return n}function _I(e,n){let i;for(i in n){const l=(X0.call(e,i)?e[i]:void 0)||(e[i]={}),h=n[i];let u;if(h)for(u in h){X0.call(l,u)||(l[u]=[]);const o=h[u];yI(l[u],Array.isArray(o)?o:o?[o]:[])}}}function yI(e,n){let i=-1;const s=[];for(;++i<n.length;)(n[i].add==="after"?e:s).push(n[i]);Hn(e,0,0,s)}function ZC(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mn=Qi(/[A-Za-z]/),dn=Qi(/[\dA-Za-z]/),bI=Qi(/[#-'*+\--9=?A-Z^-~]/);function Ju(e){return e!==null&&(e<32||e===127)}const xm=Qi(/\d/),xI=Qi(/[\dA-Fa-f]/),SI=Qi(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Ud=Qi(new RegExp("\\p{P}|\\p{S}","u")),Ts=Qi(/\s/);function Qi(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function lo(e){const n=[];let i=-1,s=0,l=0;for(;++i<e.length;){const h=e.charCodeAt(i);let u="";if(h===37&&dn(e.charCodeAt(i+1))&&dn(e.charCodeAt(i+2)))l=2;else if(h<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(h))||(u=String.fromCharCode(h));else if(h>55295&&h<57344){const o=e.charCodeAt(i+1);h<56320&&o>56319&&o<57344?(u=String.fromCharCode(h,o),l=1):u="�"}else u=String.fromCharCode(h);u&&(n.push(e.slice(s,i),encodeURIComponent(u)),s=i+l+1,u=""),l&&(i+=l,l=0)}return n.join("")+e.slice(s)}function it(e,n,i,s){const l=s?s-1:Number.POSITIVE_INFINITY;let h=0;return u;function u(c){return Je(c)?(e.enter(i),o(c)):n(c)}function o(c){return Je(c)&&h++<l?(e.consume(c),o):(e.exit(i),n(c))}}const wI={tokenize:CI};function CI(e){const n=e.attempt(this.parser.constructs.contentInitial,s,l);let i;return n;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),it(e,n,"linePrefix")}function l(o){return e.enter("paragraph"),h(o)}function h(o){const c=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ze(o)?(e.consume(o),e.exit("chunkText"),h):(e.consume(o),u)}}const kI={tokenize:EI},Z0={tokenize:AI};function EI(e){const n=this,i=[];let s=0,l,h,u;return o;function o(x){if(s<i.length){const E=i[s];return n.containerState=E[1],e.attempt(E[0].continuation,c,d)(x)}return d(x)}function c(x){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&v();const E=n.events.length;let M=E,R;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){R=n.events[M][1].end;break}y(s);let N=E;for(;N<n.events.length;)n.events[N][1].end={...R},N++;return Hn(n.events,M+1,0,n.events.slice(E)),n.events.length=N,d(x)}return o(x)}function d(x){if(s===i.length){if(!l)return b(x);if(l.currentConstruct&&l.currentConstruct.concrete)return k(x);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Z0,g,f)(x)}function g(x){return l&&v(),y(s),b(x)}function f(x){return n.parser.lazy[n.now().line]=s!==i.length,u=n.now().offset,k(x)}function b(x){return n.containerState={},e.attempt(Z0,S,k)(x)}function S(x){return s++,i.push([n.currentConstruct,n.containerState]),b(x)}function k(x){if(x===null){l&&v(),y(0),e.consume(x);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:h}),w(x)}function w(x){if(x===null){_(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return ze(x)?(e.consume(x),_(e.exit("chunkFlow")),s=0,n.interrupt=void 0,o):(e.consume(x),w)}function _(x,E){const M=n.sliceStream(x);if(E&&M.push(null),x.previous=h,h&&(h.next=x),h=x,l.defineSkip(x.start),l.write(M),n.parser.lazy[x.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const N=n.events.length;let D=N,O,P;for(;D--;)if(n.events[D][0]==="exit"&&n.events[D][1].type==="chunkFlow"){if(O){P=n.events[D][1].end;break}O=!0}for(y(s),R=N;R<n.events.length;)n.events[R][1].end={...P},R++;Hn(n.events,D+1,0,n.events.slice(N)),n.events.length=R}}function y(x){let E=i.length;for(;E-- >x;){const M=i[E];n.containerState=M[1],M[0].exit.call(n,e)}i.length=x}function v(){l.write([null]),h=void 0,l=void 0,n.containerState._closeFlow=void 0}}function AI(e,n,i){return it(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Wa(e){if(e===null||yt(e)||Ts(e))return 1;if(Ud(e))return 2}function $d(e,n,i){const s=[];let l=-1;for(;++l<e.length;){const h=e[l].resolveAll;h&&!s.includes(h)&&(n=h(n,i),s.push(h))}return n}const Sm={name:"attention",resolveAll:TI,tokenize:RI};function TI(e,n){let i=-1,s,l,h,u,o,c,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(s=i;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&n.sliceSerialize(e[s][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[s][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const f={...e[s][1].end},b={...e[i][1].start};Q0(f,-c),Q0(b,c),u={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:b},h={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[i][1].start}},l={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[s][1].end={...u.start},e[i][1].start={...o.end},d=[],e[s][1].end.offset-e[s][1].start.offset&&(d=tr(d,[["enter",e[s][1],n],["exit",e[s][1],n]])),d=tr(d,[["enter",l,n],["enter",u,n],["exit",u,n],["enter",h,n]]),d=tr(d,$d(n.parser.constructs.insideSpan.null,e.slice(s+1,i),n)),d=tr(d,[["exit",h,n],["enter",o,n],["exit",o,n],["exit",l,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=tr(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,Hn(e,s-1,i-s+3,d),i=s+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function RI(e,n){const i=this.parser.constructs.attentionMarkers.null,s=this.previous,l=Wa(s);let h;return u;function u(c){return h=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===h)return e.consume(c),o;const d=e.exit("attentionSequence"),g=Wa(c),f=!g||g===2&&l||i.includes(c),b=!l||l===2&&g||i.includes(s);return d._open=!!(h===42?f:f&&(l||!b)),d._close=!!(h===42?b:b&&(g||!f)),n(c)}}function Q0(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const DI={name:"autolink",tokenize:MI};function MI(e,n,i){let s=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),h}function h(S){return mn(S)?(e.consume(S),u):S===64?i(S):d(S)}function u(S){return S===43||S===45||S===46||dn(S)?(s=1,o(S)):d(S)}function o(S){return S===58?(e.consume(S),s=0,c):(S===43||S===45||S===46||dn(S))&&s++<32?(e.consume(S),o):(s=0,d(S))}function c(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):S===null||S===32||S===60||Ju(S)?i(S):(e.consume(S),c)}function d(S){return S===64?(e.consume(S),g):bI(S)?(e.consume(S),d):i(S)}function g(S){return dn(S)?f(S):i(S)}function f(S){return S===46?(e.consume(S),s=0,g):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):b(S)}function b(S){if((S===45||dn(S))&&s++<63){const k=S===45?b:f;return e.consume(S),k}return i(S)}}const Ql={partial:!0,tokenize:NI};function NI(e,n,i){return s;function s(h){return Je(h)?it(e,l,"linePrefix")(h):l(h)}function l(h){return h===null||ze(h)?n(h):i(h)}}const QC={continuation:{tokenize:OI},exit:LI,name:"blockQuote",tokenize:jI};function jI(e,n,i){const s=this;return l;function l(u){if(u===62){const o=s.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),h}return i(u)}function h(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function OI(e,n,i){const s=this;return l;function l(u){return Je(u)?it(e,h,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):h(u)}function h(u){return e.attempt(QC,n,i)(u)}}function LI(e){e.exit("blockQuote")}const JC={name:"characterEscape",tokenize:II};function II(e,n,i){return s;function s(h){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(h),e.exit("escapeMarker"),l}function l(h){return SI(h)?(e.enter("characterEscapeValue"),e.consume(h),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(h)}}const ek={name:"characterReference",tokenize:BI};function BI(e,n,i){const s=this;let l=0,h,u;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),h=31,u=dn,g(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),h=6,u=xI,g):(e.enter("characterReferenceValue"),h=7,u=xm,g(f))}function g(f){if(f===59&&l){const b=e.exit("characterReferenceValue");return u===dn&&!jg(s.sliceSerialize(b))?i(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(f)&&l++<h?(e.consume(f),g):i(f)}}const J0={partial:!0,tokenize:PI},ex={concrete:!0,name:"codeFenced",tokenize:zI};function zI(e,n,i){const s=this,l={partial:!0,tokenize:M};let h=0,u=0,o;return c;function c(R){return d(R)}function d(R){const N=s.events[s.events.length-1];return h=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===o?(u++,e.consume(R),g):u<3?i(R):(e.exit("codeFencedFenceSequence"),Je(R)?it(e,f,"whitespace")(R):f(R))}function f(R){return R===null||ze(R)?(e.exit("codeFencedFence"),s.interrupt?n(R):e.check(J0,w,E)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,S,"whitespace")(R)):R===96&&R===o?i(R):(e.consume(R),b)}function S(R){return R===null||ze(R)?f(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(R)):R===96&&R===o?i(R):(e.consume(R),k)}function w(R){return e.attempt(l,E,_)(R)}function _(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),y}function y(R){return h>0&&Je(R)?it(e,v,"linePrefix",h+1)(R):v(R)}function v(R){return R===null||ze(R)?e.check(J0,w,E)(R):(e.enter("codeFlowValue"),x(R))}function x(R){return R===null||ze(R)?(e.exit("codeFlowValue"),v(R)):(e.consume(R),x)}function E(R){return e.exit("codeFenced"),n(R)}function M(R,N,D){let O=0;return P;function P(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),$}function $(K){return R.enter("codeFencedFence"),Je(K)?it(R,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(R.enter("codeFencedFenceSequence"),q(K)):D(K)}function q(K){return K===o?(O++,R.consume(K),q):O>=u?(R.exit("codeFencedFenceSequence"),Je(K)?it(R,Y,"whitespace")(K):Y(K)):D(K)}function Y(K){return K===null||ze(K)?(R.exit("codeFencedFence"),N(K)):D(K)}}}function PI(e,n,i){const s=this;return l;function l(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),h)}function h(u){return s.parser.lazy[s.now().line]?i(u):n(u)}}const Op={name:"codeIndented",tokenize:HI},FI={partial:!0,tokenize:UI};function HI(e,n,i){const s=this;return l;function l(d){return e.enter("codeIndented"),it(e,h,"linePrefix",5)(d)}function h(d){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?c(d):ze(d)?e.attempt(FI,u,c)(d):(e.enter("codeFlowValue"),o(d))}function o(d){return d===null||ze(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),o)}function c(d){return e.exit("codeIndented"),n(d)}}function UI(e,n,i){const s=this;return l;function l(u){return s.parser.lazy[s.now().line]?i(u):ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):it(e,h,"linePrefix",5)(u)}function h(u){const o=s.events[s.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(u):ze(u)?l(u):i(u)}}const $I={name:"codeText",previous:VI,resolve:qI,tokenize:GI};function qI(e){let n=e.length-4,i=3,s,l;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(s=i;++s<n;)if(e[s][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(s=i-1,n++;++s<=n;)l===void 0?s!==n&&e[s][1].type!=="lineEnding"&&(l=s):(s===n||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),n-=s-l-2,s=l+2),l=void 0);return e}function VI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function GI(e,n,i){let s=0,l,h;return u;function u(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),s++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?i(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(h=e.enter("codeTextSequence"),l=0,g(f)):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||ze(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),d)}function g(f){return f===96?(e.consume(f),l++,g):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(h.type="codeTextData",d(f))}}class WI{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const s=i==null?Number.POSITIVE_INFINITY:i;return s<this.left.length?this.left.slice(n,s):n>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(n,i,s){const l=i||0;this.setCursor(Math.trunc(n));const h=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&dl(this.left,s),h.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),dl(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),dl(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);dl(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);dl(this.left,i.reverse())}}}function dl(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function tk(e){const n={};let i=-1,s,l,h,u,o,c,d;const g=new WI(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(s=g.get(i),i&&s[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,h=0,h<c.length&&c[h][1].type==="lineEndingBlank"&&(h+=2),h<c.length&&c[h][1].type==="content"))for(;++h<c.length&&c[h][1].type!=="content";)c[h][1].type==="chunkText"&&(c[h][1]._isInFirstContentOfListItem=!0,h++);if(s[0]==="enter")s[1].contentType&&(Object.assign(n,KI(g,i)),i=n[i],d=!0);else if(s[1]._container){for(h=i,l=void 0;h--;)if(u=g.get(h),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=h);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(s[1].end={...g.get(l)[1].start},o=g.slice(l,i),o.unshift(s),g.splice(l,i-l+1,o))}}return Hn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function KI(e,n){const i=e.get(n)[1],s=e.get(n)[2];let l=n-1;const h=[];let u=i._tokenizer;u||(u=s.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],d={};let g,f,b=-1,S=i,k=0,w=0;const _=[w];for(;S;){for(;e.get(++l)[1]!==S;);h.push(l),S._tokenizer||(g=s.sliceStream(S),S.next||g.push(null),f&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),f=S,S=S.next}for(S=i;++b<o.length;)o[b][0]==="exit"&&o[b-1][0]==="enter"&&o[b][1].type===o[b-1][1].type&&o[b][1].start.line!==o[b][1].end.line&&(w=b+1,_.push(w),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):_.pop(),b=_.length;b--;){const y=o.slice(_[b],_[b+1]),v=h.pop();c.push([v,v+y.length-1]),e.splice(v,2,y)}for(c.reverse(),b=-1;++b<c.length;)d[k+c[b][0]]=k+c[b][1],k+=c[b][1]-c[b][0]-1;return d}const YI={resolve:ZI,tokenize:QI},XI={partial:!0,tokenize:JI};function ZI(e){return tk(e),e}function QI(e,n){let i;return s;function s(o){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),l(o)}function l(o){return o===null?h(o):ze(o)?e.check(XI,u,h)(o):(e.consume(o),l)}function h(o){return e.exit("chunkContent"),e.exit("content"),n(o)}function u(o){return e.consume(o),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}}function JI(e,n,i){const s=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,h,"linePrefix")}function h(u){if(u===null||ze(u))return i(u);const o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(u):e.interrupt(s.parser.constructs.flow,i,n)(u)}}function nk(e,n,i,s,l,h,u,o,c){const d=c||Number.POSITIVE_INFINITY;let g=0;return f;function f(y){return y===60?(e.enter(s),e.enter(l),e.enter(h),e.consume(y),e.exit(h),b):y===null||y===32||y===41||Ju(y)?i(y):(e.enter(s),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(y))}function b(y){return y===62?(e.enter(h),e.consume(y),e.exit(h),e.exit(l),e.exit(s),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),S(y))}function S(y){return y===62?(e.exit("chunkString"),e.exit(o),b(y)):y===null||y===60||ze(y)?i(y):(e.consume(y),y===92?k:S)}function k(y){return y===60||y===62||y===92?(e.consume(y),S):S(y)}function w(y){return!g&&(y===null||y===41||yt(y))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(s),n(y)):g<d&&y===40?(e.consume(y),g++,w):y===41?(e.consume(y),g--,w):y===null||y===32||y===40||Ju(y)?i(y):(e.consume(y),y===92?_:w)}function _(y){return y===40||y===41||y===92?(e.consume(y),w):w(y)}}function rk(e,n,i,s,l,h){const u=this;let o=0,c;return d;function d(S){return e.enter(s),e.enter(l),e.consume(S),e.exit(l),e.enter(h),g}function g(S){return o>999||S===null||S===91||S===93&&!c||S===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?i(S):S===93?(e.exit(h),e.enter(l),e.consume(S),e.exit(l),e.exit(s),n):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||S===91||S===93||ze(S)||o++>999?(e.exit("chunkString"),g(S)):(e.consume(S),c||(c=!Je(S)),S===92?b:f)}function b(S){return S===91||S===92||S===93?(e.consume(S),o++,f):f(S)}}function ik(e,n,i,s,l,h){let u;return o;function o(b){return b===34||b===39||b===40?(e.enter(s),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,c):i(b)}function c(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(s),n):(e.enter(h),d(b))}function d(b){return b===u?(e.exit(h),c(u)):b===null?i(b):ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),it(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===u||b===null||ze(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?f:g)}function f(b){return b===u||b===92?(e.consume(b),g):g(b)}}function xl(e,n){let i;return s;function s(l){return ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i=!0,s):Je(l)?it(e,s,i?"linePrefix":"lineSuffix")(l):n(l)}}const eB={name:"definition",tokenize:nB},tB={partial:!0,tokenize:rB};function nB(e,n,i){const s=this;let l;return h;function h(S){return e.enter("definition"),u(S)}function u(S){return rk.call(s,e,o,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function o(S){return l=dr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),c):i(S)}function c(S){return yt(S)?xl(e,d)(S):d(S)}function d(S){return nk(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function g(S){return e.attempt(tB,f,f)(S)}function f(S){return Je(S)?it(e,b,"whitespace")(S):b(S)}function b(S){return S===null||ze(S)?(e.exit("definition"),s.parser.defined.push(l),n(S)):i(S)}}function rB(e,n,i){return s;function s(o){return yt(o)?xl(e,l)(o):i(o)}function l(o){return ik(e,h,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function h(o){return Je(o)?it(e,u,"whitespace")(o):u(o)}function u(o){return o===null||ze(o)?n(o):i(o)}}const iB={name:"hardBreakEscape",tokenize:sB};function sB(e,n,i){return s;function s(h){return e.enter("hardBreakEscape"),e.consume(h),l}function l(h){return ze(h)?(e.exit("hardBreakEscape"),n(h)):i(h)}}const aB={name:"headingAtx",resolve:oB,tokenize:lB};function oB(e,n){let i=e.length-2,s=3,l,h;return e[s][1].type==="whitespace"&&(s+=2),i-2>s&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(s===i-1||i-4>s&&e[i-2][1].type==="whitespace")&&(i-=s+1===i?2:4),i>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[i][1].end},h={type:"chunkText",start:e[s][1].start,end:e[i][1].end,contentType:"text"},Hn(e,s,i-s+1,[["enter",l,n],["enter",h,n],["exit",h,n],["exit",l,n]])),e}function lB(e,n,i){let s=0;return l;function l(g){return e.enter("atxHeading"),h(g)}function h(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&s++<6?(e.consume(g),u):g===null||yt(g)?(e.exit("atxHeadingSequence"),o(g)):i(g)}function o(g){return g===35?(e.enter("atxHeadingSequence"),c(g)):g===null||ze(g)?(e.exit("atxHeading"),n(g)):Je(g)?it(e,o,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function c(g){return g===35?(e.consume(g),c):(e.exit("atxHeadingSequence"),o(g))}function d(g){return g===null||g===35||yt(g)?(e.exit("atxHeadingText"),o(g)):(e.consume(g),d)}}const cB=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tx=["pre","script","style","textarea"],uB={concrete:!0,name:"htmlFlow",resolveTo:fB,tokenize:pB},dB={partial:!0,tokenize:gB},hB={partial:!0,tokenize:mB};function fB(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function pB(e,n,i){const s=this;let l,h,u,o,c;return d;function d(z){return g(z)}function g(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),b):z===47?(e.consume(z),h=!0,w):z===63?(e.consume(z),l=3,s.interrupt?n:j):mn(z)?(e.consume(z),u=String.fromCharCode(z),_):i(z)}function b(z){return z===45?(e.consume(z),l=2,S):z===91?(e.consume(z),l=5,o=0,k):mn(z)?(e.consume(z),l=4,s.interrupt?n:j):i(z)}function S(z){return z===45?(e.consume(z),s.interrupt?n:j):i(z)}function k(z){const X="CDATA[";return z===X.charCodeAt(o++)?(e.consume(z),o===X.length?s.interrupt?n:U:k):i(z)}function w(z){return mn(z)?(e.consume(z),u=String.fromCharCode(z),_):i(z)}function _(z){if(z===null||z===47||z===62||yt(z)){const X=z===47,ee=u.toLowerCase();return!X&&!h&&tx.includes(ee)?(l=1,s.interrupt?n(z):U(z)):cB.includes(u.toLowerCase())?(l=6,X?(e.consume(z),y):s.interrupt?n(z):U(z)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?i(z):h?v(z):x(z))}return z===45||dn(z)?(e.consume(z),u+=String.fromCharCode(z),_):i(z)}function y(z){return z===62?(e.consume(z),s.interrupt?n:U):i(z)}function v(z){return Je(z)?(e.consume(z),v):P(z)}function x(z){return z===47?(e.consume(z),P):z===58||z===95||mn(z)?(e.consume(z),E):Je(z)?(e.consume(z),x):P(z)}function E(z){return z===45||z===46||z===58||z===95||dn(z)?(e.consume(z),E):M(z)}function M(z){return z===61?(e.consume(z),R):Je(z)?(e.consume(z),M):x(z)}function R(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),c=z,N):Je(z)?(e.consume(z),R):D(z)}function N(z){return z===c?(e.consume(z),c=null,O):z===null||ze(z)?i(z):(e.consume(z),N)}function D(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||yt(z)?M(z):(e.consume(z),D)}function O(z){return z===47||z===62||Je(z)?x(z):i(z)}function P(z){return z===62?(e.consume(z),$):i(z)}function $(z){return z===null||ze(z)?U(z):Je(z)?(e.consume(z),$):i(z)}function U(z){return z===45&&l===2?(e.consume(z),V):z===60&&l===1?(e.consume(z),Q):z===62&&l===4?(e.consume(z),I):z===63&&l===3?(e.consume(z),j):z===93&&l===5?(e.consume(z),F):ze(z)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(dB,L,q)(z)):z===null||ze(z)?(e.exit("htmlFlowData"),q(z)):(e.consume(z),U)}function q(z){return e.check(hB,Y,L)(z)}function Y(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),K}function K(z){return z===null||ze(z)?q(z):(e.enter("htmlFlowData"),U(z))}function V(z){return z===45?(e.consume(z),j):U(z)}function Q(z){return z===47?(e.consume(z),u="",J):U(z)}function J(z){if(z===62){const X=u.toLowerCase();return tx.includes(X)?(e.consume(z),I):U(z)}return mn(z)&&u.length<8?(e.consume(z),u+=String.fromCharCode(z),J):U(z)}function F(z){return z===93?(e.consume(z),j):U(z)}function j(z){return z===62?(e.consume(z),I):z===45&&l===2?(e.consume(z),j):U(z)}function I(z){return z===null||ze(z)?(e.exit("htmlFlowData"),L(z)):(e.consume(z),I)}function L(z){return e.exit("htmlFlow"),n(z)}}function mB(e,n,i){const s=this;return l;function l(u){return ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),h):i(u)}function h(u){return s.parser.lazy[s.now().line]?i(u):n(u)}}function gB(e,n,i){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Ql,n,i)}}const vB={name:"htmlText",tokenize:_B};function _B(e,n,i){const s=this;let l,h,u;return o;function o(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),c}function c(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),M):j===63?(e.consume(j),x):mn(j)?(e.consume(j),D):i(j)}function d(j){return j===45?(e.consume(j),g):j===91?(e.consume(j),h=0,k):mn(j)?(e.consume(j),v):i(j)}function g(j){return j===45?(e.consume(j),S):i(j)}function f(j){return j===null?i(j):j===45?(e.consume(j),b):ze(j)?(u=f,Q(j)):(e.consume(j),f)}function b(j){return j===45?(e.consume(j),S):f(j)}function S(j){return j===62?V(j):j===45?b(j):f(j)}function k(j){const I="CDATA[";return j===I.charCodeAt(h++)?(e.consume(j),h===I.length?w:k):i(j)}function w(j){return j===null?i(j):j===93?(e.consume(j),_):ze(j)?(u=w,Q(j)):(e.consume(j),w)}function _(j){return j===93?(e.consume(j),y):w(j)}function y(j){return j===62?V(j):j===93?(e.consume(j),y):w(j)}function v(j){return j===null||j===62?V(j):ze(j)?(u=v,Q(j)):(e.consume(j),v)}function x(j){return j===null?i(j):j===63?(e.consume(j),E):ze(j)?(u=x,Q(j)):(e.consume(j),x)}function E(j){return j===62?V(j):x(j)}function M(j){return mn(j)?(e.consume(j),R):i(j)}function R(j){return j===45||dn(j)?(e.consume(j),R):N(j)}function N(j){return ze(j)?(u=N,Q(j)):Je(j)?(e.consume(j),N):V(j)}function D(j){return j===45||dn(j)?(e.consume(j),D):j===47||j===62||yt(j)?O(j):i(j)}function O(j){return j===47?(e.consume(j),V):j===58||j===95||mn(j)?(e.consume(j),P):ze(j)?(u=O,Q(j)):Je(j)?(e.consume(j),O):V(j)}function P(j){return j===45||j===46||j===58||j===95||dn(j)?(e.consume(j),P):$(j)}function $(j){return j===61?(e.consume(j),U):ze(j)?(u=$,Q(j)):Je(j)?(e.consume(j),$):O(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?i(j):j===34||j===39?(e.consume(j),l=j,q):ze(j)?(u=U,Q(j)):Je(j)?(e.consume(j),U):(e.consume(j),Y)}function q(j){return j===l?(e.consume(j),l=void 0,K):j===null?i(j):ze(j)?(u=q,Q(j)):(e.consume(j),q)}function Y(j){return j===null||j===34||j===39||j===60||j===61||j===96?i(j):j===47||j===62||yt(j)?O(j):(e.consume(j),Y)}function K(j){return j===47||j===62||yt(j)?O(j):i(j)}function V(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),n):i(j)}function Q(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),J}function J(j){return Je(j)?it(e,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return e.enter("htmlTextData"),u(j)}}const Og={name:"labelEnd",resolveAll:SB,resolveTo:wB,tokenize:CB},yB={tokenize:kB},bB={tokenize:EB},xB={tokenize:AB};function SB(e){let n=-1;const i=[];for(;++n<e.length;){const s=e[n][1];if(i.push(e[n]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",n+=l}}return e.length!==i.length&&Hn(e,0,e.length,i),e}function wB(e,n){let i=e.length,s=0,l,h,u,o;for(;i--;)if(l=e[i][1],h){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[i][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(h=i,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(u=i);const c={type:e[h][1].type==="labelLink"?"link":"image",start:{...e[h][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[h][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[h+s+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,n],["enter",d,n]],o=tr(o,e.slice(h+1,h+s+3)),o=tr(o,[["enter",g,n]]),o=tr(o,$d(n.parser.constructs.insideSpan.null,e.slice(h+s+4,u-3),n)),o=tr(o,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),o=tr(o,e.slice(u+1)),o=tr(o,[["exit",c,n]]),Hn(e,h,e.length,o),e}function CB(e,n,i){const s=this;let l=s.events.length,h,u;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){h=s.events[l][1];break}return o;function o(b){return h?h._inactive?f(b):(u=s.parser.defined.includes(dr(s.sliceSerialize({start:h.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),c):i(b)}function c(b){return b===40?e.attempt(yB,g,u?g:f)(b):b===91?e.attempt(bB,g,u?d:f)(b):u?g(b):f(b)}function d(b){return e.attempt(xB,g,f)(b)}function g(b){return n(b)}function f(b){return h._balanced=!0,i(b)}}function kB(e,n,i){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),l}function l(f){return yt(f)?xl(e,h)(f):h(f)}function h(f){return f===41?g(f):nk(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function u(f){return yt(f)?xl(e,c)(f):g(f)}function o(f){return i(f)}function c(f){return f===34||f===39||f===40?ik(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):g(f)}function d(f){return yt(f)?xl(e,g)(f):g(f)}function g(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):i(f)}}function EB(e,n,i){const s=this;return l;function l(o){return rk.call(s,e,h,u,"reference","referenceMarker","referenceString")(o)}function h(o){return s.parser.defined.includes(dr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(o):i(o)}function u(o){return i(o)}}function AB(e,n,i){return s;function s(h){return e.enter("reference"),e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),l}function l(h){return h===93?(e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),e.exit("reference"),n):i(h)}}const TB={name:"labelStartImage",resolveAll:Og.resolveAll,tokenize:RB};function RB(e,n,i){const s=this;return l;function l(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),h}function h(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):i(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(o):n(o)}}const DB={name:"labelStartLink",resolveAll:Og.resolveAll,tokenize:MB};function MB(e,n,i){const s=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),h}function h(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(u):n(u)}}const Lp={name:"lineEnding",tokenize:NB};function NB(e,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,n,"linePrefix")}}const Bu={name:"thematicBreak",tokenize:jB};function jB(e,n,i){let s=0,l;return h;function h(d){return e.enter("thematicBreak"),u(d)}function u(d){return l=d,o(d)}function o(d){return d===l?(e.enter("thematicBreakSequence"),c(d)):s>=3&&(d===null||ze(d))?(e.exit("thematicBreak"),n(d)):i(d)}function c(d){return d===l?(e.consume(d),s++,c):(e.exit("thematicBreakSequence"),Je(d)?it(e,o,"whitespace")(d):o(d))}}const kn={continuation:{tokenize:BB},exit:PB,name:"list",tokenize:IB},OB={partial:!0,tokenize:FB},LB={partial:!0,tokenize:zB};function IB(e,n,i){const s=this,l=s.events[s.events.length-1];let h=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return o;function o(S){const k=s.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||S===s.containerState.marker:xm(S)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Bu,i,d)(S):d(S);if(!s.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(S)}return i(S)}function c(S){return xm(S)&&++u<10?(e.consume(S),c):(!s.interrupt||u<2)&&(s.containerState.marker?S===s.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),d(S)):i(S)}function d(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||S,e.check(Ql,s.interrupt?i:g,e.attempt(OB,b,f))}function g(S){return s.containerState.initialBlankLine=!0,h++,b(S)}function f(S){return Je(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):i(S)}function b(S){return s.containerState.size=h+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(S)}}function BB(e,n,i){const s=this;return s.containerState._closeFlow=void 0,e.check(Ql,l,h);function l(o){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(e,n,"listItemIndent",s.containerState.size+1)(o)}function h(o){return s.containerState.furtherBlankLines||!Je(o)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(o)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(LB,n,u)(o))}function u(o){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(kn,n,i),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function zB(e,n,i){const s=this;return it(e,l,"listItemIndent",s.containerState.size+1);function l(h){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?n(h):i(h)}}function PB(e){e.exit(this.containerState.type)}function FB(e,n,i){const s=this;return it(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(h){const u=s.events[s.events.length-1];return!Je(h)&&u&&u[1].type==="listItemPrefixWhitespace"?n(h):i(h)}}const nx={name:"setextUnderline",resolveTo:HB,tokenize:UB};function HB(e,n){let i=e.length,s,l,h;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){s=i;break}e[i][1].type==="paragraph"&&(l=i)}else e[i][1].type==="content"&&e.splice(i,1),!h&&e[i][1].type==="definition"&&(h=i);const u={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",h?(e.splice(l,0,["enter",u,n]),e.splice(h+1,0,["exit",e[s][1],n]),e[s][1].end={...e[h][1].end}):e[s][1]=u,e.push(["exit",u,n]),e}function UB(e,n,i){const s=this;let l;return h;function h(d){let g=s.events.length,f;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){f=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),l=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===l?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),Je(d)?it(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||ze(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const $B={tokenize:qB};function qB(e){const n=this,i=e.attempt(Ql,s,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(YI,l)),"linePrefix")));return i;function s(h){if(h===null){e.consume(h);return}return e.enter("lineEndingBlank"),e.consume(h),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function l(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const VB={resolveAll:ak()},GB=sk("string"),WB=sk("text");function sk(e){return{resolveAll:ak(e==="text"?KB:void 0),tokenize:n};function n(i){const s=this,l=this.parser.constructs[e],h=i.attempt(l,u,o);return u;function u(g){return d(g)?h(g):o(g)}function o(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),c}function c(g){return d(g)?(i.exit("data"),h(g)):(i.consume(g),c)}function d(g){if(g===null)return!0;const f=l[g];let b=-1;if(f)for(;++b<f.length;){const S=f[b];if(!S.previous||S.previous.call(s,s.previous))return!0}return!1}}}function ak(e){return n;function n(i,s){let l=-1,h;for(;++l<=i.length;)h===void 0?i[l]&&i[l][1].type==="data"&&(h=l,l++):(!i[l]||i[l][1].type!=="data")&&(l!==h+2&&(i[h][1].end=i[l-1][1].end,i.splice(h+2,l-h-2),l=h+2),h=void 0);return e?e(i,s):i}}function KB(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const s=e[i-1][1],l=n.sliceStream(s);let h=l.length,u=-1,o=0,c;for(;h--;){const d=l[h];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(d===-2)c=!0,o++;else if(d!==-1){h++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(o=0),o){const d={type:i===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:h?u:s.start._bufferIndex+u,_index:s.start._index+h,line:s.end.line,column:s.end.column-o,offset:s.end.offset-o},end:{...s.end}};s.end={...d.start},s.start.offset===s.end.offset?Object.assign(s,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const YB={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:QC},XB={91:eB},ZB={[-2]:Op,[-1]:Op,32:Op},QB={35:aB,42:Bu,45:[nx,Bu],60:uB,61:nx,95:Bu,96:ex,126:ex},JB={38:ek,92:JC},ez={[-5]:Lp,[-4]:Lp,[-3]:Lp,33:TB,38:ek,42:Sm,60:[DI,vB],91:DB,92:[iB,JC],93:Og,95:Sm,96:$I},tz={null:[Sm,VB]},nz={null:[42,95]},rz={null:[]},iz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nz,contentInitial:XB,disable:rz,document:YB,flow:QB,flowInitial:ZB,insideSpan:tz,string:JB,text:ez},Symbol.toStringTag,{value:"Module"}));function sz(e,n,i){let s={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const l={},h=[];let u=[],o=[];const c={attempt:N(M),check:N(R),consume:v,enter:x,exit:E,interrupt:N(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:f};let g=n.tokenize.call(d,c);return n.resolveAll&&h.push(n),d;function f($){return u=tr(u,$),_(),u[u.length-1]!==null?[]:(D(n,0),d.events=$d(h,d.events,d),d.events)}function b($,U){return oz(S($),U)}function S($){return az(u,$)}function k(){const{_bufferIndex:$,_index:U,line:q,column:Y,offset:K}=s;return{_bufferIndex:$,_index:U,line:q,column:Y,offset:K}}function w($){l[$.line]=$.column,P()}function _(){let $;for(;s._index<u.length;){const U=u[s._index];if(typeof U=="string")for($=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===$&&s._bufferIndex<U.length;)y(U.charCodeAt(s._bufferIndex));else y(U)}}function y($){g=g($)}function v($){ze($)?(s.line++,s.column=1,s.offset+=$===-3?2:1,P()):$!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=$}function x($,U){const q=U||{};return q.type=$,q.start=k(),d.events.push(["enter",q,d]),o.push(q),q}function E($){const U=o.pop();return U.end=k(),d.events.push(["exit",U,d]),U}function M($,U){D($,U.from)}function R($,U){U.restore()}function N($,U){return q;function q(Y,K,V){let Q,J,F,j;return Array.isArray(Y)?L(Y):"tokenize"in Y?L([Y]):I(Y);function I(te){return W;function W(H){const re=H!==null&&te[H],ae=H!==null&&te.null,pe=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return L(pe)(H)}}function L(te){return Q=te,J=0,te.length===0?V:z(te[J])}function z(te){return W;function W(H){return j=O(),F=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?ee():te.tokenize.call(U?Object.assign(Object.create(d),U):d,c,X,ee)(H)}}function X(te){return $(F,j),K}function ee(te){return j.restore(),++J<Q.length?z(Q[J]):V}}}function D($,U){$.resolveAll&&!h.includes($)&&h.push($),$.resolve&&Hn(d.events,U,d.events.length-U,$.resolve(d.events.slice(U),d)),$.resolveTo&&(d.events=$.resolveTo(d.events,d))}function O(){const $=k(),U=d.previous,q=d.currentConstruct,Y=d.events.length,K=Array.from(o);return{from:Y,restore:V};function V(){s=$,d.previous=U,d.currentConstruct=q,d.events.length=Y,o=K,P()}}function P(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function az(e,n){const i=n.start._index,s=n.start._bufferIndex,l=n.end._index,h=n.end._bufferIndex;let u;if(i===l)u=[e[i].slice(s,h)];else{if(u=e.slice(i,l),s>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(s):u.shift()}h>0&&u.push(e[l].slice(0,h))}return u}function oz(e,n){let i=-1;const s=[];let l;for(;++i<e.length;){const h=e[i];let u;if(typeof h=="string")u=h;else switch(h){case-5:{u="\r";break}case-4:{u=`
|
|
493
|
-
`;break}case-3:{u=`\r
|
|
494
|
-
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&l)continue;u=" ";break}default:u=String.fromCharCode(h)}l=h===-2,s.push(u)}return s.join("")}function lz(e){const s={constructs:XC([iz,...(e||{}).extensions||[]]),content:l(wI),defined:[],document:l(kI),flow:l($B),lazy:{},string:l(GB),text:l(WB)};return s;function l(h){return u;function u(o){return sz(s,h,o)}}}function cz(e){for(;!tk(e););return e}const rx=/[\0\t\n\r]/g;function uz(){let e=1,n="",i=!0,s;return l;function l(h,u,o){const c=[];let d,g,f,b,S;for(h=n+(typeof h=="string"?h.toString():new TextDecoder(u||void 0).decode(h)),f=0,n="",i&&(h.charCodeAt(0)===65279&&f++,i=void 0);f<h.length;){if(rx.lastIndex=f,d=rx.exec(h),b=d&&d.index!==void 0?d.index:h.length,S=h.charCodeAt(b),!d){n=h.slice(f);break}if(S===10&&f===b&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),f<b&&(c.push(h.slice(f,b)),e+=b-f),S){case 0:{c.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,c.push(-2);e++<g;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}f=b+1}return o&&(s&&c.push(-5),n&&c.push(n),c.push(null)),c}}const dz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hz(e){return e.replace(dz,fz)}function fz(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const l=i.charCodeAt(1),h=l===120||l===88;return ZC(i.slice(h?2:1),h?16:10)}return jg(i)||e}const ok={}.hasOwnProperty;function pz(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),mz(i)(cz(lz(i).document().write(uz()(e,n,!0))))}function mz(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:h(Wt),autolinkProtocol:O,autolinkEmail:O,atxHeading:h($e),blockQuote:h(ae),characterEscape:O,characterReference:O,codeFenced:h(pe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:h(pe,u),codeText:h(ce,u),codeTextData:O,data:O,codeFlowValue:O,definition:h(Oe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:h(Be),hardBreakEscape:h(ut),hardBreakTrailing:h(ut),htmlFlow:h(Me,u),htmlFlowData:O,htmlText:h(Me,u),htmlTextData:O,image:h(vn),label:u,link:h(Wt),listItem:h(Kt),listItemValue:b,listOrdered:h(on,f),listUnordered:h(on),paragraph:h($n),reference:z,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:h($e),strong:h(Dt),thematicBreak:h(Qt)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:re,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:te,characterReference:W,codeFenced:c(_),codeFencedFence:w,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:P,codeIndented:c(y),codeText:c(K),codeTextData:P,data:P,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(q),htmlFlowData:P,htmlText:c(Y),htmlTextData:P,image:c(Q),label:F,labelText:J,lineEnding:$,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:X,resourceDestinationString:j,resourceTitleString:I,resource:L,setextHeading:c(D),setextHeadingLineSequence:N,setextHeadingText:R,strong:c(),thematicBreak:c()}};lk(n,(e||{}).mdastExtensions||[]);const i={};return s;function s(he){let Se={type:"root",children:[]};const Re={stack:[Se],tokenStack:[],config:n,enter:o,exit:d,buffer:u,resume:g,data:i},He=[];let Ve=-1;for(;++Ve<he.length;)if(he[Ve][1].type==="listOrdered"||he[Ve][1].type==="listUnordered")if(he[Ve][0]==="enter")He.push(Ve);else{const xt=He.pop();Ve=l(he,xt,Ve)}for(Ve=-1;++Ve<he.length;){const xt=n[he[Ve][0]];ok.call(xt,he[Ve][1].type)&&xt[he[Ve][1].type].call(Object.assign({sliceSerialize:he[Ve][2].sliceSerialize},Re),he[Ve][1])}if(Re.tokenStack.length>0){const xt=Re.tokenStack[Re.tokenStack.length-1];(xt[1]||ix).call(Re,void 0,xt[0])}for(Se.position={start:Pi(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Pi(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<n.transforms.length;)Se=n.transforms[Ve](Se)||Se;return Se}function l(he,Se,Re){let He=Se-1,Ve=-1,xt=!1,nt,At,Mt,Jt;for(;++He<=Re;){const ot=he[He];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Ve++:Ve--,Jt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(nt&&!Jt&&!Ve&&!Mt&&(Mt=He),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!Ve&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Ve===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(nt){let mr=He;for(At=void 0;mr--;){const An=he[mr];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;At&&(he[At][1].type="lineEndingBlank",xt=!0),An[1].type="lineEnding",At=mr}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}Mt&&(!At||Mt<At)&&(nt._spread=!0),nt.end=Object.assign({},At?he[At][1].start:ot[1].end),he.splice(At||He,0,["exit",nt,ot[2]]),He++,Re++}if(ot[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};nt=mr,he.splice(He,0,["enter",mr,ot[2]]),He++,Re++,Mt=void 0,Jt=!0}}}return he[Se][1]._spread=xt,Re}function h(he,Se){return Re;function Re(He){o.call(this,he(He),He),Se&&Se.call(this,He)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(he,Se,Re){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Se,Re||void 0]),he.position={start:Pi(Se.start),end:void 0}}function c(he){return Se;function Se(Re){he&&he.call(this,Re),d.call(this,Re)}}function d(he,Se){const Re=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==he.type&&(Se?Se.call(this,he,He[0]):(He[1]||ix).call(this,he,He[0]));else throw new Error("Cannot close `"+he.type+"` ("+bl({start:he.start,end:he.end})+"): it’s not open");Re.position.end=Pi(he.end)}function g(){return Ng(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function b(he){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function S(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=he}function k(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/(\r?\n|\r)$/g,"")}function v(he){const Se=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Se,Re.identifier=dr(this.sliceSerialize(he)).toLowerCase()}function x(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function E(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function M(he){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Re=this.sliceSerialize(he).length;Se.depth=Re}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function N(he){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function O(he){const Re=this.stack[this.stack.length-1].children;let He=Re[Re.length-1];(!He||He.type!=="text")&&(He=Et(),He.position={start:Pi(he.start),end:void 0},Re.push(He)),this.stack.push(He)}function P(he){const Se=this.stack.pop();Se.value+=this.sliceSerialize(he),Se.position.end=Pi(he.end)}function $(he){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Se.children[Se.children.length-1];Re.position.end=Pi(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(Se.type)&&(O.call(this,he),P.call(this,he))}function U(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function Y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function K(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Q(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function J(he){const Se=this.sliceSerialize(he),Re=this.stack[this.stack.length-2];Re.label=hz(Se),Re.identifier=dr(Se).toLowerCase()}function F(){const he=this.stack[this.stack.length-1],Se=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const He=he.children;Re.children=He}else Re.alt=Se}function j(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function I(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function L(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X(he){const Se=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Se,Re.identifier=dr(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ee(he){this.data.characterReferenceType=he.type}function te(he){const Se=this.sliceSerialize(he),Re=this.data.characterReferenceType;let He;Re?(He=ZC(Se,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=jg(Se);const Ve=this.stack[this.stack.length-1];Ve.value+=He}function W(he){const Se=this.stack.pop();Se.position.end=Pi(he.end)}function H(he){P.call(this,he);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(he)}function re(he){P.call(this,he);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ce(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function ut(){return{type:"break"}}function Me(){return{type:"html",value:""}}function vn(){return{type:"image",title:null,url:"",alt:null}}function Wt(){return{type:"link",title:null,url:"",children:[]}}function on(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Kt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function $n(){return{type:"paragraph",children:[]}}function Dt(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Qt(){return{type:"thematicBreak"}}}function Pi(e){return{line:e.line,column:e.column,offset:e.offset}}function lk(e,n){let i=-1;for(;++i<n.length;){const s=n[i];Array.isArray(s)?lk(e,s):gz(e,s)}}function gz(e,n){let i;for(i in n)if(ok.call(n,i))switch(i){case"canContainEols":{const s=n[i];s&&e[i].push(...s);break}case"transforms":{const s=n[i];s&&e[i].push(...s);break}case"enter":case"exit":{const s=n[i];s&&Object.assign(e[i],s);break}}}function ix(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+bl({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+bl({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+bl({start:n.start,end:n.end})+") is still open")}function vz(e){const n=this;n.parser=i;function i(s){return pz(s,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function _z(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function yz(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
495
|
-
`}]}function bz(e,n){const i=n.value?n.value+`
|
|
496
|
-
`:"",s={},l=n.lang?n.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let h={type:"element",tagName:"code",properties:s,children:[{type:"text",value:i}]};return n.meta&&(h.data={meta:n.meta}),e.patch(n,h),h=e.applyData(n,h),h={type:"element",tagName:"pre",properties:{},children:[h]},e.patch(n,h),h}function xz(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Sz(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function wz(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(n.identifier).toUpperCase(),l=lo(s.toLowerCase()),h=e.footnoteOrder.indexOf(s);let u,o=e.footnoteCounts.get(s);o===void 0?(o=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=h+1,o+=1,e.footnoteCounts.set(s,o);const c={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+l,id:i+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,d),e.applyData(n,d)}function Cz(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function kz(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function ck(e,n){const i=n.referenceType;let s="]";if(i==="collapsed"?s+="[]":i==="full"&&(s+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+s}];const l=e.all(n),h=l[0];h&&h.type==="text"?h.value="["+h.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=s:l.push({type:"text",value:s}),l}function Ez(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return ck(e,n);const l={src:lo(s.url||""),alt:n.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,h),e.applyData(n,h)}function Az(e,n){const i={src:lo(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,s),e.applyData(n,s)}function Tz(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const s={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,s),e.applyData(n,s)}function Rz(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return ck(e,n);const l={href:lo(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,h),e.applyData(n,h)}function Dz(e,n){const i={href:lo(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function Mz(e,n,i){const s=e.all(n),l=i?Nz(i):uk(n),h={},u=[];if(typeof n.checked=="boolean"){const g=s[0];let f;g&&g.type==="element"&&g.tagName==="p"?f=g:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),h.className=["task-list-item"]}let o=-1;for(;++o<s.length;){const g=s[o];(l||o!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
497
|
-
`}),g.type==="element"&&g.tagName==="p"&&!l?u.push(...g.children):u.push(g)}const c=s[s.length-1];c&&(l||c.type!=="element"||c.tagName!=="p")&&u.push({type:"text",value:`
|
|
498
|
-
`});const d={type:"element",tagName:"li",properties:h,children:u};return e.patch(n,d),e.applyData(n,d)}function Nz(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let s=-1;for(;!n&&++s<i.length;)n=uk(i[s])}return n}function uk(e){const n=e.spread;return n==null?e.children.length>1:n}function jz(e,n){const i={},s=e.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++l<s.length;){const u=s[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const h={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(s,!0)};return e.patch(n,h),e.applyData(n,h)}function Oz(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Lz(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function Iz(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Bz(e,n){const i=e.all(n),s=i.shift(),l=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(n.children[0],u),l.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},o=Tg(n.children[1]),c=$C(n.children[n.children.length-1]);o&&c&&(u.position={start:o,end:c}),l.push(u)}const h={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,h),e.applyData(n,h)}function zz(e,n,i){const s=i?i.children:void 0,h=(s?s.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,o=u?u.length:n.children.length;let c=-1;const d=[];for(;++c<o;){const f=n.children[c],b={},S=u?u[c]:void 0;S&&(b.align=S);let k={type:"element",tagName:h,properties:b,children:[]};f&&(k.children=e.all(f),e.patch(f,k),k=e.applyData(f,k)),d.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function Pz(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const sx=9,ax=32;function Fz(e){const n=String(e),i=/\r?\n|\r/g;let s=i.exec(n),l=0;const h=[];for(;s;)h.push(ox(n.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=i.exec(n);return h.push(ox(n.slice(l),l>0,!1)),h.join("")}function ox(e,n,i){let s=0,l=e.length;if(n){let h=e.codePointAt(s);for(;h===sx||h===ax;)s++,h=e.codePointAt(s)}if(i){let h=e.codePointAt(l-1);for(;h===sx||h===ax;)l--,h=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function Hz(e,n){const i={type:"text",value:Fz(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function Uz(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const $z={blockquote:_z,break:yz,code:bz,delete:xz,emphasis:Sz,footnoteReference:wz,heading:Cz,html:kz,imageReference:Ez,image:Az,inlineCode:Tz,linkReference:Rz,link:Dz,listItem:Mz,list:jz,paragraph:Oz,root:Lz,strong:Iz,table:Bz,tableCell:Pz,tableRow:zz,text:Hz,thematicBreak:Uz,toml:ku,yaml:ku,definition:ku,footnoteDefinition:ku};function ku(){}const dk=-1,qd=0,Sl=1,ed=2,Lg=3,Ig=4,Bg=5,zg=6,hk=7,fk=8,lx=typeof self=="object"?self:globalThis,qz=(e,n)=>{const i=(l,h)=>(e.set(h,l),l),s=l=>{if(e.has(l))return e.get(l);const[h,u]=n[l];switch(h){case qd:case dk:return i(u,l);case Sl:{const o=i([],l);for(const c of u)o.push(s(c));return o}case ed:{const o=i({},l);for(const[c,d]of u)o[s(c)]=s(d);return o}case Lg:return i(new Date(u),l);case Ig:{const{source:o,flags:c}=u;return i(new RegExp(o,c),l)}case Bg:{const o=i(new Map,l);for(const[c,d]of u)o.set(s(c),s(d));return o}case zg:{const o=i(new Set,l);for(const c of u)o.add(s(c));return o}case hk:{const{name:o,message:c}=u;return i(new lx[o](c),l)}case fk:return i(BigInt(u),l);case"BigInt":return i(Object(BigInt(u)),l);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return i(new DataView(o),u)}}return i(new lx[h](u),l)};return s},cx=e=>qz(new Map,e)(0),ka="",{toString:Vz}={},{keys:Gz}=Object,hl=e=>{const n=typeof e;if(n!=="object"||!e)return[qd,n];const i=Vz.call(e).slice(8,-1);switch(i){case"Array":return[Sl,ka];case"Object":return[ed,ka];case"Date":return[Lg,ka];case"RegExp":return[Ig,ka];case"Map":return[Bg,ka];case"Set":return[zg,ka];case"DataView":return[Sl,i]}return i.includes("Array")?[Sl,i]:i.includes("Error")?[hk,i]:[ed,i]},Eu=([e,n])=>e===qd&&(n==="function"||n==="symbol"),Wz=(e,n,i,s)=>{const l=(u,o)=>{const c=s.push(u)-1;return i.set(o,c),c},h=u=>{if(i.has(u))return i.get(u);let[o,c]=hl(u);switch(o){case qd:{let g=u;switch(c){case"bigint":o=fk,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return l([dk],u)}return l([o,g],u)}case Sl:{if(c){let b=u;return c==="DataView"?b=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(u)),l([c,[...b]],u)}const g=[],f=l([o,g],u);for(const b of u)g.push(h(b));return f}case ed:{if(c)switch(c){case"BigInt":return l([c,u.toString()],u);case"Boolean":case"Number":case"String":return l([c,u.valueOf()],u)}if(n&&"toJSON"in u)return h(u.toJSON());const g=[],f=l([o,g],u);for(const b of Gz(u))(e||!Eu(hl(u[b])))&&g.push([h(b),h(u[b])]);return f}case Lg:return l([o,u.toISOString()],u);case Ig:{const{source:g,flags:f}=u;return l([o,{source:g,flags:f}],u)}case Bg:{const g=[],f=l([o,g],u);for(const[b,S]of u)(e||!(Eu(hl(b))||Eu(hl(S))))&&g.push([h(b),h(S)]);return f}case zg:{const g=[],f=l([o,g],u);for(const b of u)(e||!Eu(hl(b)))&&g.push(h(b));return f}}const{message:d}=u;return l([o,{name:c,message:d}],u)};return h},ux=(e,{json:n,lossy:i}={})=>{const s=[];return Wz(!(n||i),!!n,new Map,s)(e),s},td=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?cx(ux(e,n)):structuredClone(e):(e,n)=>cx(ux(e,n));function Kz(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function Yz(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Xz(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||Kz,s=e.options.footnoteBackLabel||Yz,l=e.options.footnoteLabel||"Footnotes",h=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const g=e.all(d),f=String(d.identifier).toUpperCase(),b=lo(f.toLowerCase());let S=0;const k=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++S<=w;){k.length>0&&k.push({type:"text",value:" "});let v=typeof i=="string"?i:i(c,S);typeof v=="string"&&(v={type:"text",value:v}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,S),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const _=g[g.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const v=_.children[_.children.length-1];v&&v.type==="text"?v.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...k)}else g.push(...k);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+b},children:e.wrap(g,!0)};e.patch(d,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:h,properties:{...td(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
499
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
500
|
-
`}]}}const Vd=(function(e){if(e==null)return e8;if(typeof e=="function")return Gd(e);if(typeof e=="object")return Array.isArray(e)?Zz(e):Qz(e);if(typeof e=="string")return Jz(e);throw new Error("Expected function, string, or object as test")});function Zz(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=Vd(e[i]);return Gd(s);function s(...l){let h=-1;for(;++h<n.length;)if(n[h].apply(this,l))return!0;return!1}}function Qz(e){const n=e;return Gd(i);function i(s){const l=s;let h;for(h in e)if(l[h]!==n[h])return!1;return!0}}function Jz(e){return Gd(n);function n(i){return i&&i.type===e}}function Gd(e){return n;function n(i,s,l){return!!(t8(i)&&e.call(this,i,typeof s=="number"?s:void 0,l||void 0))}}function e8(){return!0}function t8(e){return e!==null&&typeof e=="object"&&"type"in e}const pk=[],n8=!0,wm=!1,r8="skip";function mk(e,n,i,s){let l;typeof n=="function"&&typeof i!="function"?(s=i,i=n):l=n;const h=Vd(l),u=s?-1:1;o(e,void 0,[])();function o(c,d,g){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const S=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=pk,k,w,_;if((!n||h(c,d,g[g.length-1]||void 0))&&(S=i8(i(c,g)),S[0]===wm))return S;if("children"in c&&c.children){const y=c;if(y.children&&S[0]!==r8)for(w=(s?y.children.length:-1)+u,_=g.concat(y);w>-1&&w<y.children.length;){const v=y.children[w];if(k=o(v,w,_)(),k[0]===wm)return k;w=typeof k[1]=="number"?k[1]:w+u}}return S}}}function i8(e){return Array.isArray(e)?e:typeof e=="number"?[n8,e]:e==null?pk:[e]}function Pg(e,n,i,s){let l,h,u;typeof n=="function"&&typeof i!="function"?(h=void 0,u=n,l=i):(h=n,u=i,l=s),mk(e,h,o,l);function o(c,d){const g=d[d.length-1],f=g?g.children.indexOf(c):void 0;return u(c,f,g)}}const Cm={}.hasOwnProperty,s8={};function a8(e,n){const i=n||s8,s=new Map,l=new Map,h=new Map,u={...$z,...i.handlers},o={all:d,applyData:l8,definitionById:s,footnoteById:l,footnoteCounts:h,footnoteOrder:[],handlers:u,one:c,options:i,patch:o8,wrap:u8};return Pg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const f=g.type==="definition"?s:l,b=String(g.identifier).toUpperCase();f.has(b)||f.set(b,g)}}),o;function c(g,f){const b=g.type,S=o.handlers[b];if(Cm.call(o.handlers,b)&&S)return S(o,g,f);if(o.options.passThrough&&o.options.passThrough.includes(b)){if("children"in g){const{children:w,..._}=g,y=td(_);return y.children=o.all(g),y}return td(g)}return(o.options.unknownHandler||c8)(o,g,f)}function d(g){const f=[];if("children"in g){const b=g.children;let S=-1;for(;++S<b.length;){const k=o.one(b[S],g);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=dx(k.value)),!Array.isArray(k)&&k.type==="element")){const w=k.children[0];w&&w.type==="text"&&(w.value=dx(w.value))}Array.isArray(k)?f.push(...k):f.push(k)}}}return f}}function o8(e,n){e.position&&(n.position=Y6(e))}function l8(e,n){let i=n;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,h=e.data.hProperties;if(typeof s=="string")if(i.type==="element")i.tagName=s;else{const u="children"in i?i.children:[i];i={type:"element",tagName:s,properties:{},children:u}}i.type==="element"&&h&&Object.assign(i.properties,td(h)),"children"in i&&i.children&&l!==null&&l!==void 0&&(i.children=l)}return i}function c8(e,n){const i=n.data||{},s="value"in n&&!(Cm.call(i,"hProperties")||Cm.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function u8(e,n){const i=[];let s=-1;for(n&&i.push({type:"text",value:`
|
|
501
|
-
`});++s<e.length;)s&&i.push({type:"text",value:`
|
|
502
|
-
`}),i.push(e[s]);return n&&e.length>0&&i.push({type:"text",value:`
|
|
503
|
-
`}),i}function dx(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function hx(e,n){const i=a8(e,n),s=i.one(e,void 0),l=Xz(i),h=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&h.children.push({type:"text",value:`
|
|
504
|
-
`},l),h}function d8(e,n){return e&&"run"in e?async function(i,s){const l=hx(i,{file:s,...n});await e.run(l,s)}:function(i,s){return hx(i,{file:s,...e||n})}}function fx(e){if(e)throw e}var Ip,px;function h8(){if(px)return Ip;px=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},h=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!f)return!1;var b;for(b in d);return typeof b>"u"||e.call(d,b)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},o=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(s)return s(d,g).value}else return;return d[g]};return Ip=function c(){var d,g,f,b,S,k,w=arguments[0],_=1,y=arguments.length,v=!1;for(typeof w=="boolean"&&(v=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<y;++_)if(d=arguments[_],d!=null)for(g in d)f=o(w,g),b=o(d,g),w!==b&&(v&&b&&(h(b)||(S=l(b)))?(S?(S=!1,k=f&&l(f)?f:[]):k=f&&h(f)?f:{},u(w,{name:g,newValue:c(v,k,b)})):typeof b<"u"&&u(w,{name:g,newValue:b}));return w},Ip}var f8=h8();const Bp=rd(f8);function km(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function p8(){const e=[],n={run:i,use:s};return n;function i(...l){let h=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...l);function o(c,...d){const g=e[++h];let f=-1;if(c){u(c);return}for(;++f<l.length;)(d[f]===null||d[f]===void 0)&&(d[f]=l[f]);l=d,g?m8(g,o)(...d):u(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function m8(e,n){let i;return s;function s(...u){const o=e.length>u.length;let c;o&&u.push(l);try{c=e.apply(this,u)}catch(d){const g=d;if(o&&i)throw g;return l(g)}o||(c&&c.then&&typeof c.then=="function"?c.then(h,l):c instanceof Error?l(c):h(c))}function l(u,...o){i||(i=!0,n(u,...o))}function h(u){l(null,u)}}const wr={basename:g8,dirname:v8,extname:_8,join:y8,sep:"/"};function g8(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Jl(e);let i=0,s=-1,l=e.length,h;if(n===void 0||n.length===0||n.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(h){i=l+1;break}}else s<0&&(h=!0,s=l+1);return s<0?"":e.slice(i,s)}if(n===e)return"";let u=-1,o=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(h){i=l+1;break}}else u<0&&(h=!0,u=l+1),o>-1&&(e.codePointAt(l)===n.codePointAt(o--)?o<0&&(s=l):(o=-1,s=u));return i===s?s=u:s<0&&(s=e.length),e.slice(i,s)}function v8(e){if(Jl(e),e.length===0)return".";let n=-1,i=e.length,s;for(;--i;)if(e.codePointAt(i)===47){if(s){n=i;break}}else s||(s=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function _8(e){Jl(e);let n=e.length,i=-1,s=0,l=-1,h=0,u;for(;n--;){const o=e.codePointAt(n);if(o===47){if(u){s=n+1;break}continue}i<0&&(u=!0,i=n+1),o===46?l<0?l=n:h!==1&&(h=1):l>-1&&(h=-1)}return l<0||i<0||h===0||h===1&&l===i-1&&l===s+1?"":e.slice(l,i)}function y8(...e){let n=-1,i;for(;++n<e.length;)Jl(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":b8(i)}function b8(e){Jl(e);const n=e.codePointAt(0)===47;let i=x8(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function x8(e,n){let i="",s=0,l=-1,h=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(l===u-1||h===1))if(l!==u-1&&h===2){if(i.length<2||s!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",s=0):(i=i.slice(0,c),s=i.length-1-i.lastIndexOf("/")),l=u,h=0;continue}}else if(i.length>0){i="",s=0,l=u,h=0;continue}}n&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+e.slice(l+1,u):i=e.slice(l+1,u),s=u-l-1;l=u,h=0}else o===46&&h>-1?h++:h=-1}return i}function Jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const S8={cwd:w8};function w8(){return"/"}function Em(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function C8(e){if(typeof e=="string")e=new URL(e);else if(!Em(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return k8(e)}function k8(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const s=n.codePointAt(i+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(n)}const zp=["history","path","basename","stem","extname","dirname"];class gk{constructor(n){let i;n?Em(n)?i={path:n}:typeof n=="string"||E8(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":S8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<zp.length;){const h=zp[s];h in i&&i[h]!==void 0&&i[h]!==null&&(this[h]=h==="history"?[...i[h]]:i[h])}let l;for(l in i)zp.includes(l)||(this[l]=i[l])}get basename(){return typeof this.path=="string"?wr.basename(this.path):void 0}set basename(n){Fp(n,"basename"),Pp(n,"basename"),this.path=wr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?wr.dirname(this.path):void 0}set dirname(n){mx(this.basename,"dirname"),this.path=wr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?wr.extname(this.path):void 0}set extname(n){if(Pp(n,"extname"),mx(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Em(n)&&(n=C8(n)),Fp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?wr.basename(this.path,this.extname):void 0}set stem(n){Fp(n,"stem"),Pp(n,"stem"),this.path=wr.join(this.dirname||"",n+(this.extname||""))}fail(n,i,s){const l=this.message(n,i,s);throw l.fatal=!0,l}info(n,i,s){const l=this.message(n,i,s);return l.fatal=void 0,l}message(n,i,s){const l=new hn(n,i,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Pp(e,n){if(e&&e.includes(wr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+wr.sep+"`")}function Fp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function mx(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function E8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const A8=(function(e){const s=this.constructor.prototype,l=s[e],h=function(){return l.apply(h,arguments)};return Object.setPrototypeOf(h,s),h}),T8={}.hasOwnProperty;class Fg extends A8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=p8()}copy(){const n=new Fg;let i=-1;for(;++i<this.attachers.length;){const s=this.attachers[i];n.use(...s)}return n.data(Bp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?($p("data",this.frozen),this.namespace[n]=i,this):T8.call(this.namespace,n)&&this.namespace[n]||void 0:n?($p("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=i.call(n,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=Au(n),s=this.parser||this.Parser;return Hp("parse",s),s(String(i),i)}process(n,i){const s=this;return this.freeze(),Hp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),i?l(void 0,i):new Promise(l);function l(h,u){const o=Au(n),c=s.parse(o);s.run(c,o,function(g,f,b){if(g||!f||!b)return d(g);const S=f,k=s.stringify(S,b);M8(k)?b.value=k:b.result=k,d(g,b)});function d(g,f){g||!f?u(g):h?h(f):i(void 0,f)}}}processSync(n){let i=!1,s;return this.freeze(),Hp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(n,l),vx("processSync","process",i),s;function l(h,u){i=!0,fx(h),s=u}}run(n,i,s){gx(n),this.freeze();const l=this.transformers;return!s&&typeof i=="function"&&(s=i,i=void 0),s?h(void 0,s):new Promise(h);function h(u,o){const c=Au(i);l.run(n,c,d);function d(g,f,b){const S=f||n;g?o(g):u?u(S):s(void 0,S,b)}}}runSync(n,i){let s=!1,l;return this.run(n,i,h),vx("runSync","run",s),l;function h(u,o){fx(u),l=o,s=!0}}stringify(n,i){this.freeze();const s=Au(i),l=this.compiler||this.Compiler;return Up("stringify",l),gx(n),l(n,s)}use(n,...i){const s=this.attachers,l=this.namespace;if($p("use",this.frozen),n!=null)if(typeof n=="function")c(n,i);else if(typeof n=="object")Array.isArray(n)?o(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function h(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...f]=d;c(g,f)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(d.plugins),d.settings&&(l.settings=Bp(!0,l.settings,d.settings))}function o(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const f=d[g];h(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,g){let f=-1,b=-1;for(;++f<s.length;)if(s[f][0]===d){b=f;break}if(b===-1)s.push([d,...g]);else if(g.length>0){let[S,...k]=g;const w=s[b][1];km(w)&&km(S)&&(S=Bp(!0,w,S)),s[b]=[d,S,...k]}}}}const R8=new Fg().freeze();function Hp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $p(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gx(e){if(!km(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vx(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Au(e){return D8(e)?e:new gk(e)}function D8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function M8(e){return typeof e=="string"||N8(e)}function N8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const j8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_x=[],yx={allowDangerousHtml:!0},O8=/^(https?|ircs?|mailto|xmpp)$/i,L8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function I8(e){const n=B8(e),i=z8(e);return P8(n.runSync(n.parse(i),i),e)}function B8(e){const n=e.rehypePlugins||_x,i=e.remarkPlugins||_x,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yx}:yx;return R8().use(vz).use(i).use(d8,s).use(n)}function z8(e){const n=e.children||"",i=new gk;return typeof n=="string"&&(i.value=n),i}function P8(e,n){const i=n.allowedElements,s=n.allowElement,l=n.components,h=n.disallowedElements,u=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||F8;for(const g of L8)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+j8+g.id,void 0);return Pg(e,d),eI(e,{Fragment:m.Fragment,components:l,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function d(g,f,b){if(g.type==="raw"&&b&&typeof f=="number")return u?b.children.splice(f,1):b.children[f]={type:"text",value:g.value},f;if(g.type==="element"){let S;for(S in jp)if(Object.hasOwn(jp,S)&&Object.hasOwn(g.properties,S)){const k=g.properties[S],w=jp[S];(w===null||w.includes(g.tagName))&&(g.properties[S]=c(String(k||""),S,g))}}if(g.type==="element"){let S=i?!i.includes(g.tagName):h?h.includes(g.tagName):!1;if(!S&&s&&typeof f=="number"&&(S=!s(g,f,b)),S&&b&&typeof f=="number")return o&&g.children?b.children.splice(f,1,...g.children):b.children.splice(f,1),f}}}function F8(e){const n=e.indexOf(":"),i=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return n===-1||l!==-1&&n>l||i!==-1&&n>i||s!==-1&&n>s||O8.test(e.slice(0,n))?e:""}function bx(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,l=i.indexOf(n);for(;l!==-1;)s++,l=i.indexOf(n,l+n.length);return s}function H8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U8(e,n,i){const l=Vd((i||{}).ignore||[]),h=$8(n);let u=-1;for(;++u<h.length;)mk(e,"text",o);function o(d,g){let f=-1,b;for(;++f<g.length;){const S=g[f],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return c(d,g)}function c(d,g){const f=g[g.length-1],b=h[u][0],S=h[u][1];let k=0;const _=f.children.indexOf(d);let y=!1,v=[];b.lastIndex=0;let x=b.exec(d.value);for(;x;){const E=x.index,M={index:x.index,input:x.input,stack:[...g,d]};let R=S(...x,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=E+1:(k!==E&&v.push({type:"text",value:d.value.slice(k,E)}),Array.isArray(R)?v.push(...R):R&&v.push(R),k=E+x[0].length,y=!0),!b.global)break;x=b.exec(d.value)}return y?(k<d.value.length&&v.push({type:"text",value:d.value.slice(k)}),f.children.splice(_,1,...v)):v=[d],_+v.length}}function $8(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<i.length;){const l=i[s];n.push([q8(l[0]),V8(l[1])])}return n}function q8(e){return typeof e=="string"?new RegExp(H8(e),"g"):e}function V8(e){return typeof e=="function"?e:function(){return e}}const qp="phrasing",Vp=["autolink","link","image","label"];function G8(){return{transforms:[J8],enter:{literalAutolink:K8,literalAutolinkEmail:Gp,literalAutolinkHttp:Gp,literalAutolinkWww:Gp},exit:{literalAutolink:Q8,literalAutolinkEmail:Z8,literalAutolinkHttp:Y8,literalAutolinkWww:X8}}}function W8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qp,notInConstruct:Vp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qp,notInConstruct:Vp},{character:":",before:"[ps]",after:"\\/",inConstruct:qp,notInConstruct:Vp}]}}function K8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gp(e){this.config.enter.autolinkProtocol.call(this,e)}function Y8(e){this.config.exit.autolinkProtocol.call(this,e)}function X8(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Z8(e){this.config.exit.autolinkEmail.call(this,e)}function Q8(e){this.exit(e)}function J8(e){U8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tP]],{ignore:["link","linkReference"]})}function eP(e,n,i,s,l){let h="";if(!vk(l)||(/^w/i.test(n)&&(i=n+i,n="",h="http://"),!nP(i)))return!1;const u=rP(i+s);if(!u[0])return!1;const o={type:"link",title:null,url:h+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function tP(e,n,i,s){return!vk(s,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function nP(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function rP(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],s=i.indexOf(")");const l=bx(e,"(");let h=bx(e,")");for(;s!==-1&&l>h;)e+=i.slice(0,s+1),i=i.slice(s+1),s=i.indexOf(")"),h++;return[e,i]}function vk(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Ts(i)||Ud(i))&&(!n||i!==47)}_k.peek=hP;function iP(){this.buffer()}function sP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aP(){this.buffer()}function oP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=dr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function cP(e){this.exit(e)}function uP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=dr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function dP(e){this.exit(e)}function hP(){return"["}function _k(e,n,i,s){const l=i.createTracker(s);let h=l.move("[^");const u=i.enter("footnoteReference"),o=i.enter("reference");return h+=l.move(i.safe(i.associationId(e),{after:"]",before:h})),o(),u(),h+=l.move("]"),h}function fP(){return{enter:{gfmFootnoteCallString:iP,gfmFootnoteCall:sP,gfmFootnoteDefinitionLabelString:aP,gfmFootnoteDefinition:oP},exit:{gfmFootnoteCallString:lP,gfmFootnoteCall:cP,gfmFootnoteDefinitionLabelString:uP,gfmFootnoteDefinition:dP}}}function pP(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:_k},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(s,l,h,u){const o=h.createTracker(u);let c=o.move("[^");const d=h.enter("footnoteDefinition"),g=h.enter("label");return c+=o.move(h.safe(h.associationId(s),{before:c,after:"]"})),g(),c+=o.move("]:"),s.children&&s.children.length>0&&(o.shift(4),c+=o.move((n?`
|
|
505
|
-
`:" ")+h.indentLines(h.containerFlow(s,o.current()),n?yk:mP))),d(),c}}function mP(e,n,i){return n===0?e:yk(e,n,i)}function yk(e,n,i){return(i?"":" ")+e}const gP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bk.peek=xP;function vP(){return{canContainEols:["delete"],enter:{strikethrough:yP},exit:{strikethrough:bP}}}function _P(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gP}],handlers:{delete:bk}}}function yP(e){this.enter({type:"delete",children:[]},e)}function bP(e){this.exit(e)}function bk(e,n,i,s){const l=i.createTracker(s),h=i.enter("strikethrough");let u=l.move("~~");return u+=i.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),h(),u}function xP(){return"~"}function SP(e){return e.length}function wP(e,n){const i=n||{},s=(i.align||[]).concat(),l=i.stringLength||SP,h=[],u=[],o=[],c=[];let d=0,g=-1;for(;++g<e.length;){const w=[],_=[];let y=-1;for(e[g].length>d&&(d=e[g].length);++y<e[g].length;){const v=CP(e[g][y]);if(i.alignDelimiters!==!1){const x=l(v);_[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}w.push(v)}u[g]=w,o[g]=_}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<d;)h[f]=xx(s[f]);else{const w=xx(s);for(;++f<d;)h[f]=w}f=-1;const b=[],S=[];for(;++f<d;){const w=h[f];let _="",y="";w===99?(_=":",y=":"):w===108?_=":":w===114&&(y=":");let v=i.alignDelimiters===!1?1:Math.max(1,c[f]-_.length-y.length);const x=_+"-".repeat(v)+y;i.alignDelimiters!==!1&&(v=_.length+v+y.length,v>c[f]&&(c[f]=v),S[f]=v),b[f]=x}u.splice(1,0,b),o.splice(1,0,S),g=-1;const k=[];for(;++g<u.length;){const w=u[g],_=o[g];f=-1;const y=[];for(;++f<d;){const v=w[f]||"";let x="",E="";if(i.alignDelimiters!==!1){const M=c[f]-(_[f]||0),R=h[f];R===114?x=" ".repeat(M):R===99?M%2?(x=" ".repeat(M/2+.5),E=" ".repeat(M/2-.5)):(x=" ".repeat(M/2),E=x):E=" ".repeat(M)}i.delimiterStart!==!1&&!f&&y.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&v==="")&&(i.delimiterStart!==!1||f)&&y.push(" "),i.alignDelimiters!==!1&&y.push(x),y.push(v),i.alignDelimiters!==!1&&y.push(E),i.padding!==!1&&y.push(" "),(i.delimiterEnd!==!1||f!==d-1)&&y.push("|")}k.push(i.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return k.join(`
|
|
506
|
-
`)}function CP(e){return e==null?"":String(e)}function xx(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function kP(e,n,i,s){const l=i.enter("blockquote"),h=i.createTracker(s);h.move("> "),h.shift(2);const u=i.indentLines(i.containerFlow(e,h.current()),EP);return l(),u}function EP(e,n,i){return">"+(i?"":" ")+e}function AP(e,n){return Sx(e,n.inConstruct,!0)&&!Sx(e,n.notInConstruct,!1)}function Sx(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function wx(e,n,i,s){let l=-1;for(;++l<i.unsafe.length;)if(i.unsafe[l].character===`
|
|
507
|
-
`&&AP(i.stack,i.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
508
|
-
`}function TP(e,n){const i=String(e);let s=i.indexOf(n),l=s,h=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++h>u&&(u=h):h=1,l=s+n.length,s=i.indexOf(n,l);return u}function RP(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function DP(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function MP(e,n,i,s){const l=DP(i),h=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(RP(e,i)){const f=i.enter("codeIndented"),b=i.indentLines(h,NP);return f(),b}const o=i.createTracker(s),c=l.repeat(Math.max(TP(h,l)+1,3)),d=i.enter("codeFenced");let g=o.move(c);if(e.lang){const f=i.enter(`codeFencedLang${u}`);g+=o.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=i.enter(`codeFencedMeta${u}`);g+=o.move(" "),g+=o.move(i.safe(e.meta,{before:g,after:`
|
|
509
|
-
`,encode:["`"],...o.current()})),f()}return g+=o.move(`
|
|
510
|
-
`),h&&(g+=o.move(h+`
|
|
511
|
-
`)),g+=o.move(c),d(),g}function NP(e,n,i){return(i?"":" ")+e}function Hg(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function jP(e,n,i,s){const l=Hg(i),h=l==='"'?"Quote":"Apostrophe",u=i.enter("definition");let o=i.enter("label");const c=i.createTracker(s);let d=c.move("[");return d+=c.move(i.safe(i.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(i.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=i.enter("destinationRaw"),d+=c.move(i.safe(e.url,{before:d,after:e.title?" ":`
|
|
512
|
-
`,...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),d+=c.move(" "+l),d+=c.move(i.safe(e.title,{before:d,after:l,...c.current()})),d+=c.move(l),o()),u(),d}function OP(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Nl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function nd(e,n,i){const s=Wa(e),l=Wa(n);return s===void 0?l===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xk.peek=LP;function xk(e,n,i,s){const l=OP(i),h=i.enter("emphasis"),u=i.createTracker(s),o=u.move(l);let c=u.move(i.containerPhrasing(e,{after:l,before:o,...u.current()}));const d=c.charCodeAt(0),g=nd(s.before.charCodeAt(s.before.length-1),d,l);g.inside&&(c=Nl(d)+c.slice(1));const f=c.charCodeAt(c.length-1),b=nd(s.after.charCodeAt(0),f,l);b.inside&&(c=c.slice(0,-1)+Nl(f));const S=u.move(l);return h(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},o+c+S}function LP(e,n,i){return i.options.emphasis||"*"}function IP(e,n){let i=!1;return Pg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return i=!0,wm}),!!((!e.depth||e.depth<3)&&Ng(e)&&(n.options.setext||i))}function BP(e,n,i,s){const l=Math.max(Math.min(6,e.depth||1),1),h=i.createTracker(s);if(IP(e,i)){const g=i.enter("headingSetext"),f=i.enter("phrasing"),b=i.containerPhrasing(e,{...h.current(),before:`
|
|
513
|
-
`,after:`
|
|
514
|
-
`});return f(),g(),b+`
|
|
515
|
-
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
516
|
-
`))+1))}const u="#".repeat(l),o=i.enter("headingAtx"),c=i.enter("phrasing");h.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
|
|
517
|
-
`,...h.current()});return/^[\t ]/.test(d)&&(d=Nl(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),c(),o(),d}Sk.peek=zP;function Sk(e){return e.value||""}function zP(){return"<"}wk.peek=PP;function wk(e,n,i,s){const l=Hg(i),h=l==='"'?"Quote":"Apostrophe",u=i.enter("image");let o=i.enter("label");const c=i.createTracker(s);let d=c.move("![");return d+=c.move(i.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(i.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=i.enter("destinationRaw"),d+=c.move(i.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),d+=c.move(" "+l),d+=c.move(i.safe(e.title,{before:d,after:l,...c.current()})),d+=c.move(l),o()),d+=c.move(")"),u(),d}function PP(){return"!"}Ck.peek=FP;function Ck(e,n,i,s){const l=e.referenceType,h=i.enter("imageReference");let u=i.enter("label");const o=i.createTracker(s);let c=o.move("![");const d=i.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return u(),i.stack=g,h(),l==="full"||!d||d!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function FP(){return"!"}kk.peek=HP;function kk(e,n,i){let s=e.value||"",l="`",h=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++h<i.unsafe.length;){const u=i.unsafe[h],o=i.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(s);){let d=c.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(c.index+1)}}return l+s+l}function HP(){return"`"}function Ek(e,n){const i=Ng(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ak.peek=UP;function Ak(e,n,i,s){const l=Hg(i),h=l==='"'?"Quote":"Apostrophe",u=i.createTracker(s);let o,c;if(Ek(e,i)){const g=i.stack;i.stack=[],o=i.enter("autolink");let f=u.move("<");return f+=u.move(i.containerPhrasing(e,{before:f,after:">",...u.current()})),f+=u.move(">"),o(),i.stack=g,f}o=i.enter("link"),c=i.enter("label");let d=u.move("[");return d+=u.move(i.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=i.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(i.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(c=i.enter("destinationRaw"),d+=u.move(i.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=i.enter(`title${h}`),d+=u.move(" "+l),d+=u.move(i.safe(e.title,{before:d,after:l,...u.current()})),d+=u.move(l),c()),d+=u.move(")"),o(),d}function UP(e,n,i){return Ek(e,i)?"<":"["}Tk.peek=$P;function Tk(e,n,i,s){const l=e.referenceType,h=i.enter("linkReference");let u=i.enter("label");const o=i.createTracker(s);let c=o.move("[");const d=i.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return u(),i.stack=g,h(),l==="full"||!d||d!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $P(){return"["}function Ug(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function qP(e){const n=Ug(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function VP(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Rk(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function GP(e,n,i,s){const l=i.enter("list"),h=i.bulletCurrent;let u=e.ordered?VP(i):Ug(i);const o=e.ordered?u==="."?")":".":qP(i);let c=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(c=!0),Rk(i)===u&&g){let f=-1;for(;++f<e.children.length;){const b=e.children[f];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),i.bulletCurrent=u;const d=i.containerFlow(e,s);return i.bulletLastUsed=u,i.bulletCurrent=h,l(),d}function WP(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function KP(e,n,i,s){const l=WP(i);let h=i.bulletCurrent||Ug(i);n&&n.type==="list"&&n.ordered&&(h=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+h);let u=h.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=i.createTracker(s);o.move(h+" ".repeat(u-h.length)),o.shift(u);const c=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,o.current()),g);return c(),d;function g(f,b,S){return b?(S?"":" ".repeat(u))+f:(S?h:h+" ".repeat(u-h.length))+f}}function YP(e,n,i,s){const l=i.enter("paragraph"),h=i.enter("phrasing"),u=i.containerPhrasing(e,s);return h(),l(),u}const XP=Vd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZP(e,n,i,s){return(e.children.some(function(u){return XP(u)})?i.containerPhrasing:i.containerFlow).call(i,e,s)}function QP(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Dk.peek=JP;function Dk(e,n,i,s){const l=QP(i),h=i.enter("strong"),u=i.createTracker(s),o=u.move(l+l);let c=u.move(i.containerPhrasing(e,{after:l,before:o,...u.current()}));const d=c.charCodeAt(0),g=nd(s.before.charCodeAt(s.before.length-1),d,l);g.inside&&(c=Nl(d)+c.slice(1));const f=c.charCodeAt(c.length-1),b=nd(s.after.charCodeAt(0),f,l);b.inside&&(c=c.slice(0,-1)+Nl(f));const S=u.move(l+l);return h(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},o+c+S}function JP(e,n,i){return i.options.strong||"*"}function e7(e,n,i,s){return i.safe(e.value,s)}function t7(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7(e,n,i){const s=(Rk(i)+(i.options.ruleSpaces?" ":"")).repeat(t7(i));return i.options.ruleSpaces?s.slice(0,-1):s}const Mk={blockquote:kP,break:wx,code:MP,definition:jP,emphasis:xk,hardBreak:wx,heading:BP,html:Sk,image:wk,imageReference:Ck,inlineCode:kk,link:Ak,linkReference:Tk,list:GP,listItem:KP,paragraph:YP,root:ZP,strong:Dk,text:e7,thematicBreak:n7};function r7(){return{enter:{table:i7,tableData:Cx,tableHeader:Cx,tableRow:a7},exit:{codeText:o7,table:s7,tableData:Wp,tableHeader:Wp,tableRow:Wp}}}function i7(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function s7(e){this.exit(e),this.data.inTable=void 0}function a7(e){this.enter({type:"tableRow",children:[]},e)}function Wp(e){this.exit(e)}function Cx(e){this.enter({type:"tableCell",children:[]},e)}function o7(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function l7(e,n){return n==="|"?n:e}function c7(e){const n=e||{},i=n.tableCellPadding,s=n.tablePipeAlign,l=n.stringLength,h=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
518
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:c,tableRow:o}};function u(S,k,w,_){return d(g(S,w,_),S.align)}function o(S,k,w,_){const y=f(S,w,_),v=d([y]);return v.slice(0,v.indexOf(`
|
|
519
|
-
`))}function c(S,k,w,_){const y=w.enter("tableCell"),v=w.enter("phrasing"),x=w.containerPhrasing(S,{..._,before:h,after:h});return v(),y(),x}function d(S,k){return wP(S,{align:k,alignDelimiters:s,padding:i,stringLength:l})}function g(S,k,w){const _=S.children;let y=-1;const v=[],x=k.enter("table");for(;++y<_.length;)v[y]=f(_[y],k,w);return x(),v}function f(S,k,w){const _=S.children;let y=-1;const v=[],x=k.enter("tableRow");for(;++y<_.length;)v[y]=c(_[y],S,k,w);return x(),v}function b(S,k,w){let _=Mk.inlineCode(S,k,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function u7(){return{exit:{taskListCheckValueChecked:kx,taskListCheckValueUnchecked:kx,paragraph:h7}}}function d7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:f7}}}function kx(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function h7(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const s=i.children[0];if(s&&s.type==="text"){const l=n.children;let h=-1,u;for(;++h<l.length;){const o=l[h];if(o.type==="paragraph"){u=o;break}}u===i&&(s.value=s.value.slice(1),s.value.length===0?i.children.shift():i.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,i.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function f7(e,n,i,s){const l=e.children[0],h=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=i.createTracker(s);h&&o.move(u);let c=Mk.listItem(e,n,i,{...s,...o.current()});return h&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(g){return g+u}}function p7(){return[G8(),fP(),vP(),r7(),u7()]}function m7(e){return{extensions:[W8(),pP(e),_P(),c7(e),d7()]}}const g7={tokenize:S7,partial:!0},Nk={tokenize:w7,partial:!0},jk={tokenize:C7,partial:!0},Ok={tokenize:k7,partial:!0},v7={tokenize:E7,partial:!0},Lk={name:"wwwAutolink",tokenize:b7,previous:Bk},Ik={name:"protocolAutolink",tokenize:x7,previous:zk},oi={name:"emailAutolink",tokenize:y7,previous:Pk},Dr={};function _7(){return{text:Dr}}let bs=48;for(;bs<123;)Dr[bs]=oi,bs++,bs===58?bs=65:bs===91&&(bs=97);Dr[43]=oi;Dr[45]=oi;Dr[46]=oi;Dr[95]=oi;Dr[72]=[oi,Ik];Dr[104]=[oi,Ik];Dr[87]=[oi,Lk];Dr[119]=[oi,Lk];function y7(e,n,i){const s=this;let l,h;return u;function u(f){return!Am(f)||!Pk.call(s,s.previous)||$g(s.events)?i(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Am(f)?(e.consume(f),o):f===64?(e.consume(f),c):i(f)}function c(f){return f===46?e.check(v7,g,d)(f):f===45||f===95||dn(f)?(h=!0,e.consume(f),c):g(f)}function d(f){return e.consume(f),l=!0,c}function g(f){return h&&l&&mn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(f)):i(f)}}function b7(e,n,i){const s=this;return l;function l(u){return u!==87&&u!==119||!Bk.call(s,s.previous)||$g(s.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(g7,e.attempt(Nk,e.attempt(jk,h),i),i)(u))}function h(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function x7(e,n,i){const s=this;let l="",h=!1;return u;function u(f){return(f===72||f===104)&&zk.call(s,s.previous)&&!$g(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(f),e.consume(f),o):i(f)}function o(f){if(mn(f)&&l.length<5)return l+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(f),c}return i(f)}function c(f){return f===47?(e.consume(f),h?d:(h=!0,c)):i(f)}function d(f){return f===null||Ju(f)||yt(f)||Ts(f)||Ud(f)?i(f):e.attempt(Nk,e.attempt(jk,g),i)(f)}function g(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(f)}}function S7(e,n,i){let s=0;return l;function l(u){return(u===87||u===119)&&s<3?(s++,e.consume(u),l):u===46&&s===3?(e.consume(u),h):i(u)}function h(u){return u===null?i(u):n(u)}}function w7(e,n,i){let s,l,h;return u;function u(d){return d===46||d===95?e.check(Ok,c,o)(d):d===null||yt(d)||Ts(d)||d!==45&&Ud(d)?c(d):(h=!0,e.consume(d),u)}function o(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),u}function c(d){return l||s||!h?i(d):n(d)}}function C7(e,n){let i=0,s=0;return l;function l(u){return u===40?(i++,e.consume(u),l):u===41&&s<i?h(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Ok,n,h)(u):u===null||yt(u)||Ts(u)?n(u):(e.consume(u),l)}function h(u){return u===41&&s++,e.consume(u),l}}function k7(e,n,i){return s;function s(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),s):o===38?(e.consume(o),h):o===93?(e.consume(o),l):o===60||o===null||yt(o)||Ts(o)?n(o):i(o)}function l(o){return o===null||o===40||o===91||yt(o)||Ts(o)?n(o):s(o)}function h(o){return mn(o)?u(o):i(o)}function u(o){return o===59?(e.consume(o),s):mn(o)?(e.consume(o),u):i(o)}}function E7(e,n,i){return s;function s(h){return e.consume(h),l}function l(h){return dn(h)?i(h):n(h)}}function Bk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function zk(e){return!mn(e)}function Pk(e){return!(e===47||Am(e))}function Am(e){return e===43||e===45||e===46||e===95||dn(e)}function $g(e){let n=e.length,i=!1;for(;n--;){const s=e[n][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){i=!0;break}if(s._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const A7={tokenize:L7,partial:!0};function T7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N7,continuation:{tokenize:j7},exit:O7}},text:{91:{name:"gfmFootnoteCall",tokenize:M7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:R7,resolveTo:D7}}}}function R7(e,n,i){const s=this;let l=s.events.length;const h=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u;for(;l--;){const c=s.events[l][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return i(c);const d=dr(s.sliceSerialize({start:u.end,end:s.now()}));return d.codePointAt(0)!==94||!h.includes(d.slice(1))?i(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function D7(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const h={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},h.start),end:Object.assign({},h.end)},o=[e[i+1],e[i+2],["enter",s,n],e[i+3],e[i+4],["enter",l,n],["exit",l,n],["enter",h,n],["enter",u,n],["exit",u,n],["exit",h,n],e[e.length-2],e[e.length-1],["exit",s,n]];return e.splice(i,e.length-i+1,...o),e}function M7(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h=0,u;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?i(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(h>999||f===93&&!u||f===null||f===91||yt(f))return i(f);if(f===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(dr(s.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(f)}return yt(f)||(u=!0),h++,e.consume(f),f===92?g:d}function g(f){return f===91||f===92||f===93?(e.consume(f),h++,d):d(f)}}function N7(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h,u=0,o;return c;function c(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(k)}function g(k){if(u>999||k===93&&!o||k===null||k===91||yt(k))return i(k);if(k===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return h=dr(s.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return yt(k)||(o=!0),u++,e.consume(k),k===92?f:g}function f(k){return k===91||k===92||k===93?(e.consume(k),u++,g):g(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(h)||l.push(h),it(e,S,"gfmFootnoteDefinitionWhitespace")):i(k)}function S(k){return n(k)}}function j7(e,n,i){return e.check(Ql,n,e.attempt(A7,n,i))}function O7(e){e.exit("gfmFootnoteDefinition")}function L7(e,n,i){const s=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(h){const u=s.events[s.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(h):i(h)}}function I7(e){let i=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:h,resolveAll:l};return i==null&&(i=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let d=c;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[c][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[c][1].end)},f={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[c][1].start)},b=[["enter",g,o],["enter",u[d][1],o],["exit",u[d][1],o],["enter",f,o]],S=o.parser.constructs.insideSpan.null;S&&Hn(b,b.length,0,$d(S,u.slice(d+1,c),o)),Hn(b,b.length,0,[["exit",f,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",g,o]]),Hn(u,d-1,c-d+3,b),c=d+b.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function h(u,o,c){const d=this.previous,g=this.events;let f=0;return b;function b(k){return d===126&&g[g.length-1][1].type!=="characterEscape"?c(k):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const w=Wa(d);if(k===126)return f>1?c(k):(u.consume(k),f++,S);if(f<2&&!i)return c(k);const _=u.exit("strikethroughSequenceTemporary"),y=Wa(k);return _._open=!y||y===2&&!!w,_._close=!w||w===2&&!!y,o(k)}}}class B7{constructor(){this.map=[]}add(n,i,s){z7(this,n,i,s)}consume(n){if(this.map.sort(function(h,u){return h[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const s=[];for(;i>0;)i-=1,s.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];s.push(n.slice()),n.length=0;let l=s.pop();for(;l;){for(const h of l)n.push(h);l=s.pop()}this.map.length=0}}function z7(e,n,i,s){let l=0;if(!(i===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=i,e.map[l][2].push(...s);return}l+=1}e.map.push([n,i,s])}}function P7(e,n){let i=!1;const s=[];for(;n<e.length;){const l=e[n];if(i){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const h=s.length-1;s[h]=s[h]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return s}function F7(){return{flow:{null:{name:"table",tokenize:H7,resolveAll:U7}}}}function H7(e,n,i){const s=this;let l=0,h=0,u;return o;function o(P){let $=s.events.length-1;for(;$>-1;){const Y=s.events[$][1].type;if(Y==="lineEnding"||Y==="linePrefix")$--;else break}const U=$>-1?s.events[$][1].type:null,q=U==="tableHead"||U==="tableRow"?R:c;return q===R&&s.parser.lazy[s.now().line]?i(P):q(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(u=!0,h+=1),g(P)}function g(P){return P===null?i(P):ze(P)?h>1?(h=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),S):i(P):Je(P)?it(e,g,"whitespace")(P):(h+=1,u&&(u=!1,l+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||yt(P)?(e.exit("data"),g(P)):(e.consume(P),P===92?b:f)}function b(P){return P===92||P===124?(e.consume(P),f):f(P)}function S(P){return s.interrupt=!1,s.parser.lazy[s.now().line]?i(P):(e.enter("tableDelimiterRow"),u=!1,Je(P)?it(e,k,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):k(P))}function k(P){return P===45||P===58?_(P):P===124?(u=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):M(P)}function w(P){return Je(P)?it(e,_,"whitespace")(P):_(P)}function _(P){return P===58?(h+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),y):P===45?(h+=1,y(P)):P===null||ze(P)?E(P):M(P)}function y(P){return P===45?(e.enter("tableDelimiterFiller"),v(P)):M(P)}function v(P){return P===45?(e.consume(P),v):P===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(P))}function x(P){return Je(P)?it(e,E,"whitespace")(P):E(P)}function E(P){return P===124?k(P):P===null||ze(P)?!u||l!==h?M(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(P)):M(P)}function M(P){return i(P)}function R(P){return e.enter("tableRow"),N(P)}function N(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),N):P===null||ze(P)?(e.exit("tableRow"),n(P)):Je(P)?it(e,N,"whitespace")(P):(e.enter("data"),D(P))}function D(P){return P===null||P===124||yt(P)?(e.exit("data"),N(P)):(e.consume(P),P===92?O:D)}function O(P){return P===92||P===124?(e.consume(P),D):D(P)}}function U7(e,n){let i=-1,s=!0,l=0,h=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,d,g,f;const b=new B7;for(;++i<e.length;){const S=e[i],k=S[1];S[0]==="enter"?k.type==="tableHead"?(o=!1,c!==0&&(Ex(b,n,c,d,g),g=void 0,c=0),d={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",d,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(s=!0,f=void 0,h=[0,0,0,0],u=[0,i+1,0,0],o&&(o=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",g,n]])),l=k.type==="tableDelimiterRow"?2:g?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(s=!1,u[2]===0&&(h[1]!==0&&(u[0]=u[1],f=Tu(b,n,h,l,void 0,f),h=[0,0,0,0]),u[2]=i)):k.type==="tableCellDivider"&&(s?s=!1:(h[1]!==0&&(u[0]=u[1],f=Tu(b,n,h,l,void 0,f)),h=u,u=[h[1],i,0,0])):k.type==="tableHead"?(o=!0,c=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=i,h[1]!==0?(u[0]=u[1],f=Tu(b,n,h,l,i,f)):u[1]!==0&&(f=Tu(b,n,u,l,i,f)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=i)}for(c!==0&&Ex(b,n,c,d,g),b.consume(n.events),i=-1;++i<n.events.length;){const S=n.events[i];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=P7(n.events,i))}return e}function Tu(e,n,i,s,l,h){const u=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",o="tableContent";i[0]!==0&&(h.end=Object.assign({},Ta(n.events,i[0])),e.add(i[0],0,[["exit",h,n]]));const c=Ta(n.events,i[1]);if(h={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(i[1],0,[["enter",h,n]]),i[2]!==0){const d=Ta(n.events,i[2]),g=Ta(n.events,i[3]),f={type:o,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",f,n]]),s!==2){const b=n.events[i[2]],S=n.events[i[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",i[3]>i[2]+1){const k=i[2]+1,w=i[3]-i[2]-1;e.add(k,w,[])}}e.add(i[3]+1,0,[["exit",f,n]])}return l!==void 0&&(h.end=Object.assign({},Ta(n.events,l)),e.add(l,0,[["exit",h,n]]),h=void 0),h}function Ex(e,n,i,s,l){const h=[],u=Ta(n.events,i);l&&(l.end=Object.assign({},u),h.push(["exit",l,n])),s.end=Object.assign({},u),h.push(["exit",s,n]),e.add(i+1,0,h)}function Ta(e,n){const i=e[n],s=i[0]==="enter"?"start":"end";return i[1][s]}const $7={name:"tasklistCheck",tokenize:V7};function q7(){return{text:{91:$7}}}function V7(e,n,i){const s=this;return l;function l(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?i(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),h)}function h(c){return yt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):i(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):i(c)}function o(c){return ze(c)?n(c):Je(c)?e.check({tokenize:G7},n,i)(c):i(c)}}function G7(e,n,i){return it(e,s,"whitespace");function s(l){return l===null?i(l):n(l)}}function W7(e){return XC([_7(),T7(),I7(e),F7(),q7()])}const K7={};function Y7(e){const n=this,i=e||K7,s=n.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),h=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),u=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(W7(i)),h.push(p7()),u.push(m7(i))}function Fk({children:e,className:n,inverted:i=!1}){return m.jsx("div",{className:_e("visualization-container markdown-render overflow-x-auto wrap-break-words break",n),children:m.jsx(I8,{remarkPlugins:[Y7],components:{code({className:s,children:l,...h}){const u=/language-(\w+)/.exec(s||""),o=u?u[1]:"",c=!o,d=Array.isArray(l)?l.join(""):String(l);return!c&&o?m.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:m.jsx(kg,{theme:i?Dl.nightOwl:Dl.oneDark,code:d.trim(),language:o,children:({className:g,style:f,tokens:b,getLineProps:S,getTokenProps:k})=>m.jsx("pre",{className:_e("rounded-lg text-sm p-3",g),style:f,children:b.map((w,_)=>m.jsx("div",{...S({line:w}),children:w.map((y,v)=>m.jsx("span",{...k({token:y})},v))},_))})})}):m.jsx("code",{className:_e("px-1.5 py-0.5 rounded text-sm font-mono",i?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",s),...h,children:l})},a({href:s,children:l,...h}){return m.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:_e("underline underline-offset-2 transition-colors",i?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...h,children:l})},p({children:s}){return m.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:s})},ul({children:s}){return m.jsx("ul",{className:"list-outside list-disc pl-8",children:s})},ol({children:s}){return m.jsx("ol",{className:"list-outside list-decimal pl-8",children:s})},li({children:s,className:l}){const h=l==null?void 0:l.includes("nested");return m.jsx("li",{className:_e("leading-snug",h&&"ml-8"),children:s})},h1({children:s}){return m.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:s})},h2({children:s}){return m.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:s})},h3({children:s}){return m.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:s})},blockquote({children:s}){return m.jsx("blockquote",{className:_e("border-l-2 pl-3 my-1.5 italic",i?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:s})},strong({children:s}){return m.jsx("strong",{className:_e("font-semibold",i&&"text-primary-foreground"),children:s})},em({children:s}){return m.jsx("em",{className:"italic",children:s})},hr(){return m.jsx("hr",{className:_e("my-3",i?"border-primary-foreground/30":"border-border")})},table({children:s}){return m.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:m.jsx("table",{className:"w-full border-collapse text-sm",children:s})})},th({children:s}){return m.jsx("th",{className:_e("border border-border px-2 py-1.5 text-left font-semibold",i?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:s})},td({children:s}){return m.jsx("td",{className:_e("border px-2 py-1.5",i?"border-primary-foreground/20":"border-border"),children:s})}},children:e})})}function X7(e){return e.filter(n=>n.type==="text").map(n=>n.text).join("")}function Z7(e,n){const i=n.findIndex(s=>s.message.id===e);if(i<=0)return null;for(let s=i-1;s>=0;s--){const l=n[s];if(l.message.role==="assistant"&&l.message.status!=="streaming")return l.message.id}return null}function Q7(e,n){const i=e.map(u=>({message:u.message,parts:u.parts,isQueued:!1})),s=n.map(u=>({message:{id:u.id,role:"user",sessionId:u.sessionId,createdAt:u.createdAt},parts:[{id:`${u.id}-part`,messageId:u.id,createdAt:u.createdAt,type:"text",text:u.content}],isQueued:!0,queueId:u.id})),l=[...i].sort((u,o)=>u.message.createdAt-o.message.createdAt),h=[...s].sort((u,o)=>u.message.createdAt-o.message.createdAt);return[...l,...h]}function J7({part:e}){const[n,i]=T.useState(!1);return m.jsxs("div",{className:"flex flex-col items-center my-4",children:[m.jsxs("button",{onClick:()=>i(!n),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[n?m.jsx(Ka,{className:"size-3"}):m.jsx(ti,{className:"size-3"}),m.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[e.compactedMessageIds.length," messages compacted"]})]}),n&&m.jsx("div",{className:"mt-2 max-w-lg w-full rounded-lg border border-border bg-muted/50 px-4 py-3 text-sm text-muted-foreground",children:m.jsx(Fk,{children:e.summary})})]})}function e9({parts:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s,inverted:l=!1}){const h=[...e].sort((u,o)=>u.createdAt-o.createdAt);return m.jsx(m.Fragment,{children:h.map(u=>{switch(u.type){case"text":return m.jsx("div",{className:"min-w-0",children:m.jsx(Fk,{inverted:l,children:u.text||"..."})},u.id);case"reasoning":return m.jsx("div",{className:"visualization-container text-muted-foreground text-sm italic border-l-2 border-muted-foreground/30 pl-3 my-2 wrap-break-word",children:u.text},u.id);case"tool":return m.jsx(b6,{part:u,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s},u.id);case"image":return m.jsx("img",{src:u.url,alt:"",className:"max-w-full rounded-lg mt-2"},u.id);case"file":return m.jsx("div",{className:"mt-2 p-2 bg-muted rounded text-sm",children:u.filename||"unnamed"},u.id);default:return null}})})}function t9({session:e,messagesWithParts:n,queuedMessages:i,preconfigs:s,prompts:l,models:h,connectedProviderIds:u,connectableProviderIds:o,defaultModel:c,onSendMessage:d,onRemoveFromQueue:g,onChangePreconfig:f,onChangeModel:b,onChangeVariant:S,pendingPermissions:k,onPermissionResponse:w,onRename:_,usage:y,modelName:v,onNavigateToSubagent:x,onNavigateBack:E,isStreaming:M,onInterrupt:R,onRevert:N,onFork:D,onCompact:O,isCompacting:P,serverUrl:$,apiToken:U,selectedVariant:q,variants:Y}){const K=T.useRef(null),[V,Q]=T.useState(!0),J=150,F=Q7(n,i);T.useEffect(()=>{Q(!0),K.current&&(K.current.scrollTop=K.current.scrollHeight)},[e.id]),T.useEffect(()=>{K.current&&V&&(K.current.scrollTop=K.current.scrollHeight)},[n,V]),T.useEffect(()=>{const I=K.current;if(!I)return;const L=()=>{const{scrollHeight:z,scrollTop:X,clientHeight:ee}=I,te=z-X-ee;Q(te<J)};return I.addEventListener("scroll",L,{passive:!0}),()=>I.removeEventListener("scroll",L)},[]);const j=k.filter(I=>!n.some(L=>L.parts.some(z=>z.type==="tool"&&z.callId===I.toolCallId)));return m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[m.jsx(eL,{session:e,preconfigs:s,models:h,defaultModel:c,usage:y,modelName:v,onChangePreconfig:f,onChangeModel:b,onChangeVariant:S,onRename:_,onNavigateBack:E,isStreaming:M,onInterrupt:R,onCompact:O,isCompacting:P,canCompact:n.length>=4,connectedProviderIds:u,connectableProviderIds:o,selectedVariant:q,variants:Y}),e.status==="closed"&&m.jsx(Lu,{className:"mx-4 mt-4",children:m.jsx(Iu,{children:"This session is archived. You can reopen it from the sidebar."})}),m.jsx(Vi,{className:"flex-1 min-h-0",ref:K,children:m.jsxs("div",{className:"p-4",children:[F.length===0?m.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[m.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),m.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):F.map(I=>{const L=I.parts.find(ee=>ee.type==="compaction");if(L)return m.jsx(J7,{part:L},I.message.id);const z=!I.isQueued&&I.message.role==="user",X=z?Z7(I.message.id,n):null;return m.jsx(tL,{message:I.message,textContent:X7(I.parts),isQueued:I.isQueued,onRemove:I.isQueued?()=>g(I.queueId):void 0,canRevert:z&&X!==null,onRevert:X?()=>N==null?void 0:N(e.id,X):void 0,canFork:z&&X!==null,onFork:X?()=>D==null?void 0:D(e.id,I.message.id):void 0,children:I.parts.length===0?m.jsx("span",{className:"opacity-50",children:"..."}):m.jsx(e9,{parts:I.parts,pendingPermissions:k,onPermissionResponse:w,onNavigateToSubagent:x,inverted:I.message.role==="user"})},I.message.id)}),j.length>0&&m.jsx("div",{className:"mt-4 flex flex-col gap-2",children:j.map(I=>m.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"text-sm font-medium",children:I.toolName}),m.jsx("span",{className:"text-xs text-muted-foreground",children:I.permissionType})]}),m.jsx("p",{className:"text-sm mb-3",children:I.message}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.jsx(ke,{variant:"outline",size:"sm",onClick:()=>w(I.toolCallId,!1,!1),children:"Deny"}),m.jsx(ke,{size:"sm",onClick:()=>w(I.toolCallId,!0,!1),children:"Approve"})]})]},I.toolCallId))})]})}),e.status==="active"&&!e.parentId&&m.jsx(k6,{onSendMessage:d,disabled:P,workspaceId:e.workspaceId,serverUrl:$,apiToken:U,prompts:l}),e.parentId&&m.jsxs("div",{className:"p-4 border-t border-border bg-muted/50 text-center flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[m.jsx(iT,{className:"size-4"}),"This is a subagent session (read-only)"]})]})}function n9({className:e,orientation:n="horizontal",...i}){return m.jsx(e5,{"data-slot":"tabs","data-orientation":n,className:_e("group/tabs flex gap-2 data-horizontal:flex-col",e),...i})}const r9=Za("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function i9({className:e,variant:n="default",...i}){return m.jsx(t5,{"data-slot":"tabs-list","data-variant":n,className:_e(r9({variant:n}),e),...i})}function Ru({className:e,...n}){return m.jsx(n5,{"data-slot":"tabs-trigger",className:_e("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...n})}function Du({className:e,...n}){return m.jsx(r5,{"data-slot":"tabs-content",className:_e("flex-1 text-sm outline-none",e),...n})}function Ax(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Tx({permission:e,onRevoke:n}){const i=!!e.revokedAt;return m.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsxs(un,{variant:i?"outline":"secondary",children:[m.jsx(Fx,{className:"size-3","data-icon":"inline-start"}),e.permissionType]}),i&&m.jsx(un,{variant:"outline",className:"text-muted-foreground",children:"Revoked"})]}),m.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:e.permissionKey}),m.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",Ax(e.grantedAt),e.revokedAt&&` • Revoked ${Ax(e.revokedAt)}`]})]}),!i&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>n(e.id),className:"size-8 text-destructive hover:text-destructive",children:m.jsx(Ol,{className:"size-4"})})]})}function s9({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",variant:u="default",onConfirm:o,onCancel:c}){const d=()=>{c==null||c(),n(!1)},g=()=>{o(),n(!1)};return m.jsx(ro,{open:e,onOpenChange:n,children:m.jsxs(io,{className:"sm:max-w-[425px]",children:[m.jsxs(so,{children:[m.jsx(ao,{children:i}),m.jsx(Kl,{children:s})]}),m.jsxs(Nd,{children:[m.jsx(ke,{variant:"outline",onClick:d,children:h}),m.jsx(ke,{variant:u==="destructive"?"destructive":"default",onClick:g,children:l})]})]})})}function a9({provider:e,onConnect:n,onDisconnect:i}){const[s,l]=T.useState(!1);T.useEffect(()=>{(e.error||e.connected)&&l(!1)},[e.error,e.connected]),T.useEffect(()=>{e.authorizationUrl&&l(!1)},[e.authorizationUrl]);const h=()=>{l(!0),n()},u=()=>{i()};return m.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:`size-2 rounded-full ${e.connected?"bg-green-500":"bg-muted-foreground"}`}),m.jsx("span",{className:"text-sm font-medium",children:e.displayName||e.provider})]}),e.connected&&m.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),e.error&&m.jsx("p",{className:"text-xs text-destructive",children:e.error}),e.connected&&e.connectedAt&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(e.connectedAt).toLocaleDateString()]}),m.jsxs("div",{className:"flex gap-2",children:[!e.connected&&!e.authorizationUrl&&m.jsxs(ke,{size:"sm",onClick:h,disabled:s,children:[s?m.jsx(Pn,{className:"size-3 animate-spin","data-icon":"inline-start"}):null,"Connect"]}),!e.connected&&e.authorizationUrl&&m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("a",{href:e.authorizationUrl,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:e.authorizationUrl}),m.jsxs(ke,{variant:"outline",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(e.authorizationUrl)}catch{}},children:[m.jsx(wl,{className:"size-3","data-icon":"inline-start"}),"Copy URL"]})]}),e.connected&&m.jsxs(ke,{variant:"destructive",size:"sm",onClick:u,children:[m.jsx(UT,{className:"size-3","data-icon":"inline-start"}),"Disconnect"]})]})]})}function o9({token:e,onLogout:n}){return m.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[m.jsx("span",{className:"text-muted-foreground",children:"Token:"}),m.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:iR(e)})]}),m.jsx(ke,{variant:"destructive",size:"sm",onClick:n,title:"Disconnect and clear token",children:"Logout"})]})}function l9({open:e,onOpenChange:n,permissions:i,onRefreshPermissions:s,onRevokePermission:l,onRevokeAllPermissions:h,apiToken:u,onLogout:o,providerStatuses:c,onConnectProvider:d,onDisconnectProvider:g}){const{theme:f,setTheme:b}=tA(),[S,k]=T.useState(!1),w=i.filter(y=>!y.revokedAt),_=i.filter(y=>y.revokedAt);return m.jsxs(ro,{open:e,onOpenChange:n,children:[m.jsxs(io,{className:"sm:max-w-[500px] max-h-[80vh]",children:[m.jsxs(so,{children:[m.jsx(ao,{children:"Settings"}),m.jsx(Kl,{children:"Manage your preferences and permissions"})]}),m.jsxs(n9,{defaultValue:"account",className:"mt-4",children:[m.jsxs(i9,{className:"grid w-full grid-cols-4",children:[m.jsxs(Ru,{value:"account",children:[m.jsx(Ux,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),m.jsxs(Ru,{value:"appearance",children:[m.jsx(pT,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),m.jsxs(Ru,{value:"permissions",children:[m.jsx(Fx,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),w.length>0&&m.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-primary text-[8px] font-bold leading-none text-primary-foreground sm:static sm:flex sm:size-auto sm:ml-1.5 sm:px-1.5 sm:py-0.5 sm:text-xs sm:font-medium sm:leading-normal",children:w.length})]}),m.jsxs(Ru,{value:"providers",children:[m.jsx(tT,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Providers"})]})]}),m.jsx(Du,{value:"account",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx(Jr,{className:"text-sm font-medium",children:"Session"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),u?m.jsx(o9,{token:u,onLogout:o}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]})})}),m.jsx(Du,{value:"appearance",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx(Jr,{className:"text-sm font-medium",children:"Theme"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color scheme"}),m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[m.jsxs(ke,{variant:f==="light"?"default":"outline",className:"justify-start",onClick:()=>b("light"),children:[m.jsx(LT,{className:"size-4","data-icon":"inline-start"}),"Light"]}),m.jsxs(ke,{variant:f==="dark"?"default":"outline",className:"justify-start",onClick:()=>b("dark"),children:[m.jsx(hT,{className:"size-4","data-icon":"inline-start"}),"Dark"]}),m.jsxs(ke,{variant:f==="system"?"default":"outline",className:"justify-start",onClick:()=>b("system"),children:[m.jsx(uT,{className:"size-4","data-icon":"inline-start"}),"System"]})]})]})})}),m.jsx(Du,{value:"permissions",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx(Jr,{className:"text-sm font-medium",children:"Always-allowed Operations"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(ke,{variant:"outline",size:"icon",onClick:s,className:"size-8",children:m.jsx(Da,{className:"size-4"})}),w.length>0&&m.jsxs(ke,{variant:"destructive",size:"sm",onClick:()=>k(!0),children:[m.jsx(Ol,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]})]})]}),m.jsx(ml,{}),m.jsxs(Vi,{className:"h-[300px]",children:[w.length===0&&_.length===0&&m.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",m.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),w.length>0&&m.jsxs("div",{className:"mb-4",children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",w.length,")"]}),w.map(y=>m.jsx(Tx,{permission:y,onRevoke:l},y.id))]}),_.length>0&&m.jsxs("div",{children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",_.length,")"]}),_.map(y=>m.jsx(Tx,{permission:y,onRevoke:l},y.id))]})]})]})}),m.jsx(Du,{value:"providers",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect subscription-based providers to use models without API keys."}),m.jsx("div",{className:"flex flex-col gap-3",children:c.map(y=>m.jsx(a9,{provider:y,onConnect:()=>d(y.provider),onDisconnect:()=>g(y.provider)},y.provider))})]})})})]})]}),m.jsx(s9,{open:S,onOpenChange:k,title:"Revoke All Permissions",description:"This will revoke all always-allowed permissions for this workspace. You'll need to approve these tools again when they're used.",confirmLabel:"Revoke All",variant:"destructive",onConfirm:()=>{h(),k(!1)}})]})}function c9({status:e}){switch(e.status){case"connected":return m.jsxs(un,{variant:"default",className:"bg-green-600",children:[m.jsx(jl,{className:"size-3 mr-1"}),"Connected"]});case"disabled":return m.jsxs(un,{variant:"secondary",children:[m.jsx(id,{className:"size-3 mr-1"}),"Disabled"]});case"failed":return m.jsxs(un,{variant:"destructive",children:[m.jsx(gl,{className:"size-3 mr-1"}),"Failed"]});case"needs_auth":return m.jsxs(un,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[m.jsx(gl,{className:"size-3 mr-1"}),"Needs Auth"]});case"needs_client_registration":return m.jsxs(un,{variant:"outline",className:"border-orange-500 text-orange-600",children:[m.jsx(gl,{className:"size-3 mr-1"}),"Needs Registration"]});default:return m.jsx(un,{variant:"secondary",children:"Unknown"})}}function u9({open:e,onOpenChange:n,workspaceId:i,workspacePath:s,serverUrl:l,apiToken:h}){const{fetchWithAuth:u}=Wl(),[o,c]=T.useState({}),[d,g]=T.useState(!1),[f,b]=T.useState(null),[S,k]=T.useState(null),w=T.useCallback(async()=>{if(i){g(!0),k(null);try{const E=await u(`/api/workspaces/${i}/mcp/status`,{},{serverUrl:l,token:h});if(!E.ok)throw new Error("Failed to load MCP status");const M=await E.json();c(M.status||{})}catch(E){const M=E instanceof Error?E.message:"Unknown error";k(M)}finally{g(!1)}}},[i,u,l,h]);T.useEffect(()=>{e&&i&&w()},[e,i,w]);const _=async E=>{if(i){b(E);try{if(!(await u(`/api/workspaces/${i}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h})).ok)throw new Error("Failed to connect");await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{b(null)}}},y=async E=>{if(i){b(E);try{if(!(await u(`/api/workspaces/${i}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h})).ok)throw new Error("Failed to disconnect");await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{b(null)}}},v=async E=>{if(i){b(E);try{const M=await u(`/api/workspaces/${i}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h});if(!M.ok)throw new Error("Failed to start auth");const R=await M.json();R.authorizationUrl&&window.open(R.authorizationUrl,"_blank"),await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{b(null)}}},x=Object.entries(o);return m.jsx(ro,{open:e,onOpenChange:n,children:m.jsxs(io,{className:"sm:max-w-[600px] max-h-[80vh]",children:[m.jsxs(so,{children:[m.jsxs(ao,{className:"flex items-center gap-2",children:[m.jsx(Ss,{className:"size-5"}),"MCP Servers"]}),m.jsx(Kl,{children:"Manage Model Context Protocol servers for this workspace"})]}),m.jsxs("div",{className:"mt-4 space-y-4",children:[S&&m.jsxs(Lu,{variant:"destructive",children:[m.jsx(gl,{className:"size-4"}),m.jsx(Iu,{children:S})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),m.jsx(ke,{variant:"outline",size:"sm",onClick:w,disabled:d,children:m.jsx(Da,{className:`size-4 ${d?"animate-spin":""}`})})]}),m.jsx(Vi,{className:"h-[400px]",children:d&&x.length===0?m.jsx("div",{className:"flex items-center justify-center py-8",children:m.jsx(Pn,{className:"size-6 animate-spin text-muted-foreground"})}):x.length===0?m.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[m.jsx(Ss,{className:"size-12 mx-auto mb-3 opacity-50"}),m.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),m.jsxs("p",{className:"text-sm mt-1",children:["Create ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):m.jsx("div",{className:"space-y-3",children:x.map(([E,{config:M,status:R}])=>{var N;return m.jsxs("div",{className:"border rounded-lg p-4",children:[m.jsxs("div",{className:"flex items-start justify-between",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx(Ss,{className:"size-5 text-muted-foreground mt-0.5"}),m.jsxs("div",{children:[m.jsx("div",{className:"font-medium",children:E}),m.jsx("div",{className:"text-sm text-muted-foreground",children:(M==null?void 0:M.type)==="local"?m.jsxs("span",{children:["Local - ",((N=M.command)==null?void 0:N[0])||"command"]}):(M==null?void 0:M.type)==="remote"?m.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",M.url]}):"Unknown type"}),R.status==="failed"&&"error"in R&&m.jsx(Lu,{variant:"destructive",className:"mt-2 py-2",children:m.jsx(Iu,{className:"text-xs",children:R.error})}),R.status==="needs_client_registration"&&"error"in R&&m.jsx(Lu,{className:"mt-2 py-2 border-orange-500",children:m.jsx(Iu,{className:"text-xs",children:R.error})})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsx(c9,{status:R})})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[R.status==="connected"&&m.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>y(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(_T,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(R.status==="disabled"||R.status==="failed")&&m.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>_(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(bT,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Connect"})]}),R.status==="needs_auth"&&m.jsxs(ke,{variant:"default",size:"sm",onClick:()=>v(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(Xp,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},E)})})})]})]})})}function Rx({message:e="Connecting to server..."}){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[m.jsx(Pn,{className:"size-8 animate-spin"}),m.jsx("p",{className:"text-sm",children:e})]})}const d9=({serverUrl:e,authError:n,retryCount:i,nextRetryIn:s,onRetry:l,onLogout:h})=>m.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[m.jsx($x,{className:"size-12 text-destructive mb-4"}),m.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:n||"Please check that the server is running."}),e&&m.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:e}),m.jsxs("div",{className:"flex flex-col items-center gap-4",children:[m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",s,"s..."]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(ke,{onClick:l,variant:"default",children:[m.jsx(Da,{className:"size-4 mr-2","data-icon":"inline-start"}),"Retry Now"]}),m.jsx(ke,{onClick:h,variant:"ghost",children:"Change Server"})]}),i>0&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",i]})]})]});function Dx({onServerAdded:e,error:n}){const[i,s]=T.useState(""),[l,h]=T.useState(""),[u,o]=T.useState(""),[c,d]=T.useState(!1),[g,f]=T.useState(null),b=S=>{S.preventDefault();const k=i.trim(),w=l.trim(),_=u.trim();if(!k){f("Please enter a server name");return}if(!w){f("Please enter a server URL");return}if(!_){f("Please enter an API token");return}if(!Vx(_)){f("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const y=zu(w),v={id:crypto.randomUUID(),name:k,url:y,token:_,createdAt:new Date().toISOString()};e(v)};return m.jsx("div",{className:"w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4",children:m.jsx("div",{className:"w-full max-w-md",children:m.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[m.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[m.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),m.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),m.jsxs("form",{onSubmit:b,className:"p-6 space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),m.jsx("input",{id:"serverName",type:"text",value:i,onChange:S=>{s(S.target.value),f(null)},placeholder:"Production",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),m.jsx("input",{id:"serverUrl",type:"text",value:l,onChange:S=>{h(S.target.value),f(null)},placeholder:"localhost:3000",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{id:"token",type:c?"text":"password",value:u,onChange:S=>{o(S.target.value),f(null)},placeholder:"Enter your 64-character token",className:"w-full px-3 py-2 pr-10 bg-background border border-input rounded-lg text-foreground font-mono text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"}),m.jsx("button",{type:"button",onClick:()=>d(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":c?"Hide token":"Show token",children:c?m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):m.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})]}),(g||n)&&m.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:g||n}),m.jsx("button",{type:"submit",className:"w-full py-2.5 bg-primary text-primary-foreground font-medium rounded-lg hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-colors",children:"Add Server"})]})]})})})}function Mx({onServerSwitch:e,onSelectWorkspace:n}){const[i,s]=T.useState(!1),l=T.useRef(!1),h=Xl(),{quickConnections:u,switchServer:o,removeFromQuickConnections:c,isSwitching:d}=Xa(),g=S=>{o(S.serverId)&&(l.current=!0,e==null||e(),S.workspaceId&&n&&n(S.workspaceId))};T.useEffect(()=>{!d&&i&&l.current&&(s(!1),l.current=!1)},[d,i]);const f=(S,k)=>{S.stopPropagation(),c(k)},b=()=>m.jsx(gg,{children:m.jsx(vg,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?m.jsx(Tl,{heading:"Quick Switch",children:u.map(S=>m.jsxs(ja,{onSelect:()=>g(S),className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Ss,{className:"size-4 text-muted-foreground"}),m.jsxs("span",{children:[S.serverName,S.workspaceName&&m.jsxs("span",{className:"text-muted-foreground",children:[" / ",S.workspaceName]})]})]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:k=>f(k,S.id),children:m.jsx(Ol,{className:"size-3 text-destructive"})})]},S.id))}):m.jsx(_g,{className:"py-6",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[m.jsx(lp,{className:"size-8"}),m.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),m.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});return h?m.jsxs(Id,{open:i,onOpenChange:s,children:[m.jsx(Q4,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(lp,{className:"size-4"})})}),m.jsxs(Bd,{side:"bottom",className:"max-h-[80vh]",children:[m.jsx(zd,{children:m.jsx(Pd,{children:"Quick Switch"})}),m.jsx("div",{className:"mt-4",children:b()})]})]}):m.jsxs(Od,{open:i,onOpenChange:s,children:[m.jsx(yg,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(lp,{className:"size-4"})})}),m.jsx(Ld,{className:"w-[300px] p-0",align:"start",children:b()})]})}function Nx({viewMode:e,onViewModeChange:n}){const i=T.useCallback(()=>{n(e==="overview"?"default":"overview")},[e,n]),s=e==="overview";return m.jsx(Rl,{children:m.jsxs(Fa,{children:[m.jsx(Ha,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:i,children:s?m.jsx(JA,{className:"h-4 w-4"}):m.jsx(ZA,{className:"h-4 w-4"})})}),m.jsx(Ua,{children:s?"Single workspace":"Overview"})]})})}function h9({open:e,onOpenChange:n,editServer:i}){const{addServer:s,editServer:l}=Xa(),[h,u]=T.useState(""),[o,c]=T.useState(""),[d,g]=T.useState(""),[f,b]=T.useState(!1),[S,k]=T.useState(null),w=i!=null;T.useEffect(()=>{i?(u(i.name),c(i.url),g(i.token)):(u(""),c(""),g("")),k(null),b(!1)},[i,e]);const _=y=>{y.preventDefault(),k(null);const v=h.trim(),x=o.trim(),E=d.trim();if(!v){k("Name is required");return}if(!x){k("Server URL is required");return}if(!E){k("API token is required");return}if(!Vx(E)){k("Token must be 64 hexadecimal characters");return}const M=zu(x);w?l(i.id,{name:v,url:M,token:E}):s(v,M,E),n(!1)};return m.jsx(ro,{open:e,onOpenChange:n,children:m.jsxs(io,{className:"sm:max-w-[425px]",children:[m.jsxs(so,{children:[m.jsx(ao,{children:w?"Edit Server":"Add Server"}),m.jsx(Kl,{children:w?"Update server details":"Enter your server details"})]}),m.jsxs("form",{onSubmit:_,children:[m.jsxs("div",{className:"grid gap-4 py-4",children:[m.jsxs("div",{className:"grid gap-2",children:[m.jsx(Jr,{htmlFor:"server-name",children:"Name"}),m.jsx(Ou,{id:"server-name",value:h,onChange:y=>u(y.target.value),placeholder:"My Server"})]}),m.jsxs("div",{className:"grid gap-2",children:[m.jsx(Jr,{htmlFor:"server-url",children:"Server URL"}),m.jsx(Ou,{id:"server-url",value:o,onChange:y=>c(y.target.value),placeholder:"localhost:3000"})]}),m.jsxs("div",{className:"grid gap-2",children:[m.jsx(Jr,{htmlFor:"server-token",children:"API Token"}),m.jsxs("div",{className:"relative",children:[m.jsx(Ou,{id:"server-token",type:f?"text":"password",value:d,onChange:y=>g(y.target.value),placeholder:"64-character hex string",className:"pr-10"}),m.jsx("button",{type:"button",onClick:()=>b(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:f?m.jsx(zA,{className:"size-4 text-muted-foreground"}):m.jsx(FA,{className:"size-4 text-muted-foreground"})})]})]}),S&&m.jsx("p",{className:"text-sm text-destructive",children:S})]}),m.jsxs(Nd,{children:[m.jsx(ke,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),m.jsx(ke,{type:"submit",children:w?"Save":"Add"})]})]})]})})}const f9=(e,n)=>e&&n?`ws://${n}/ws?token=${e}`:null,Kp=e=>e?`http://${e}/api`:null;function p9(){var fn,Us,vo,$s;const{servers:e,activeServer:n,addServer:i,removeServer:s,isSwitching:l,clearSwitchingState:h,quickConnections:u}=Xa(),[o,c]=T.useState([]),[d,g]=T.useState([]),[f,b]=T.useState([]),[S,k]=T.useState(null),[w,_]=T.useState({}),[y,v]=T.useState({}),[x,E]=T.useState(null),M=T.useRef(null),[R,N]=T.useState(!1),[D,O]=T.useState(null),[P,$]=T.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[U,q]=T.useState("gpt-4o"),[Y,K]=T.useState(null),[V,Q]=T.useState([]),[J,F]=T.useState("gpt-4o");T.useEffect(()=>{var be;const Z=(be=V.find(Ue=>Ue.id===U))==null?void 0:be.variants;Y&&Z&&!Z[Y]&&K(null)},[U,Y,V]);const[j,I]=T.useState([]),[L,z]=T.useState(null),[X,ee]=T.useState(!1),[te,W]=T.useState(!1),[H,re]=T.useState(!1),[ae,pe]=T.useState(!1),[ce,Oe]=T.useState(()=>localStorage.getItem("jean2_sidebar_view")||"default"),[Be,$e]=T.useState([]),[ut,Me]=T.useState([]),[vn,Wt]=T.useState({}),[on,Kt]=T.useState([]),[$n,Dt]=T.useState(null),[Et,Qt]=T.useState(!1),[he,Se]=T.useState(null),[Re,He]=T.useState(!1),[Ve,xt]=T.useState(0),[nt,At]=T.useState(0),[Mt,Jt]=T.useState(0),ot=(fn=S==null?void 0:S.compacting)!=null?fn:!1;T.useEffect(()=>{localStorage.setItem("jean2_sidebar_view",ce)},[ce]);const mr=1e4,An=3e4,Wd=1e3,Mr=T.useRef(null),Nr=T.useRef(null),[co,sr]=T.useState(!1),dt=(Us=n==null?void 0:n.token)!=null?Us:null,lt=(vo=n==null?void 0:n.url)!=null?vo:null;T.useEffect(()=>{M.current=x},[x]);const Os=T.useRef(null),Ji=T.useRef(!1),Ls=T.useCallback(Z=>{i(Z.name,Z.url,Z.token)},[i]),Tn=T.useCallback(()=>{n&&s(n.id),M.current&&M.current.close(),E(null),N(!1),He(!1),xt(0),At(0)},[n,s]),Kd=T.useCallback(()=>{xt(Z=>Z+1),He(!1),At(0)},[]),Is=T.useCallback(()=>{M.current&&M.current.close(),E(null),N(!1),He(!1),xt(0),At(0),c([]),g([]),k(null),_({}),v({}),O(null),$({promptTokens:0,completionTokens:0,totalTokens:0}),q("gpt-4o"),Q([]),I([]),z(null),$e([]),Me([]),Wt({}),Jt(Z=>Z+1)},[]),qn=T.useCallback(async(Z,be={})=>{if(!dt)throw new Error("No API token available");const Ue=new Headers(be.headers||{});Ue.set("Authorization",`Bearer ${dt}`);const Le=await fetch(Z,{...be,signal:be.signal,headers:Ue});if(Le.status===401)throw Dt("Authentication failed. Your token may have been regenerated."),Tn(),new Error("Unauthorized");return Le},[dt,Tn]),ec=T.useCallback(Z=>{const be=w[Z]||[],Ue=y[Z]||{};return be.map(Le=>({message:Le,parts:(Ue[Le.id]||[]).sort((Ct,Vn)=>Ct.createdAt-Vn.createdAt)}))},[w,y]);T.useEffect(()=>{if(!dt||!lt)return;const Z=f9(dt,lt);if(!Z)return;const be=new WebSocket(Z);return be.onopen=()=>{N(!0),Dt(null),xt(0),He(!1)},be.onclose=Ue=>{N(!1),(Ue.code===1008||Ue.code===401)&&(Dt("Authentication failed. Please check your token."),Tn())},be.onerror=Ue=>{console.error("WebSocket error:",Ue)},be.onmessage=Ue=>{var Ct;const Le=JSON.parse(Ue.data);(Ct=Os.current)==null||Ct.call(Os,Le)},E(be),()=>be.close()},[dt,lt,Tn,Mt]),T.useEffect(()=>{if(dt&<&&!R&&!Re){const Z=setTimeout(()=>{R||He(!0)},mr);return()=>clearTimeout(Z)}},[dt,lt,R,Re]),T.useEffect(()=>{if(Re&&!R&&dt&<){const Z=Math.min(Wd*Math.pow(2,Ve),An);let be=Math.floor(Z/1e3);At(be);const Ue=setInterval(()=>{be-=1,At(Math.max(0,be))},1e3),Le=setTimeout(()=>{xt(Ct=>Ct+1),Jt(Ct=>Ct+1)},Z);return()=>{clearInterval(Ue),clearTimeout(Le)}}},[Re,R,dt,lt,Ve]),T.useEffect(()=>{var Ue;if(!dt||!lt)return;(Ue=Mr.current)==null||Ue.abort(),Mr.current=new AbortController;const Z=Mr.current.signal,be=Kp(lt);if(be)return sr(!0),Promise.all([qn(`${be}/sessions`,{signal:Z}).then(Le=>Le.json()),qn(`${be}/preconfigs`,{signal:Z}).then(Le=>Le.json()),qn(`${be}/prompts`,{signal:Z}).then(Le=>Le.json()),qn(`${be}/models`,{signal:Z}).then(Le=>Le.json()),qn(`${be}/workspaces`,{signal:Z}).then(Le=>Le.json()),qn(`${be}/providers`,{signal:Z}).then(Le=>Le.json())]).then(([Le,Ct,Vn,ye,we,ht])=>{c(Le.sessions||[]),g(Ct.preconfigs||[]),b(Vn.prompts||[]),Q(ye.models||[]),F(ye.defaultModel||"gpt-4o"),Kt(ht.providers||[]);const $t=we.workspaces||[];if(I($t),Nr.current){const ln=$t.find(Lt=>Lt.id===Nr.current);ln&&z(ln),Nr.current=null}else{const ln=localStorage.getItem("activeWorkspaceId"),Lt=$t.find(hi=>hi.id===ln);z(Lt||$t[0])}h(),sr(!1)}).catch(Le=>{var Ct;if(Le.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",Le),sr(!1),(Ct=Le.message)!=null&&Ct.includes("Unauthorized")||Dt("Failed to connect to server")}),()=>{var Le;(Le=Mr.current)==null||Le.abort()}},[dt,lt,qn,h]),T.useEffect(()=>{L&&localStorage.setItem("activeWorkspaceId",L.id)},[L]);const Bs=async(Z,be,Ue)=>{const Le=Kp(lt);if(!Le)return;const Vn=await(await qn(`${Le}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Z,path:be,isVirtual:Ue})})).json();return I(ye=>[...ye,Vn.workspace]),Vn.workspace},uo=Z=>{z(Z),k(null)},ho=Z=>{Nr.current=Z},tc=async Z=>{const be=Kp(lt);be&&(await qn(`${be}/workspaces/${Z}`,{method:"DELETE"}),I(Ue=>Ue.filter(Le=>Le.id!==Z)),(L==null?void 0:L.id)===Z&&z(j[0]||null))},gr=async()=>{const Z=`Workspace ${j.length+1}`,be=`~/.jean2/workspaces/${crypto.randomUUID()}`;await Bs(Z,be,!0)},Ht=async Z=>{const be=Z.split("/").pop()||Z.split("\\").pop()||"Workspace";await Bs(be,Z,!1)},en=T.useCallback(Z=>{var be,Ue,Le;switch(Z.type){case"session.created":c(ye=>[Z.session,...ye]),Ji.current&&(k(Z.session),_(ye=>({...ye,[Z.session.id]:[]})),v(ye=>({...ye,[Z.session.id]:{}})),$({promptTokens:0,completionTokens:0,totalTokens:0}),q(Z.session.selectedModel||J),K((be=Z.session.selectedVariant)!=null?be:null),Ji.current=!1);break;case"session.resumed":k(Z.session),Z.isRunning&&O(Z.session.id),Z.messages&&(_(ye=>({...ye,[Z.session.id]:Z.messages.map(we=>we.message)})),v(ye=>{const we={...ye};we[Z.session.id]={};for(const ht of Z.messages)we[Z.session.id][ht.message.id]=ht.parts;return we})),$((Ue=Z.usage)!=null?Ue:{promptTokens:0,completionTokens:0,totalTokens:0}),q(Z.session.selectedModel||J),K(Z.session.selectedVariant||null);const Ct=Z.session.selectedModel||J,Vn=(Le=V.find(ye=>ye.id===Ct))==null?void 0:Le.variants;Z.session.selectedVariant&&Vn&&!Vn[Z.session.selectedVariant]&&K(null);break;case"message.created":_(ye=>({...ye,[Z.message.sessionId]:[...ye[Z.message.sessionId]||[],Z.message]})),v(ye=>({...ye,[Z.message.sessionId]:{...ye[Z.message.sessionId],[Z.message.id]:[]}})),"status"in Z.message&&Z.message.status==="streaming"&&O(Z.message.sessionId);break;case"message.updated":_(ye=>({...ye,[Z.message.sessionId]:(ye[Z.message.sessionId]||[]).map(we=>we.id===Z.message.id?Z.message:we)})),"status"in Z.message&&Z.message.status!=="streaming"&&O(ye=>ye===Z.message.sessionId?null:ye);break;case"part.created":v(ye=>{const we=ye[Z.sessionId]||{},ht=we[Z.part.messageId]||[];return{...ye,[Z.sessionId]:{...we,[Z.part.messageId]:[...ht,Z.part]}}});break;case"part.updated":v(ye=>{const we=ye[Z.sessionId]||{},ht=we[Z.part.messageId]||[];return{...ye,[Z.sessionId]:{...we,[Z.part.messageId]:ht.map($t=>$t.id===Z.part.id?Z.part:$t)}}});break;case"part.append":O(Z.sessionId),v(ye=>{const we=ye[Z.sessionId]||{};for(const ht of Object.keys(we)){const $t=we[ht],ln=$t.findIndex(Lt=>Lt.id===Z.partId);if(ln!==-1){const Lt=$t[ln];if(Lt.type==="text"||Lt.type==="reasoning"){const hi=[...$t];return hi[ln]={...Lt,text:Lt.text+Z.delta},{...ye,[Z.sessionId]:{...we,[ht]:hi}}}}}return ye});break;case"chat.usage":if(Z.sessionId!==(S==null?void 0:S.id))return;$({promptTokens:Z.usage.promptTokens,completionTokens:Z.usage.completionTokens,totalTokens:Z.usage.totalTokens}),q(Z.model);break;case"error":console.error("Server error:",Z.code,Z.message);break;case"session.closed":c(ye=>ye.map(we=>we.id===Z.sessionId?{...we,status:"closed"}:we)),_(ye=>{const we={...ye};return delete we[Z.sessionId],we}),v(ye=>{const we={...ye};return delete we[Z.sessionId],we}),(S==null?void 0:S.id)===Z.sessionId&&k(null);break;case"session.reopened":c(ye=>ye.map(we=>we.id===Z.session.id?Z.session:we)),(S==null?void 0:S.id)===Z.session.id&&k(Z.session);break;case"session.deleted":c(ye=>ye.filter(we=>we.id!==Z.sessionId)),_(ye=>{const we={...ye};return delete we[Z.sessionId],we}),v(ye=>{const we={...ye};return delete we[Z.sessionId],we}),(S==null?void 0:S.id)===Z.sessionId&&k(null);break;case"session.updated":c(ye=>ye.map(we=>we.id===Z.session.id?Z.session:we)),(S==null?void 0:S.id)===Z.session.id&&(k(Z.session),Z.session.selectedVariant!==void 0&&K(Z.session.selectedVariant));break;case"session.renamed":c(ye=>ye.map(we=>we.id===Z.session.id?Z.session:we)),(S==null?void 0:S.id)===Z.session.id&&k(Z.session);break;case"permission.list":$e(Z.permissions);break;case"permission.revoked":$e(ye=>ye.map(we=>we.id===Z.permissionId?{...we,revokedAt:new Date().toISOString()}:we));break;case"permission.all_revoked":$e(ye=>{const we=new Date().toISOString();return ye.map(ht=>({...ht,revokedAt:we}))});break;case"permission.request":{const ye={toolCallId:Z.toolCallId,toolName:Z.toolName,args:Z.args,permissionType:Z.permissionType,permissionKey:Z.permissionKey,message:Z.message,details:Z.details,dangerous:Z.dangerous,childSessionId:Z.childSessionId,subagentName:Z.subagentName};Me(we=>[...we,ye]);break}case"permission.granted":Me(ye=>ye.filter(we=>we.toolCallId!==Z.toolCallId));break;case"session.interrupted":D===Z.sessionId&&O(null),Z.result.cascadedTo.length>0&&console.log(`Session ${Z.sessionId} interrupted. Cascaded to:`,Z.result.cascadedTo);break;case"queue.list":Wt(ye=>({...ye,[Z.sessionId]:Z.messages}));break;case"queue.added":Wt(ye=>({...ye,[Z.sessionId]:[...ye[Z.sessionId]||[],Z.message]}));break;case"queue.removed":Wt(ye=>({...ye,[Z.sessionId]:(ye[Z.sessionId]||[]).filter(we=>we.id!==Z.queueId)}));break;case"queue.sending":Wt(ye=>({...ye,[Z.sessionId]:(ye[Z.sessionId]||[]).filter(we=>we.id!==Z.queueId)}));break;case"session.reverted":console.log(`Session reverted to message ${Z.revertedTo.messageId}, removed ${Z.removed.messageIds.length} messages`);break;case"compaction.complete":break;case"session.forked":{const{forkedSession:ye,messages:we}=Z;c(ht=>[ye,...ht]),_(ht=>({...ht,[ye.id]:we.map($t=>$t.message)})),v(ht=>{const $t={...ht};$t[ye.id]={};for(const ln of we)$t[ye.id][ln.message.id]=ln.parts;return $t}),k(ye),$({promptTokens:0,completionTokens:0,totalTokens:0});break}case"session.state":_(ye=>({...ye,[Z.sessionId]:Z.messages.map(we=>we.message)})),v(ye=>{const we={...ye};we[Z.sessionId]={};for(const ht of Z.messages)we[Z.sessionId][ht.message.id]=ht.parts;return we}),D===Z.sessionId&&O(null);break;case"provider.status":{Kt(ye=>ye.find(ht=>ht.provider===Z.provider)?ye.map(ht=>ht.provider===Z.provider?{...ht,connected:Z.connected,authorizationUrl:Z.authorizationUrl,error:Z.error}:ht):[...ye,{provider:Z.provider,connected:Z.connected,authorizationUrl:Z.authorizationUrl,error:Z.error}]);break}case"provider.connected":Kt(ye=>ye.map(we=>we.provider===Z.provider?{...we,connected:Z.connected,connectedAt:Z.connectedAt,accountId:Z.accountId}:we));break}},[S,J,D]);T.useEffect(()=>{Os.current=en},[en]),T.useEffect(()=>{const Z=async be=>{const Ue=be.target;if(!(Ue.tagName==="INPUT"||Ue.tagName==="TEXTAREA"||Ue.isContentEditable)){if((be.metaKey||be.ctrlKey)&&be.key==="`"){be.preventDefault(),re(Ct=>!Ct);return}if((be.metaKey||be.ctrlKey)&&be.key==="n"){be.preventDefault();try{await nA("create_new_window")}catch(Ct){console.error("Failed to create new window:",Ct)}}}};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[]);const Pe=T.useCallback((Z,be)=>{x&&x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:Z,...be}))},[x]),fo=T.useCallback((Z,be)=>{Ji.current=!0,Pe("session.create",{preconfigId:Z,title:be,workspaceId:L==null?void 0:L.id})},[Pe,L]),zs=T.useCallback(Z=>{Me([]),O(null);const be=o.find(Ue=>Ue.id===Z);if(be!=null&&be.workspaceId&&be.workspaceId!==(L==null?void 0:L.id)){const Ue=j.find(Le=>Le.id===be.workspaceId);Ue&&z(Ue)}Pe("session.resume",{sessionId:Z})},[Pe,o,j,L]),Yd=T.useCallback(Z=>{Pe("session.close",{sessionId:Z})},[Pe]),nc=T.useCallback((Z,be)=>{Pe("session.revert",{sessionId:Z,messageId:be})},[Pe]),es=T.useCallback((Z,be)=>{Pe("session.fork",{sessionId:Z,messageId:be})},[Pe]),po=T.useCallback((Z,be)=>{Pe("session.compact",{sessionId:Z,messageIds:be})},[Pe]),li=T.useCallback(Z=>{Pe("session.reopen",{sessionId:Z})},[Pe]),ci=T.useCallback(Z=>{Pe("session.delete",{sessionId:Z})},[Pe]),ts=T.useCallback(Z=>{S&&Pe("session.update",{sessionId:S.id,preconfigId:Z})},[S,Pe]),ui=T.useCallback((Z,be)=>{q(Z),K(null),S&&Pe("session.update_model",{sessionId:S.id,modelId:Z,providerId:be})},[S,Pe]),Ot=T.useCallback(Z=>{S&&(Pe("session.update_model",{sessionId:S.id,modelId:S.selectedModel||U,providerId:S.selectedProvider||"openai",variant:Z}),K(Z))},[S,U,Pe]),rc=T.useCallback((Z,be)=>{Pe("session.rename",{sessionId:Z,title:be})},[Pe]),ic=T.useCallback(()=>{S!=null&&S.parentId&&zs(S.parentId)},[S,zs]),vr=T.useCallback((Z,be)=>{Pe("queue.add",{sessionId:Z,content:be})},[Pe]),di=T.useCallback(Z=>{Pe("queue.remove",{queueId:Z})},[Pe]),Xd=T.useCallback(Z=>{!S||ot||(D===S.id?vr(S.id,Z):Pe("chat.message",{sessionId:S.id,content:Z}))},[S,D,ot,Pe,vr]),sc=T.useCallback((Z,be,Ue)=>{Me(Le=>Le.filter(Ct=>Ct.toolCallId!==Z)),Pe("permission.response",{toolCallId:Z,allowed:be,alwaysAllow:Ue})},[Pe]),ac=T.useCallback(()=>{S&&Pe("session.interrupt",{sessionId:S.id})},[S,Pe]),Zd=T.useCallback(()=>{L&&Pe("permission.list",{workspaceId:L.id})},[L,Pe]),Ps=T.useCallback(Z=>{Pe("provider.connect",{provider:Z})},[Pe]),Fs=T.useCallback(Z=>{Pe("provider.disconnect",{provider:Z})},[Pe]),ar=o.filter(Z=>Z.workspaceId===(L==null?void 0:L.id)),_n=u.filter(Z=>Z.serverId===(n==null?void 0:n.id)&&Z.workspaceId).map(Z=>Z.workspaceId),mo=S?ec(S.id):[],Hs=d.filter(Z=>Z.mode!=="subagent"),go=T.useCallback(Z=>{var Ue;z(j.find(Le=>Le.id===Z)||null),Ji.current=!0;const be=(Ue=Hs[0])==null?void 0:Ue.id;Pe("session.create",{preconfigId:be,workspaceId:Z})},[Pe,j,Hs]),oc=!(S!=null&&S.parentId),Ut=!!n,Qd=()=>{var Z;return e.length===0?m.jsx(Dx,{onServerAdded:Ls,error:$n||void 0}):Ut?l?m.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:m.jsx(Rx,{message:`Connecting to ${(n==null?void 0:n.name)||"server"}...`})}):!R&&o.length===0?Re?m.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:m.jsx(d9,{serverUrl:lt,authError:$n,retryCount:Ve,nextRetryIn:nt,onRetry:Kd,onLogout:Tn})}):m.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[m.jsx(Rx,{}),m.jsx(ke,{variant:"ghost",size:"sm",onClick:Tn,className:"text-muted-foreground",children:"Change Server"})]}):m.jsx(m.Fragment,{children:S?m.jsx(t9,{session:S,messagesWithParts:mo,queuedMessages:vn[S.id]||[],preconfigs:oc?Hs:d,prompts:f,models:V,connectedProviderIds:new Set(on.filter(be=>be.connected).map(be=>be.provider)),connectableProviderIds:new Set(on.filter(be=>be.connectable).map(be=>be.provider)),defaultModel:J,onSendMessage:Xd,onRemoveFromQueue:di,onChangePreconfig:ts,onChangeModel:ui,onChangeVariant:Ot,selectedVariant:Y,variants:(Z=V.find(be=>be.id===U))==null?void 0:Z.variants,pendingPermissions:ut,onPermissionResponse:sc,onRename:rc,usage:P,modelName:U,onNavigateToSubagent:zs,onNavigateBack:ic,isStreaming:D===S.id,onInterrupt:ac,onRevert:nc,onFork:es,onCompact:(()=>{const be=mo.filter(Ue=>Ue.message.role!=="system"&&!Ue.parts.some(Le=>Le.type==="compaction"));return be.length>=4?()=>{const Ue=be.slice(0,be.length-2).map(Le=>Le.message.id);Ue.length>0&&po(S.id,Ue)}:void 0})(),isCompacting:ot,serverUrl:lt!=null?lt:void 0,apiToken:dt!=null?dt:void 0}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[m.jsx("h2",{className:"mb-2",children:"Select or create a session"}),m.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]})}):m.jsx(Dx,{onServerAdded:Ls,error:$n||void 0})};return m.jsxs(lO,{defaultOpen:!0,children:[Ut&&m.jsx(xO,{allSessions:o,viewMode:ce,favoritedWorkspaceIds:_n,sessions:ar,currentSession:S,currentSessionId:($s=S==null?void 0:S.id)!=null?$s:null,streamingSessionId:D,connected:R,workspaces:j,activeWorkspace:L,onCreateSession:()=>{var Z;return fo((Z=Hs[0])==null?void 0:Z.id)},onResumeSession:zs,onCloseSession:Yd,onReopenSession:li,onDeleteSession:ci,onSelectWorkspace:uo,onCreateVirtualWorkspace:gr,onCreatePhysicalWorkspace:Ht,onDeleteWorkspace:tc,onOpenSettings:()=>ee(!0),onOpenMCP:()=>pe(!0),onOpenAddServer:()=>Qt(!0),onServerSwitch:Is,onCreateSessionInWorkspace:go}),m.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",style:{paddingTop:"env(safe-area-inset-top, 0)",paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[m.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[Ut&&m.jsx(k0,{}),m.jsx("span",{className:"font-semibold",children:"Jean2"})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[Ut&&m.jsx(Mx,{onServerSwitch:Is,onSelectWorkspace:ho}),Ut&&m.jsx(Nx,{viewMode:ce,onViewModeChange:Oe}),Ut&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>W(!te),title:te?"Hide Files":"Show Files",children:m.jsx(Zp,{className:"w-4 h-4"})}),Ut&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>re(!H),title:H?"Hide Terminal":"Show Terminal",children:m.jsx(Ob,{className:"w-4 h-4"})})]})]}),m.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[Ut&&m.jsx(k0,{}),m.jsx("span",{className:"font-semibold",children:"Jean2"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[Ut&&m.jsx(Mx,{onServerSwitch:Is,onSelectWorkspace:ho}),Ut&&m.jsx(Nx,{viewMode:ce,onViewModeChange:Oe}),Ut&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>W(!te),title:te?"Hide Files":"Show Files",children:m.jsx(Zp,{className:"w-4 h-4"})}),Ut&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>re(!H),title:H?"Hide Terminal":"Show Terminal",children:m.jsx(Ob,{className:"w-4 h-4"})})]})]}),Qd(),Ut&&m.jsx(zO,{workspaceId:L==null?void 0:L.id,workspacePath:L==null?void 0:L.path,workspaceName:L==null?void 0:L.name,serverUrl:lt!=null?lt:void 0,apiToken:dt!=null?dt:void 0,isOpen:H,onClose:()=>re(!1)})]}),Ut&&m.jsxs(m.Fragment,{children:[m.jsx(CO,{workspaceId:L==null?void 0:L.id,serverUrl:lt!=null?lt:void 0,apiToken:dt!=null?dt:void 0,isOpen:te,onClose:()=>W(!1)}),m.jsx(l9,{open:X,onOpenChange:ee,permissions:Be,onRefreshPermissions:Zd,onRevokePermission:Z=>{Pe("permission.revoke",{permissionId:Z})},onRevokeAllPermissions:()=>{Pe("permission.revoke_all",{workspaceId:L==null?void 0:L.id})},apiToken:dt,onLogout:Tn,providerStatuses:on,onConnectProvider:Ps,onDisconnectProvider:Fs}),m.jsx(u9,{open:ae,onOpenChange:pe,workspaceId:L==null?void 0:L.id,workspacePath:L==null?void 0:L.path,serverUrl:lt!=null?lt:void 0,apiToken:dt!=null?dt:void 0})]}),m.jsx(h9,{open:Et,onOpenChange:Z=>{Qt(Z),Z||Se(null)},editServer:he})]})}function m9(){return m.jsx(sR,{children:m.jsx(p9,{})})}Q2.createRoot(document.getElementById("root")).render(m.jsx(T.StrictMode,{children:m.jsx(eA,{defaultTheme:"dark",storageKey:"jean2-theme",children:m.jsx(m9,{})})}));
|