@jean2/client 0.6.7 → 0.7.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.
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
function u4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Xd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yp={exports:{}},Xl={};/**
|
|
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 p_;function d4(){if(p_)return Xl;p_=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var a in o)a!=="key"&&(l[a]=o[a])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Xl.Fragment=e,Xl.jsx=n,Xl.jsxs=n,Xl}var m_;function f4(){return m_||(m_=1,Yp.exports=d4()),Yp.exports}var m=f4(),Xp={exports:{}},rt={};/**
|
|
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 g_;function h4(){if(g_)return rt;g_=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function S(P,H,B){this.props=P,this.context=H,this.refs=y,this.updater=B||C}S.prototype.isReactComponent={},S.prototype.setState=function(P,H){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,H,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function _(){}_.prototype=S.prototype;function b(P,H,B){this.props=P,this.context=H,this.refs=y,this.updater=B||C}var k=b.prototype=new _;k.constructor=b,w(k,S.prototype),k.isPureReactComponent=!0;var T=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function j(P,H,B){var Z=B.ref;return{$$typeof:t,type:P,key:H,ref:Z!==void 0?Z:null,props:B}}function O(P,H){return j(P.type,H,P.props)}function z(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function V(P){var H={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(B){return H[B]})}var F=/\/+/g;function W(P,H){return typeof P=="object"&&P!==null&&P.key!=null?V(""+P.key):H.toString(36)}function G(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(R,R):(P.status="pending",P.then(function(H){P.status==="pending"&&(P.status="fulfilled",P.value=H)},function(H){P.status==="pending"&&(P.status="rejected",P.reason=H)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function q(P,H,B,Z,J){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var K=!1;if(P===null)K=!0;else switch(ee){case"bigint":case"string":case"number":K=!0;break;case"object":switch(P.$$typeof){case t:case e:K=!0;break;case p:return K=P._init,q(K(P._payload),H,B,Z,J)}}if(K)return J=J(P),K=Z===""?"."+W(P,0):Z,T(J)?(B="",K!=null&&(B=K.replace(F,"$&/")+"/"),q(J,H,B,"",function(re){return re})):J!=null&&(z(J)&&(J=O(J,B+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(F,"$&/")+"/")+K)),H.push(J)),1;K=0;var $=Z===""?".":Z+":";if(T(P))for(var te=0;te<P.length;te++)Z=P[te],ee=$+W(Z,te),K+=q(Z,H,B,ee,J);else if(te=x(P),typeof te=="function")for(P=te.call(P),te=0;!(Z=P.next()).done;)Z=Z.value,ee=$+W(Z,te++),K+=q(Z,H,B,ee,J);else if(ee==="object"){if(typeof P.then=="function")return q(G(P),H,B,Z,J);throw H=String(P),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return K}function X(P,H,B){if(P==null)return P;var Z=[],J=0;return q(P,Z,"","",function(ee){return H.call(B,ee,J++)}),Z}function Y(P){if(P._status===-1){var H=P._result;H=H(),H.then(function(B){(P._status===0||P._status===-1)&&(P._status=1,P._result=B)},function(B){(P._status===0||P._status===-1)&&(P._status=2,P._result=B)}),P._status===-1&&(P._status=0,P._result=H)}if(P._status===1)return P._result.default;throw P._result}var I=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},L={map:X,forEach:function(P,H,B){X(P,function(){H.apply(this,arguments)},B)},count:function(P){var H=0;return X(P,function(){H++}),H},toArray:function(P){return X(P,function(H){return H})||[]},only:function(P){if(!z(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return rt.Activity=h,rt.Children=L,rt.Component=S,rt.Fragment=n,rt.Profiler=o,rt.PureComponent=b,rt.StrictMode=r,rt.Suspense=u,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,rt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return M.H.useMemoCache(P)}},rt.cache=function(P){return function(){return P.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(P,H,B){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Z=w({},P.props),J=P.key;if(H!=null)for(ee in H.key!==void 0&&(J=""+H.key),H)!A.call(H,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&H.ref===void 0||(Z[ee]=H[ee]);var ee=arguments.length-2;if(ee===1)Z.children=B;else if(1<ee){for(var K=Array(ee),$=0;$<ee;$++)K[$]=arguments[$+2];Z.children=K}return j(P.type,J,Z)},rt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},rt.createElement=function(P,H,B){var Z,J={},ee=null;if(H!=null)for(Z in H.key!==void 0&&(ee=""+H.key),H)A.call(H,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(J[Z]=H[Z]);var K=arguments.length-2;if(K===1)J.children=B;else if(1<K){for(var $=Array(K),te=0;te<K;te++)$[te]=arguments[te+2];J.children=$}if(P&&P.defaultProps)for(Z in K=P.defaultProps,K)J[Z]===void 0&&(J[Z]=K[Z]);return j(P,ee,J)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(P){return{$$typeof:a,render:P}},rt.isValidElement=z,rt.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:Y}},rt.memo=function(P,H){return{$$typeof:d,type:P,compare:H===void 0?null:H}},rt.startTransition=function(P){var H=M.T,B={};M.T=B;try{var Z=P(),J=M.S;J!==null&&J(B,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,I)}catch(ee){I(ee)}finally{H!==null&&B.types!==null&&(H.types=B.types),M.T=H}},rt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},rt.use=function(P){return M.H.use(P)},rt.useActionState=function(P,H,B){return M.H.useActionState(P,H,B)},rt.useCallback=function(P,H){return M.H.useCallback(P,H)},rt.useContext=function(P){return M.H.useContext(P)},rt.useDebugValue=function(){},rt.useDeferredValue=function(P,H){return M.H.useDeferredValue(P,H)},rt.useEffect=function(P,H){return M.H.useEffect(P,H)},rt.useEffectEvent=function(P){return M.H.useEffectEvent(P)},rt.useId=function(){return M.H.useId()},rt.useImperativeHandle=function(P,H,B){return M.H.useImperativeHandle(P,H,B)},rt.useInsertionEffect=function(P,H){return M.H.useInsertionEffect(P,H)},rt.useLayoutEffect=function(P,H){return M.H.useLayoutEffect(P,H)},rt.useMemo=function(P,H){return M.H.useMemo(P,H)},rt.useOptimistic=function(P,H){return M.H.useOptimistic(P,H)},rt.useReducer=function(P,H,B){return M.H.useReducer(P,H,B)},rt.useRef=function(P){return M.H.useRef(P)},rt.useState=function(P){return M.H.useState(P)},rt.useSyncExternalStore=function(P,H,B){return M.H.useSyncExternalStore(P,H,B)},rt.useTransition=function(){return M.H.useTransition()},rt.version="19.2.4",rt}var v_;function Qd(){return v_||(v_=1,Xp.exports=h4()),Xp.exports}var N=Qd();const En=Xd(N),Qx=u4({__proto__:null,default:En},[N]);var Qp={exports:{}},Ql={},Zp={exports:{}},Jp={};/**
|
|
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 y_;function p4(){return y_||(y_=1,(function(t){function e(q,X){var Y=q.length;q.push(X);e:for(;0<Y;){var I=Y-1>>>1,L=q[I];if(0<o(L,X))q[I]=X,q[Y]=L,Y=I;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var X=q[0],Y=q.pop();if(Y!==X){q[0]=Y;e:for(var I=0,L=q.length,P=L>>>1;I<P;){var H=2*(I+1)-1,B=q[H],Z=H+1,J=q[Z];if(0>o(B,Y))Z<L&&0>o(J,B)?(q[I]=J,q[Z]=Y,I=Z):(q[I]=B,q[H]=Y,I=H);else if(Z<L&&0>o(J,Y))q[I]=J,q[Z]=Y,I=Z;else break e}}return X}function o(q,X){var Y=q.sortIndex-X.sortIndex;return Y!==0?Y:q.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,a=c.now();t.unstable_now=function(){return c.now()-a}}var u=[],d=[],p=1,h=null,v=3,x=!1,C=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=q)r(d),X.sortIndex=X.expirationTime,e(u,X);else break;X=n(d)}}function T(q){if(w=!1,k(q),!C)if(n(u)!==null)C=!0,R||(R=!0,V());else{var X=n(d);X!==null&&G(T,X.startTime-q)}}var R=!1,M=-1,A=5,j=-1;function O(){return y?!0:!(t.unstable_now()-j<A)}function z(){if(y=!1,R){var q=t.unstable_now();j=q;var X=!0;try{e:{C=!1,w&&(w=!1,_(M),M=-1),x=!0;var Y=v;try{t:{for(k(q),h=n(u);h!==null&&!(h.expirationTime>q&&O());){var I=h.callback;if(typeof I=="function"){h.callback=null,v=h.priorityLevel;var L=I(h.expirationTime<=q);if(q=t.unstable_now(),typeof L=="function"){h.callback=L,k(q),X=!0;break t}h===n(u)&&r(u),k(q)}else r(u);h=n(u)}if(h!==null)X=!0;else{var P=n(d);P!==null&&G(T,P.startTime-q),X=!1}}break e}finally{h=null,v=Y,x=!1}X=void 0}}finally{X?V():R=!1}}}var V;if(typeof b=="function")V=function(){b(z)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,W=F.port2;F.port1.onmessage=z,V=function(){W.postMessage(null)}}else V=function(){S(z,0)};function G(q,X){M=S(function(){q(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(q){q.callback=null},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(q){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var Y=v;v=X;try{return q()}finally{v=Y}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=v;v=q;try{return X()}finally{v=Y}},t.unstable_scheduleCallback=function(q,X,Y){var I=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,q){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Y+L,q={id:p++,callback:X,priorityLevel:q,startTime:Y,expirationTime:L,sortIndex:-1},Y>I?(q.sortIndex=Y,e(d,q),n(u)===null&&q===n(d)&&(w?(_(M),M=-1):w=!0,G(T,Y-I))):(q.sortIndex=L,e(u,q),C||x||(C=!0,R||(R=!0,V()))),q},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(q){var X=v;return function(){var Y=v;v=X;try{return q.apply(this,arguments)}finally{v=Y}}}})(Jp)),Jp}var __;function m4(){return __||(__=1,Zp.exports=p4()),Zp.exports}var em={exports:{}},jn={};/**
|
|
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 b_;function g4(){if(b_)return jn;b_=1;var t=Qd();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(u,d,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:u,containerInfo:d,implementation:p}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,jn.createPortal=function(u,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return l(u,d,null,p)},jn.flushSync=function(u){var d=c.T,p=r.p;try{if(c.T=null,r.p=2,u)return u()}finally{c.T=d,r.p=p,r.d.f()}},jn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},jn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},jn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var p=d.as,h=a(p,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:x}):p==="script"&&r.d.X(u,{crossOrigin:h,integrity:v,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},jn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=a(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},jn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,h=a(p,d.crossOrigin);r.d.L(u,p,{crossOrigin:h,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})}},jn.preloadModule=function(u,d){if(typeof u=="string")if(d){var p=a(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},jn.requestFormReset=function(u){r.d.r(u)},jn.unstable_batchedUpdates=function(u,d){return u(d)},jn.useFormState=function(u,d,p){return c.H.useFormState(u,d,p)},jn.useFormStatus=function(){return c.H.useHostTransitionStatus()},jn.version="19.2.4",jn}var x_;function Zx(){if(x_)return em.exports;x_=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),em.exports=g4(),em.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 S_;function v4(){if(S_)return Ql;S_=1;var t=m4(),e=Qd(),n=Zx();function r(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)i+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var i=s,f=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(f=i.return),s=i.return;while(s)}return i.tag===3?f:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function a(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function u(s){if(l(s)!==s)throw Error(r(188))}function d(s){var i=s.alternate;if(!i){if(i=l(s),i===null)throw Error(r(188));return i!==s?null:s}for(var f=s,g=i;;){var E=f.return;if(E===null)break;var D=E.alternate;if(D===null){if(g=E.return,g!==null){f=g;continue}break}if(E.child===D.child){for(D=E.child;D;){if(D===f)return u(E),s;if(D===g)return u(E),i;D=D.sibling}throw Error(r(188))}if(f.return!==g.return)f=E,g=D;else{for(var U=!1,Q=E.child;Q;){if(Q===f){U=!0,f=E,g=D;break}if(Q===g){U=!0,g=E,f=D;break}Q=Q.sibling}if(!U){for(Q=D.child;Q;){if(Q===f){U=!0,f=D,g=E;break}if(Q===g){U=!0,g=D,f=E;break}Q=Q.sibling}if(!U)throw Error(r(189))}}if(f.alternate!==g)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?s:i}function p(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=p(s),i!==null)return i;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),b=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function V(s){return s===null||typeof s!="object"?null:(s=z&&s[z]||s["@@iterator"],typeof s=="function"?s:null)}var F=Symbol.for("react.client.reference");function W(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===F?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList";case j:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case C:return"Portal";case b:return s.displayName||"Context";case _:return(s._context.displayName||"Context")+".Consumer";case k:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case M:return i=s.displayName||null,i!==null?i:W(s.type)||"Memo";case A:i=s._payload,s=s._init;try{return W(s(i))}catch{}}return null}var G=Array.isArray,q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},I=[],L=-1;function P(s){return{current:s}}function H(s){0>L||(s.current=I[L],I[L]=null,L--)}function B(s,i){L++,I[L]=s.current,s.current=i}var Z=P(null),J=P(null),ee=P(null),K=P(null);function $(s,i){switch(B(ee,i),B(J,s),B(Z,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?Py(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=Py(i),s=zy(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}H(Z),B(Z,s)}function te(){H(Z),H(J),H(ee)}function re(s){s.memoizedState!==null&&B(K,s);var i=Z.current,f=zy(i,s.type);i!==f&&(B(J,s),B(Z,f))}function ae(s){J.current===s&&(H(Z),H(J)),K.current===s&&(H(K),Wl._currentValue=Y)}var se,_e;function Re(s){if(se===void 0)try{throw Error()}catch(f){var i=f.stack.trim().match(/\n( *(at )?)/);se=i&&i[1]||"",_e=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+se+s+_e}var je=!1;function ze(s,i){if(!s||je)return"";je=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(i){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ge){var pe=ge}Reflect.construct(s,[],Se)}else{try{Se.call()}catch(ge){pe=ge}s.call(Se.prototype)}}else{try{throw Error()}catch(ge){pe=ge}(Se=s())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ge){if(ge&&pe&&typeof ge.stack=="string")return[ge.stack,pe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var D=g.DetermineComponentFrameRoot(),U=D[0],Q=D[1];if(U&&Q){var ne=U.split(`
|
|
44
|
+
`),de=Q.split(`
|
|
45
|
+
`);for(E=g=0;g<ne.length&&!ne[g].includes("DetermineComponentFrameRoot");)g++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(g===ne.length||E===de.length)for(g=ne.length-1,E=de.length-1;1<=g&&0<=E&&ne[g]!==de[E];)E--;for(;1<=g&&0<=E;g--,E--)if(ne[g]!==de[E]){if(g!==1||E!==1)do if(g--,E--,0>E||ne[g]!==de[E]){var be=`
|
|
46
|
+
`+ne[g].replace(" at new "," at ");return s.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",s.displayName)),be}while(1<=g&&0<=E);break}}}finally{je=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Re(f):""}function ce(s,i){switch(s.tag){case 26:case 27:case 5:return Re(s.type);case 16:return Re("Lazy");case 13:return s.child!==i&&i!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return ze(s.type,!1);case 11:return ze(s.type.render,!1);case 1:return ze(s.type,!0);case 31:return Re("Activity");default:return""}}function Te(s){try{var i="",f=null;do i+=ce(s,f),f=s,s=s.return;while(s);return i}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var ye=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,ve=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Ae=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,me=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,De=t.unstable_LowPriority,Be=t.unstable_IdlePriority,nt=t.log,Ye=t.unstable_setDisableYieldValue,Ue=null,Me=null;function We(s){if(typeof nt=="function"&&Ye(s),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Ue,s)}catch{}}var Xe=Math.clz32?Math.clz32:Rn,vt=Math.log,Lt=Math.LN2;function Rn(s){return s>>>=0,s===0?32:31-(vt(s)/Lt|0)|0}var Ut=256,et=262144,at=4194304;function Gt(s){var i=s&42;if(i!==0)return i;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Qe(s,i,f){var g=s.pendingLanes;if(g===0)return 0;var E=0,D=s.suspendedLanes,U=s.pingedLanes;s=s.warmLanes;var Q=g&134217727;return Q!==0?(g=Q&~D,g!==0?E=Gt(g):(U&=Q,U!==0?E=Gt(U):f||(f=Q&~s,f!==0&&(E=Gt(f))))):(Q=g&~D,Q!==0?E=Gt(Q):U!==0?E=Gt(U):f||(f=g&~s,f!==0&&(E=Gt(f)))),E===0?0:i!==0&&i!==E&&(i&D)===0&&(D=E&-E,f=i&-i,D>=f||D===32&&(f&4194048)!==0)?i:E}function yt(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function It(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 $t(){var s=at;return at<<=1,(at&62914560)===0&&(at=4194304),s}function Qt(s){for(var i=[],f=0;31>f;f++)i.push(s);return i}function In(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function xr(s,i,f,g,E,D){var U=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var Q=s.entanglements,ne=s.expirationTimes,de=s.hiddenUpdates;for(f=U&~f;0<f;){var be=31-Xe(f),Se=1<<be;Q[be]=0,ne[be]=-1;var pe=de[be];if(pe!==null)for(de[be]=null,be=0;be<pe.length;be++){var ge=pe[be];ge!==null&&(ge.lane&=-536870913)}f&=~Se}g!==0&&Pn(s,g,0),D!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=D&~(U&~i))}function Pn(s,i,f){s.pendingLanes|=i,s.suspendedLanes&=~i;var g=31-Xe(i);s.entangledLanes|=i,s.entanglements[g]=s.entanglements[g]|1073741824|f&261930}function qn(s,i){var f=s.entangledLanes|=i;for(s=s.entanglements;f;){var g=31-Xe(f),E=1<<g;E&i|s[g]&i&&(s[g]|=i),f&=~E}}function zn(s,i){var f=i&-i;return f=(f&42)!==0?1:Zt(f),(f&(s.suspendedLanes|i))!==0?0:f}function Zt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Jt(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function fn(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:a_(s.type))}function Sr(s,i){var f=X.p;try{return X.p=s,i()}finally{X.p=f}}var Bn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Bn,en="__reactProps$"+Bn,Tn="__reactContainer$"+Bn,sr="__reactEvents$"+Bn,ms="__reactListeners$"+Bn,Gs="__reactHandles$"+Bn,Br="__reactResources$"+Bn,Fn="__reactMarker$"+Bn;function wr(s){delete s[Rt],delete s[en],delete s[sr],delete s[ms],delete s[Gs]}function ir(s){var i=s[Rt];if(i)return i;for(var f=s.parentNode;f;){if(i=f[Tn]||f[Rt]){if(f=i.alternate,i.child!==null||f!==null&&f.child!==null)for(s=qy(s);s!==null;){if(f=s[Rt])return f;s=qy(s)}return i}s=f,f=s.parentNode}return null}function gn(s){if(s=s[Rt]||s[Tn]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function Wn(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(r(33))}function Nn(s){var i=s[Br];return i||(i=s[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Tt(s){s[Fn]=!0}var gs=new Set,vs={};function Dn(s,i){vn(s,i),vn(s+"Capture",i)}function vn(s,i){for(vs[s]=i,s=0;s<i.length;s++)gs.add(i[s])}var or=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]*$"),Fr={},Mn={};function Gn(s){return ye.call(Mn,s)?!0:ye.call(Fr,s)?!1:or.test(s)?Mn[s]=!0:(Fr[s]=!0,!1)}function tn(s,i,f){if(Gn(i))if(f===null)s.removeAttribute(i);else{switch(typeof f){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var g=i.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+f)}}function Kn(s,i,f){if(f===null)s.removeAttribute(i);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+f)}}function qt(s,i,f,g){if(g===null)s.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(f);return}s.setAttributeNS(i,f,""+g)}}function Kt(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ys(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function es(s,i,f){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,D=g.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return E.call(this)},set:function(U){f=""+U,D.call(this,U)}}),Object.defineProperty(s,i,{enumerable:g.enumerable}),{getValue:function(){return f},setValue:function(U){f=""+U},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function Ks(s){if(!s._valueTracker){var i=ys(s)?"checked":"value";s._valueTracker=es(s,i,""+s[i])}}function nl(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var f=i.getValue(),g="";return s&&(g=ys(s)?s.checked?"true":"false":s.value),s=g,s!==f?(i.setValue(s),!0):!1}function Ys(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Vc=/[\n"\\]/g;function Yn(s){return s.replace(Vc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Wt(s,i,f,g,E,D,U,Q){s.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?s.type=U:s.removeAttribute("type"),i!=null?U==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+Kt(i)):s.value!==""+Kt(i)&&(s.value=""+Kt(i)):U!=="submit"&&U!=="reset"||s.removeAttribute("value"),i!=null?Xs(s,U,Kt(i)):f!=null?Xs(s,U,Kt(f)):g!=null&&s.removeAttribute("value"),E==null&&D!=null&&(s.defaultChecked=!!D),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?s.name=""+Kt(Q):s.removeAttribute("name")}function nn(s,i,f,g,E,D,U,Q){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(s.type=D),i!=null||f!=null){if(!(D!=="submit"&&D!=="reset"||i!=null)){Ks(s);return}f=f!=null?""+Kt(f):"",i=i!=null?""+Kt(i):f,Q||i===s.value||(s.value=i),s.defaultValue=i}g=g!=null?g:E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=Q?s.checked:!!g,s.defaultChecked=!!g,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(s.name=U),Ks(s)}function Xs(s,i,f){i==="number"&&Ys(s.ownerDocument)===s||s.defaultValue===""+f||(s.defaultValue=""+f)}function ts(s,i,f,g){if(s=s.options,i){i={};for(var E=0;E<f.length;E++)i["$"+f[E]]=!0;for(f=0;f<s.length;f++)E=i.hasOwnProperty("$"+s[f].value),s[f].selected!==E&&(s[f].selected=E),E&&g&&(s[f].defaultSelected=!0)}else{for(f=""+Kt(f),i=null,E=0;E<s.length;E++){if(s[E].value===f){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}i!==null||s[E].disabled||(i=s[E])}i!==null&&(i.selected=!0)}}function qc(s,i,f){if(i!=null&&(i=""+Kt(i),i!==s.value&&(s.value=i),f==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=f!=null?""+Kt(f):""}function Wc(s,i,f,g){if(i==null){if(g!=null){if(f!=null)throw Error(r(92));if(G(g)){if(1<g.length)throw Error(r(93));g=g[0]}f=g}f==null&&(f=""),i=f}f=Kt(i),s.defaultValue=f,g=s.textContent,g===f&&g!==""&&g!==null&&(s.value=g),Ks(s)}function Cr(s,i){if(i){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=i;return}}s.textContent=i}var Gf=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 Hi(s,i,f){var g=i.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?g?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":g?s.setProperty(i,f):typeof f!="number"||f===0||Gf.has(i)?i==="float"?s.cssFloat=f:s[i]=(""+f).trim():s[i]=f+"px"}function jo(s,i,f){if(i!=null&&typeof i!="object")throw Error(r(62));if(s=s.style,f!=null){for(var g in f)!f.hasOwnProperty(g)||i!=null&&i.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in i)g=i[E],i.hasOwnProperty(E)&&f[E]!==g&&Hi(s,E,g)}else for(var D in i)i.hasOwnProperty(D)&&Hi(s,D,i[D])}function rl(s){if(s.indexOf("-")===-1)return!1;switch(s){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 Gc=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"]]),Kf=/^[\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 Oo(s){return Kf.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Hr(){}var sl=null;function il(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var kr=null,_s=null;function Ui(s){var i=gn(s);if(i&&(s=i.stateNode)){var f=s[en]||null;e:switch(s=i.stateNode,i.type){case"input":if(Wt(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),i=f.name,f.type==="radio"&&i!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Yn(""+i)+'"][type="radio"]'),i=0;i<f.length;i++){var g=f[i];if(g!==s&&g.form===s.form){var E=g[en]||null;if(!E)throw Error(r(90));Wt(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(i=0;i<f.length;i++)g=f[i],g.form===s.form&&nl(g)}break e;case"textarea":qc(s,f.value,f.defaultValue);break e;case"select":i=f.value,i!=null&&ts(s,!!f.multiple,i,!1)}}}var Lo=!1;function ol(s,i,f){if(Lo)return s(i,f);Lo=!0;try{var g=s(i);return g}finally{if(Lo=!1,(kr!==null||_s!==null)&&(zu(),kr&&(i=kr,s=_s,_s=kr=null,Ui(i),s)))for(i=0;i<s.length;i++)Ui(s[i])}}function Qs(s,i){var f=s.stateNode;if(f===null)return null;var g=f[en]||null;if(g===null)return null;f=g[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(r(231,i,typeof f));return f}var Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),al=!1;if(Ur)try{var $i={};Object.defineProperty($i,"passive",{get:function(){al=!0}}),window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{al=!1}var $r=null,ll=null,Io=null;function Kc(){if(Io)return Io;var s,i=ll,f=i.length,g,E="value"in $r?$r.value:$r.textContent,D=E.length;for(s=0;s<f&&i[s]===E[s];s++);var U=f-s;for(g=1;g<=U&&i[f-g]===E[D-g];g++);return Io=E.slice(s,1<g?1-g:void 0)}function Po(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function zo(){return!0}function Yc(){return!1}function xn(s){function i(f,g,E,D,U){this._reactName=f,this._targetInst=E,this.type=g,this.nativeEvent=D,this.target=U,this.currentTarget=null;for(var Q in s)s.hasOwnProperty(Q)&&(f=s[Q],this[Q]=f?f(D):D[Q]);return this.isDefaultPrevented=(D.defaultPrevented!=null?D.defaultPrevented:D.returnValue===!1)?zo:Yc,this.isPropagationStopped=Yc,this}return h(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=zo)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=zo)},persist:function(){},isPersistent:zo}),i}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bo=xn(bs),Vi=h({},bs,{view:0,detail:0}),Yf=xn(Vi),cl,ul,qi,Fo=h({},Vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_t,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==qi&&(qi&&s.type==="mousemove"?(cl=s.screenX-qi.screenX,ul=s.screenY-qi.screenY):ul=cl=0,qi=s),cl)},movementY:function(s){return"movementY"in s?s.movementY:ul}}),Xc=xn(Fo),Xf=h({},Fo,{dataTransfer:0}),Qf=xn(Xf),Zf=h({},Vi,{relatedTarget:0}),Ho=xn(Zf),Jf=h({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),Qc=xn(Jf),eh=h({},bs,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Zs=xn(eh),Zc=h({},bs,{data:0}),dl=xn(Zc),Jc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eu={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"},tu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function he(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=tu[s])?!!i[s]:!1}function _t(){return he}var Bt=h({},Vi,{key:function(s){if(s.key){var i=Jc[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=Po(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?eu[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_t,charCode:function(s){return s.type==="keypress"?Po(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Po(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),bt=xn(Bt),rn=h({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xt=xn(rn),Ct=h({},Vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_t}),Wi=xn(Ct),fl=h({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gi=xn(fl),nu=h({},Fo,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),TE=xn(nu),NE=h({},bs,{newState:0,oldState:0}),DE=xn(NE),ME=[9,13,27,32],th=Ur&&"CompositionEvent"in window,hl=null;Ur&&"documentMode"in document&&(hl=document.documentMode);var jE=Ur&&"TextEvent"in window&&!hl,$v=Ur&&(!th||hl&&8<hl&&11>=hl),Vv=" ",qv=!1;function Wv(s,i){switch(s){case"keyup":return ME.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Uo=!1;function OE(s,i){switch(s){case"compositionend":return Gv(i);case"keypress":return i.which!==32?null:(qv=!0,Vv);case"textInput":return s=i.data,s===Vv&&qv?null:s;default:return null}}function LE(s,i){if(Uo)return s==="compositionend"||!th&&Wv(s,i)?(s=Kc(),Io=ll=$r=null,Uo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return $v&&i.locale!=="ko"?null:i.data;default:return null}}var IE={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 Kv(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!IE[s.type]:i==="textarea"}function Yv(s,i,f,g){kr?_s?_s.push(g):_s=[g]:kr=g,i=qu(i,"onChange"),0<i.length&&(f=new Bo("onChange","change",null,f,g),s.push({event:f,listeners:i}))}var pl=null,ml=null;function PE(s){Dy(s,0)}function ru(s){var i=Wn(s);if(nl(i))return s}function Xv(s,i){if(s==="change")return i}var Qv=!1;if(Ur){var nh;if(Ur){var rh="oninput"in document;if(!rh){var Zv=document.createElement("div");Zv.setAttribute("oninput","return;"),rh=typeof Zv.oninput=="function"}nh=rh}else nh=!1;Qv=nh&&(!document.documentMode||9<document.documentMode)}function Jv(){pl&&(pl.detachEvent("onpropertychange",e1),ml=pl=null)}function e1(s){if(s.propertyName==="value"&&ru(ml)){var i=[];Yv(i,ml,s,il(s)),ol(PE,i)}}function zE(s,i,f){s==="focusin"?(Jv(),pl=i,ml=f,pl.attachEvent("onpropertychange",e1)):s==="focusout"&&Jv()}function BE(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return ru(ml)}function FE(s,i){if(s==="click")return ru(i)}function HE(s,i){if(s==="input"||s==="change")return ru(i)}function UE(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var ar=typeof Object.is=="function"?Object.is:UE;function gl(s,i){if(ar(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var f=Object.keys(s),g=Object.keys(i);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var E=f[g];if(!ye.call(i,E)||!ar(s[E],i[E]))return!1}return!0}function t1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function n1(s,i){var f=t1(s);s=0;for(var g;f;){if(f.nodeType===3){if(g=s+f.textContent.length,s<=i&&g>=i)return{node:f,offset:i-s};s=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=t1(f)}}function r1(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?r1(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function s1(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=Ys(s.document);i instanceof s.HTMLIFrameElement;){try{var f=typeof i.contentWindow.location.href=="string"}catch{f=!1}if(f)s=i.contentWindow;else break;i=Ys(s.document)}return i}function sh(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var $E=Ur&&"documentMode"in document&&11>=document.documentMode,$o=null,ih=null,vl=null,oh=!1;function i1(s,i,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;oh||$o==null||$o!==Ys(g)||(g=$o,"selectionStart"in g&&sh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),vl&&gl(vl,g)||(vl=g,g=qu(ih,"onSelect"),0<g.length&&(i=new Bo("onSelect","select",null,i,f),s.push({event:i,listeners:g}),i.target=$o)))}function Ki(s,i){var f={};return f[s.toLowerCase()]=i.toLowerCase(),f["Webkit"+s]="webkit"+i,f["Moz"+s]="moz"+i,f}var Vo={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionrun:Ki("Transition","TransitionRun"),transitionstart:Ki("Transition","TransitionStart"),transitioncancel:Ki("Transition","TransitionCancel"),transitionend:Ki("Transition","TransitionEnd")},ah={},o1={};Ur&&(o1=document.createElement("div").style,"AnimationEvent"in window||(delete Vo.animationend.animation,delete Vo.animationiteration.animation,delete Vo.animationstart.animation),"TransitionEvent"in window||delete Vo.transitionend.transition);function Yi(s){if(ah[s])return ah[s];if(!Vo[s])return s;var i=Vo[s],f;for(f in i)if(i.hasOwnProperty(f)&&f in o1)return ah[s]=i[f];return s}var a1=Yi("animationend"),l1=Yi("animationiteration"),c1=Yi("animationstart"),VE=Yi("transitionrun"),qE=Yi("transitionstart"),WE=Yi("transitioncancel"),u1=Yi("transitionend"),d1=new Map,lh="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(" ");lh.push("scrollEnd");function Vr(s,i){d1.set(s,i),Dn(i,[s])}var su=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Er=[],qo=0,ch=0;function iu(){for(var s=qo,i=ch=qo=0;i<s;){var f=Er[i];Er[i++]=null;var g=Er[i];Er[i++]=null;var E=Er[i];Er[i++]=null;var D=Er[i];if(Er[i++]=null,g!==null&&E!==null){var U=g.pending;U===null?E.next=E:(E.next=U.next,U.next=E),g.pending=E}D!==0&&f1(f,E,D)}}function ou(s,i,f,g){Er[qo++]=s,Er[qo++]=i,Er[qo++]=f,Er[qo++]=g,ch|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function uh(s,i,f,g){return ou(s,i,f,g),au(s)}function Xi(s,i){return ou(s,null,null,i),au(s)}function f1(s,i,f){s.lanes|=f;var g=s.alternate;g!==null&&(g.lanes|=f);for(var E=!1,D=s.return;D!==null;)D.childLanes|=f,g=D.alternate,g!==null&&(g.childLanes|=f),D.tag===22&&(s=D.stateNode,s===null||s._visibility&1||(E=!0)),s=D,D=D.return;return s.tag===3?(D=s.stateNode,E&&i!==null&&(E=31-Xe(f),s=D.hiddenUpdates,g=s[E],g===null?s[E]=[i]:g.push(i),i.lane=f|536870912),D):null}function au(s){if(50<Bl)throw Bl=0,_p=null,Error(r(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var Wo={};function GE(s,i,f,g){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lr(s,i,f,g){return new GE(s,i,f,g)}function dh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function xs(s,i){var f=s.alternate;return f===null?(f=lr(s.tag,i,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=i,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&65011712,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,i=s.dependencies,f.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f.refCleanup=s.refCleanup,f}function h1(s,i){s.flags&=65011714;var f=s.alternate;return f===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=f.childLanes,s.lanes=f.lanes,s.child=f.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=f.memoizedProps,s.memoizedState=f.memoizedState,s.updateQueue=f.updateQueue,s.type=f.type,i=f.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function lu(s,i,f,g,E,D){var U=0;if(g=s,typeof s=="function")dh(s)&&(U=1);else if(typeof s=="string")U=Z3(s,f,Z.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case j:return s=lr(31,f,i,E),s.elementType=j,s.lanes=D,s;case w:return Qi(f.children,E,D,i);case y:U=8,E|=24;break;case S:return s=lr(12,f,i,E|2),s.elementType=S,s.lanes=D,s;case T:return s=lr(13,f,i,E),s.elementType=T,s.lanes=D,s;case R:return s=lr(19,f,i,E),s.elementType=R,s.lanes=D,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case b:U=10;break e;case _:U=9;break e;case k:U=11;break e;case M:U=14;break e;case A:U=16,g=null;break e}U=29,f=Error(r(130,s===null?"null":typeof s,"")),g=null}return i=lr(U,f,i,E),i.elementType=s,i.type=g,i.lanes=D,i}function Qi(s,i,f,g){return s=lr(7,s,g,i),s.lanes=f,s}function fh(s,i,f){return s=lr(6,s,null,i),s.lanes=f,s}function p1(s){var i=lr(18,null,null,0);return i.stateNode=s,i}function hh(s,i,f){return i=lr(4,s.children!==null?s.children:[],s.key,i),i.lanes=f,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var m1=new WeakMap;function Ar(s,i){if(typeof s=="object"&&s!==null){var f=m1.get(s);return f!==void 0?f:(i={value:s,source:i,stack:Te(i)},m1.set(s,i),i)}return{value:s,source:i,stack:Te(i)}}var Go=[],Ko=0,cu=null,yl=0,Rr=[],Tr=0,Js=null,ns=1,rs="";function Ss(s,i){Go[Ko++]=yl,Go[Ko++]=cu,cu=s,yl=i}function g1(s,i,f){Rr[Tr++]=ns,Rr[Tr++]=rs,Rr[Tr++]=Js,Js=s;var g=ns;s=rs;var E=32-Xe(g)-1;g&=~(1<<E),f+=1;var D=32-Xe(i)+E;if(30<D){var U=E-E%5;D=(g&(1<<U)-1).toString(32),g>>=U,E-=U,ns=1<<32-Xe(i)+E|f<<E|g,rs=D+s}else ns=1<<D|f<<E|g,rs=s}function ph(s){s.return!==null&&(Ss(s,1),g1(s,1,0))}function mh(s){for(;s===cu;)cu=Go[--Ko],Go[Ko]=null,yl=Go[--Ko],Go[Ko]=null;for(;s===Js;)Js=Rr[--Tr],Rr[Tr]=null,rs=Rr[--Tr],Rr[Tr]=null,ns=Rr[--Tr],Rr[Tr]=null}function v1(s,i){Rr[Tr++]=ns,Rr[Tr++]=rs,Rr[Tr++]=Js,ns=i.id,rs=i.overflow,Js=s}var Sn=null,Ft=null,mt=!1,ei=null,Nr=!1,gh=Error(r(519));function ti(s){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _l(Ar(i,s)),gh}function y1(s){var i=s.stateNode,f=s.type,g=s.memoizedProps;switch(i[Rt]=s,i[en]=g,f){case"dialog":dt("cancel",i),dt("close",i);break;case"iframe":case"object":case"embed":dt("load",i);break;case"video":case"audio":for(f=0;f<Hl.length;f++)dt(Hl[f],i);break;case"source":dt("error",i);break;case"img":case"image":case"link":dt("error",i),dt("load",i);break;case"details":dt("toggle",i);break;case"input":dt("invalid",i),nn(i,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":dt("invalid",i);break;case"textarea":dt("invalid",i),Wc(i,g.value,g.defaultValue,g.children)}f=g.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||i.textContent===""+f||g.suppressHydrationWarning===!0||Ly(i.textContent,f)?(g.popover!=null&&(dt("beforetoggle",i),dt("toggle",i)),g.onScroll!=null&&dt("scroll",i),g.onScrollEnd!=null&&dt("scrollend",i),g.onClick!=null&&(i.onclick=Hr),i=!0):i=!1,i||ti(s,!0)}function _1(s){for(Sn=s.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Nr=!1;return;case 27:case 3:Nr=!0;return;default:Sn=Sn.return}}function Yo(s){if(s!==Sn)return!1;if(!mt)return _1(s),mt=!0,!1;var i=s.tag,f;if((f=i!==3&&i!==27)&&((f=i===5)&&(f=s.type,f=!(f!=="form"&&f!=="button")||Op(s.type,s.memoizedProps)),f=!f),f&&Ft&&ti(s),_1(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Ft=Vy(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Ft=Vy(s)}else i===27?(i=Ft,mi(s.type)?(s=Bp,Bp=null,Ft=s):Ft=i):Ft=Sn?Mr(s.stateNode.nextSibling):null;return!0}function Zi(){Ft=Sn=null,mt=!1}function vh(){var s=ei;return s!==null&&(Jn===null?Jn=s:Jn.push.apply(Jn,s),ei=null),s}function _l(s){ei===null?ei=[s]:ei.push(s)}var yh=P(null),Ji=null,ws=null;function ni(s,i,f){B(yh,i._currentValue),i._currentValue=f}function Cs(s){s._currentValue=yh.current,H(yh)}function _h(s,i,f){for(;s!==null;){var g=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,g!==null&&(g.childLanes|=i)):g!==null&&(g.childLanes&i)!==i&&(g.childLanes|=i),s===f)break;s=s.return}}function bh(s,i,f,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var D=E.dependencies;if(D!==null){var U=E.child;D=D.firstContext;e:for(;D!==null;){var Q=D;D=E;for(var ne=0;ne<i.length;ne++)if(Q.context===i[ne]){D.lanes|=f,Q=D.alternate,Q!==null&&(Q.lanes|=f),_h(D.return,f,s),g||(U=null);break e}D=Q.next}}else if(E.tag===18){if(U=E.return,U===null)throw Error(r(341));U.lanes|=f,D=U.alternate,D!==null&&(D.lanes|=f),_h(U,f,s),U=null}else U=E.child;if(U!==null)U.return=E;else for(U=E;U!==null;){if(U===s){U=null;break}if(E=U.sibling,E!==null){E.return=U.return,U=E;break}U=U.return}E=U}}function Xo(s,i,f,g){s=null;for(var E=i,D=!1;E!==null;){if(!D){if((E.flags&524288)!==0)D=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var U=E.alternate;if(U===null)throw Error(r(387));if(U=U.memoizedProps,U!==null){var Q=E.type;ar(E.pendingProps.value,U.value)||(s!==null?s.push(Q):s=[Q])}}else if(E===K.current){if(U=E.alternate,U===null)throw Error(r(387));U.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(Wl):s=[Wl])}E=E.return}s!==null&&bh(i,s,f,g),i.flags|=262144}function uu(s){for(s=s.firstContext;s!==null;){if(!ar(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function eo(s){Ji=s,ws=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function wn(s){return b1(Ji,s)}function du(s,i){return Ji===null&&eo(s),b1(s,i)}function b1(s,i){var f=i._currentValue;if(i={context:i,memoizedValue:f,next:null},ws===null){if(s===null)throw Error(r(308));ws=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else ws=ws.next=i;return f}var KE=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(f,g){s.push(g)}};this.abort=function(){i.aborted=!0,s.forEach(function(f){return f()})}},YE=t.unstable_scheduleCallback,XE=t.unstable_NormalPriority,an={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xh(){return{controller:new KE,data:new Map,refCount:0}}function bl(s){s.refCount--,s.refCount===0&&YE(XE,function(){s.controller.abort()})}var xl=null,Sh=0,Qo=0,Zo=null;function QE(s,i){if(xl===null){var f=xl=[];Sh=0,Qo=kp(),Zo={status:"pending",value:void 0,then:function(g){f.push(g)}}}return Sh++,i.then(x1,x1),i}function x1(){if(--Sh===0&&xl!==null){Zo!==null&&(Zo.status="fulfilled");var s=xl;xl=null,Qo=0,Zo=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function ZE(s,i){var f=[],g={status:"pending",value:null,reason:null,then:function(E){f.push(E)}};return s.then(function(){g.status="fulfilled",g.value=i;for(var E=0;E<f.length;E++)(0,f[E])(i)},function(E){for(g.status="rejected",g.reason=E,E=0;E<f.length;E++)(0,f[E])(void 0)}),g}var S1=q.S;q.S=function(s,i){iy=Ae(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&QE(s,i),S1!==null&&S1(s,i)};var to=P(null);function wh(){var s=to.current;return s!==null?s:jt.pooledCache}function fu(s,i){i===null?B(to,to.current):B(to,i.pool)}function w1(){var s=wh();return s===null?null:{parent:an._currentValue,pool:s}}var Jo=Error(r(460)),Ch=Error(r(474)),hu=Error(r(542)),pu={then:function(){}};function C1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function k1(s,i,f){switch(f=s[f],f===void 0?s.push(i):f!==i&&(i.then(Hr,Hr),i=f),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,A1(s),s;default:if(typeof i.status=="string")i.then(Hr,Hr);else{if(s=jt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=i,s.status="pending",s.then(function(g){if(i.status==="pending"){var E=i;E.status="fulfilled",E.value=g}},function(g){if(i.status==="pending"){var E=i;E.status="rejected",E.reason=g}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,A1(s),s}throw ro=i,Jo}}function no(s){try{var i=s._init;return i(s._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ro=f,Jo):f}}var ro=null;function E1(){if(ro===null)throw Error(r(459));var s=ro;return ro=null,s}function A1(s){if(s===Jo||s===hu)throw Error(r(483))}var ea=null,Sl=0;function mu(s){var i=Sl;return Sl+=1,ea===null&&(ea=[]),k1(ea,s,i)}function wl(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function gu(s,i){throw i.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(i),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function R1(s){function i(le,ie){if(s){var ue=le.deletions;ue===null?(le.deletions=[ie],le.flags|=16):ue.push(ie)}}function f(le,ie){if(!s)return null;for(;ie!==null;)i(le,ie),ie=ie.sibling;return null}function g(le){for(var ie=new Map;le!==null;)le.key!==null?ie.set(le.key,le):ie.set(le.index,le),le=le.sibling;return ie}function E(le,ie){return le=xs(le,ie),le.index=0,le.sibling=null,le}function D(le,ie,ue){return le.index=ue,s?(ue=le.alternate,ue!==null?(ue=ue.index,ue<ie?(le.flags|=67108866,ie):ue):(le.flags|=67108866,ie)):(le.flags|=1048576,ie)}function U(le){return s&&le.alternate===null&&(le.flags|=67108866),le}function Q(le,ie,ue,xe){return ie===null||ie.tag!==6?(ie=fh(ue,le.mode,xe),ie.return=le,ie):(ie=E(ie,ue),ie.return=le,ie)}function ne(le,ie,ue,xe){var Ze=ue.type;return Ze===w?be(le,ie,ue.props.children,xe,ue.key):ie!==null&&(ie.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===A&&no(Ze)===ie.type)?(ie=E(ie,ue.props),wl(ie,ue),ie.return=le,ie):(ie=lu(ue.type,ue.key,ue.props,null,le.mode,xe),wl(ie,ue),ie.return=le,ie)}function de(le,ie,ue,xe){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ue.containerInfo||ie.stateNode.implementation!==ue.implementation?(ie=hh(ue,le.mode,xe),ie.return=le,ie):(ie=E(ie,ue.children||[]),ie.return=le,ie)}function be(le,ie,ue,xe,Ze){return ie===null||ie.tag!==7?(ie=Qi(ue,le.mode,xe,Ze),ie.return=le,ie):(ie=E(ie,ue),ie.return=le,ie)}function Se(le,ie,ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=fh(""+ie,le.mode,ue),ie.return=le,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ue=lu(ie.type,ie.key,ie.props,null,le.mode,ue),wl(ue,ie),ue.return=le,ue;case C:return ie=hh(ie,le.mode,ue),ie.return=le,ie;case A:return ie=no(ie),Se(le,ie,ue)}if(G(ie)||V(ie))return ie=Qi(ie,le.mode,ue,null),ie.return=le,ie;if(typeof ie.then=="function")return Se(le,mu(ie),ue);if(ie.$$typeof===b)return Se(le,du(le,ie),ue);gu(le,ie)}return null}function pe(le,ie,ue,xe){var Ze=ie!==null?ie.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ze!==null?null:Q(le,ie,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ue.key===Ze?ne(le,ie,ue,xe):null;case C:return ue.key===Ze?de(le,ie,ue,xe):null;case A:return ue=no(ue),pe(le,ie,ue,xe)}if(G(ue)||V(ue))return Ze!==null?null:be(le,ie,ue,xe,null);if(typeof ue.then=="function")return pe(le,ie,mu(ue),xe);if(ue.$$typeof===b)return pe(le,ie,du(le,ue),xe);gu(le,ue)}return null}function ge(le,ie,ue,xe,Ze){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return le=le.get(ue)||null,Q(ie,le,""+xe,Ze);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case x:return le=le.get(xe.key===null?ue:xe.key)||null,ne(ie,le,xe,Ze);case C:return le=le.get(xe.key===null?ue:xe.key)||null,de(ie,le,xe,Ze);case A:return xe=no(xe),ge(le,ie,ue,xe,Ze)}if(G(xe)||V(xe))return le=le.get(ue)||null,be(ie,le,xe,Ze,null);if(typeof xe.then=="function")return ge(le,ie,ue,mu(xe),Ze);if(xe.$$typeof===b)return ge(le,ie,ue,du(ie,xe),Ze);gu(ie,xe)}return null}function $e(le,ie,ue,xe){for(var Ze=null,St=null,Ge=ie,it=ie=0,pt=null;Ge!==null&&it<ue.length;it++){Ge.index>it?(pt=Ge,Ge=null):pt=Ge.sibling;var wt=pe(le,Ge,ue[it],xe);if(wt===null){Ge===null&&(Ge=pt);break}s&&Ge&&wt.alternate===null&&i(le,Ge),ie=D(wt,ie,it),St===null?Ze=wt:St.sibling=wt,St=wt,Ge=pt}if(it===ue.length)return f(le,Ge),mt&&Ss(le,it),Ze;if(Ge===null){for(;it<ue.length;it++)Ge=Se(le,ue[it],xe),Ge!==null&&(ie=D(Ge,ie,it),St===null?Ze=Ge:St.sibling=Ge,St=Ge);return mt&&Ss(le,it),Ze}for(Ge=g(Ge);it<ue.length;it++)pt=ge(Ge,le,it,ue[it],xe),pt!==null&&(s&&pt.alternate!==null&&Ge.delete(pt.key===null?it:pt.key),ie=D(pt,ie,it),St===null?Ze=pt:St.sibling=pt,St=pt);return s&&Ge.forEach(function(bi){return i(le,bi)}),mt&&Ss(le,it),Ze}function tt(le,ie,ue,xe){if(ue==null)throw Error(r(151));for(var Ze=null,St=null,Ge=ie,it=ie=0,pt=null,wt=ue.next();Ge!==null&&!wt.done;it++,wt=ue.next()){Ge.index>it?(pt=Ge,Ge=null):pt=Ge.sibling;var bi=pe(le,Ge,wt.value,xe);if(bi===null){Ge===null&&(Ge=pt);break}s&&Ge&&bi.alternate===null&&i(le,Ge),ie=D(bi,ie,it),St===null?Ze=bi:St.sibling=bi,St=bi,Ge=pt}if(wt.done)return f(le,Ge),mt&&Ss(le,it),Ze;if(Ge===null){for(;!wt.done;it++,wt=ue.next())wt=Se(le,wt.value,xe),wt!==null&&(ie=D(wt,ie,it),St===null?Ze=wt:St.sibling=wt,St=wt);return mt&&Ss(le,it),Ze}for(Ge=g(Ge);!wt.done;it++,wt=ue.next())wt=ge(Ge,le,it,wt.value,xe),wt!==null&&(s&&wt.alternate!==null&&Ge.delete(wt.key===null?it:wt.key),ie=D(wt,ie,it),St===null?Ze=wt:St.sibling=wt,St=wt);return s&&Ge.forEach(function(c4){return i(le,c4)}),mt&&Ss(le,it),Ze}function Mt(le,ie,ue,xe){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:e:{for(var Ze=ue.key;ie!==null;){if(ie.key===Ze){if(Ze=ue.type,Ze===w){if(ie.tag===7){f(le,ie.sibling),xe=E(ie,ue.props.children),xe.return=le,le=xe;break e}}else if(ie.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===A&&no(Ze)===ie.type){f(le,ie.sibling),xe=E(ie,ue.props),wl(xe,ue),xe.return=le,le=xe;break e}f(le,ie);break}else i(le,ie);ie=ie.sibling}ue.type===w?(xe=Qi(ue.props.children,le.mode,xe,ue.key),xe.return=le,le=xe):(xe=lu(ue.type,ue.key,ue.props,null,le.mode,xe),wl(xe,ue),xe.return=le,le=xe)}return U(le);case C:e:{for(Ze=ue.key;ie!==null;){if(ie.key===Ze)if(ie.tag===4&&ie.stateNode.containerInfo===ue.containerInfo&&ie.stateNode.implementation===ue.implementation){f(le,ie.sibling),xe=E(ie,ue.children||[]),xe.return=le,le=xe;break e}else{f(le,ie);break}else i(le,ie);ie=ie.sibling}xe=hh(ue,le.mode,xe),xe.return=le,le=xe}return U(le);case A:return ue=no(ue),Mt(le,ie,ue,xe)}if(G(ue))return $e(le,ie,ue,xe);if(V(ue)){if(Ze=V(ue),typeof Ze!="function")throw Error(r(150));return ue=Ze.call(ue),tt(le,ie,ue,xe)}if(typeof ue.then=="function")return Mt(le,ie,mu(ue),xe);if(ue.$$typeof===b)return Mt(le,ie,du(le,ue),xe);gu(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ie!==null&&ie.tag===6?(f(le,ie.sibling),xe=E(ie,ue),xe.return=le,le=xe):(f(le,ie),xe=fh(ue,le.mode,xe),xe.return=le,le=xe),U(le)):f(le,ie)}return function(le,ie,ue,xe){try{Sl=0;var Ze=Mt(le,ie,ue,xe);return ea=null,Ze}catch(Ge){if(Ge===Jo||Ge===hu)throw Ge;var St=lr(29,Ge,null,le.mode);return St.lanes=xe,St.return=le,St}finally{}}}var so=R1(!0),T1=R1(!1),ri=!1;function kh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eh(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function si(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ii(s,i,f){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(kt&2)!==0){var E=g.pending;return E===null?i.next=i:(i.next=E.next,E.next=i),g.pending=i,i=au(s),f1(s,null,f),i}return ou(s,g,i,f),au(s)}function Cl(s,i,f){if(i=i.updateQueue,i!==null&&(i=i.shared,(f&4194048)!==0)){var g=i.lanes;g&=s.pendingLanes,f|=g,i.lanes=f,qn(s,f)}}function Ah(s,i){var f=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var E=null,D=null;if(f=f.firstBaseUpdate,f!==null){do{var U={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};D===null?E=D=U:D=D.next=U,f=f.next}while(f!==null);D===null?E=D=i:D=D.next=i}else E=D=i;f={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:D,shared:g.shared,callbacks:g.callbacks},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=i:s.next=i,f.lastBaseUpdate=i}var Rh=!1;function kl(){if(Rh){var s=Zo;if(s!==null)throw s}}function El(s,i,f,g){Rh=!1;var E=s.updateQueue;ri=!1;var D=E.firstBaseUpdate,U=E.lastBaseUpdate,Q=E.shared.pending;if(Q!==null){E.shared.pending=null;var ne=Q,de=ne.next;ne.next=null,U===null?D=de:U.next=de,U=ne;var be=s.alternate;be!==null&&(be=be.updateQueue,Q=be.lastBaseUpdate,Q!==U&&(Q===null?be.firstBaseUpdate=de:Q.next=de,be.lastBaseUpdate=ne))}if(D!==null){var Se=E.baseState;U=0,be=de=ne=null,Q=D;do{var pe=Q.lane&-536870913,ge=pe!==Q.lane;if(ge?(ht&pe)===pe:(g&pe)===pe){pe!==0&&pe===Qo&&(Rh=!0),be!==null&&(be=be.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var $e=s,tt=Q;pe=i;var Mt=f;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){Se=$e.call(Mt,Se,pe);break e}Se=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,pe=typeof $e=="function"?$e.call(Mt,Se,pe):$e,pe==null)break e;Se=h({},Se,pe);break e;case 2:ri=!0}}pe=Q.callback,pe!==null&&(s.flags|=64,ge&&(s.flags|=8192),ge=E.callbacks,ge===null?E.callbacks=[pe]:ge.push(pe))}else ge={lane:pe,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},be===null?(de=be=ge,ne=Se):be=be.next=ge,U|=pe;if(Q=Q.next,Q===null){if(Q=E.shared.pending,Q===null)break;ge=Q,Q=ge.next,ge.next=null,E.lastBaseUpdate=ge,E.shared.pending=null}}while(!0);be===null&&(ne=Se),E.baseState=ne,E.firstBaseUpdate=de,E.lastBaseUpdate=be,D===null&&(E.shared.lanes=0),ui|=U,s.lanes=U,s.memoizedState=Se}}function N1(s,i){if(typeof s!="function")throw Error(r(191,s));s.call(i)}function D1(s,i){var f=s.callbacks;if(f!==null)for(s.callbacks=null,s=0;s<f.length;s++)N1(f[s],i)}var ta=P(null),vu=P(0);function M1(s,i){s=js,B(vu,s),B(ta,i),js=s|i.baseLanes}function Th(){B(vu,js),B(ta,ta.current)}function Nh(){js=vu.current,H(ta),H(vu)}var cr=P(null),Dr=null;function oi(s){var i=s.alternate;B(sn,sn.current&1),B(cr,s),Dr===null&&(i===null||ta.current!==null||i.memoizedState!==null)&&(Dr=s)}function Dh(s){B(sn,sn.current),B(cr,s),Dr===null&&(Dr=s)}function j1(s){s.tag===22?(B(sn,sn.current),B(cr,s),Dr===null&&(Dr=s)):ai()}function ai(){B(sn,sn.current),B(cr,cr.current)}function ur(s){H(cr),Dr===s&&(Dr=null),H(sn)}var sn=P(0);function yu(s){for(var i=s;i!==null;){if(i.tag===13){var f=i.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Pp(f)||zp(f)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ks=0,st=null,Nt=null,ln=null,_u=!1,na=!1,io=!1,bu=0,Al=0,ra=null,JE=0;function Yt(){throw Error(r(321))}function Mh(s,i){if(i===null)return!1;for(var f=0;f<i.length&&f<s.length;f++)if(!ar(s[f],i[f]))return!1;return!0}function jh(s,i,f,g,E,D){return ks=D,st=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=s===null||s.memoizedState===null?g0:Kh,io=!1,D=f(g,E),io=!1,na&&(D=L1(i,f,g,E)),O1(s),D}function O1(s){q.H=Nl;var i=Nt!==null&&Nt.next!==null;if(ks=0,ln=Nt=st=null,_u=!1,Al=0,ra=null,i)throw Error(r(300));s===null||cn||(s=s.dependencies,s!==null&&uu(s)&&(cn=!0))}function L1(s,i,f,g){st=s;var E=0;do{if(na&&(ra=null),Al=0,na=!1,25<=E)throw Error(r(301));if(E+=1,ln=Nt=null,s.updateQueue!=null){var D=s.updateQueue;D.lastEffect=null,D.events=null,D.stores=null,D.memoCache!=null&&(D.memoCache.index=0)}q.H=v0,D=i(f,g)}while(na);return D}function e3(){var s=q.H,i=s.useState()[0];return i=typeof i.then=="function"?Rl(i):i,s=s.useState()[0],(Nt!==null?Nt.memoizedState:null)!==s&&(st.flags|=1024),i}function Oh(){var s=bu!==0;return bu=0,s}function Lh(s,i,f){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~f}function Ih(s){if(_u){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}_u=!1}ks=0,ln=Nt=st=null,na=!1,Al=bu=0,ra=null}function Hn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?st.memoizedState=ln=s:ln=ln.next=s,ln}function on(){if(Nt===null){var s=st.alternate;s=s!==null?s.memoizedState:null}else s=Nt.next;var i=ln===null?st.memoizedState:ln.next;if(i!==null)ln=i,Nt=s;else{if(s===null)throw st.alternate===null?Error(r(467)):Error(r(310));Nt=s,s={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},ln===null?st.memoizedState=ln=s:ln=ln.next=s}return ln}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rl(s){var i=Al;return Al+=1,ra===null&&(ra=[]),s=k1(ra,s,i),i=st,(ln===null?i.memoizedState:ln.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?g0:Kh),s}function Su(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Rl(s);if(s.$$typeof===b)return wn(s)}throw Error(r(438,String(s)))}function Ph(s){var i=null,f=st.updateQueue;if(f!==null&&(i=f.memoCache),i==null){var g=st.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(i={data:g.data.map(function(E){return E.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),f===null&&(f=xu(),st.updateQueue=f),f.memoCache=i,f=i.data[i.index],f===void 0)for(f=i.data[i.index]=Array(s),g=0;g<s;g++)f[g]=O;return i.index++,f}function Es(s,i){return typeof i=="function"?i(s):i}function wu(s){var i=on();return zh(i,Nt,s)}function zh(s,i,f){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=f;var E=s.baseQueue,D=g.pending;if(D!==null){if(E!==null){var U=E.next;E.next=D.next,D.next=U}i.baseQueue=E=D,g.pending=null}if(D=s.baseState,E===null)s.memoizedState=D;else{i=E.next;var Q=U=null,ne=null,de=i,be=!1;do{var Se=de.lane&-536870913;if(Se!==de.lane?(ht&Se)===Se:(ks&Se)===Se){var pe=de.revertLane;if(pe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),Se===Qo&&(be=!0);else if((ks&pe)===pe){de=de.next,pe===Qo&&(be=!0);continue}else Se={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ne===null?(Q=ne=Se,U=D):ne=ne.next=Se,st.lanes|=pe,ui|=pe;Se=de.action,io&&f(D,Se),D=de.hasEagerState?de.eagerState:f(D,Se)}else pe={lane:Se,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ne===null?(Q=ne=pe,U=D):ne=ne.next=pe,st.lanes|=Se,ui|=Se;de=de.next}while(de!==null&&de!==i);if(ne===null?U=D:ne.next=Q,!ar(D,s.memoizedState)&&(cn=!0,be&&(f=Zo,f!==null)))throw f;s.memoizedState=D,s.baseState=U,s.baseQueue=ne,g.lastRenderedState=D}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Bh(s){var i=on(),f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var g=f.dispatch,E=f.pending,D=i.memoizedState;if(E!==null){f.pending=null;var U=E=E.next;do D=s(D,U.action),U=U.next;while(U!==E);ar(D,i.memoizedState)||(cn=!0),i.memoizedState=D,i.baseQueue===null&&(i.baseState=D),f.lastRenderedState=D}return[D,g]}function I1(s,i,f){var g=st,E=on(),D=mt;if(D){if(f===void 0)throw Error(r(407));f=f()}else f=i();var U=!ar((Nt||E).memoizedState,f);if(U&&(E.memoizedState=f,cn=!0),E=E.queue,Uh(B1.bind(null,g,E,s),[s]),E.getSnapshot!==i||U||ln!==null&&ln.memoizedState.tag&1){if(g.flags|=2048,sa(9,{destroy:void 0},z1.bind(null,g,E,f,i),null),jt===null)throw Error(r(349));D||(ks&127)!==0||P1(g,i,f)}return f}function P1(s,i,f){s.flags|=16384,s={getSnapshot:i,value:f},i=st.updateQueue,i===null?(i=xu(),st.updateQueue=i,i.stores=[s]):(f=i.stores,f===null?i.stores=[s]:f.push(s))}function z1(s,i,f,g){i.value=f,i.getSnapshot=g,F1(i)&&H1(s)}function B1(s,i,f){return f(function(){F1(i)&&H1(s)})}function F1(s){var i=s.getSnapshot;s=s.value;try{var f=i();return!ar(s,f)}catch{return!0}}function H1(s){var i=Xi(s,2);i!==null&&er(i,s,2)}function Fh(s){var i=Hn();if(typeof s=="function"){var f=s;if(s=f(),io){We(!0);try{f()}finally{We(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:s},i}function U1(s,i,f,g){return s.baseState=f,zh(s,Nt,typeof g=="function"?g:Es)}function t3(s,i,f,g,E){if(Eu(s))throw Error(r(485));if(s=i.action,s!==null){var D={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){D.listeners.push(U)}};q.T!==null?f(!0):D.isTransition=!1,g(D),f=i.pending,f===null?(D.next=i.pending=D,$1(i,D)):(D.next=f.next,i.pending=f.next=D)}}function $1(s,i){var f=i.action,g=i.payload,E=s.state;if(i.isTransition){var D=q.T,U={};q.T=U;try{var Q=f(E,g),ne=q.S;ne!==null&&ne(U,Q),V1(s,i,Q)}catch(de){Hh(s,i,de)}finally{D!==null&&U.types!==null&&(D.types=U.types),q.T=D}}else try{D=f(E,g),V1(s,i,D)}catch(de){Hh(s,i,de)}}function V1(s,i,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(g){q1(s,i,g)},function(g){return Hh(s,i,g)}):q1(s,i,f)}function q1(s,i,f){i.status="fulfilled",i.value=f,W1(i),s.state=f,i=s.pending,i!==null&&(f=i.next,f===i?s.pending=null:(f=f.next,i.next=f,$1(s,f)))}function Hh(s,i,f){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do i.status="rejected",i.reason=f,W1(i),i=i.next;while(i!==g)}s.action=null}function W1(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function G1(s,i){return i}function K1(s,i){if(mt){var f=jt.formState;if(f!==null){e:{var g=st;if(mt){if(Ft){t:{for(var E=Ft,D=Nr;E.nodeType!==8;){if(!D){E=null;break t}if(E=Mr(E.nextSibling),E===null){E=null;break t}}D=E.data,E=D==="F!"||D==="F"?E:null}if(E){Ft=Mr(E.nextSibling),g=E.data==="F!";break e}}ti(g)}g=!1}g&&(i=f[0])}}return f=Hn(),f.memoizedState=f.baseState=i,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:G1,lastRenderedState:i},f.queue=g,f=h0.bind(null,st,g),g.dispatch=f,g=Fh(!1),D=Gh.bind(null,st,!1,g.queue),g=Hn(),E={state:i,dispatch:null,action:s,pending:null},g.queue=E,f=t3.bind(null,st,E,D,f),E.dispatch=f,g.memoizedState=s,[i,f,!1]}function Y1(s){var i=on();return X1(i,Nt,s)}function X1(s,i,f){if(i=zh(s,i,G1)[0],s=wu(Es)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var g=Rl(i)}catch(U){throw U===Jo?hu:U}else g=i;i=on();var E=i.queue,D=E.dispatch;return f!==i.memoizedState&&(st.flags|=2048,sa(9,{destroy:void 0},n3.bind(null,E,f),null)),[g,D,s]}function n3(s,i){s.action=i}function Q1(s){var i=on(),f=Nt;if(f!==null)return X1(i,f,s);on(),i=i.memoizedState,f=on();var g=f.queue.dispatch;return f.memoizedState=s,[i,g,!1]}function sa(s,i,f,g){return s={tag:s,create:f,deps:g,inst:i,next:null},i=st.updateQueue,i===null&&(i=xu(),st.updateQueue=i),f=i.lastEffect,f===null?i.lastEffect=s.next=s:(g=f.next,f.next=s,s.next=g,i.lastEffect=s),s}function Z1(){return on().memoizedState}function Cu(s,i,f,g){var E=Hn();st.flags|=s,E.memoizedState=sa(1|i,{destroy:void 0},f,g===void 0?null:g)}function ku(s,i,f,g){var E=on();g=g===void 0?null:g;var D=E.memoizedState.inst;Nt!==null&&g!==null&&Mh(g,Nt.memoizedState.deps)?E.memoizedState=sa(i,D,f,g):(st.flags|=s,E.memoizedState=sa(1|i,D,f,g))}function J1(s,i){Cu(8390656,8,s,i)}function Uh(s,i){ku(2048,8,s,i)}function r3(s){st.flags|=4;var i=st.updateQueue;if(i===null)i=xu(),st.updateQueue=i,i.events=[s];else{var f=i.events;f===null?i.events=[s]:f.push(s)}}function e0(s){var i=on().memoizedState;return r3({ref:i,nextImpl:s}),function(){if((kt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function t0(s,i){return ku(4,2,s,i)}function n0(s,i){return ku(4,4,s,i)}function r0(s,i){if(typeof i=="function"){s=s();var f=i(s);return function(){typeof f=="function"?f():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function s0(s,i,f){f=f!=null?f.concat([s]):null,ku(4,4,r0.bind(null,i,s),f)}function $h(){}function i0(s,i){var f=on();i=i===void 0?null:i;var g=f.memoizedState;return i!==null&&Mh(i,g[1])?g[0]:(f.memoizedState=[s,i],s)}function o0(s,i){var f=on();i=i===void 0?null:i;var g=f.memoizedState;if(i!==null&&Mh(i,g[1]))return g[0];if(g=s(),io){We(!0);try{s()}finally{We(!1)}}return f.memoizedState=[g,i],g}function Vh(s,i,f){return f===void 0||(ks&1073741824)!==0&&(ht&261930)===0?s.memoizedState=i:(s.memoizedState=f,s=ay(),st.lanes|=s,ui|=s,f)}function a0(s,i,f,g){return ar(f,i)?f:ta.current!==null?(s=Vh(s,f,g),ar(s,i)||(cn=!0),s):(ks&42)===0||(ks&1073741824)!==0&&(ht&261930)===0?(cn=!0,s.memoizedState=f):(s=ay(),st.lanes|=s,ui|=s,i)}function l0(s,i,f,g,E){var D=X.p;X.p=D!==0&&8>D?D:8;var U=q.T,Q={};q.T=Q,Gh(s,!1,i,f);try{var ne=E(),de=q.S;if(de!==null&&de(Q,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var be=ZE(ne,g);Tl(s,i,be,hr(s))}else Tl(s,i,g,hr(s))}catch(Se){Tl(s,i,{then:function(){},status:"rejected",reason:Se},hr())}finally{X.p=D,U!==null&&Q.types!==null&&(U.types=Q.types),q.T=U}}function s3(){}function qh(s,i,f,g){if(s.tag!==5)throw Error(r(476));var E=c0(s).queue;l0(s,E,i,Y,f===null?s3:function(){return u0(s),f(g)})}function c0(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:Y},next:null};var f={};return i.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:f},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function u0(s){var i=c0(s);i.next===null&&(i=s.alternate.memoizedState),Tl(s,i.next.queue,{},hr())}function Wh(){return wn(Wl)}function d0(){return on().memoizedState}function f0(){return on().memoizedState}function i3(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var f=hr();s=si(f);var g=ii(i,s,f);g!==null&&(er(g,i,f),Cl(g,i,f)),i={cache:xh()},s.payload=i;return}i=i.return}}function o3(s,i,f){var g=hr();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Eu(s)?p0(i,f):(f=uh(s,i,f,g),f!==null&&(er(f,s,g),m0(f,i,g)))}function h0(s,i,f){var g=hr();Tl(s,i,f,g)}function Tl(s,i,f,g){var E={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Eu(s))p0(i,E);else{var D=s.alternate;if(s.lanes===0&&(D===null||D.lanes===0)&&(D=i.lastRenderedReducer,D!==null))try{var U=i.lastRenderedState,Q=D(U,f);if(E.hasEagerState=!0,E.eagerState=Q,ar(Q,U))return ou(s,i,E,0),jt===null&&iu(),!1}catch{}finally{}if(f=uh(s,i,E,g),f!==null)return er(f,s,g),m0(f,i,g),!0}return!1}function Gh(s,i,f,g){if(g={lane:2,revertLane:kp(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Eu(s)){if(i)throw Error(r(479))}else i=uh(s,f,g,2),i!==null&&er(i,s,2)}function Eu(s){var i=s.alternate;return s===st||i!==null&&i===st}function p0(s,i){na=_u=!0;var f=s.pending;f===null?i.next=i:(i.next=f.next,f.next=i),s.pending=i}function m0(s,i,f){if((f&4194048)!==0){var g=i.lanes;g&=s.pendingLanes,f|=g,i.lanes=f,qn(s,f)}}var Nl={readContext:wn,use:Su,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};Nl.useEffectEvent=Yt;var g0={readContext:wn,use:Su,useCallback:function(s,i){return Hn().memoizedState=[s,i===void 0?null:i],s},useContext:wn,useEffect:J1,useImperativeHandle:function(s,i,f){f=f!=null?f.concat([s]):null,Cu(4194308,4,r0.bind(null,i,s),f)},useLayoutEffect:function(s,i){return Cu(4194308,4,s,i)},useInsertionEffect:function(s,i){Cu(4,2,s,i)},useMemo:function(s,i){var f=Hn();i=i===void 0?null:i;var g=s();if(io){We(!0);try{s()}finally{We(!1)}}return f.memoizedState=[g,i],g},useReducer:function(s,i,f){var g=Hn();if(f!==void 0){var E=f(i);if(io){We(!0);try{f(i)}finally{We(!1)}}}else E=i;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=o3.bind(null,st,s),[g.memoizedState,s]},useRef:function(s){var i=Hn();return s={current:s},i.memoizedState=s},useState:function(s){s=Fh(s);var i=s.queue,f=h0.bind(null,st,i);return i.dispatch=f,[s.memoizedState,f]},useDebugValue:$h,useDeferredValue:function(s,i){var f=Hn();return Vh(f,s,i)},useTransition:function(){var s=Fh(!1);return s=l0.bind(null,st,s.queue,!0,!1),Hn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,f){var g=st,E=Hn();if(mt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=i(),jt===null)throw Error(r(349));(ht&127)!==0||P1(g,i,f)}E.memoizedState=f;var D={value:f,getSnapshot:i};return E.queue=D,J1(B1.bind(null,g,D,s),[s]),g.flags|=2048,sa(9,{destroy:void 0},z1.bind(null,g,D,f,i),null),f},useId:function(){var s=Hn(),i=jt.identifierPrefix;if(mt){var f=rs,g=ns;f=(g&~(1<<32-Xe(g)-1)).toString(32)+f,i="_"+i+"R_"+f,f=bu++,0<f&&(i+="H"+f.toString(32)),i+="_"}else f=JE++,i="_"+i+"r_"+f.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:Wh,useFormState:K1,useActionState:K1,useOptimistic:function(s){var i=Hn();i.memoizedState=i.baseState=s;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=f,i=Gh.bind(null,st,!0,f),f.dispatch=i,[s,i]},useMemoCache:Ph,useCacheRefresh:function(){return Hn().memoizedState=i3.bind(null,st)},useEffectEvent:function(s){var i=Hn(),f={impl:s};return i.memoizedState=f,function(){if((kt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},Kh={readContext:wn,use:Su,useCallback:i0,useContext:wn,useEffect:Uh,useImperativeHandle:s0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:o0,useReducer:wu,useRef:Z1,useState:function(){return wu(Es)},useDebugValue:$h,useDeferredValue:function(s,i){var f=on();return a0(f,Nt.memoizedState,s,i)},useTransition:function(){var s=wu(Es)[0],i=on().memoizedState;return[typeof s=="boolean"?s:Rl(s),i]},useSyncExternalStore:I1,useId:d0,useHostTransitionStatus:Wh,useFormState:Y1,useActionState:Y1,useOptimistic:function(s,i){var f=on();return U1(f,Nt,s,i)},useMemoCache:Ph,useCacheRefresh:f0};Kh.useEffectEvent=e0;var v0={readContext:wn,use:Su,useCallback:i0,useContext:wn,useEffect:Uh,useImperativeHandle:s0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:o0,useReducer:Bh,useRef:Z1,useState:function(){return Bh(Es)},useDebugValue:$h,useDeferredValue:function(s,i){var f=on();return Nt===null?Vh(f,s,i):a0(f,Nt.memoizedState,s,i)},useTransition:function(){var s=Bh(Es)[0],i=on().memoizedState;return[typeof s=="boolean"?s:Rl(s),i]},useSyncExternalStore:I1,useId:d0,useHostTransitionStatus:Wh,useFormState:Q1,useActionState:Q1,useOptimistic:function(s,i){var f=on();return Nt!==null?U1(f,Nt,s,i):(f.baseState=s,[s,f.queue.dispatch])},useMemoCache:Ph,useCacheRefresh:f0};v0.useEffectEvent=e0;function Yh(s,i,f,g){i=s.memoizedState,f=f(g,i),f=f==null?i:h({},i,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var Xh={enqueueSetState:function(s,i,f){s=s._reactInternals;var g=hr(),E=si(g);E.payload=i,f!=null&&(E.callback=f),i=ii(s,E,g),i!==null&&(er(i,s,g),Cl(i,s,g))},enqueueReplaceState:function(s,i,f){s=s._reactInternals;var g=hr(),E=si(g);E.tag=1,E.payload=i,f!=null&&(E.callback=f),i=ii(s,E,g),i!==null&&(er(i,s,g),Cl(i,s,g))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var f=hr(),g=si(f);g.tag=2,i!=null&&(g.callback=i),i=ii(s,g,f),i!==null&&(er(i,s,f),Cl(i,s,f))}};function y0(s,i,f,g,E,D,U){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,D,U):i.prototype&&i.prototype.isPureReactComponent?!gl(f,g)||!gl(E,D):!0}function _0(s,i,f,g){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(f,g),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(f,g),i.state!==s&&Xh.enqueueReplaceState(i,i.state,null)}function oo(s,i){var f=i;if("ref"in i){f={};for(var g in i)g!=="ref"&&(f[g]=i[g])}if(s=s.defaultProps){f===i&&(f=h({},f));for(var E in s)f[E]===void 0&&(f[E]=s[E])}return f}function b0(s){su(s)}function x0(s){console.error(s)}function S0(s){su(s)}function Au(s,i){try{var f=s.onUncaughtError;f(i.value,{componentStack:i.stack})}catch(g){setTimeout(function(){throw g})}}function w0(s,i,f){try{var g=s.onCaughtError;g(f.value,{componentStack:f.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Qh(s,i,f){return f=si(f),f.tag=3,f.payload={element:null},f.callback=function(){Au(s,i)},f}function C0(s){return s=si(s),s.tag=3,s}function k0(s,i,f,g){var E=f.type.getDerivedStateFromError;if(typeof E=="function"){var D=g.value;s.payload=function(){return E(D)},s.callback=function(){w0(i,f,g)}}var U=f.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(s.callback=function(){w0(i,f,g),typeof E!="function"&&(di===null?di=new Set([this]):di.add(this));var Q=g.stack;this.componentDidCatch(g.value,{componentStack:Q!==null?Q:""})})}function a3(s,i,f,g,E){if(f.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(i=f.alternate,i!==null&&Xo(i,f,E,!0),f=cr.current,f!==null){switch(f.tag){case 31:case 13:return Dr===null?Bu():f.alternate===null&&Xt===0&&(Xt=3),f.flags&=-257,f.flags|=65536,f.lanes=E,g===pu?f.flags|=16384:(i=f.updateQueue,i===null?f.updateQueue=new Set([g]):i.add(g),Sp(s,g,E)),!1;case 22:return f.flags|=65536,g===pu?f.flags|=16384:(i=f.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([g])},f.updateQueue=i):(f=i.retryQueue,f===null?i.retryQueue=new Set([g]):f.add(g)),Sp(s,g,E)),!1}throw Error(r(435,f.tag))}return Sp(s,g,E),Bu(),!1}if(mt)return i=cr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=E,g!==gh&&(s=Error(r(422),{cause:g}),_l(Ar(s,f)))):(g!==gh&&(i=Error(r(423),{cause:g}),_l(Ar(i,f))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=Ar(g,f),E=Qh(s.stateNode,g,E),Ah(s,E),Xt!==4&&(Xt=2)),!1;var D=Error(r(520),{cause:g});if(D=Ar(D,f),zl===null?zl=[D]:zl.push(D),Xt!==4&&(Xt=2),i===null)return!0;g=Ar(g,f),f=i;do{switch(f.tag){case 3:return f.flags|=65536,s=E&-E,f.lanes|=s,s=Qh(f.stateNode,g,s),Ah(f,s),!1;case 1:if(i=f.type,D=f.stateNode,(f.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||D!==null&&typeof D.componentDidCatch=="function"&&(di===null||!di.has(D))))return f.flags|=65536,E&=-E,f.lanes|=E,E=C0(E),k0(E,s,f,g),Ah(f,E),!1}f=f.return}while(f!==null);return!1}var Zh=Error(r(461)),cn=!1;function Cn(s,i,f,g){i.child=s===null?T1(i,null,f,g):so(i,s.child,f,g)}function E0(s,i,f,g,E){f=f.render;var D=i.ref;if("ref"in g){var U={};for(var Q in g)Q!=="ref"&&(U[Q]=g[Q])}else U=g;return eo(i),g=jh(s,i,f,U,D,E),Q=Oh(),s!==null&&!cn?(Lh(s,i,E),As(s,i,E)):(mt&&Q&&ph(i),i.flags|=1,Cn(s,i,g,E),i.child)}function A0(s,i,f,g,E){if(s===null){var D=f.type;return typeof D=="function"&&!dh(D)&&D.defaultProps===void 0&&f.compare===null?(i.tag=15,i.type=D,R0(s,i,D,g,E)):(s=lu(f.type,null,g,i,i.mode,E),s.ref=i.ref,s.return=i,i.child=s)}if(D=s.child,!op(s,E)){var U=D.memoizedProps;if(f=f.compare,f=f!==null?f:gl,f(U,g)&&s.ref===i.ref)return As(s,i,E)}return i.flags|=1,s=xs(D,g),s.ref=i.ref,s.return=i,i.child=s}function R0(s,i,f,g,E){if(s!==null){var D=s.memoizedProps;if(gl(D,g)&&s.ref===i.ref)if(cn=!1,i.pendingProps=g=D,op(s,E))(s.flags&131072)!==0&&(cn=!0);else return i.lanes=s.lanes,As(s,i,E)}return Jh(s,i,f,g,E)}function T0(s,i,f,g){var E=g.children,D=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((i.flags&128)!==0){if(D=D!==null?D.baseLanes|f:f,s!==null){for(g=i.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~D}else g=0,i.child=null;return N0(s,i,D,f,g)}if((f&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&fu(i,D!==null?D.cachePool:null),D!==null?M1(i,D):Th(),j1(i);else return g=i.lanes=536870912,N0(s,i,D!==null?D.baseLanes|f:f,f,g)}else D!==null?(fu(i,D.cachePool),M1(i,D),ai(),i.memoizedState=null):(s!==null&&fu(i,null),Th(),ai());return Cn(s,i,E,f),i.child}function Dl(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function N0(s,i,f,g,E){var D=wh();return D=D===null?null:{parent:an._currentValue,pool:D},i.memoizedState={baseLanes:f,cachePool:D},s!==null&&fu(i,null),Th(),j1(i),s!==null&&Xo(s,i,g,!0),i.childLanes=E,null}function Ru(s,i){return i=Nu({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function D0(s,i,f){return so(i,s.child,null,f),s=Ru(i,i.pendingProps),s.flags|=2,ur(i),i.memoizedState=null,s}function l3(s,i,f){var g=i.pendingProps,E=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(mt){if(g.mode==="hidden")return s=Ru(i,g),i.lanes=536870912,Dl(null,s);if(Dh(i),(s=Ft)?(s=$y(s,Nr),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Js!==null?{id:ns,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},f=p1(s),f.return=i,i.child=f,Sn=i,Ft=null)):s=null,s===null)throw ti(i);return i.lanes=536870912,null}return Ru(i,g)}var D=s.memoizedState;if(D!==null){var U=D.dehydrated;if(Dh(i),E)if(i.flags&256)i.flags&=-257,i=D0(s,i,f);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(r(558));else if(cn||Xo(s,i,f,!1),E=(f&s.childLanes)!==0,cn||E){if(g=jt,g!==null&&(U=zn(g,f),U!==0&&U!==D.retryLane))throw D.retryLane=U,Xi(s,U),er(g,s,U),Zh;Bu(),i=D0(s,i,f)}else s=D.treeContext,Ft=Mr(U.nextSibling),Sn=i,mt=!0,ei=null,Nr=!1,s!==null&&v1(i,s),i=Ru(i,g),i.flags|=4096;return i}return s=xs(s.child,{mode:g.mode,children:g.children}),s.ref=i.ref,i.child=s,s.return=i,s}function Tu(s,i){var f=i.ref;if(f===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(s===null||s.ref!==f)&&(i.flags|=4194816)}}function Jh(s,i,f,g,E){return eo(i),f=jh(s,i,f,g,void 0,E),g=Oh(),s!==null&&!cn?(Lh(s,i,E),As(s,i,E)):(mt&&g&&ph(i),i.flags|=1,Cn(s,i,f,E),i.child)}function M0(s,i,f,g,E,D){return eo(i),i.updateQueue=null,f=L1(i,g,f,E),O1(s),g=Oh(),s!==null&&!cn?(Lh(s,i,D),As(s,i,D)):(mt&&g&&ph(i),i.flags|=1,Cn(s,i,f,D),i.child)}function j0(s,i,f,g,E){if(eo(i),i.stateNode===null){var D=Wo,U=f.contextType;typeof U=="object"&&U!==null&&(D=wn(U)),D=new f(g,D),i.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,D.updater=Xh,i.stateNode=D,D._reactInternals=i,D=i.stateNode,D.props=g,D.state=i.memoizedState,D.refs={},kh(i),U=f.contextType,D.context=typeof U=="object"&&U!==null?wn(U):Wo,D.state=i.memoizedState,U=f.getDerivedStateFromProps,typeof U=="function"&&(Yh(i,f,U,g),D.state=i.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof D.getSnapshotBeforeUpdate=="function"||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(U=D.state,typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount(),U!==D.state&&Xh.enqueueReplaceState(D,D.state,null),El(i,g,D,E),kl(),D.state=i.memoizedState),typeof D.componentDidMount=="function"&&(i.flags|=4194308),g=!0}else if(s===null){D=i.stateNode;var Q=i.memoizedProps,ne=oo(f,Q);D.props=ne;var de=D.context,be=f.contextType;U=Wo,typeof be=="object"&&be!==null&&(U=wn(be));var Se=f.getDerivedStateFromProps;be=typeof Se=="function"||typeof D.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,be||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Q||de!==U)&&_0(i,D,g,U),ri=!1;var pe=i.memoizedState;D.state=pe,El(i,g,D,E),kl(),de=i.memoizedState,Q||pe!==de||ri?(typeof Se=="function"&&(Yh(i,f,Se,g),de=i.memoizedState),(ne=ri||y0(i,f,ne,g,pe,de,U))?(be||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(i.flags|=4194308)):(typeof D.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=g,i.memoizedState=de),D.props=g,D.state=de,D.context=U,g=ne):(typeof D.componentDidMount=="function"&&(i.flags|=4194308),g=!1)}else{D=i.stateNode,Eh(s,i),U=i.memoizedProps,be=oo(f,U),D.props=be,Se=i.pendingProps,pe=D.context,de=f.contextType,ne=Wo,typeof de=="object"&&de!==null&&(ne=wn(de)),Q=f.getDerivedStateFromProps,(de=typeof Q=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(U!==Se||pe!==ne)&&_0(i,D,g,ne),ri=!1,pe=i.memoizedState,D.state=pe,El(i,g,D,E),kl();var ge=i.memoizedState;U!==Se||pe!==ge||ri||s!==null&&s.dependencies!==null&&uu(s.dependencies)?(typeof Q=="function"&&(Yh(i,f,Q,g),ge=i.memoizedState),(be=ri||y0(i,f,be,g,pe,ge,ne)||s!==null&&s.dependencies!==null&&uu(s.dependencies))?(de||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(g,ge,ne),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(g,ge,ne)),typeof D.componentDidUpdate=="function"&&(i.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof D.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(i.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(i.flags|=1024),i.memoizedProps=g,i.memoizedState=ge),D.props=g,D.state=ge,D.context=ne,g=be):(typeof D.componentDidUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(i.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||U===s.memoizedProps&&pe===s.memoizedState||(i.flags|=1024),g=!1)}return D=g,Tu(s,i),g=(i.flags&128)!==0,D||g?(D=i.stateNode,f=g&&typeof f.getDerivedStateFromError!="function"?null:D.render(),i.flags|=1,s!==null&&g?(i.child=so(i,s.child,null,E),i.child=so(i,null,f,E)):Cn(s,i,f,E),i.memoizedState=D.state,s=i.child):s=As(s,i,E),s}function O0(s,i,f,g){return Zi(),i.flags|=256,Cn(s,i,f,g),i.child}var ep={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tp(s){return{baseLanes:s,cachePool:w1()}}function np(s,i,f){return s=s!==null?s.childLanes&~f:0,i&&(s|=fr),s}function L0(s,i,f){var g=i.pendingProps,E=!1,D=(i.flags&128)!==0,U;if((U=D)||(U=s!==null&&s.memoizedState===null?!1:(sn.current&2)!==0),U&&(E=!0,i.flags&=-129),U=(i.flags&32)!==0,i.flags&=-33,s===null){if(mt){if(E?oi(i):ai(),(s=Ft)?(s=$y(s,Nr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Js!==null?{id:ns,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},f=p1(s),f.return=i,i.child=f,Sn=i,Ft=null)):s=null,s===null)throw ti(i);return zp(s)?i.lanes=32:i.lanes=536870912,null}var Q=g.children;return g=g.fallback,E?(ai(),E=i.mode,Q=Nu({mode:"hidden",children:Q},E),g=Qi(g,E,f,null),Q.return=i,g.return=i,Q.sibling=g,i.child=Q,g=i.child,g.memoizedState=tp(f),g.childLanes=np(s,U,f),i.memoizedState=ep,Dl(null,g)):(oi(i),rp(i,Q))}var ne=s.memoizedState;if(ne!==null&&(Q=ne.dehydrated,Q!==null)){if(D)i.flags&256?(oi(i),i.flags&=-257,i=sp(s,i,f)):i.memoizedState!==null?(ai(),i.child=s.child,i.flags|=128,i=null):(ai(),Q=g.fallback,E=i.mode,g=Nu({mode:"visible",children:g.children},E),Q=Qi(Q,E,f,null),Q.flags|=2,g.return=i,Q.return=i,g.sibling=Q,i.child=g,so(i,s.child,null,f),g=i.child,g.memoizedState=tp(f),g.childLanes=np(s,U,f),i.memoizedState=ep,i=Dl(null,g));else if(oi(i),zp(Q)){if(U=Q.nextSibling&&Q.nextSibling.dataset,U)var de=U.dgst;U=de,g=Error(r(419)),g.stack="",g.digest=U,_l({value:g,source:null,stack:null}),i=sp(s,i,f)}else if(cn||Xo(s,i,f,!1),U=(f&s.childLanes)!==0,cn||U){if(U=jt,U!==null&&(g=zn(U,f),g!==0&&g!==ne.retryLane))throw ne.retryLane=g,Xi(s,g),er(U,s,g),Zh;Pp(Q)||Bu(),i=sp(s,i,f)}else Pp(Q)?(i.flags|=192,i.child=s.child,i=null):(s=ne.treeContext,Ft=Mr(Q.nextSibling),Sn=i,mt=!0,ei=null,Nr=!1,s!==null&&v1(i,s),i=rp(i,g.children),i.flags|=4096);return i}return E?(ai(),Q=g.fallback,E=i.mode,ne=s.child,de=ne.sibling,g=xs(ne,{mode:"hidden",children:g.children}),g.subtreeFlags=ne.subtreeFlags&65011712,de!==null?Q=xs(de,Q):(Q=Qi(Q,E,f,null),Q.flags|=2),Q.return=i,g.return=i,g.sibling=Q,i.child=g,Dl(null,g),g=i.child,Q=s.child.memoizedState,Q===null?Q=tp(f):(E=Q.cachePool,E!==null?(ne=an._currentValue,E=E.parent!==ne?{parent:ne,pool:ne}:E):E=w1(),Q={baseLanes:Q.baseLanes|f,cachePool:E}),g.memoizedState=Q,g.childLanes=np(s,U,f),i.memoizedState=ep,Dl(s.child,g)):(oi(i),f=s.child,s=f.sibling,f=xs(f,{mode:"visible",children:g.children}),f.return=i,f.sibling=null,s!==null&&(U=i.deletions,U===null?(i.deletions=[s],i.flags|=16):U.push(s)),i.child=f,i.memoizedState=null,f)}function rp(s,i){return i=Nu({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Nu(s,i){return s=lr(22,s,null,i),s.lanes=0,s}function sp(s,i,f){return so(i,s.child,null,f),s=rp(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function I0(s,i,f){s.lanes|=i;var g=s.alternate;g!==null&&(g.lanes|=i),_h(s.return,i,f)}function ip(s,i,f,g,E,D){var U=s.memoizedState;U===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:E,treeForkCount:D}:(U.isBackwards=i,U.rendering=null,U.renderingStartTime=0,U.last=g,U.tail=f,U.tailMode=E,U.treeForkCount=D)}function P0(s,i,f){var g=i.pendingProps,E=g.revealOrder,D=g.tail;g=g.children;var U=sn.current,Q=(U&2)!==0;if(Q?(U=U&1|2,i.flags|=128):U&=1,B(sn,U),Cn(s,i,g,f),g=mt?yl:0,!Q&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&I0(s,f,i);else if(s.tag===19)I0(s,f,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(f=i.child,E=null;f!==null;)s=f.alternate,s!==null&&yu(s)===null&&(E=f),f=f.sibling;f=E,f===null?(E=i.child,i.child=null):(E=f.sibling,f.sibling=null),ip(i,!1,E,f,D,g);break;case"backwards":case"unstable_legacy-backwards":for(f=null,E=i.child,i.child=null;E!==null;){if(s=E.alternate,s!==null&&yu(s)===null){i.child=E;break}s=E.sibling,E.sibling=f,f=E,E=s}ip(i,!0,f,null,D,g);break;case"together":ip(i,!1,null,null,void 0,g);break;default:i.memoizedState=null}return i.child}function As(s,i,f){if(s!==null&&(i.dependencies=s.dependencies),ui|=i.lanes,(f&i.childLanes)===0)if(s!==null){if(Xo(s,i,f,!1),(f&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(r(153));if(i.child!==null){for(s=i.child,f=xs(s,s.pendingProps),i.child=f,f.return=i;s.sibling!==null;)s=s.sibling,f=f.sibling=xs(s,s.pendingProps),f.return=i;f.sibling=null}return i.child}function op(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&uu(s)))}function c3(s,i,f){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),ni(i,an,s.memoizedState.cache),Zi();break;case 27:case 5:re(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:ni(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Dh(i),null;break;case 13:var g=i.memoizedState;if(g!==null)return g.dehydrated!==null?(oi(i),i.flags|=128,null):(f&i.child.childLanes)!==0?L0(s,i,f):(oi(i),s=As(s,i,f),s!==null?s.sibling:null);oi(i);break;case 19:var E=(s.flags&128)!==0;if(g=(f&i.childLanes)!==0,g||(Xo(s,i,f,!1),g=(f&i.childLanes)!==0),E){if(g)return P0(s,i,f);i.flags|=128}if(E=i.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(sn,sn.current),g)break;return null;case 22:return i.lanes=0,T0(s,i,f,i.pendingProps);case 24:ni(i,an,s.memoizedState.cache)}return As(s,i,f)}function z0(s,i,f){if(s!==null)if(s.memoizedProps!==i.pendingProps)cn=!0;else{if(!op(s,f)&&(i.flags&128)===0)return cn=!1,c3(s,i,f);cn=(s.flags&131072)!==0}else cn=!1,mt&&(i.flags&1048576)!==0&&g1(i,yl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var g=i.pendingProps;if(s=no(i.elementType),i.type=s,typeof s=="function")dh(s)?(g=oo(s,g),i.tag=1,i=j0(null,i,s,g,f)):(i.tag=0,i=Jh(null,i,s,g,f));else{if(s!=null){var E=s.$$typeof;if(E===k){i.tag=11,i=E0(null,i,s,g,f);break e}else if(E===M){i.tag=14,i=A0(null,i,s,g,f);break e}}throw i=W(s)||s,Error(r(306,i,""))}}return i;case 0:return Jh(s,i,i.type,i.pendingProps,f);case 1:return g=i.type,E=oo(g,i.pendingProps),j0(s,i,g,E,f);case 3:e:{if($(i,i.stateNode.containerInfo),s===null)throw Error(r(387));g=i.pendingProps;var D=i.memoizedState;E=D.element,Eh(s,i),El(i,g,null,f);var U=i.memoizedState;if(g=U.cache,ni(i,an,g),g!==D.cache&&bh(i,[an],f,!0),kl(),g=U.element,D.isDehydrated)if(D={element:g,isDehydrated:!1,cache:U.cache},i.updateQueue.baseState=D,i.memoizedState=D,i.flags&256){i=O0(s,i,g,f);break e}else if(g!==E){E=Ar(Error(r(424)),i),_l(E),i=O0(s,i,g,f);break e}else{switch(s=i.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Ft=Mr(s.firstChild),Sn=i,mt=!0,ei=null,Nr=!0,f=T1(i,null,g,f),i.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Zi(),g===E){i=As(s,i,f);break e}Cn(s,i,g,f)}i=i.child}return i;case 26:return Tu(s,i),s===null?(f=Yy(i.type,null,i.pendingProps,null))?i.memoizedState=f:mt||(f=i.type,s=i.pendingProps,g=Wu(ee.current).createElement(f),g[Rt]=i,g[en]=s,kn(g,f,s),Tt(g),i.stateNode=g):i.memoizedState=Yy(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return re(i),s===null&&mt&&(g=i.stateNode=Wy(i.type,i.pendingProps,ee.current),Sn=i,Nr=!0,E=Ft,mi(i.type)?(Bp=E,Ft=Mr(g.firstChild)):Ft=E),Cn(s,i,i.pendingProps.children,f),Tu(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&mt&&((E=g=Ft)&&(g=B3(g,i.type,i.pendingProps,Nr),g!==null?(i.stateNode=g,Sn=i,Ft=Mr(g.firstChild),Nr=!1,E=!0):E=!1),E||ti(i)),re(i),E=i.type,D=i.pendingProps,U=s!==null?s.memoizedProps:null,g=D.children,Op(E,D)?g=null:U!==null&&Op(E,U)&&(i.flags|=32),i.memoizedState!==null&&(E=jh(s,i,e3,null,null,f),Wl._currentValue=E),Tu(s,i),Cn(s,i,g,f),i.child;case 6:return s===null&&mt&&((s=f=Ft)&&(f=F3(f,i.pendingProps,Nr),f!==null?(i.stateNode=f,Sn=i,Ft=null,s=!0):s=!1),s||ti(i)),null;case 13:return L0(s,i,f);case 4:return $(i,i.stateNode.containerInfo),g=i.pendingProps,s===null?i.child=so(i,null,g,f):Cn(s,i,g,f),i.child;case 11:return E0(s,i,i.type,i.pendingProps,f);case 7:return Cn(s,i,i.pendingProps,f),i.child;case 8:return Cn(s,i,i.pendingProps.children,f),i.child;case 12:return Cn(s,i,i.pendingProps.children,f),i.child;case 10:return g=i.pendingProps,ni(i,i.type,g.value),Cn(s,i,g.children,f),i.child;case 9:return E=i.type._context,g=i.pendingProps.children,eo(i),E=wn(E),g=g(E),i.flags|=1,Cn(s,i,g,f),i.child;case 14:return A0(s,i,i.type,i.pendingProps,f);case 15:return R0(s,i,i.type,i.pendingProps,f);case 19:return P0(s,i,f);case 31:return l3(s,i,f);case 22:return T0(s,i,f,i.pendingProps);case 24:return eo(i),g=wn(an),s===null?(E=wh(),E===null&&(E=jt,D=xh(),E.pooledCache=D,D.refCount++,D!==null&&(E.pooledCacheLanes|=f),E=D),i.memoizedState={parent:g,cache:E},kh(i),ni(i,an,E)):((s.lanes&f)!==0&&(Eh(s,i),El(i,null,null,f),kl()),E=s.memoizedState,D=i.memoizedState,E.parent!==g?(E={parent:g,cache:g},i.memoizedState=E,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=E),ni(i,an,g)):(g=D.cache,ni(i,an,g),g!==E.cache&&bh(i,[an],f,!0))),Cn(s,i,i.pendingProps.children,f),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Rs(s){s.flags|=4}function ap(s,i,f,g,E){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(dy())s.flags|=8192;else throw ro=pu,Ch}else s.flags&=-16777217}function B0(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!e_(i))if(dy())s.flags|=8192;else throw ro=pu,Ch}function Du(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?$t():536870912,s.lanes|=i,la|=i)}function Ml(s,i){if(!mt)switch(s.tailMode){case"hidden":i=s.tail;for(var f=null;i!==null;)i.alternate!==null&&(f=i),i=i.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Ht(s){var i=s.alternate!==null&&s.alternate.child===s.child,f=0,g=0;if(i)for(var E=s.child;E!==null;)f|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)f|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=f,i}function u3(s,i,f){var g=i.pendingProps;switch(mh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(i),null;case 1:return Ht(i),null;case 3:return f=i.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),i.memoizedState.cache!==g&&(i.flags|=2048),Cs(an),te(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(Yo(i)?Rs(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,vh())),Ht(i),null;case 26:var E=i.type,D=i.memoizedState;return s===null?(Rs(i),D!==null?(Ht(i),B0(i,D)):(Ht(i),ap(i,E,null,g,f))):D?D!==s.memoizedState?(Rs(i),Ht(i),B0(i,D)):(Ht(i),i.flags&=-16777217):(s=s.memoizedProps,s!==g&&Rs(i),Ht(i),ap(i,E,s,g,f)),null;case 27:if(ae(i),f=ee.current,E=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&Rs(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return Ht(i),null}s=Z.current,Yo(i)?y1(i):(s=Wy(E,g,f),i.stateNode=s,Rs(i))}return Ht(i),null;case 5:if(ae(i),E=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&Rs(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return Ht(i),null}if(D=Z.current,Yo(i))y1(i);else{var U=Wu(ee.current);switch(D){case 1:D=U.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:D=U.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":D=U.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":D=U.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":D=U.createElement("div"),D.innerHTML="<script><\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof g.is=="string"?U.createElement("select",{is:g.is}):U.createElement("select"),g.multiple?D.multiple=!0:g.size&&(D.size=g.size);break;default:D=typeof g.is=="string"?U.createElement(E,{is:g.is}):U.createElement(E)}}D[Rt]=i,D[en]=g;e:for(U=i.child;U!==null;){if(U.tag===5||U.tag===6)D.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===i)break e;for(;U.sibling===null;){if(U.return===null||U.return===i)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}i.stateNode=D;e:switch(kn(D,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Rs(i)}}return Ht(i),ap(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,f),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==g&&Rs(i);else{if(typeof g!="string"&&i.stateNode===null)throw Error(r(166));if(s=ee.current,Yo(i)){if(s=i.stateNode,f=i.memoizedProps,g=null,E=Sn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[Rt]=i,s=!!(s.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||Ly(s.nodeValue,f)),s||ti(i,!0)}else s=Wu(s).createTextNode(g),s[Rt]=i,i.stateNode=s}return Ht(i),null;case 31:if(f=i.memoizedState,s===null||s.memoizedState!==null){if(g=Yo(i),f!==null){if(s===null){if(!g)throw Error(r(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Rt]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ht(i),s=!1}else f=vh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=f),s=!0;if(!s)return i.flags&256?(ur(i),i):(ur(i),null);if((i.flags&128)!==0)throw Error(r(558))}return Ht(i),null;case 13:if(g=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Yo(i),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=i.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Rt]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ht(i),E=!1}else E=vh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return i.flags&256?(ur(i),i):(ur(i),null)}return ur(i),(i.flags&128)!==0?(i.lanes=f,i):(f=g!==null,s=s!==null&&s.memoizedState!==null,f&&(g=i.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),D=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(D=g.memoizedState.cachePool.pool),D!==E&&(g.flags|=2048)),f!==s&&f&&(i.child.flags|=8192),Du(i,i.updateQueue),Ht(i),null);case 4:return te(),s===null&&Tp(i.stateNode.containerInfo),Ht(i),null;case 10:return Cs(i.type),Ht(i),null;case 19:if(H(sn),g=i.memoizedState,g===null)return Ht(i),null;if(E=(i.flags&128)!==0,D=g.rendering,D===null)if(E)Ml(g,!1);else{if(Xt!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(D=yu(s),D!==null){for(i.flags|=128,Ml(g,!1),s=D.updateQueue,i.updateQueue=s,Du(i,s),i.subtreeFlags=0,s=f,f=i.child;f!==null;)h1(f,s),f=f.sibling;return B(sn,sn.current&1|2),mt&&Ss(i,g.treeForkCount),i.child}s=s.sibling}g.tail!==null&&Ae()>Iu&&(i.flags|=128,E=!0,Ml(g,!1),i.lanes=4194304)}else{if(!E)if(s=yu(D),s!==null){if(i.flags|=128,E=!0,s=s.updateQueue,i.updateQueue=s,Du(i,s),Ml(g,!0),g.tail===null&&g.tailMode==="hidden"&&!D.alternate&&!mt)return Ht(i),null}else 2*Ae()-g.renderingStartTime>Iu&&f!==536870912&&(i.flags|=128,E=!0,Ml(g,!1),i.lanes=4194304);g.isBackwards?(D.sibling=i.child,i.child=D):(s=g.last,s!==null?s.sibling=D:i.child=D,g.last=D)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Ae(),s.sibling=null,f=sn.current,B(sn,E?f&1|2:f&1),mt&&Ss(i,g.treeForkCount),s):(Ht(i),null);case 22:case 23:return ur(i),Nh(),g=i.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(i.flags|=8192):g&&(i.flags|=8192),g?(f&536870912)!==0&&(i.flags&128)===0&&(Ht(i),i.subtreeFlags&6&&(i.flags|=8192)):Ht(i),f=i.updateQueue,f!==null&&Du(i,f.retryQueue),f=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),g=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(g=i.memoizedState.cachePool.pool),g!==f&&(i.flags|=2048),s!==null&&H(to),null;case 24:return f=null,s!==null&&(f=s.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Cs(an),Ht(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function d3(s,i){switch(mh(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return Cs(an),te(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return ae(i),null;case 31:if(i.memoizedState!==null){if(ur(i),i.alternate===null)throw Error(r(340));Zi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(ur(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Zi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return H(sn),null;case 4:return te(),null;case 10:return Cs(i.type),null;case 22:case 23:return ur(i),Nh(),s!==null&&H(to),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return Cs(an),null;case 25:return null;default:return null}}function F0(s,i){switch(mh(i),i.tag){case 3:Cs(an),te();break;case 26:case 27:case 5:ae(i);break;case 4:te();break;case 31:i.memoizedState!==null&&ur(i);break;case 13:ur(i);break;case 19:H(sn);break;case 10:Cs(i.type);break;case 22:case 23:ur(i),Nh(),s!==null&&H(to);break;case 24:Cs(an)}}function jl(s,i){try{var f=i.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var E=g.next;f=E;do{if((f.tag&s)===s){g=void 0;var D=f.create,U=f.inst;g=D(),U.destroy=g}f=f.next}while(f!==E)}}catch(Q){At(i,i.return,Q)}}function li(s,i,f){try{var g=i.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var D=E.next;g=D;do{if((g.tag&s)===s){var U=g.inst,Q=U.destroy;if(Q!==void 0){U.destroy=void 0,E=i;var ne=f,de=Q;try{de()}catch(be){At(E,ne,be)}}}g=g.next}while(g!==D)}}catch(be){At(i,i.return,be)}}function H0(s){var i=s.updateQueue;if(i!==null){var f=s.stateNode;try{D1(i,f)}catch(g){At(s,s.return,g)}}}function U0(s,i,f){f.props=oo(s.type,s.memoizedProps),f.state=s.memoizedState;try{f.componentWillUnmount()}catch(g){At(s,i,g)}}function Ol(s,i){try{var f=s.ref;if(f!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof f=="function"?s.refCleanup=f(g):f.current=g}}catch(E){At(s,i,E)}}function ss(s,i){var f=s.ref,g=s.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(E){At(s,i,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(E){At(s,i,E)}else f.current=null}function $0(s){var i=s.type,f=s.memoizedProps,g=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(E){At(s,s.return,E)}}function lp(s,i,f){try{var g=s.stateNode;j3(g,s.type,f,i),g[en]=i}catch(E){At(s,s.return,E)}}function V0(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&mi(s.type)||s.tag===4}function cp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||V0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&mi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function up(s,i,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(s,i):(i=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,i.appendChild(s),f=f._reactRootContainer,f!=null||i.onclick!==null||(i.onclick=Hr));else if(g!==4&&(g===27&&mi(s.type)&&(f=s.stateNode,i=null),s=s.child,s!==null))for(up(s,i,f),s=s.sibling;s!==null;)up(s,i,f),s=s.sibling}function Mu(s,i,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?f.insertBefore(s,i):f.appendChild(s);else if(g!==4&&(g===27&&mi(s.type)&&(f=s.stateNode),s=s.child,s!==null))for(Mu(s,i,f),s=s.sibling;s!==null;)Mu(s,i,f),s=s.sibling}function q0(s){var i=s.stateNode,f=s.memoizedProps;try{for(var g=s.type,E=i.attributes;E.length;)i.removeAttributeNode(E[0]);kn(i,g,f),i[Rt]=s,i[en]=f}catch(D){At(s,s.return,D)}}var Ts=!1,un=!1,dp=!1,W0=typeof WeakSet=="function"?WeakSet:Set,yn=null;function f3(s,i){if(s=s.containerInfo,Mp=Ju,s=s1(s),sh(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var E=g.anchorOffset,D=g.focusNode;g=g.focusOffset;try{f.nodeType,D.nodeType}catch{f=null;break e}var U=0,Q=-1,ne=-1,de=0,be=0,Se=s,pe=null;t:for(;;){for(var ge;Se!==f||E!==0&&Se.nodeType!==3||(Q=U+E),Se!==D||g!==0&&Se.nodeType!==3||(ne=U+g),Se.nodeType===3&&(U+=Se.nodeValue.length),(ge=Se.firstChild)!==null;)pe=Se,Se=ge;for(;;){if(Se===s)break t;if(pe===f&&++de===E&&(Q=U),pe===D&&++be===g&&(ne=U),(ge=Se.nextSibling)!==null)break;Se=pe,pe=Se.parentNode}Se=ge}f=Q===-1||ne===-1?null:{start:Q,end:ne}}else f=null}f=f||{start:0,end:0}}else f=null;for(jp={focusedElem:s,selectionRange:f},Ju=!1,yn=i;yn!==null;)if(i=yn,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,yn=s;else for(;yn!==null;){switch(i=yn,D=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(f=0;f<s.length;f++)E=s[f],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&D!==null){s=void 0,f=i,E=D.memoizedProps,D=D.memoizedState,g=f.stateNode;try{var $e=oo(f.type,E);s=g.getSnapshotBeforeUpdate($e,D),g.__reactInternalSnapshotBeforeUpdate=s}catch(tt){At(f,f.return,tt)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,f=s.nodeType,f===9)Ip(s);else if(f===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Ip(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=i.sibling,s!==null){s.return=i.return,yn=s;break}yn=i.return}}function G0(s,i,f){var g=f.flags;switch(f.tag){case 0:case 11:case 15:Ds(s,f),g&4&&jl(5,f);break;case 1:if(Ds(s,f),g&4)if(s=f.stateNode,i===null)try{s.componentDidMount()}catch(U){At(f,f.return,U)}else{var E=oo(f.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(E,i,s.__reactInternalSnapshotBeforeUpdate)}catch(U){At(f,f.return,U)}}g&64&&H0(f),g&512&&Ol(f,f.return);break;case 3:if(Ds(s,f),g&64&&(s=f.updateQueue,s!==null)){if(i=null,f.child!==null)switch(f.child.tag){case 27:case 5:i=f.child.stateNode;break;case 1:i=f.child.stateNode}try{D1(s,i)}catch(U){At(f,f.return,U)}}break;case 27:i===null&&g&4&&q0(f);case 26:case 5:Ds(s,f),i===null&&g&4&&$0(f),g&512&&Ol(f,f.return);break;case 12:Ds(s,f);break;case 31:Ds(s,f),g&4&&X0(s,f);break;case 13:Ds(s,f),g&4&&Q0(s,f),g&64&&(s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(f=x3.bind(null,f),H3(s,f))));break;case 22:if(g=f.memoizedState!==null||Ts,!g){i=i!==null&&i.memoizedState!==null||un,E=Ts;var D=un;Ts=g,(un=i)&&!D?Ms(s,f,(f.subtreeFlags&8772)!==0):Ds(s,f),Ts=E,un=D}break;case 30:break;default:Ds(s,f)}}function K0(s){var i=s.alternate;i!==null&&(s.alternate=null,K0(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&wr(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Vt=null,Xn=!1;function Ns(s,i,f){for(f=f.child;f!==null;)Y0(s,i,f),f=f.sibling}function Y0(s,i,f){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Ue,f)}catch{}switch(f.tag){case 26:un||ss(f,i),Ns(s,i,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:un||ss(f,i);var g=Vt,E=Xn;mi(f.type)&&(Vt=f.stateNode,Xn=!1),Ns(s,i,f),$l(f.stateNode),Vt=g,Xn=E;break;case 5:un||ss(f,i);case 6:if(g=Vt,E=Xn,Vt=null,Ns(s,i,f),Vt=g,Xn=E,Vt!==null)if(Xn)try{(Vt.nodeType===9?Vt.body:Vt.nodeName==="HTML"?Vt.ownerDocument.body:Vt).removeChild(f.stateNode)}catch(D){At(f,i,D)}else try{Vt.removeChild(f.stateNode)}catch(D){At(f,i,D)}break;case 18:Vt!==null&&(Xn?(s=Vt,Hy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,f.stateNode),ga(s)):Hy(Vt,f.stateNode));break;case 4:g=Vt,E=Xn,Vt=f.stateNode.containerInfo,Xn=!0,Ns(s,i,f),Vt=g,Xn=E;break;case 0:case 11:case 14:case 15:li(2,f,i),un||li(4,f,i),Ns(s,i,f);break;case 1:un||(ss(f,i),g=f.stateNode,typeof g.componentWillUnmount=="function"&&U0(f,i,g)),Ns(s,i,f);break;case 21:Ns(s,i,f);break;case 22:un=(g=un)||f.memoizedState!==null,Ns(s,i,f),un=g;break;default:Ns(s,i,f)}}function X0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ga(s)}catch(f){At(i,i.return,f)}}}function Q0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ga(s)}catch(f){At(i,i.return,f)}}function h3(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new W0),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new W0),i;default:throw Error(r(435,s.tag))}}function ju(s,i){var f=h3(s);i.forEach(function(g){if(!f.has(g)){f.add(g);var E=S3.bind(null,s,g);g.then(E,E)}})}function Qn(s,i){var f=i.deletions;if(f!==null)for(var g=0;g<f.length;g++){var E=f[g],D=s,U=i,Q=U;e:for(;Q!==null;){switch(Q.tag){case 27:if(mi(Q.type)){Vt=Q.stateNode,Xn=!1;break e}break;case 5:Vt=Q.stateNode,Xn=!1;break e;case 3:case 4:Vt=Q.stateNode.containerInfo,Xn=!0;break e}Q=Q.return}if(Vt===null)throw Error(r(160));Y0(D,U,E),Vt=null,Xn=!1,D=E.alternate,D!==null&&(D.return=null),E.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Z0(i,s),i=i.sibling}var qr=null;function Z0(s,i){var f=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Qn(i,s),Zn(s),g&4&&(li(3,s,s.return),jl(3,s),li(5,s,s.return));break;case 1:Qn(i,s),Zn(s),g&512&&(un||f===null||ss(f,f.return)),g&64&&Ts&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(f=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=f===null?g:f.concat(g))));break;case 26:var E=qr;if(Qn(i,s),Zn(s),g&512&&(un||f===null||ss(f,f.return)),g&4){var D=f!==null?f.memoizedState:null;if(g=s.memoizedState,f===null)if(g===null)if(s.stateNode===null){e:{g=s.type,f=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":D=E.getElementsByTagName("title")[0],(!D||D[Fn]||D[Rt]||D.namespaceURI==="http://www.w3.org/2000/svg"||D.hasAttribute("itemprop"))&&(D=E.createElement(g),E.head.insertBefore(D,E.querySelector("head > title"))),kn(D,g,f),D[Rt]=s,Tt(D),g=D;break e;case"link":var U=Zy("link","href",E).get(g+(f.href||""));if(U){for(var Q=0;Q<U.length;Q++)if(D=U[Q],D.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&D.getAttribute("rel")===(f.rel==null?null:f.rel)&&D.getAttribute("title")===(f.title==null?null:f.title)&&D.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){U.splice(Q,1);break t}}D=E.createElement(g),kn(D,g,f),E.head.appendChild(D);break;case"meta":if(U=Zy("meta","content",E).get(g+(f.content||""))){for(Q=0;Q<U.length;Q++)if(D=U[Q],D.getAttribute("content")===(f.content==null?null:""+f.content)&&D.getAttribute("name")===(f.name==null?null:f.name)&&D.getAttribute("property")===(f.property==null?null:f.property)&&D.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&D.getAttribute("charset")===(f.charSet==null?null:f.charSet)){U.splice(Q,1);break t}}D=E.createElement(g),kn(D,g,f),E.head.appendChild(D);break;default:throw Error(r(468,g))}D[Rt]=s,Tt(D),g=D}s.stateNode=g}else Jy(E,s.type,s.stateNode);else s.stateNode=Qy(E,g,s.memoizedProps);else D!==g?(D===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):D.count--,g===null?Jy(E,s.type,s.stateNode):Qy(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&lp(s,s.memoizedProps,f.memoizedProps)}break;case 27:Qn(i,s),Zn(s),g&512&&(un||f===null||ss(f,f.return)),f!==null&&g&4&&lp(s,s.memoizedProps,f.memoizedProps);break;case 5:if(Qn(i,s),Zn(s),g&512&&(un||f===null||ss(f,f.return)),s.flags&32){E=s.stateNode;try{Cr(E,"")}catch($e){At(s,s.return,$e)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,lp(s,E,f!==null?f.memoizedProps:E)),g&1024&&(dp=!0);break;case 6:if(Qn(i,s),Zn(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,f=s.stateNode;try{f.nodeValue=g}catch($e){At(s,s.return,$e)}}break;case 3:if(Yu=null,E=qr,qr=Gu(i.containerInfo),Qn(i,s),qr=E,Zn(s),g&4&&f!==null&&f.memoizedState.isDehydrated)try{ga(i.containerInfo)}catch($e){At(s,s.return,$e)}dp&&(dp=!1,J0(s));break;case 4:g=qr,qr=Gu(s.stateNode.containerInfo),Qn(i,s),Zn(s),qr=g;break;case 12:Qn(i,s),Zn(s);break;case 31:Qn(i,s),Zn(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,ju(s,g)));break;case 13:Qn(i,s),Zn(s),s.child.flags&8192&&s.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Lu=Ae()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,ju(s,g)));break;case 22:E=s.memoizedState!==null;var ne=f!==null&&f.memoizedState!==null,de=Ts,be=un;if(Ts=de||E,un=be||ne,Qn(i,s),un=be,Ts=de,Zn(s),g&8192)e:for(i=s.stateNode,i._visibility=E?i._visibility&-2:i._visibility|1,E&&(f===null||ne||Ts||un||ao(s)),f=null,i=s;;){if(i.tag===5||i.tag===26){if(f===null){ne=f=i;try{if(D=ne.stateNode,E)U=D.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{Q=ne.stateNode;var Se=ne.memoizedProps.style,pe=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;Q.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch($e){At(ne,ne.return,$e)}}}else if(i.tag===6){if(f===null){ne=i;try{ne.stateNode.nodeValue=E?"":ne.memoizedProps}catch($e){At(ne,ne.return,$e)}}}else if(i.tag===18){if(f===null){ne=i;try{var ge=ne.stateNode;E?Uy(ge,!0):Uy(ne.stateNode,!1)}catch($e){At(ne,ne.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;f===i&&(f=null),i=i.return}f===i&&(f=null),i.sibling.return=i.return,i=i.sibling}g&4&&(g=s.updateQueue,g!==null&&(f=g.retryQueue,f!==null&&(g.retryQueue=null,ju(s,f))));break;case 19:Qn(i,s),Zn(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,ju(s,g)));break;case 30:break;case 21:break;default:Qn(i,s),Zn(s)}}function Zn(s){var i=s.flags;if(i&2){try{for(var f,g=s.return;g!==null;){if(V0(g)){f=g;break}g=g.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var E=f.stateNode,D=cp(s);Mu(s,D,E);break;case 5:var U=f.stateNode;f.flags&32&&(Cr(U,""),f.flags&=-33);var Q=cp(s);Mu(s,Q,U);break;case 3:case 4:var ne=f.stateNode.containerInfo,de=cp(s);up(s,de,ne);break;default:throw Error(r(161))}}catch(be){At(s,s.return,be)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function J0(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;J0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Ds(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)G0(s,i.alternate,i),i=i.sibling}function ao(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:li(4,i,i.return),ao(i);break;case 1:ss(i,i.return);var f=i.stateNode;typeof f.componentWillUnmount=="function"&&U0(i,i.return,f),ao(i);break;case 27:$l(i.stateNode);case 26:case 5:ss(i,i.return),ao(i);break;case 22:i.memoizedState===null&&ao(i);break;case 30:ao(i);break;default:ao(i)}s=s.sibling}}function Ms(s,i,f){for(f=f&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var g=i.alternate,E=s,D=i,U=D.flags;switch(D.tag){case 0:case 11:case 15:Ms(E,D,f),jl(4,D);break;case 1:if(Ms(E,D,f),g=D,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){At(g,g.return,de)}if(g=D,E=g.updateQueue,E!==null){var Q=g.stateNode;try{var ne=E.shared.hiddenCallbacks;if(ne!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ne.length;E++)N1(ne[E],Q)}catch(de){At(g,g.return,de)}}f&&U&64&&H0(D),Ol(D,D.return);break;case 27:q0(D);case 26:case 5:Ms(E,D,f),f&&g===null&&U&4&&$0(D),Ol(D,D.return);break;case 12:Ms(E,D,f);break;case 31:Ms(E,D,f),f&&U&4&&X0(E,D);break;case 13:Ms(E,D,f),f&&U&4&&Q0(E,D);break;case 22:D.memoizedState===null&&Ms(E,D,f),Ol(D,D.return);break;case 30:break;default:Ms(E,D,f)}i=i.sibling}}function fp(s,i){var f=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==f&&(s!=null&&s.refCount++,f!=null&&bl(f))}function hp(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&bl(s))}function Wr(s,i,f,g){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ey(s,i,f,g),i=i.sibling}function ey(s,i,f,g){var E=i.flags;switch(i.tag){case 0:case 11:case 15:Wr(s,i,f,g),E&2048&&jl(9,i);break;case 1:Wr(s,i,f,g);break;case 3:Wr(s,i,f,g),E&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&bl(s)));break;case 12:if(E&2048){Wr(s,i,f,g),s=i.stateNode;try{var D=i.memoizedProps,U=D.id,Q=D.onPostCommit;typeof Q=="function"&&Q(U,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){At(i,i.return,ne)}}else Wr(s,i,f,g);break;case 31:Wr(s,i,f,g);break;case 13:Wr(s,i,f,g);break;case 23:break;case 22:D=i.stateNode,U=i.alternate,i.memoizedState!==null?D._visibility&2?Wr(s,i,f,g):Ll(s,i):D._visibility&2?Wr(s,i,f,g):(D._visibility|=2,ia(s,i,f,g,(i.subtreeFlags&10256)!==0||!1)),E&2048&&fp(U,i);break;case 24:Wr(s,i,f,g),E&2048&&hp(i.alternate,i);break;default:Wr(s,i,f,g)}}function ia(s,i,f,g,E){for(E=E&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var D=s,U=i,Q=f,ne=g,de=U.flags;switch(U.tag){case 0:case 11:case 15:ia(D,U,Q,ne,E),jl(8,U);break;case 23:break;case 22:var be=U.stateNode;U.memoizedState!==null?be._visibility&2?ia(D,U,Q,ne,E):Ll(D,U):(be._visibility|=2,ia(D,U,Q,ne,E)),E&&de&2048&&fp(U.alternate,U);break;case 24:ia(D,U,Q,ne,E),E&&de&2048&&hp(U.alternate,U);break;default:ia(D,U,Q,ne,E)}i=i.sibling}}function Ll(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var f=s,g=i,E=g.flags;switch(g.tag){case 22:Ll(f,g),E&2048&&fp(g.alternate,g);break;case 24:Ll(f,g),E&2048&&hp(g.alternate,g);break;default:Ll(f,g)}i=i.sibling}}var Il=8192;function oa(s,i,f){if(s.subtreeFlags&Il)for(s=s.child;s!==null;)ty(s,i,f),s=s.sibling}function ty(s,i,f){switch(s.tag){case 26:oa(s,i,f),s.flags&Il&&s.memoizedState!==null&&J3(f,qr,s.memoizedState,s.memoizedProps);break;case 5:oa(s,i,f);break;case 3:case 4:var g=qr;qr=Gu(s.stateNode.containerInfo),oa(s,i,f),qr=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Il,Il=16777216,oa(s,i,f),Il=g):oa(s,i,f));break;default:oa(s,i,f)}}function ny(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function Pl(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var f=0;f<i.length;f++){var g=i[f];yn=g,sy(g,s)}ny(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)ry(s),s=s.sibling}function ry(s){switch(s.tag){case 0:case 11:case 15:Pl(s),s.flags&2048&&li(9,s,s.return);break;case 3:Pl(s);break;case 12:Pl(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,Ou(s)):Pl(s);break;default:Pl(s)}}function Ou(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var f=0;f<i.length;f++){var g=i[f];yn=g,sy(g,s)}ny(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:li(8,i,i.return),Ou(i);break;case 22:f=i.stateNode,f._visibility&2&&(f._visibility&=-3,Ou(i));break;default:Ou(i)}s=s.sibling}}function sy(s,i){for(;yn!==null;){var f=yn;switch(f.tag){case 0:case 11:case 15:li(8,f,i);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var g=f.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:bl(f.memoizedState.cache)}if(g=f.child,g!==null)g.return=f,yn=g;else e:for(f=s;yn!==null;){g=yn;var E=g.sibling,D=g.return;if(K0(g),g===f){yn=null;break e}if(E!==null){E.return=D,yn=E;break e}yn=D}}}var p3={getCacheForType:function(s){var i=wn(an),f=i.data.get(s);return f===void 0&&(f=s(),i.data.set(s,f)),f},cacheSignal:function(){return wn(an).controller.signal}},m3=typeof WeakMap=="function"?WeakMap:Map,kt=0,jt=null,ut=null,ht=0,Et=0,dr=null,ci=!1,aa=!1,pp=!1,js=0,Xt=0,ui=0,lo=0,mp=0,fr=0,la=0,zl=null,Jn=null,gp=!1,Lu=0,iy=0,Iu=1/0,Pu=null,di=null,hn=0,fi=null,ca=null,Os=0,vp=0,yp=null,oy=null,Bl=0,_p=null;function hr(){return(kt&2)!==0&&ht!==0?ht&-ht:q.T!==null?kp():fn()}function ay(){if(fr===0)if((ht&536870912)===0||mt){var s=et;et<<=1,(et&3932160)===0&&(et=262144),fr=s}else fr=536870912;return s=cr.current,s!==null&&(s.flags|=32),fr}function er(s,i,f){(s===jt&&(Et===2||Et===9)||s.cancelPendingCommit!==null)&&(ua(s,0),hi(s,ht,fr,!1)),In(s,f),((kt&2)===0||s!==jt)&&(s===jt&&((kt&2)===0&&(lo|=f),Xt===4&&hi(s,ht,fr,!1)),is(s))}function ly(s,i,f){if((kt&6)!==0)throw Error(r(327));var g=!f&&(i&127)===0&&(i&s.expiredLanes)===0||yt(s,i),E=g?y3(s,i):xp(s,i,!0),D=g;do{if(E===0){aa&&!g&&hi(s,i,0,!1);break}else{if(f=s.current.alternate,D&&!g3(f)){E=xp(s,i,!1),D=!1;continue}if(E===2){if(D=i,s.errorRecoveryDisabledLanes&D)var U=0;else U=s.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){i=U;e:{var Q=s;E=zl;var ne=Q.current.memoizedState.isDehydrated;if(ne&&(ua(Q,U).flags|=256),U=xp(Q,U,!1),U!==2){if(pp&&!ne){Q.errorRecoveryDisabledLanes|=D,lo|=D,E=4;break e}D=Jn,Jn=E,D!==null&&(Jn===null?Jn=D:Jn.push.apply(Jn,D))}E=U}if(D=!1,E!==2)continue}}if(E===1){ua(s,0),hi(s,i,0,!0);break}e:{switch(g=s,D=E,D){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:hi(g,i,fr,!ci);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(E=Lu+300-Ae(),10<E)){if(hi(g,i,fr,!ci),Qe(g,0,!0)!==0)break e;Os=i,g.timeoutHandle=By(cy.bind(null,g,f,Jn,Pu,gp,i,fr,lo,la,ci,D,"Throttled",-0,0),E);break e}cy(g,f,Jn,Pu,gp,i,fr,lo,la,ci,D,null,-0,0)}}break}while(!0);is(s)}function cy(s,i,f,g,E,D,U,Q,ne,de,be,Se,pe,ge){if(s.timeoutHandle=-1,Se=i.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hr},ty(i,D,Se);var $e=(D&62914560)===D?Lu-Ae():(D&4194048)===D?iy-Ae():0;if($e=e4(Se,$e),$e!==null){Os=D,s.cancelPendingCommit=$e(vy.bind(null,s,i,D,f,g,E,U,Q,ne,be,Se,null,pe,ge)),hi(s,D,U,!de);return}}vy(s,i,D,f,g,E,U,Q,ne)}function g3(s){for(var i=s;;){var f=i.tag;if((f===0||f===11||f===15)&&i.flags&16384&&(f=i.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var g=0;g<f.length;g++){var E=f[g],D=E.getSnapshot;E=E.value;try{if(!ar(D(),E))return!1}catch{return!1}}if(f=i.child,i.subtreeFlags&16384&&f!==null)f.return=i,i=f;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function hi(s,i,f,g){i&=~mp,i&=~lo,s.suspendedLanes|=i,s.pingedLanes&=~i,g&&(s.warmLanes|=i),g=s.expirationTimes;for(var E=i;0<E;){var D=31-Xe(E),U=1<<D;g[D]=-1,E&=~U}f!==0&&Pn(s,f,i)}function zu(){return(kt&6)===0?(Fl(0),!1):!0}function bp(){if(ut!==null){if(Et===0)var s=ut.return;else s=ut,ws=Ji=null,Ih(s),ea=null,Sl=0,s=ut;for(;s!==null;)F0(s.alternate,s),s=s.return;ut=null}}function ua(s,i){var f=s.timeoutHandle;f!==-1&&(s.timeoutHandle=-1,I3(f)),f=s.cancelPendingCommit,f!==null&&(s.cancelPendingCommit=null,f()),Os=0,bp(),jt=s,ut=f=xs(s.current,null),ht=i,Et=0,dr=null,ci=!1,aa=yt(s,i),pp=!1,la=fr=mp=lo=ui=Xt=0,Jn=zl=null,gp=!1,(i&8)!==0&&(i|=i&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=i;0<g;){var E=31-Xe(g),D=1<<E;i|=s[E],g&=~D}return js=i,iu(),f}function uy(s,i){st=null,q.H=Nl,i===Jo||i===hu?(i=E1(),Et=3):i===Ch?(i=E1(),Et=4):Et=i===Zh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,dr=i,ut===null&&(Xt=1,Au(s,Ar(i,s.current)))}function dy(){var s=cr.current;return s===null?!0:(ht&4194048)===ht?Dr===null:(ht&62914560)===ht||(ht&536870912)!==0?s===Dr:!1}function fy(){var s=q.H;return q.H=Nl,s===null?Nl:s}function hy(){var s=q.A;return q.A=p3,s}function Bu(){Xt=4,ci||(ht&4194048)!==ht&&cr.current!==null||(aa=!0),(ui&134217727)===0&&(lo&134217727)===0||jt===null||hi(jt,ht,fr,!1)}function xp(s,i,f){var g=kt;kt|=2;var E=fy(),D=hy();(jt!==s||ht!==i)&&(Pu=null,ua(s,i)),i=!1;var U=Xt;e:do try{if(Et!==0&&ut!==null){var Q=ut,ne=dr;switch(Et){case 8:bp(),U=6;break e;case 3:case 2:case 9:case 6:cr.current===null&&(i=!0);var de=Et;if(Et=0,dr=null,da(s,Q,ne,de),f&&aa){U=0;break e}break;default:de=Et,Et=0,dr=null,da(s,Q,ne,de)}}v3(),U=Xt;break}catch(be){uy(s,be)}while(!0);return i&&s.shellSuspendCounter++,ws=Ji=null,kt=g,q.H=E,q.A=D,ut===null&&(jt=null,ht=0,iu()),U}function v3(){for(;ut!==null;)py(ut)}function y3(s,i){var f=kt;kt|=2;var g=fy(),E=hy();jt!==s||ht!==i?(Pu=null,Iu=Ae()+500,ua(s,i)):aa=yt(s,i);e:do try{if(Et!==0&&ut!==null){i=ut;var D=dr;t:switch(Et){case 1:Et=0,dr=null,da(s,i,D,1);break;case 2:case 9:if(C1(D)){Et=0,dr=null,my(i);break}i=function(){Et!==2&&Et!==9||jt!==s||(Et=7),is(s)},D.then(i,i);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:C1(D)?(Et=0,dr=null,my(i)):(Et=0,dr=null,da(s,i,D,7));break;case 5:var U=null;switch(ut.tag){case 26:U=ut.memoizedState;case 5:case 27:var Q=ut;if(U?e_(U):Q.stateNode.complete){Et=0,dr=null;var ne=Q.sibling;if(ne!==null)ut=ne;else{var de=Q.return;de!==null?(ut=de,Fu(de)):ut=null}break t}}Et=0,dr=null,da(s,i,D,5);break;case 6:Et=0,dr=null,da(s,i,D,6);break;case 8:bp(),Xt=6;break e;default:throw Error(r(462))}}_3();break}catch(be){uy(s,be)}while(!0);return ws=Ji=null,q.H=g,q.A=E,kt=f,ut!==null?0:(jt=null,ht=0,iu(),Xt)}function _3(){for(;ut!==null&&!ve();)py(ut)}function py(s){var i=z0(s.alternate,s,js);s.memoizedProps=s.pendingProps,i===null?Fu(s):ut=i}function my(s){var i=s,f=i.alternate;switch(i.tag){case 15:case 0:i=M0(f,i,i.pendingProps,i.type,void 0,ht);break;case 11:i=M0(f,i,i.pendingProps,i.type.render,i.ref,ht);break;case 5:Ih(i);default:F0(f,i),i=ut=h1(i,js),i=z0(f,i,js)}s.memoizedProps=s.pendingProps,i===null?Fu(s):ut=i}function da(s,i,f,g){ws=Ji=null,Ih(i),ea=null,Sl=0;var E=i.return;try{if(a3(s,E,i,f,ht)){Xt=1,Au(s,Ar(f,s.current)),ut=null;return}}catch(D){if(E!==null)throw ut=E,D;Xt=1,Au(s,Ar(f,s.current)),ut=null;return}i.flags&32768?(mt||g===1?s=!0:aa||(ht&536870912)!==0?s=!1:(ci=s=!0,(g===2||g===9||g===3||g===6)&&(g=cr.current,g!==null&&g.tag===13&&(g.flags|=16384))),gy(i,s)):Fu(i)}function Fu(s){var i=s;do{if((i.flags&32768)!==0){gy(i,ci);return}s=i.return;var f=u3(i.alternate,i,js);if(f!==null){ut=f;return}if(i=i.sibling,i!==null){ut=i;return}ut=i=s}while(i!==null);Xt===0&&(Xt=5)}function gy(s,i){do{var f=d3(s.alternate,s);if(f!==null){f.flags&=32767,ut=f;return}if(f=s.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!i&&(s=s.sibling,s!==null)){ut=s;return}ut=s=f}while(s!==null);Xt=6,ut=null}function vy(s,i,f,g,E,D,U,Q,ne){s.cancelPendingCommit=null;do Hu();while(hn!==0);if((kt&6)!==0)throw Error(r(327));if(i!==null){if(i===s.current)throw Error(r(177));if(D=i.lanes|i.childLanes,D|=ch,xr(s,f,D,U,Q,ne),s===jt&&(ut=jt=null,ht=0),ca=i,fi=s,Os=f,vp=D,yp=E,oy=g,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,w3(ke,function(){return Sy(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||g){g=q.T,q.T=null,E=X.p,X.p=2,U=kt,kt|=4;try{f3(s,i,f)}finally{kt=U,X.p=E,q.T=g}}hn=1,yy(),_y(),by()}}function yy(){if(hn===1){hn=0;var s=fi,i=ca,f=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||f){f=q.T,q.T=null;var g=X.p;X.p=2;var E=kt;kt|=4;try{Z0(i,s);var D=jp,U=s1(s.containerInfo),Q=D.focusedElem,ne=D.selectionRange;if(U!==Q&&Q&&Q.ownerDocument&&r1(Q.ownerDocument.documentElement,Q)){if(ne!==null&&sh(Q)){var de=ne.start,be=ne.end;if(be===void 0&&(be=de),"selectionStart"in Q)Q.selectionStart=de,Q.selectionEnd=Math.min(be,Q.value.length);else{var Se=Q.ownerDocument||document,pe=Se&&Se.defaultView||window;if(pe.getSelection){var ge=pe.getSelection(),$e=Q.textContent.length,tt=Math.min(ne.start,$e),Mt=ne.end===void 0?tt:Math.min(ne.end,$e);!ge.extend&&tt>Mt&&(U=Mt,Mt=tt,tt=U);var le=n1(Q,tt),ie=n1(Q,Mt);if(le&&ie&&(ge.rangeCount!==1||ge.anchorNode!==le.node||ge.anchorOffset!==le.offset||ge.focusNode!==ie.node||ge.focusOffset!==ie.offset)){var ue=Se.createRange();ue.setStart(le.node,le.offset),ge.removeAllRanges(),tt>Mt?(ge.addRange(ue),ge.extend(ie.node,ie.offset)):(ue.setEnd(ie.node,ie.offset),ge.addRange(ue))}}}}for(Se=[],ge=Q;ge=ge.parentNode;)ge.nodeType===1&&Se.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<Se.length;Q++){var xe=Se[Q];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Ju=!!Mp,jp=Mp=null}finally{kt=E,X.p=g,q.T=f}}s.current=i,hn=2}}function _y(){if(hn===2){hn=0;var s=fi,i=ca,f=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||f){f=q.T,q.T=null;var g=X.p;X.p=2;var E=kt;kt|=4;try{G0(s,i.alternate,i)}finally{kt=E,X.p=g,q.T=f}}hn=3}}function by(){if(hn===4||hn===3){hn=0,Ne();var s=fi,i=ca,f=Os,g=oy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?hn=5:(hn=0,ca=fi=null,xy(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(di=null),Jt(f),i=i.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Ue,i,void 0,(i.current.flags&128)===128)}catch{}if(g!==null){i=q.T,E=X.p,X.p=2,q.T=null;try{for(var D=s.onRecoverableError,U=0;U<g.length;U++){var Q=g[U];D(Q.value,{componentStack:Q.stack})}}finally{q.T=i,X.p=E}}(Os&3)!==0&&Hu(),is(s),E=s.pendingLanes,(f&261930)!==0&&(E&42)!==0?s===_p?Bl++:(Bl=0,_p=s):Bl=0,Fl(0)}}function xy(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,bl(i)))}function Hu(){return yy(),_y(),by(),Sy()}function Sy(){if(hn!==5)return!1;var s=fi,i=vp;vp=0;var f=Jt(Os),g=q.T,E=X.p;try{X.p=32>f?32:f,q.T=null,f=yp,yp=null;var D=fi,U=Os;if(hn=0,ca=fi=null,Os=0,(kt&6)!==0)throw Error(r(331));var Q=kt;if(kt|=4,ry(D.current),ey(D,D.current,U,f),kt=Q,Fl(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Ue,D)}catch{}return!0}finally{X.p=E,q.T=g,xy(s,i)}}function wy(s,i,f){i=Ar(f,i),i=Qh(s.stateNode,i,2),s=ii(s,i,2),s!==null&&(In(s,2),is(s))}function At(s,i,f){if(s.tag===3)wy(s,s,f);else for(;i!==null;){if(i.tag===3){wy(i,s,f);break}else if(i.tag===1){var g=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(di===null||!di.has(g))){s=Ar(f,s),f=C0(2),g=ii(i,f,2),g!==null&&(k0(f,g,i,s),In(g,2),is(g));break}}i=i.return}}function Sp(s,i,f){var g=s.pingCache;if(g===null){g=s.pingCache=new m3;var E=new Set;g.set(i,E)}else E=g.get(i),E===void 0&&(E=new Set,g.set(i,E));E.has(f)||(pp=!0,E.add(f),s=b3.bind(null,s,i,f),i.then(s,s))}function b3(s,i,f){var g=s.pingCache;g!==null&&g.delete(i),s.pingedLanes|=s.suspendedLanes&f,s.warmLanes&=~f,jt===s&&(ht&f)===f&&(Xt===4||Xt===3&&(ht&62914560)===ht&&300>Ae()-Lu?(kt&2)===0&&ua(s,0):mp|=f,la===ht&&(la=0)),is(s)}function Cy(s,i){i===0&&(i=$t()),s=Xi(s,i),s!==null&&(In(s,i),is(s))}function x3(s){var i=s.memoizedState,f=0;i!==null&&(f=i.retryLane),Cy(s,f)}function S3(s,i){var f=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(f=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(i),Cy(s,f)}function w3(s,i){return Pe(s,i)}var Uu=null,fa=null,wp=!1,$u=!1,Cp=!1,pi=0;function is(s){s!==fa&&s.next===null&&(fa===null?Uu=fa=s:fa=fa.next=s),$u=!0,wp||(wp=!0,k3())}function Fl(s,i){if(!Cp&&$u){Cp=!0;do for(var f=!1,g=Uu;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var D=0;else{var U=g.suspendedLanes,Q=g.pingedLanes;D=(1<<31-Xe(42|s)+1)-1,D&=E&~(U&~Q),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(f=!0,Ry(g,D))}else D=ht,D=Qe(g,g===jt?D:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(D&3)===0||yt(g,D)||(f=!0,Ry(g,D));g=g.next}while(f);Cp=!1}}function C3(){ky()}function ky(){$u=wp=!1;var s=0;pi!==0&&L3()&&(s=pi);for(var i=Ae(),f=null,g=Uu;g!==null;){var E=g.next,D=Ey(g,i);D===0?(g.next=null,f===null?Uu=E:f.next=E,E===null&&(fa=f)):(f=g,(s!==0||(D&3)!==0)&&($u=!0)),g=E}hn!==0&&hn!==5||Fl(s),pi!==0&&(pi=0)}function Ey(s,i){for(var f=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,D=s.pendingLanes&-62914561;0<D;){var U=31-Xe(D),Q=1<<U,ne=E[U];ne===-1?((Q&f)===0||(Q&g)!==0)&&(E[U]=It(Q,i)):ne<=i&&(s.expiredLanes|=Q),D&=~Q}if(i=jt,f=ht,f=Qe(s,s===i?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,f===0||s===i&&(Et===2||Et===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Fe(g),s.callbackNode=null,s.callbackPriority=0;if((f&3)===0||yt(s,f)){if(i=f&-f,i===s.callbackPriority)return i;switch(g!==null&&Fe(g),Jt(f)){case 2:case 8:f=me;break;case 32:f=ke;break;case 268435456:f=Be;break;default:f=ke}return g=Ay.bind(null,s),f=Pe(f,g),s.callbackPriority=i,s.callbackNode=f,i}return g!==null&&g!==null&&Fe(g),s.callbackPriority=2,s.callbackNode=null,2}function Ay(s,i){if(hn!==0&&hn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var f=s.callbackNode;if(Hu()&&s.callbackNode!==f)return null;var g=ht;return g=Qe(s,s===jt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(ly(s,g,i),Ey(s,Ae()),s.callbackNode!=null&&s.callbackNode===f?Ay.bind(null,s):null)}function Ry(s,i){if(Hu())return null;ly(s,i,!0)}function k3(){P3(function(){(kt&6)!==0?Pe(oe,C3):ky()})}function kp(){if(pi===0){var s=Qo;s===0&&(s=Ut,Ut<<=1,(Ut&261888)===0&&(Ut=256)),pi=s}return pi}function Ty(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Oo(""+s)}function Ny(s,i){var f=i.ownerDocument.createElement("input");return f.name=i.name,f.value=i.value,s.id&&f.setAttribute("form",s.id),i.parentNode.insertBefore(f,i),s=new FormData(s),f.parentNode.removeChild(f),s}function E3(s,i,f,g,E){if(i==="submit"&&f&&f.stateNode===E){var D=Ty((E[en]||null).action),U=g.submitter;U&&(i=(i=U[en]||null)?Ty(i.formAction):U.getAttribute("formAction"),i!==null&&(D=i,U=null));var Q=new Bo("action","action",null,g,E);s.push({event:Q,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(pi!==0){var ne=U?Ny(E,U):new FormData(E);qh(f,{pending:!0,data:ne,method:E.method,action:D},null,ne)}}else typeof D=="function"&&(Q.preventDefault(),ne=U?Ny(E,U):new FormData(E),qh(f,{pending:!0,data:ne,method:E.method,action:D},D,ne))},currentTarget:E}]})}}for(var Ep=0;Ep<lh.length;Ep++){var Ap=lh[Ep],A3=Ap.toLowerCase(),R3=Ap[0].toUpperCase()+Ap.slice(1);Vr(A3,"on"+R3)}Vr(a1,"onAnimationEnd"),Vr(l1,"onAnimationIteration"),Vr(c1,"onAnimationStart"),Vr("dblclick","onDoubleClick"),Vr("focusin","onFocus"),Vr("focusout","onBlur"),Vr(VE,"onTransitionRun"),Vr(qE,"onTransitionStart"),Vr(WE,"onTransitionCancel"),Vr(u1,"onTransitionEnd"),vn("onMouseEnter",["mouseout","mouseover"]),vn("onMouseLeave",["mouseout","mouseover"]),vn("onPointerEnter",["pointerout","pointerover"]),vn("onPointerLeave",["pointerout","pointerover"]),Dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),T3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hl));function Dy(s,i){i=(i&4)!==0;for(var f=0;f<s.length;f++){var g=s[f],E=g.event;g=g.listeners;e:{var D=void 0;if(i)for(var U=g.length-1;0<=U;U--){var Q=g[U],ne=Q.instance,de=Q.currentTarget;if(Q=Q.listener,ne!==D&&E.isPropagationStopped())break e;D=Q,E.currentTarget=de;try{D(E)}catch(be){su(be)}E.currentTarget=null,D=ne}else for(U=0;U<g.length;U++){if(Q=g[U],ne=Q.instance,de=Q.currentTarget,Q=Q.listener,ne!==D&&E.isPropagationStopped())break e;D=Q,E.currentTarget=de;try{D(E)}catch(be){su(be)}E.currentTarget=null,D=ne}}}}function dt(s,i){var f=i[sr];f===void 0&&(f=i[sr]=new Set);var g=s+"__bubble";f.has(g)||(My(i,s,2,!1),f.add(g))}function Rp(s,i,f){var g=0;i&&(g|=4),My(f,s,g,i)}var Vu="_reactListening"+Math.random().toString(36).slice(2);function Tp(s){if(!s[Vu]){s[Vu]=!0,gs.forEach(function(f){f!=="selectionchange"&&(T3.has(f)||Rp(f,!1,s),Rp(f,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[Vu]||(i[Vu]=!0,Rp("selectionchange",!1,i))}}function My(s,i,f,g){switch(a_(i)){case 2:var E=r4;break;case 8:E=s4;break;default:E=Vp}f=E.bind(null,i,f,s),E=void 0,!al||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(i,f,{capture:!0,passive:E}):s.addEventListener(i,f,!0):E!==void 0?s.addEventListener(i,f,{passive:E}):s.addEventListener(i,f,!1)}function Np(s,i,f,g,E){var D=g;if((i&1)===0&&(i&2)===0&&g!==null)e:for(;;){if(g===null)return;var U=g.tag;if(U===3||U===4){var Q=g.stateNode.containerInfo;if(Q===E)break;if(U===4)for(U=g.return;U!==null;){var ne=U.tag;if((ne===3||ne===4)&&U.stateNode.containerInfo===E)return;U=U.return}for(;Q!==null;){if(U=ir(Q),U===null)return;if(ne=U.tag,ne===5||ne===6||ne===26||ne===27){g=D=U;continue e}Q=Q.parentNode}}g=g.return}ol(function(){var de=D,be=il(f),Se=[];e:{var pe=d1.get(s);if(pe!==void 0){var ge=Bo,$e=s;switch(s){case"keypress":if(Po(f)===0)break e;case"keydown":case"keyup":ge=bt;break;case"focusin":$e="focus",ge=Ho;break;case"focusout":$e="blur",ge=Ho;break;case"beforeblur":case"afterblur":ge=Ho;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Xc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Qf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Wi;break;case a1:case l1:case c1:ge=Qc;break;case u1:ge=Gi;break;case"scroll":case"scrollend":ge=Yf;break;case"wheel":ge=TE;break;case"copy":case"cut":case"paste":ge=Zs;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=xt;break;case"toggle":case"beforetoggle":ge=DE}var tt=(i&4)!==0,Mt=!tt&&(s==="scroll"||s==="scrollend"),le=tt?pe!==null?pe+"Capture":null:pe;tt=[];for(var ie=de,ue;ie!==null;){var xe=ie;if(ue=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ue===null||le===null||(xe=Qs(ie,le),xe!=null&&tt.push(Ul(ie,xe,ue))),Mt)break;ie=ie.return}0<tt.length&&(pe=new ge(pe,$e,null,f,be),Se.push({event:pe,listeners:tt}))}}if((i&7)===0){e:{if(pe=s==="mouseover"||s==="pointerover",ge=s==="mouseout"||s==="pointerout",pe&&f!==sl&&($e=f.relatedTarget||f.fromElement)&&(ir($e)||$e[Tn]))break e;if((ge||pe)&&(pe=be.window===be?be:(pe=be.ownerDocument)?pe.defaultView||pe.parentWindow:window,ge?($e=f.relatedTarget||f.toElement,ge=de,$e=$e?ir($e):null,$e!==null&&(Mt=l($e),tt=$e.tag,$e!==Mt||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(ge=null,$e=de),ge!==$e)){if(tt=Xc,xe="onMouseLeave",le="onMouseEnter",ie="mouse",(s==="pointerout"||s==="pointerover")&&(tt=xt,xe="onPointerLeave",le="onPointerEnter",ie="pointer"),Mt=ge==null?pe:Wn(ge),ue=$e==null?pe:Wn($e),pe=new tt(xe,ie+"leave",ge,f,be),pe.target=Mt,pe.relatedTarget=ue,xe=null,ir(be)===de&&(tt=new tt(le,ie+"enter",$e,f,be),tt.target=ue,tt.relatedTarget=Mt,xe=tt),Mt=xe,ge&&$e)t:{for(tt=N3,le=ge,ie=$e,ue=0,xe=le;xe;xe=tt(xe))ue++;xe=0;for(var Ze=ie;Ze;Ze=tt(Ze))xe++;for(;0<ue-xe;)le=tt(le),ue--;for(;0<xe-ue;)ie=tt(ie),xe--;for(;ue--;){if(le===ie||ie!==null&&le===ie.alternate){tt=le;break t}le=tt(le),ie=tt(ie)}tt=null}else tt=null;ge!==null&&jy(Se,pe,ge,tt,!1),$e!==null&&Mt!==null&&jy(Se,Mt,$e,tt,!0)}}e:{if(pe=de?Wn(de):window,ge=pe.nodeName&&pe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&pe.type==="file")var St=Xv;else if(Kv(pe))if(Qv)St=HE;else{St=BE;var Ge=zE}else ge=pe.nodeName,!ge||ge.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?de&&rl(de.elementType)&&(St=Xv):St=FE;if(St&&(St=St(s,de))){Yv(Se,St,f,be);break e}Ge&&Ge(s,pe,de),s==="focusout"&&de&&pe.type==="number"&&de.memoizedProps.value!=null&&Xs(pe,"number",pe.value)}switch(Ge=de?Wn(de):window,s){case"focusin":(Kv(Ge)||Ge.contentEditable==="true")&&($o=Ge,ih=de,vl=null);break;case"focusout":vl=ih=$o=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,i1(Se,f,be);break;case"selectionchange":if($E)break;case"keydown":case"keyup":i1(Se,f,be)}var it;if(th)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Uo?Wv(s,f)&&(pt="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(pt="onCompositionStart");pt&&($v&&f.locale!=="ko"&&(Uo||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Uo&&(it=Kc()):($r=be,ll="value"in $r?$r.value:$r.textContent,Uo=!0)),Ge=qu(de,pt),0<Ge.length&&(pt=new dl(pt,s,null,f,be),Se.push({event:pt,listeners:Ge}),it?pt.data=it:(it=Gv(f),it!==null&&(pt.data=it)))),(it=jE?OE(s,f):LE(s,f))&&(pt=qu(de,"onBeforeInput"),0<pt.length&&(Ge=new dl("onBeforeInput","beforeinput",null,f,be),Se.push({event:Ge,listeners:pt}),Ge.data=it)),E3(Se,s,de,f,be)}Dy(Se,i)})}function Ul(s,i,f){return{instance:s,listener:i,currentTarget:f}}function qu(s,i){for(var f=i+"Capture",g=[];s!==null;){var E=s,D=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||D===null||(E=Qs(s,f),E!=null&&g.unshift(Ul(s,E,D)),E=Qs(s,i),E!=null&&g.push(Ul(s,E,D))),s.tag===3)return g;s=s.return}return[]}function N3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function jy(s,i,f,g,E){for(var D=i._reactName,U=[];f!==null&&f!==g;){var Q=f,ne=Q.alternate,de=Q.stateNode;if(Q=Q.tag,ne!==null&&ne===g)break;Q!==5&&Q!==26&&Q!==27||de===null||(ne=de,E?(de=Qs(f,D),de!=null&&U.unshift(Ul(f,de,ne))):E||(de=Qs(f,D),de!=null&&U.push(Ul(f,de,ne)))),f=f.return}U.length!==0&&s.push({event:i,listeners:U})}var D3=/\r\n?/g,M3=/\u0000|\uFFFD/g;function Oy(s){return(typeof s=="string"?s:""+s).replace(D3,`
|
|
49
|
+
`).replace(M3,"")}function Ly(s,i){return i=Oy(i),Oy(s)===i}function Dt(s,i,f,g,E,D){switch(f){case"children":typeof g=="string"?i==="body"||i==="textarea"&&g===""||Cr(s,g):(typeof g=="number"||typeof g=="bigint")&&i!=="body"&&Cr(s,""+g);break;case"className":Kn(s,"class",g);break;case"tabIndex":Kn(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Kn(s,f,g);break;case"style":jo(s,g,D);break;case"data":if(i!=="object"){Kn(s,"data",g);break}case"src":case"href":if(g===""&&(i!=="a"||f!=="href")){s.removeAttribute(f);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(f);break}g=Oo(""+g),s.setAttribute(f,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(f,"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 D=="function"&&(f==="formAction"?(i!=="input"&&Dt(s,i,"name",E.name,E,null),Dt(s,i,"formEncType",E.formEncType,E,null),Dt(s,i,"formMethod",E.formMethod,E,null),Dt(s,i,"formTarget",E.formTarget,E,null)):(Dt(s,i,"encType",E.encType,E,null),Dt(s,i,"method",E.method,E,null),Dt(s,i,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(f);break}g=Oo(""+g),s.setAttribute(f,g);break;case"onClick":g!=null&&(s.onclick=Hr);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}f=Oo(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,""+g):s.removeAttribute(f);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":g===!0?s.setAttribute(f,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(f,g):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(f,g):s.removeAttribute(f);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(f):s.setAttribute(f,g);break;case"popover":dt("beforetoggle",s),dt("toggle",s),tn(s,"popover",g);break;case"xlinkActuate":qt(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":qt(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":qt(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":qt(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":qt(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":qt(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":qt(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":qt(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":qt(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":tn(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Gc.get(f)||f,tn(s,f,g))}}function Dp(s,i,f,g,E,D){switch(f){case"style":jo(s,g,D);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof g=="string"?Cr(s,g):(typeof g=="number"||typeof g=="bigint")&&Cr(s,""+g);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vs.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(E=f.endsWith("Capture"),i=f.slice(2,E?f.length-7:void 0),D=s[en]||null,D=D!=null?D[f]:null,typeof D=="function"&&s.removeEventListener(i,D,E),typeof g=="function")){typeof D!="function"&&D!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(i,g,E);break e}f in s?s[f]=g:g===!0?s.setAttribute(f,""):tn(s,f,g)}}}function kn(s,i,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",s),dt("load",s);var g=!1,E=!1,D;for(D in f)if(f.hasOwnProperty(D)){var U=f[D];if(U!=null)switch(D){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Dt(s,i,D,U,f,null)}}E&&Dt(s,i,"srcSet",f.srcSet,f,null),g&&Dt(s,i,"src",f.src,f,null);return;case"input":dt("invalid",s);var Q=D=U=E=null,ne=null,de=null;for(g in f)if(f.hasOwnProperty(g)){var be=f[g];if(be!=null)switch(g){case"name":E=be;break;case"type":U=be;break;case"checked":ne=be;break;case"defaultChecked":de=be;break;case"value":D=be;break;case"defaultValue":Q=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,i));break;default:Dt(s,i,g,be,f,null)}}nn(s,D,Q,ne,de,U,E,!1);return;case"select":dt("invalid",s),g=U=D=null;for(E in f)if(f.hasOwnProperty(E)&&(Q=f[E],Q!=null))switch(E){case"value":D=Q;break;case"defaultValue":U=Q;break;case"multiple":g=Q;default:Dt(s,i,E,Q,f,null)}i=D,f=U,s.multiple=!!g,i!=null?ts(s,!!g,i,!1):f!=null&&ts(s,!!g,f,!0);return;case"textarea":dt("invalid",s),D=E=g=null;for(U in f)if(f.hasOwnProperty(U)&&(Q=f[U],Q!=null))switch(U){case"value":g=Q;break;case"defaultValue":E=Q;break;case"children":D=Q;break;case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(91));break;default:Dt(s,i,U,Q,f,null)}Wc(s,g,E,D);return;case"option":for(ne in f)if(f.hasOwnProperty(ne)&&(g=f[ne],g!=null))switch(ne){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Dt(s,i,ne,g,f,null)}return;case"dialog":dt("beforetoggle",s),dt("toggle",s),dt("cancel",s),dt("close",s);break;case"iframe":case"object":dt("load",s);break;case"video":case"audio":for(g=0;g<Hl.length;g++)dt(Hl[g],s);break;case"image":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"embed":case"source":case"link":dt("error",s),dt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in f)if(f.hasOwnProperty(de)&&(g=f[de],g!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Dt(s,i,de,g,f,null)}return;default:if(rl(i)){for(be in f)f.hasOwnProperty(be)&&(g=f[be],g!==void 0&&Dp(s,i,be,g,f,void 0));return}}for(Q in f)f.hasOwnProperty(Q)&&(g=f[Q],g!=null&&Dt(s,i,Q,g,f,null))}function j3(s,i,f,g){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,D=null,U=null,Q=null,ne=null,de=null,be=null;for(ge in f){var Se=f[ge];if(f.hasOwnProperty(ge)&&Se!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":ne=Se;default:g.hasOwnProperty(ge)||Dt(s,i,ge,null,g,Se)}}for(var pe in g){var ge=g[pe];if(Se=f[pe],g.hasOwnProperty(pe)&&(ge!=null||Se!=null))switch(pe){case"type":D=ge;break;case"name":E=ge;break;case"checked":de=ge;break;case"defaultChecked":be=ge;break;case"value":U=ge;break;case"defaultValue":Q=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,i));break;default:ge!==Se&&Dt(s,i,pe,ge,g,Se)}}Wt(s,U,Q,ne,de,be,D,E);return;case"select":ge=U=Q=pe=null;for(D in f)if(ne=f[D],f.hasOwnProperty(D)&&ne!=null)switch(D){case"value":break;case"multiple":ge=ne;default:g.hasOwnProperty(D)||Dt(s,i,D,null,g,ne)}for(E in g)if(D=g[E],ne=f[E],g.hasOwnProperty(E)&&(D!=null||ne!=null))switch(E){case"value":pe=D;break;case"defaultValue":Q=D;break;case"multiple":U=D;default:D!==ne&&Dt(s,i,E,D,g,ne)}i=Q,f=U,g=ge,pe!=null?ts(s,!!f,pe,!1):!!g!=!!f&&(i!=null?ts(s,!!f,i,!0):ts(s,!!f,f?[]:"",!1));return;case"textarea":ge=pe=null;for(Q in f)if(E=f[Q],f.hasOwnProperty(Q)&&E!=null&&!g.hasOwnProperty(Q))switch(Q){case"value":break;case"children":break;default:Dt(s,i,Q,null,g,E)}for(U in g)if(E=g[U],D=f[U],g.hasOwnProperty(U)&&(E!=null||D!=null))switch(U){case"value":pe=E;break;case"defaultValue":ge=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==D&&Dt(s,i,U,E,g,D)}qc(s,pe,ge);return;case"option":for(var $e in f)if(pe=f[$e],f.hasOwnProperty($e)&&pe!=null&&!g.hasOwnProperty($e))switch($e){case"selected":s.selected=!1;break;default:Dt(s,i,$e,null,g,pe)}for(ne in g)if(pe=g[ne],ge=f[ne],g.hasOwnProperty(ne)&&pe!==ge&&(pe!=null||ge!=null))switch(ne){case"selected":s.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:Dt(s,i,ne,pe,g,ge)}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 tt in f)pe=f[tt],f.hasOwnProperty(tt)&&pe!=null&&!g.hasOwnProperty(tt)&&Dt(s,i,tt,null,g,pe);for(de in g)if(pe=g[de],ge=f[de],g.hasOwnProperty(de)&&pe!==ge&&(pe!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,i));break;default:Dt(s,i,de,pe,g,ge)}return;default:if(rl(i)){for(var Mt in f)pe=f[Mt],f.hasOwnProperty(Mt)&&pe!==void 0&&!g.hasOwnProperty(Mt)&&Dp(s,i,Mt,void 0,g,pe);for(be in g)pe=g[be],ge=f[be],!g.hasOwnProperty(be)||pe===ge||pe===void 0&&ge===void 0||Dp(s,i,be,pe,g,ge);return}}for(var le in f)pe=f[le],f.hasOwnProperty(le)&&pe!=null&&!g.hasOwnProperty(le)&&Dt(s,i,le,null,g,pe);for(Se in g)pe=g[Se],ge=f[Se],!g.hasOwnProperty(Se)||pe===ge||pe==null&&ge==null||Dt(s,i,Se,pe,g,ge)}function Iy(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,f=performance.getEntriesByType("resource"),g=0;g<f.length;g++){var E=f[g],D=E.transferSize,U=E.initiatorType,Q=E.duration;if(D&&Q&&Iy(U)){for(U=0,Q=E.responseEnd,g+=1;g<f.length;g++){var ne=f[g],de=ne.startTime;if(de>Q)break;var be=ne.transferSize,Se=ne.initiatorType;be&&Iy(Se)&&(ne=ne.responseEnd,U+=be*(ne<Q?1:(Q-de)/(ne-de)))}if(--g,i+=8*(D+U)/(E.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Mp=null,jp=null;function Wu(s){return s.nodeType===9?s:s.ownerDocument}function Py(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function zy(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function Op(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Lp=null;function L3(){var s=window.event;return s&&s.type==="popstate"?s===Lp?!1:(Lp=s,!0):(Lp=null,!1)}var By=typeof setTimeout=="function"?setTimeout:void 0,I3=typeof clearTimeout=="function"?clearTimeout:void 0,Fy=typeof Promise=="function"?Promise:void 0,P3=typeof queueMicrotask=="function"?queueMicrotask:typeof Fy<"u"?function(s){return Fy.resolve(null).then(s).catch(z3)}:By;function z3(s){setTimeout(function(){throw s})}function mi(s){return s==="head"}function Hy(s,i){var f=i,g=0;do{var E=f.nextSibling;if(s.removeChild(f),E&&E.nodeType===8)if(f=E.data,f==="/$"||f==="/&"){if(g===0){s.removeChild(E),ga(i);return}g--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")g++;else if(f==="html")$l(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,$l(f);for(var D=f.firstChild;D;){var U=D.nextSibling,Q=D.nodeName;D[Fn]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&D.rel.toLowerCase()==="stylesheet"||f.removeChild(D),D=U}}else f==="body"&&$l(s.ownerDocument.body);f=E}while(f);ga(i)}function Uy(s,i){var f=s;s=0;do{var g=f.nextSibling;if(f.nodeType===1?i?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(i?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),g&&g.nodeType===8)if(f=g.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=g}while(f)}function Ip(s){var i=s.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var f=i;switch(i=i.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Ip(f),wr(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function B3(s,i,f,g){for(;s.nodeType===1;){var E=f;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Fn])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(D=s.getAttribute("rel"),D==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(D!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(D=s.getAttribute("src"),(D!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&D&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var D=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===D)return s}else return s;if(s=Mr(s.nextSibling),s===null)break}return null}function F3(s,i,f){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Mr(s.nextSibling),s===null))return null;return s}function $y(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=Mr(s.nextSibling),s===null))return null;return s}function Pp(s){return s.data==="$?"||s.data==="$~"}function zp(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function H3(s,i){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||f.readyState!=="loading")i();else{var g=function(){i(),f.removeEventListener("DOMContentLoaded",g)};f.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Mr(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var Bp=null;function Vy(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(i===0)return Mr(s.nextSibling);i--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||i++}s=s.nextSibling}return null}function qy(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(i===0)return s;i--}else f!=="/$"&&f!=="/&"||i++}s=s.previousSibling}return null}function Wy(s,i,f){switch(i=Wu(f),s){case"html":if(s=i.documentElement,!s)throw Error(r(452));return s;case"head":if(s=i.head,!s)throw Error(r(453));return s;case"body":if(s=i.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function $l(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);wr(s)}var jr=new Map,Gy=new Set;function Gu(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ls=X.d;X.d={f:U3,r:$3,D:V3,C:q3,L:W3,m:G3,X:Y3,S:K3,M:X3};function U3(){var s=Ls.f(),i=zu();return s||i}function $3(s){var i=gn(s);i!==null&&i.tag===5&&i.type==="form"?u0(i):Ls.r(s)}var ha=typeof document>"u"?null:document;function Ky(s,i,f){var g=ha;if(g&&typeof i=="string"&&i){var E=Yn(i);E='link[rel="'+s+'"][href="'+E+'"]',typeof f=="string"&&(E+='[crossorigin="'+f+'"]'),Gy.has(E)||(Gy.add(E),s={rel:s,crossOrigin:f,href:i},g.querySelector(E)===null&&(i=g.createElement("link"),kn(i,"link",s),Tt(i),g.head.appendChild(i)))}}function V3(s){Ls.D(s),Ky("dns-prefetch",s,null)}function q3(s,i){Ls.C(s,i),Ky("preconnect",s,i)}function W3(s,i,f){Ls.L(s,i,f);var g=ha;if(g&&s&&i){var E='link[rel="preload"][as="'+Yn(i)+'"]';i==="image"&&f&&f.imageSrcSet?(E+='[imagesrcset="'+Yn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(E+='[imagesizes="'+Yn(f.imageSizes)+'"]')):E+='[href="'+Yn(s)+'"]';var D=E;switch(i){case"style":D=pa(s);break;case"script":D=ma(s)}jr.has(D)||(s=h({rel:"preload",href:i==="image"&&f&&f.imageSrcSet?void 0:s,as:i},f),jr.set(D,s),g.querySelector(E)!==null||i==="style"&&g.querySelector(Vl(D))||i==="script"&&g.querySelector(ql(D))||(i=g.createElement("link"),kn(i,"link",s),Tt(i),g.head.appendChild(i)))}}function G3(s,i){Ls.m(s,i);var f=ha;if(f&&s){var g=i&&typeof i.as=="string"?i.as:"script",E='link[rel="modulepreload"][as="'+Yn(g)+'"][href="'+Yn(s)+'"]',D=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=ma(s)}if(!jr.has(D)&&(s=h({rel:"modulepreload",href:s},i),jr.set(D,s),f.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(ql(D)))return}g=f.createElement("link"),kn(g,"link",s),Tt(g),f.head.appendChild(g)}}}function K3(s,i,f){Ls.S(s,i,f);var g=ha;if(g&&s){var E=Nn(g).hoistableStyles,D=pa(s);i=i||"default";var U=E.get(D);if(!U){var Q={loading:0,preload:null};if(U=g.querySelector(Vl(D)))Q.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":i},f),(f=jr.get(D))&&Fp(s,f);var ne=U=g.createElement("link");Tt(ne),kn(ne,"link",s),ne._p=new Promise(function(de,be){ne.onload=de,ne.onerror=be}),ne.addEventListener("load",function(){Q.loading|=1}),ne.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,Ku(U,i,g)}U={type:"stylesheet",instance:U,count:1,state:Q},E.set(D,U)}}}function Y3(s,i){Ls.X(s,i);var f=ha;if(f&&s){var g=Nn(f).hoistableScripts,E=ma(s),D=g.get(E);D||(D=f.querySelector(ql(E)),D||(s=h({src:s,async:!0},i),(i=jr.get(E))&&Hp(s,i),D=f.createElement("script"),Tt(D),kn(D,"link",s),f.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},g.set(E,D))}}function X3(s,i){Ls.M(s,i);var f=ha;if(f&&s){var g=Nn(f).hoistableScripts,E=ma(s),D=g.get(E);D||(D=f.querySelector(ql(E)),D||(s=h({src:s,async:!0,type:"module"},i),(i=jr.get(E))&&Hp(s,i),D=f.createElement("script"),Tt(D),kn(D,"link",s),f.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},g.set(E,D))}}function Yy(s,i,f,g){var E=(E=ee.current)?Gu(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(i=pa(f.href),f=Nn(E).hoistableStyles,g=f.get(i),g||(g={type:"style",instance:null,count:0,state:null},f.set(i,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=pa(f.href);var D=Nn(E).hoistableStyles,U=D.get(s);if(U||(E=E.ownerDocument||E,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(s,U),(D=E.querySelector(Vl(s)))&&!D._p&&(U.instance=D,U.state.loading=5),jr.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},jr.set(s,f),D||Q3(E,s,f,U.state))),i&&g===null)throw Error(r(528,""));return U}if(i&&g!==null)throw Error(r(529,""));return null;case"script":return i=f.async,f=f.src,typeof f=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ma(f),f=Nn(E).hoistableScripts,g=f.get(i),g||(g={type:"script",instance:null,count:0,state:null},f.set(i,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function pa(s){return'href="'+Yn(s)+'"'}function Vl(s){return'link[rel="stylesheet"]['+s+"]"}function Xy(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function Q3(s,i,f,g){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?g.loading=1:(i=s.createElement("link"),g.preload=i,i.addEventListener("load",function(){return g.loading|=1}),i.addEventListener("error",function(){return g.loading|=2}),kn(i,"link",f),Tt(i),s.head.appendChild(i))}function ma(s){return'[src="'+Yn(s)+'"]'}function ql(s){return"script[async]"+s}function Qy(s,i,f){if(i.count++,i.instance===null)switch(i.type){case"style":var g=s.querySelector('style[data-href~="'+Yn(f.href)+'"]');if(g)return i.instance=g,Tt(g),g;var E=h({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),Tt(g),kn(g,"style",E),Ku(g,f.precedence,s),i.instance=g;case"stylesheet":E=pa(f.href);var D=s.querySelector(Vl(E));if(D)return i.state.loading|=4,i.instance=D,Tt(D),D;g=Xy(f),(E=jr.get(E))&&Fp(g,E),D=(s.ownerDocument||s).createElement("link"),Tt(D);var U=D;return U._p=new Promise(function(Q,ne){U.onload=Q,U.onerror=ne}),kn(D,"link",g),i.state.loading|=4,Ku(D,f.precedence,s),i.instance=D;case"script":return D=ma(f.src),(E=s.querySelector(ql(D)))?(i.instance=E,Tt(E),E):(g=f,(E=jr.get(D))&&(g=h({},f),Hp(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),Tt(E),kn(E,"link",g),s.head.appendChild(E),i.instance=E);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(g=i.instance,i.state.loading|=4,Ku(g,f.precedence,s));return i.instance}function Ku(s,i,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,D=E,U=0;U<g.length;U++){var Q=g[U];if(Q.dataset.precedence===i)D=Q;else if(D!==E)break}D?D.parentNode.insertBefore(s,D.nextSibling):(i=f.nodeType===9?f.head:f,i.insertBefore(s,i.firstChild))}function Fp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function Hp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var Yu=null;function Zy(s,i,f){if(Yu===null){var g=new Map,E=Yu=new Map;E.set(f,g)}else E=Yu,g=E.get(f),g||(g=new Map,E.set(f,g));if(g.has(s))return g;for(g.set(s,null),f=f.getElementsByTagName(s),E=0;E<f.length;E++){var D=f[E];if(!(D[Fn]||D[Rt]||s==="link"&&D.getAttribute("rel")==="stylesheet")&&D.namespaceURI!=="http://www.w3.org/2000/svg"){var U=D.getAttribute(i)||"";U=s+U;var Q=g.get(U);Q?Q.push(D):g.set(U,[D])}}return g}function Jy(s,i,f){s=s.ownerDocument||s,s.head.insertBefore(f,i==="title"?s.querySelector("head > title"):null)}function Z3(s,i,f){if(f===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return s=i.disabled,typeof i.precedence=="string"&&s==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function e_(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function J3(s,i,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var E=pa(g.href),D=i.querySelector(Vl(E));if(D){i=D._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=Xu.bind(s),i.then(s,s)),f.state.loading|=4,f.instance=D,Tt(D);return}D=i.ownerDocument||i,g=Xy(g),(E=jr.get(E))&&Fp(g,E),D=D.createElement("link"),Tt(D);var U=D;U._p=new Promise(function(Q,ne){U.onload=Q,U.onerror=ne}),kn(D,"link",g),f.instance=D}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,i),(i=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=Xu.bind(s),i.addEventListener("load",f),i.addEventListener("error",f))}}var Up=0;function e4(s,i){return s.stylesheets&&s.count===0&&Zu(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var g=setTimeout(function(){if(s.stylesheets&&Zu(s,s.stylesheets),s.unsuspend){var D=s.unsuspend;s.unsuspend=null,D()}},6e4+i);0<s.imgBytes&&Up===0&&(Up=62500*O3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Zu(s,s.stylesheets),s.unsuspend)){var D=s.unsuspend;s.unsuspend=null,D()}},(s.imgBytes>Up?50:800)+i);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Qu=null;function Zu(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Qu=new Map,i.forEach(t4,s),Qu=null,Xu.call(s))}function t4(s,i){if(!(i.state.loading&4)){var f=Qu.get(s);if(f)var g=f.get(null);else{f=new Map,Qu.set(s,f);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D<E.length;D++){var U=E[D];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(f.set(U.dataset.precedence,U),g=U)}g&&f.set(null,g)}E=i.instance,U=E.getAttribute("data-precedence"),D=f.get(U)||g,D===g&&f.set(null,E),f.set(U,E),this.count++,g=Xu.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),D?D.parentNode.insertBefore(E,D.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),i.state.loading|=4}}var Wl={$$typeof:b,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function n4(s,i,f,g,E,D,U,Q,ne){this.tag=1,this.containerInfo=s,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=Qt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qt(0),this.hiddenUpdates=Qt(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=D,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function t_(s,i,f,g,E,D,U,Q,ne,de,be,Se){return s=new n4(s,i,f,U,ne,de,be,Se,Q),i=1,D===!0&&(i|=24),D=lr(3,null,null,i),s.current=D,D.stateNode=s,i=xh(),i.refCount++,s.pooledCache=i,i.refCount++,D.memoizedState={element:g,isDehydrated:f,cache:i},kh(D),s}function n_(s){return s?(s=Wo,s):Wo}function r_(s,i,f,g,E,D){E=n_(E),g.context===null?g.context=E:g.pendingContext=E,g=si(i),g.payload={element:f},D=D===void 0?null:D,D!==null&&(g.callback=D),f=ii(s,g,i),f!==null&&(er(f,s,i),Cl(f,s,i))}function s_(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<i?f:i}}function $p(s,i){s_(s,i),(s=s.alternate)&&s_(s,i)}function i_(s){if(s.tag===13||s.tag===31){var i=Xi(s,67108864);i!==null&&er(i,s,67108864),$p(s,67108864)}}function o_(s){if(s.tag===13||s.tag===31){var i=hr();i=Zt(i);var f=Xi(s,i);f!==null&&er(f,s,i),$p(s,i)}}var Ju=!0;function r4(s,i,f,g){var E=q.T;q.T=null;var D=X.p;try{X.p=2,Vp(s,i,f,g)}finally{X.p=D,q.T=E}}function s4(s,i,f,g){var E=q.T;q.T=null;var D=X.p;try{X.p=8,Vp(s,i,f,g)}finally{X.p=D,q.T=E}}function Vp(s,i,f,g){if(Ju){var E=qp(g);if(E===null)Np(s,i,g,ed,f),l_(s,g);else if(o4(E,s,i,f,g))g.stopPropagation();else if(l_(s,g),i&4&&-1<i4.indexOf(s)){for(;E!==null;){var D=gn(E);if(D!==null)switch(D.tag){case 3:if(D=D.stateNode,D.current.memoizedState.isDehydrated){var U=Gt(D.pendingLanes);if(U!==0){var Q=D;for(Q.pendingLanes|=2,Q.entangledLanes|=2;U;){var ne=1<<31-Xe(U);Q.entanglements[1]|=ne,U&=~ne}is(D),(kt&6)===0&&(Iu=Ae()+500,Fl(0))}}break;case 31:case 13:Q=Xi(D,2),Q!==null&&er(Q,D,2),zu(),$p(D,2)}if(D=qp(g),D===null&&Np(s,i,g,ed,f),D===E)break;E=D}E!==null&&g.stopPropagation()}else Np(s,i,g,null,f)}}function qp(s){return s=il(s),Wp(s)}var ed=null;function Wp(s){if(ed=null,s=ir(s),s!==null){var i=l(s);if(i===null)s=null;else{var f=i.tag;if(f===13){if(s=c(i),s!==null)return s;s=null}else if(f===31){if(s=a(i),s!==null)return s;s=null}else if(f===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return ed=s,null}function a_(s){switch(s){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(Ce()){case oe:return 2;case me:return 8;case ke:case De:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Gp=!1,gi=null,vi=null,yi=null,Gl=new Map,Kl=new Map,_i=[],i4="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 l_(s,i){switch(s){case"focusin":case"focusout":gi=null;break;case"dragenter":case"dragleave":vi=null;break;case"mouseover":case"mouseout":yi=null;break;case"pointerover":case"pointerout":Gl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kl.delete(i.pointerId)}}function Yl(s,i,f,g,E,D){return s===null||s.nativeEvent!==D?(s={blockedOn:i,domEventName:f,eventSystemFlags:g,nativeEvent:D,targetContainers:[E]},i!==null&&(i=gn(i),i!==null&&i_(i)),s):(s.eventSystemFlags|=g,i=s.targetContainers,E!==null&&i.indexOf(E)===-1&&i.push(E),s)}function o4(s,i,f,g,E){switch(i){case"focusin":return gi=Yl(gi,s,i,f,g,E),!0;case"dragenter":return vi=Yl(vi,s,i,f,g,E),!0;case"mouseover":return yi=Yl(yi,s,i,f,g,E),!0;case"pointerover":var D=E.pointerId;return Gl.set(D,Yl(Gl.get(D)||null,s,i,f,g,E)),!0;case"gotpointercapture":return D=E.pointerId,Kl.set(D,Yl(Kl.get(D)||null,s,i,f,g,E)),!0}return!1}function c_(s){var i=ir(s.target);if(i!==null){var f=l(i);if(f!==null){if(i=f.tag,i===13){if(i=c(f),i!==null){s.blockedOn=i,Sr(s.priority,function(){o_(f)});return}}else if(i===31){if(i=a(f),i!==null){s.blockedOn=i,Sr(s.priority,function(){o_(f)});return}}else if(i===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function td(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var f=qp(s.nativeEvent);if(f===null){f=s.nativeEvent;var g=new f.constructor(f.type,f);sl=g,f.target.dispatchEvent(g),sl=null}else return i=gn(f),i!==null&&i_(i),s.blockedOn=f,!1;i.shift()}return!0}function u_(s,i,f){td(s)&&f.delete(i)}function a4(){Gp=!1,gi!==null&&td(gi)&&(gi=null),vi!==null&&td(vi)&&(vi=null),yi!==null&&td(yi)&&(yi=null),Gl.forEach(u_),Kl.forEach(u_)}function nd(s,i){s.blockedOn===i&&(s.blockedOn=null,Gp||(Gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,a4)))}var rd=null;function d_(s){rd!==s&&(rd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){rd===s&&(rd=null);for(var i=0;i<s.length;i+=3){var f=s[i],g=s[i+1],E=s[i+2];if(typeof g!="function"){if(Wp(g||f)===null)continue;break}var D=gn(f);D!==null&&(s.splice(i,3),i-=3,qh(D,{pending:!0,data:E,method:f.method,action:g},g,E))}}))}function ga(s){function i(ne){return nd(ne,s)}gi!==null&&nd(gi,s),vi!==null&&nd(vi,s),yi!==null&&nd(yi,s),Gl.forEach(i),Kl.forEach(i);for(var f=0;f<_i.length;f++){var g=_i[f];g.blockedOn===s&&(g.blockedOn=null)}for(;0<_i.length&&(f=_i[0],f.blockedOn===null);)c_(f),f.blockedOn===null&&_i.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(g=0;g<f.length;g+=3){var E=f[g],D=f[g+1],U=E[en]||null;if(typeof D=="function")U||d_(f);else if(U){var Q=null;if(D&&D.hasAttribute("formAction")){if(E=D,U=D[en]||null)Q=U.formAction;else if(Wp(E)!==null)continue}else Q=U.action;typeof Q=="function"?f[g+1]=Q:(f.splice(g,3),g-=3),d_(f)}}}function f_(){function s(D){D.canIntercept&&D.info==="react-transition"&&D.intercept({handler:function(){return new Promise(function(U){return E=U})},focusReset:"manual",scroll:"manual"})}function i(){E!==null&&(E(),E=null),g||setTimeout(f,20)}function f(){if(!g&&!navigation.transition){var D=navigation.currentEntry;D&&D.url!=null&&navigation.navigate(D.url,{state:D.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(f,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),E!==null&&(E(),E=null)}}}function Kp(s){this._internalRoot=s}sd.prototype.render=Kp.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(r(409));var f=i.current,g=hr();r_(f,g,s,i,null,null)},sd.prototype.unmount=Kp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;r_(s.current,2,null,s,null,null),zu(),i[Tn]=null}};function sd(s){this._internalRoot=s}sd.prototype.unstable_scheduleHydration=function(s){if(s){var i=fn();s={blockedOn:null,target:s,priority:i};for(var f=0;f<_i.length&&i!==0&&i<_i[f].priority;f++);_i.splice(f,0,s),f===0&&c_(s)}};var h_=e.version;if(h_!=="19.2.4")throw Error(r(527,h_,"19.2.4"));X.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(i),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var l4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!id.isDisabled&&id.supportsFiber)try{Ue=id.inject(l4),Me=id}catch{}}return Ql.createRoot=function(s,i){if(!o(s))throw Error(r(299));var f=!1,g="",E=b0,D=x0,U=S0;return i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(E=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&(U=i.onRecoverableError)),i=t_(s,1,!1,null,null,f,g,null,E,D,U,f_),s[Tn]=i.current,Tp(s),new Kp(i)},Ql.hydrateRoot=function(s,i,f){if(!o(s))throw Error(r(299));var g=!1,E="",D=b0,U=x0,Q=S0,ne=null;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onUncaughtError!==void 0&&(D=f.onUncaughtError),f.onCaughtError!==void 0&&(U=f.onCaughtError),f.onRecoverableError!==void 0&&(Q=f.onRecoverableError),f.formState!==void 0&&(ne=f.formState)),i=t_(s,1,!0,i,f!=null?f:null,g,E,ne,D,U,Q,f_),i.context=n_(null),f=i.current,g=hr(),g=Zt(g),E=si(g),E.callback=null,ii(f,E,g),f=g,i.current.lanes=f,In(i,f),is(i),s[Tn]=i.current,Tp(s),new sd(i)},Ql.version="19.2.4",Ql}var w_;function y4(){if(w_)return Qp.exports;w_=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Qp.exports=v4(),Qp.exports}var _4=y4();const C_="jean2-theme",Ag="neutral",Jx="system",b4={mode:Jx,scheme:Ag,setMode:()=>null,setScheme:()=>null,resolvedMode:"dark"},eS=N.createContext(b4);function x4(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function k_(t){return t==="system"?x4():t}function S4(t){const e=localStorage.getItem(C_);if(!e||!["light","dark","system"].includes(e))return null;const r={mode:e,scheme:Ag};return localStorage.setItem(t,JSON.stringify(r)),localStorage.removeItem(C_),r}function w4({children:t,defaultMode:e=Jx,defaultScheme:n=Ag,storageKey:r="jean2-theme-settings",...o}){const[l,c]=N.useState(()=>{const x=S4(r);if(x)return x;const C=localStorage.getItem(r);if(C)try{const w=JSON.parse(C);if(typeof w=="object"&&w!==null&&"mode"in w&&"scheme"in w)return w}catch{}return{mode:e,scheme:n}}),[a,u]=N.useState(()=>k_(l.mode)),d=N.useCallback((x,C)=>{const w=window.document.documentElement,y=k_(x);w.classList.remove("light","dark"),w.classList.remove("neutral","ocean","forest","sunset","amethyst"),w.classList.add(y),w.classList.add(C),u(y)},[]);N.useEffect(()=>{d(l.mode,l.scheme)},[l,d]),N.useEffect(()=>{if(l.mode!=="system")return;const x=window.matchMedia("(prefers-color-scheme: dark)"),C=()=>{d(l.mode,l.scheme)};return x.addEventListener("change",C),()=>x.removeEventListener("change",C)},[l.mode,l.scheme,d]);const p=N.useCallback(x=>{const C={...l,mode:x};c(C),localStorage.setItem(r,JSON.stringify(C))},[l,r]),h=N.useCallback(x=>{const C={...l,scheme:x};c(C),localStorage.setItem(r,JSON.stringify(C))},[l,r]),v={mode:l.mode,scheme:l.scheme,setMode:p,setScheme:h,resolvedMode:a};return m.jsx(eS.Provider,{...o,value:v,children:t})}const C4=()=>{const t=N.useContext(eS);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var tm={exports:{}},nm={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* react-compiler-runtime.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var E_;function k4(){if(E_)return nm;E_=1;var t=Qd().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return nm.c=function(e){return t.H.useMemoCache(e)},nm}var A_;function E4(){return A_||(A_=1,tm.exports=k4()),tm.exports}var fe=E4();const R_=t=>Symbol.iterator in t,T_=t=>"entries"in t,N_=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),r=e instanceof Map?e:new Map(e.entries());if(n.size!==r.size)return!1;for(const[o,l]of n)if(!r.has(o)||!Object.is(l,r.get(o)))return!1;return!0},A4=(t,e)=>{const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let o=n.next(),l=r.next();for(;!o.done&&!l.done;){if(!Object.is(o.value,l.value))return!1;o=n.next(),l=r.next()}return!!o.done&&!!l.done};function R4(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:R_(t)&&R_(e)?T_(t)&&T_(e)?N_(t,e):A4(t,e):N_({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function co(t){const e=En.useRef(void 0);return n=>{const r=t(n);return R4(e.current,r)?e.current:e.current=r}}const D_=t=>{let e;const n=new Set,r=(d,p)=>{const h=typeof d=="function"?d(e):d;if(!Object.is(h,e)){const v=e;e=(p!=null?p:typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(x=>x(e,v))}},o=()=>e,a={setState:r,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,o,a);return a},T4=(t=>t?D_(t):D_),N4=t=>t;function D4(t,e=N4){const n=En.useSyncExternalStore(t.subscribe,En.useCallback(()=>e(t.getState()),[t,e]),En.useCallback(()=>e(t.getInitialState()),[t,e]));return En.useDebugValue(n),n}const M_=t=>{const e=T4(t),n=r=>D4(e,r);return Object.assign(n,e),n},za=(t=>t?M_(t):M_);function Rg(t){return t.role==="assistant"}const M4=220,tS=256,j4=512;function Ed(t){return Math.max(M4,Math.min(j4,t))}const Zd={SESSIONS:"jean2_sessions_panel_width",FILES:"jean2_files_panel_width"};function Jd(t){return Ed(t)}function O4(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(Zd.SESSIONS);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:Jd(n.width)}catch{return t}}function L4(t){if(!(typeof window>"u"))try{const e=Jd(t);localStorage.setItem(Zd.SESSIONS,JSON.stringify({width:e}))}catch(e){console.warn("Error saving sessions panel width:",e)}}function I4(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(Zd.FILES);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:Jd(n.width)}catch{return t}}function P4(t){if(!(typeof window>"u"))try{const e=Jd(t);localStorage.setItem(Zd.FILES,JSON.stringify({width:e}))}catch(e){console.warn("Error saving files panel width:",e)}}const z4=5e3,nS="jean2_sidebar_view",B4=()=>{if(typeof window>"u")return"default";const t=localStorage.getItem(nS);return t==="default"||t==="overview"?t:"default"},F4=()=>O4(tS),H4=()=>I4(tS),zt=za(t=>({showSettings:!1,showMCPDialog:!1,showFilesPanel:!1,showTerminalPanel:!1,showAddServer:!1,editServerData:null,sidebarViewMode:B4(),completionState:new Map,sessionsPanelWidth:F4(),filesPanelWidth:H4(),filePreviewTarget:null,setShowSettings:e=>t({showSettings:e}),setShowMCPDialog:e=>t({showMCPDialog:e}),setShowFilesPanel:e=>t({showFilesPanel:e}),setShowTerminalPanel:e=>t({showTerminalPanel:e}),setShowAddServer:e=>t({showAddServer:e}),setEditServerData:e=>t({editServerData:e}),setSidebarViewMode:e=>{typeof window<"u"&&localStorage.setItem(nS,e),t({sidebarViewMode:e})},setCompletion:(e,n)=>t(r=>{const o=new Map(r.completionState);return o.set(e,n),{completionState:o}}),clearCompletion:e=>t(n=>{const r=new Map(n.completionState);return r.delete(e),{completionState:r}}),clearAllCompletions:()=>t({completionState:new Map}),setSessionsPanelWidth:e=>{const n=Ed(e);L4(n),t({sessionsPanelWidth:n})},setFilesPanelWidth:e=>{const n=Ed(e);P4(n),t({filesPanelWidth:n})},openFilePreview:e=>t({filePreviewTarget:e}),closeFilePreview:()=>t({filePreviewTarget:null})})),U4=t=>e=>e.completionState.get(t),j_=z4,$4=za(t=>({pendingPermissions:[],queuedMessages:{},clearPendingPermissions:()=>t({pendingPermissions:[]}),setPendingPermissions:e=>t({pendingPermissions:e}),mergePendingPermissions:e=>t(n=>{const r=new Set(n.pendingPermissions.map(l=>l.toolCallId)),o=e.filter(l=>!r.has(l.toolCallId));return{pendingPermissions:[...n.pendingPermissions,...o]}}),addPendingPermission:e=>t(n=>({pendingPermissions:[...n.pendingPermissions,e]})),removePendingPermissionByToolCallId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.toolCallId!==e)})),removePendingPermissionsBySessionId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.sessionId!==e)})),clearQueuedMessages:()=>t({queuedMessages:{}}),setQueuedMessagesForSession:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:n}})),addQueuedMessage:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:[...r.queuedMessages[e]||[],n]}})),removeQueuedMessageById:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(o=>o.id!==n)}})),removeQueuedMessagesByIds:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(o=>!n.includes(o.id))}}))})),Wm=za(t=>({streamingSessionIds:new Set,interruptedSessions:new Set,clearStreamingSessions:()=>t({streamingSessionIds:new Set}),addStreamingSession:e=>t(n=>{if(n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.add(e),{streamingSessionIds:r}}),removeStreamingSession:e=>t(n=>{if(!n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.delete(e),{streamingSessionIds:r}}),replaceStreamingSessions:e=>t({streamingSessionIds:e instanceof Set?e:new Set(e)}),addInterruptedSession:e=>t(n=>{if(n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.add(e),{interruptedSessions:r}}),removeInterruptedSession:e=>t(n=>{if(!n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.delete(e),{interruptedSessions:r}}),clearInterruptedSessions:()=>t({interruptedSessions:new Set})})),V4=za(t=>({sessions:[],currentSession:null,setSessions:e=>t(n=>({sessions:typeof e=="function"?e(n.sessions):e})),addSessionToFront:e=>t(n=>({sessions:[e,...n.sessions]})),updateSession:e=>t(n=>({sessions:n.sessions.map(r=>r.id===e.id?e:r)})),removeSessionById:e=>t(n=>({sessions:n.sessions.filter(r=>r.id!==e)})),setCurrentSession:e=>t({currentSession:e}),clearSessionState:()=>t({sessions:[],currentSession:null})})),Zl=za((t,e)=>({messagesBySession:{},partsBySession:{},setMessagesBySession:n=>t(r=>({messagesBySession:typeof n=="function"?n(r.messagesBySession):n})),setPartsBySession:n=>t(r=>({partsBySession:typeof n=="function"?n(r.partsBySession):n})),getMessagesBySessionKeysCount:()=>Object.keys(e().messagesBySession).length})),Tg=za(t=>({activeWorkspace:null,setActiveWorkspace:e=>t({activeWorkspace:e})})),vr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Ps(){try{const t=localStorage.getItem(vr.SERVERS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading saved servers from localStorage:",t),[]}}function q4(t){return Ps().find(n=>n.id===t)||null}function W4(t){try{const e=Ps();e.push(t),localStorage.setItem(vr.SERVERS,JSON.stringify(e))}catch(e){console.error("Error saving server to localStorage:",e)}}function G4(t,e){try{const n=Ps(),r=n.findIndex(o=>o.id===t);if(r===-1){console.error("Server not found:",t);return}n[r]={...n[r],...e},localStorage.setItem(vr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error updating server in localStorage:",n)}}function K4(t){try{const n=Ps().filter(c=>c.id!==t);localStorage.setItem(vr.SERVERS,JSON.stringify(n));const o=Kr().filter(c=>c.serverId!==t);localStorage.setItem(vr.QUICK_CONNECTIONS,JSON.stringify(o)),rS()===t&&localStorage.removeItem(vr.ACTIVE_SERVER_ID)}catch(e){console.error("Error deleting server from localStorage:",e)}}function rS(){try{return localStorage.getItem(vr.ACTIVE_SERVER_ID)}catch(t){return console.error("Error reading active server ID from localStorage:",t),null}}function rm(t){try{localStorage.setItem(vr.ACTIVE_SERVER_ID,t)}catch(e){console.error("Error setting active server ID in localStorage:",e)}}function O_(){const t=rS();return t?q4(t):null}function Kr(){try{const t=localStorage.getItem(vr.QUICK_CONNECTIONS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading quick connections from localStorage:",t),[]}}function Y4(t){const e=Kr(),n=e.reduce((o,l)=>Math.max(o,l.order),-1),r={...t,id:crypto.randomUUID(),order:n+1};e.push(r);try{localStorage.setItem(vr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(o){console.error("Error saving quick connection to localStorage:",o)}return r}function X4(t){try{const n=Kr().filter(r=>r.id!==t);localStorage.setItem(vr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connection from localStorage:",e)}}function Q4(t){try{const n=Kr().filter(r=>r.workspaceId!==t);localStorage.setItem(vr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connections for workspace from localStorage:",e)}}function Z4(t){try{const e=Kr(),n=new Map(e.map(r=>[r.id,r]));t.forEach((r,o)=>{const l=n.get(r);l&&(l.order=o)}),localStorage.setItem(vr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(e){console.error("Error reordering quick connections in localStorage:",e)}}function sS(t){return/^[a-f0-9]{64}$/.test(t)}function J4(t){return t.length<12?t:`${t.slice(0,4)}...${t.slice(-4)}`}function Ad(t){let e=t.trim();return e=e.replace(/^(https?:\/\/|wss?:\/\/)/i,""),e=e.replace(/\/+$/,""),e}const iS=N.createContext(null),e5=t=>{const e=fe.c(30),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],e[0]=r):r=e[0];const[o,l]=N.useState(r),[c,a]=N.useState(null);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[1]=u):u=e[1];const[d,p]=N.useState(u),[h,v]=N.useState(!1),x=N.useRef(null),C=N.useRef(!1);let w,y;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{const Z=Ps(),J=O_(),ee=Kr();l(Z),a(J),p(ee)},y=[],e[2]=w,e[3]=y):(w=e[2],y=e[3]),N.useEffect(w,y);let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{C.current=!0},e[4]=S):S=e[4];const _=S;let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=(Z,J,ee)=>{const K=Ad(J),$={id:crypto.randomUUID(),name:Z,url:K,token:ee,createdAt:new Date().toISOString()};return W4($),l(Ps()),rm($.id),a($),$},e[5]=b):b=e[5];const k=b;let T;e[6]!==(c==null?void 0:c.id)?(T=(Z,J)=>{const ee={...J,...J.url&&{url:Ad(J.url)}};G4(Z,ee),l(Ps()),(c==null?void 0:c.id)===Z&&a(O_())},e[6]=c==null?void 0:c.id,e[7]=T):T=e[7];const R=T;let M;e[8]!==(c==null?void 0:c.id)?(M=Z=>{const J=(c==null?void 0:c.id)===Z;if(K4(Z),l(Ps()),J){const ee=Ps(),K=ee.length>0?ee[0]:null;K?(rm(K.id),a(K)):a(null)}p(Kr())},e[8]=c==null?void 0:c.id,e[9]=M):M=e[9];const A=M;let j;e[10]!==(c==null?void 0:c.id)||e[11]!==h||e[12]!==o?(j=Z=>(x.current&&(clearTimeout(x.current),x.current=null),h&&(c==null?void 0:c.id)===Z?!1:(h&&v(!1),v(!0),x.current=setTimeout(()=>{rm(Z);const J=o.find(ee=>ee.id===Z)||null;a(J),v(!1)},100),!0)),e[10]=c==null?void 0:c.id,e[11]=h,e[12]=o,e[13]=j):j=e[13];const O=j;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{v(!1)},e[14]=z):z=e[14];const V=z;let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=(Z,J,ee,K)=>{Y4({serverId:Z,serverName:J,workspaceId:ee,workspaceName:K}),p(Kr())},e[15]=F):F=e[15];const W=F;let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=Z=>{X4(Z),p(Kr())},e[16]=G):G=e[16];const q=G;let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=Z=>{Q4(Z),p(Kr())},e[17]=X):X=e[17];const Y=X;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=Z=>{Z4(Z),p(Kr())},e[18]=I):I=e[18];const L=I;let P;e[19]!==c||e[20]!==R||e[21]!==h||e[22]!==d||e[23]!==A||e[24]!==o||e[25]!==O?(P={servers:o,activeServer:c,quickConnections:d,isSwitching:h,isAddingServerRef:C,prepareForServerAdd:_,addServer:k,editServer:R,removeServer:A,switchServer:O,clearSwitchingState:V,addToQuickConnections:W,removeFromQuickConnections:q,removeFromQuickConnectionsByWorkspace:Y,reorderQuick:L},e[19]=c,e[20]=R,e[21]=h,e[22]=d,e[23]=A,e[24]=o,e[25]=O,e[26]=P):P=e[26];const H=P;let B;return e[27]!==n||e[28]!==H?(B=m.jsx(iS.Provider,{value:H,children:n}),e[27]=n,e[28]=H,e[29]=B):B=e[29],B},Ba=()=>{const t=N.useContext(iS);if(t===null)throw new Error("useServerContext must be used within a ServerProvider");return t};/**
|
|
58
|
+
* @license lucide-react v0.577.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const oS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
63
|
+
* @license lucide-react v0.577.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const t5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
68
|
+
* @license lucide-react v0.577.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const n5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
73
|
+
* @license lucide-react v0.577.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const L_=t=>{const e=n5(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
78
|
+
* @license lucide-react v0.577.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/var r5={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"};/**
|
|
83
|
+
* @license lucide-react v0.577.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const s5=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
88
|
+
* @license lucide-react v0.577.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const i5=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:c,...a},u)=>N.createElement("svg",{ref:u,...r5,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:oS("lucide",o),...!l&&!s5(a)&&{"aria-hidden":"true"},...a},[...c.map(([d,p])=>N.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
|
93
|
+
* @license lucide-react v0.577.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Le=(t,e)=>{const n=N.forwardRef(({className:r,...o},l)=>N.createElement(i5,{ref:l,iconNode:e,className:oS(`lucide-${t5(L_(t))}`,`lucide-${t}`,r),...o}));return n.displayName=L_(t),n};/**
|
|
98
|
+
* @license lucide-react v0.577.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const o5=[["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"}]],a5=Le("archive",o5);/**
|
|
103
|
+
* @license lucide-react v0.577.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const l5=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],c5=Le("arrow-down",l5);/**
|
|
108
|
+
* @license lucide-react v0.577.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const u5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],d5=Le("arrow-left",u5);/**
|
|
113
|
+
* @license lucide-react v0.577.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const f5=[["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"}]],h5=Le("bot",f5);/**
|
|
118
|
+
* @license lucide-react v0.577.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const p5=[["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"}]],Gm=Le("box",p5);/**
|
|
123
|
+
* @license lucide-react v0.577.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const m5=[["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"}]],I_=Le("brain",m5);/**
|
|
128
|
+
* @license lucide-react v0.577.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const g5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fs=Le("check",g5);/**
|
|
133
|
+
* @license lucide-react v0.577.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const v5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Fa=Le("chevron-down",v5);/**
|
|
138
|
+
* @license lucide-react v0.577.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const y5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_5=Le("chevron-left",y5);/**
|
|
143
|
+
* @license lucide-react v0.577.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const b5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xr=Le("chevron-right",b5);/**
|
|
148
|
+
* @license lucide-react v0.577.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const x5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],S5=Le("chevron-up",x5);/**
|
|
153
|
+
* @license lucide-react v0.577.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const w5=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],aS=Le("chevrons-up-down",w5);/**
|
|
158
|
+
* @license lucide-react v0.577.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const C5=[["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"}]],Ea=Le("circle-alert",C5);/**
|
|
163
|
+
* @license lucide-react v0.577.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const k5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ec=Le("circle-check-big",k5);/**
|
|
168
|
+
* @license lucide-react v0.577.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const E5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],A5=Le("circle-check",E5);/**
|
|
173
|
+
* @license lucide-react v0.577.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const R5=[["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"}]],ef=Le("circle-x",R5);/**
|
|
178
|
+
* @license lucide-react v0.577.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const T5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],N5=Le("circle",T5);/**
|
|
183
|
+
* @license lucide-react v0.577.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const D5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],lS=Le("clock",D5);/**
|
|
188
|
+
* @license lucide-react v0.577.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const M5=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],j5=Le("cog",M5);/**
|
|
193
|
+
* @license lucide-react v0.577.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const O5=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],pc=Le("copy",O5);/**
|
|
198
|
+
* @license lucide-react v0.577.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const L5=[["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"}]],P_=Le("cpu",L5);/**
|
|
203
|
+
* @license lucide-react v0.577.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const I5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],P5=Le("download",I5);/**
|
|
208
|
+
* @license lucide-react v0.577.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const z5=[["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"}]],cS=Le("ellipsis",z5);/**
|
|
213
|
+
* @license lucide-react v0.577.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const B5=[["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"}]],mc=Le("external-link",B5);/**
|
|
218
|
+
* @license lucide-react v0.577.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const F5=[["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"}]],H5=Le("eye-off",F5);/**
|
|
223
|
+
* @license lucide-react v0.577.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const U5=[["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"}]],uS=Le("eye",U5);/**
|
|
228
|
+
* @license lucide-react v0.577.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const $5=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],V5=Le("file-exclamation-point",$5);/**
|
|
233
|
+
* @license lucide-react v0.577.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const q5=[["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"}]],W5=Le("file-pen",q5);/**
|
|
238
|
+
* @license lucide-react v0.577.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const G5=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],K5=Le("file-question-mark",G5);/**
|
|
243
|
+
* @license lucide-react v0.577.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const Y5=[["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"}]],Ng=Le("file-text",Y5);/**
|
|
248
|
+
* @license lucide-react v0.577.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const X5=[["path",{d:"M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5",key:"1jo35a"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m15 17 5 5",key:"36xl1x"}],["path",{d:"m20 17-5 5",key:"vdz27y"}]],Q5=Le("file-x-corner",X5);/**
|
|
253
|
+
* @license lucide-react v0.577.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const Z5=[["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"}]],Or=Le("file",Z5);/**
|
|
258
|
+
* @license lucide-react v0.577.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const J5=[["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"}]],Km=Le("folder-open",J5);/**
|
|
263
|
+
* @license lucide-react v0.577.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const eA=[["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"}]],zs=Le("folder",eA);/**
|
|
268
|
+
* @license lucide-react v0.577.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const tA=[["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"}]],nA=Le("git-branch",tA);/**
|
|
273
|
+
* @license lucide-react v0.577.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const rA=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],sA=Le("hard-drive",rA);/**
|
|
278
|
+
* @license lucide-react v0.577.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const iA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oA=Le("image",iA);/**
|
|
283
|
+
* @license lucide-react v0.577.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const aA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lA=Le("info",aA);/**
|
|
288
|
+
* @license lucide-react v0.577.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const cA=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],uA=Le("keyboard",cA);/**
|
|
293
|
+
* @license lucide-react v0.577.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const dA=[["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"}]],fA=Le("layout-grid",dA);/**
|
|
298
|
+
* @license lucide-react v0.577.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const hA=[["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"}]],pA=Le("layout-list",hA);/**
|
|
303
|
+
* @license lucide-react v0.577.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const mA=[["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"}]],gA=Le("link-2",mA);/**
|
|
308
|
+
* @license lucide-react v0.577.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const vA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],nr=Le("loader-circle",vA);/**
|
|
313
|
+
* @license lucide-react v0.577.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const yA=[["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"}]],_A=Le("lock",yA);/**
|
|
318
|
+
* @license lucide-react v0.577.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const bA=[["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"}]],xA=Le("message-square",bA);/**
|
|
323
|
+
* @license lucide-react v0.577.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const SA=[["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"}]],dS=Le("minimize-2",SA);/**
|
|
328
|
+
* @license lucide-react v0.577.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const wA=[["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"}]],CA=Le("monitor",wA);/**
|
|
333
|
+
* @license lucide-react v0.577.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const kA=[["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"}]],EA=Le("moon",kA);/**
|
|
338
|
+
* @license lucide-react v0.577.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const AA=[["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"}]],RA=Le("palette",AA);/**
|
|
343
|
+
* @license lucide-react v0.577.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const TA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],NA=Le("panel-left",TA);/**
|
|
348
|
+
* @license lucide-react v0.577.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const DA=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],MA=Le("paperclip",DA);/**
|
|
353
|
+
* @license lucide-react v0.577.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const jA=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],fS=Le("pause",jA);/**
|
|
358
|
+
* @license lucide-react v0.577.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const OA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],LA=Le("pencil",OA);/**
|
|
363
|
+
* @license lucide-react v0.577.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const IA=[["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"}]],PA=Le("plug-zap",IA);/**
|
|
368
|
+
* @license lucide-react v0.577.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const zA=[["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"}]],BA=Le("plug",zA);/**
|
|
373
|
+
* @license lucide-react v0.577.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const FA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ha=Le("plus",FA);/**
|
|
378
|
+
* @license lucide-react v0.577.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const HA=[["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"}]],Ai=Le("refresh-cw",HA);/**
|
|
383
|
+
* @license lucide-react v0.577.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const UA=[["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"}]],hS=Le("rotate-ccw",UA);/**
|
|
388
|
+
* @license lucide-react v0.577.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const $A=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dg=Le("search",$A);/**
|
|
393
|
+
* @license lucide-react v0.577.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const VA=[["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"}]],qA=Le("send",VA);/**
|
|
398
|
+
* @license lucide-react v0.577.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const WA=[["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"}]],go=Le("server",WA);/**
|
|
403
|
+
* @license lucide-react v0.577.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const GA=[["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"}]],pS=Le("settings",GA);/**
|
|
408
|
+
* @license lucide-react v0.577.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const KA=[["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"}]],mS=Le("shield",KA);/**
|
|
413
|
+
* @license lucide-react v0.577.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const YA=[["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"}]],z_=Le("square-terminal",YA);/**
|
|
418
|
+
* @license lucide-react v0.577.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const XA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],gS=Le("square",XA);/**
|
|
423
|
+
* @license lucide-react v0.577.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const QA=[["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"}]],B_=Le("star",QA);/**
|
|
428
|
+
* @license lucide-react v0.577.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const ZA=[["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"}]],JA=Le("sun",ZA);/**
|
|
433
|
+
* @license lucide-react v0.577.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const eR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],F_=Le("terminal",eR);/**
|
|
438
|
+
* @license lucide-react v0.577.0 - ISC
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the ISC license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/const tR=[["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"}]],Ua=Le("trash-2",tR);/**
|
|
443
|
+
* @license lucide-react v0.577.0 - ISC
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the ISC license.
|
|
446
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/const nR=[["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"}]],Da=Le("triangle-alert",nR);/**
|
|
448
|
+
* @license lucide-react v0.577.0 - ISC
|
|
449
|
+
*
|
|
450
|
+
* This source code is licensed under the ISC license.
|
|
451
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
+
*/const rR=[["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"}]],sR=Le("undo-2",rR);/**
|
|
453
|
+
* @license lucide-react v0.577.0 - ISC
|
|
454
|
+
*
|
|
455
|
+
* This source code is licensed under the ISC license.
|
|
456
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
+
*/const iR=[["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"}]],oR=Le("unplug",iR);/**
|
|
458
|
+
* @license lucide-react v0.577.0 - ISC
|
|
459
|
+
*
|
|
460
|
+
* This source code is licensed under the ISC license.
|
|
461
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
+
*/const aR=[["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"}]],vS=Le("user",aR);/**
|
|
463
|
+
* @license lucide-react v0.577.0 - ISC
|
|
464
|
+
*
|
|
465
|
+
* This source code is licensed under the ISC license.
|
|
466
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
+
*/const lR=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],cR=Le("volume-2",lR);/**
|
|
468
|
+
* @license lucide-react v0.577.0 - ISC
|
|
469
|
+
*
|
|
470
|
+
* This source code is licensed under the ISC license.
|
|
471
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
+
*/const uR=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],dR=Le("volume-x",uR);/**
|
|
473
|
+
* @license lucide-react v0.577.0 - ISC
|
|
474
|
+
*
|
|
475
|
+
* This source code is licensed under the ISC license.
|
|
476
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
+
*/const fR=[["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"}]],yS=Le("wifi-off",fR);/**
|
|
478
|
+
* @license lucide-react v0.577.0 - ISC
|
|
479
|
+
*
|
|
480
|
+
* This source code is licensed under the ISC license.
|
|
481
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
+
*/const hR=[["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"}]],pR=Le("wifi",hR);/**
|
|
483
|
+
* @license lucide-react v0.577.0 - ISC
|
|
484
|
+
*
|
|
485
|
+
* This source code is licensed under the ISC license.
|
|
486
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
487
|
+
*/const mR=[["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"}]],gR=Le("wrench",mR);/**
|
|
488
|
+
* @license lucide-react v0.577.0 - ISC
|
|
489
|
+
*
|
|
490
|
+
* This source code is licensed under the ISC license.
|
|
491
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
+
*/const vR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bs=Le("x",vR);/**
|
|
493
|
+
* @license lucide-react v0.577.0 - ISC
|
|
494
|
+
*
|
|
495
|
+
* This source code is licensed under the ISC license.
|
|
496
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
+
*/const yR=[["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"}]],sm=Le("zap",yR);function _S(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=_S(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function tf(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=_S(t))&&(r&&(r+=" "),r+=e);return r}const H_=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,U_=tf,$a=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return U_(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=e,c=Object.keys(o).map(d=>{const p=n==null?void 0:n[d],h=l==null?void 0:l[d];if(p===null)return null;const v=H_(p)||H_(h);return o[d][v]}),a=n&&Object.entries(n).reduce((d,p)=>{let[h,v]=p;return v===void 0||(d[h]=v),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:h,className:v,...x}=p;return Object.entries(x).every(C=>{let[w,y]=C;return Array.isArray(y)?y.includes({...l,...a}[w]):{...l,...a}[w]===y})?[...d,h,v]:d},[]);return U_(t,c,u,n==null?void 0:n.class,n==null?void 0:n.className)};var Va=Zx();const _R=Xd(Va);function $_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Hs(...t){return e=>{let n=!1;const r=t.map(o=>{const l=$_(o,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():$_(t[o],null)}}}}function ct(...t){return N.useCallback(Hs(...t),t)}function Ri(t){const e=bR(t),n=N.forwardRef((r,o)=>{const{children:l,...c}=r,a=N.Children.toArray(l),u=a.find(SR);if(u){const d=u.props.children,p=a.map(h=>h===u?N.Children.count(d)>1?N.Children.only(null):N.isValidElement(d)?d.props.children:null:h);return m.jsx(e,{...c,ref:o,children:N.isValidElement(d)?N.cloneElement(d,void 0,p):null})}return m.jsx(e,{...c,ref:o,children:l})});return n.displayName=`${t}.Slot`,n}var Ac=Ri("Slot");function bR(t){const e=N.forwardRef((n,r)=>{const{children:o,...l}=n;if(N.isValidElement(o)){const c=CR(o),a=wR(l,o.props);return o.type!==N.Fragment&&(a.ref=r?Hs(r,c):c),N.cloneElement(o,a)}return N.Children.count(o)>1?N.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var bS=Symbol("radix.slottable");function xR(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=bS,e}function SR(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===bS}function wR(t,e){const n={...e};for(const r in e){const o=t[r],l=e[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...a)=>{const u=l(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...t,...n}}function CR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var kR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=kR.reduce((t,e)=>{const n=Ri(`Primitive.${e}`),r=N.forwardRef((o,l)=>{const{asChild:c,...a}=o,u=c?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...a,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function xS(t,e){t&&Va.flushSync(()=>t.dispatchEvent(e))}var SS=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"}),ER="VisuallyHidden",wS=N.forwardRef((t,e)=>m.jsx(Ke.span,{...t,ref:e,style:{...SS,...t.style}}));wS.displayName=ER;var AR=wS;function RR(t,e){const n=N.createContext(e),r=l=>{const{children:c,...a}=l,u=N.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:u,children:c})};r.displayName=t+"Provider";function o(l){const c=N.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${l}\` must be used within \`${t}\``)}return[r,o]}function br(t,e=[]){let n=[];function r(l,c){const a=N.createContext(c),u=n.length;n=[...n,c];const d=h=>{var S;const{scope:v,children:x,...C}=h,w=((S=v==null?void 0:v[t])==null?void 0:S[u])||a,y=N.useMemo(()=>C,Object.values(C));return m.jsx(w.Provider,{value:y,children:x})};d.displayName=l+"Provider";function p(h,v){var w;const x=((w=v==null?void 0:v[t])==null?void 0:w[u])||a,C=N.useContext(x);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${h}\` must be used within \`${l}\``)}return[d,p]}const o=()=>{const l=n.map(c=>N.createContext(c));return function(a){const u=(a==null?void 0:a[t])||l;return N.useMemo(()=>({[`__scope${t}`]:{...a,[t]:u}}),[a,u])}};return o.scopeName=t,[r,TR(o,...e)]}function TR(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const c=r.reduce((a,{useScope:u,scopeName:d})=>{const h=u(l)[`__scope${d}`];return{...a,...h}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function Mg(t){const e=t+"CollectionProvider",[n,r]=br(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),c=w=>{const{scope:y,children:S}=w,_=En.useRef(null),b=En.useRef(new Map).current;return m.jsx(o,{scope:y,itemMap:b,collectionRef:_,children:S})};c.displayName=e;const a=t+"CollectionSlot",u=Ri(a),d=En.forwardRef((w,y)=>{const{scope:S,children:_}=w,b=l(a,S),k=ct(y,b.collectionRef);return m.jsx(u,{ref:k,children:_})});d.displayName=a;const p=t+"CollectionItemSlot",h="data-radix-collection-item",v=Ri(p),x=En.forwardRef((w,y)=>{const{scope:S,children:_,...b}=w,k=En.useRef(null),T=ct(y,k),R=l(p,S);return En.useEffect(()=>(R.itemMap.set(k,{ref:k,...b}),()=>void R.itemMap.delete(k))),m.jsx(v,{[h]:"",ref:T,children:_})});x.displayName=p;function C(w){const y=l(t+"CollectionConsumer",w);return En.useCallback(()=>{const _=y.collectionRef.current;if(!_)return[];const b=Array.from(_.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((R,M)=>b.indexOf(R.ref.current)-b.indexOf(M.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:c,Slot:d,ItemSlot:x},C,r]}function Ie(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}var _n=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},NR=Qx[" useInsertionEffect ".trim().toString()]||_n;function Us({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,c]=DR({defaultProp:e,onChange:n}),a=t!==void 0,u=a?t:o;{const p=N.useRef(t!==void 0);N.useEffect(()=>{const h=p.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"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.`),p.current=a},[a,r])}const d=N.useCallback(p=>{var h;if(a){const v=MR(p)?p(t):p;v!==t&&((h=c.current)==null||h.call(c,v))}else l(p)},[a,t,l,c]);return[u,d]}function DR({defaultProp:t,onChange:e}){const[n,r]=N.useState(t),o=N.useRef(n),l=N.useRef(e);return NR(()=>{l.current=e},[e]),N.useEffect(()=>{var c;o.current!==n&&((c=l.current)==null||c.call(l,n),o.current=n)},[n,o]),[n,r,l]}function MR(t){return typeof t=="function"}function jR(t,e){return N.useReducer((n,r)=>{const o=e[n][r];return o!=null?o:n},t)}var bn=t=>{const{present:e,children:n}=t,r=OR(e),o=typeof n=="function"?n({present:r.isPresent}):N.Children.only(n),l=ct(r.ref,LR(o));return typeof n=="function"||r.isPresent?N.cloneElement(o,{ref:l}):null};bn.displayName="Presence";function OR(t){const[e,n]=N.useState(),r=N.useRef(null),o=N.useRef(t),l=N.useRef("none"),c=t?"mounted":"unmounted",[a,u]=jR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const d=od(r.current);l.current=a==="mounted"?d:"none"},[a]),_n(()=>{const d=r.current,p=o.current;if(p!==t){const v=l.current,x=od(d);t?u("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),_n(()=>{var d;if(e){let p;const h=(d=e.ownerDocument.defaultView)!=null?d:window,v=C=>{const y=od(r.current).includes(CSS.escape(C.animationName));if(C.target===e&&y&&(u("ANIMATION_END"),!o.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",p=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},x=C=>{C.target===e&&(l.current=od(r.current))};return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{h.clearTimeout(p),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:N.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function od(t){return(t==null?void 0:t.animationName)||"none"}function LR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var IR=Qx[" useId ".trim().toString()]||(()=>{}),PR=0;function mn(t){const[e,n]=N.useState(IR());return _n(()=>{n(r=>r!=null?r:String(PR++))},[t]),e?`radix-${e}`:""}var nf="Collapsible",[zR]=br(nf),[BR,jg]=zR(nf),CS=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:l,onOpenChange:c,...a}=t,[u,d]=Us({prop:r,defaultProp:o!=null?o:!1,onChange:c,caller:nf});return m.jsx(BR,{scope:n,disabled:l,contentId:mn(),open:u,onOpenToggle:N.useCallback(()=>d(p=>!p),[d]),children:m.jsx(Ke.div,{"data-state":Lg(u),"data-disabled":l?"":void 0,...a,ref:e})})});CS.displayName=nf;var kS="CollapsibleTrigger",ES=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=jg(kS,n);return m.jsx(Ke.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Lg(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:e,onClick:Ie(t.onClick,o.onOpenToggle)})});ES.displayName=kS;var Og="CollapsibleContent",AS=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=jg(Og,t.__scopeCollapsible);return m.jsx(bn,{present:n||o.open,children:({present:l})=>m.jsx(FR,{...r,ref:e,present:l})})});AS.displayName=Og;var FR=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...l}=t,c=jg(Og,n),[a,u]=N.useState(r),d=N.useRef(null),p=ct(e,d),h=N.useRef(0),v=h.current,x=N.useRef(0),C=x.current,w=c.open||a,y=N.useRef(w),S=N.useRef(void 0);return N.useEffect(()=>{const _=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(_)},[]),_n(()=>{const _=d.current;if(_){S.current=S.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const b=_.getBoundingClientRect();h.current=b.height,x.current=b.width,y.current||(_.style.transitionDuration=S.current.transitionDuration,_.style.animationName=S.current.animationName),u(r)}},[c.open,r]),m.jsx(Ke.div,{"data-state":Lg(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...l,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...t.style},children:w&&o})});function Lg(t){return t?"open":"closed"}var HR=CS,UR=N.createContext(void 0);function Rc(t){const e=N.useContext(UR);return t||e||"ltr"}function An(t){const e=N.useRef(t);return N.useEffect(()=>{e.current=t}),N.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function $R(t,e=globalThis==null?void 0:globalThis.document){const n=An(t);N.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var VR="DismissableLayer",Ym="dismissableLayer.update",qR="dismissableLayer.pointerDownOutside",WR="dismissableLayer.focusOutside",V_,RS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qa=N.forwardRef((t,e)=>{var M;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:a,...u}=t,d=N.useContext(RS),[p,h]=N.useState(null),v=(M=p==null?void 0:p.ownerDocument)!=null?M:globalThis==null?void 0:globalThis.document,[,x]=N.useState({}),C=ct(e,A=>h(A)),w=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(y),_=p?w.indexOf(p):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,k=_>=S,T=YR(A=>{const j=A.target,O=[...d.branches].some(z=>z.contains(j));!k||O||(o==null||o(A),c==null||c(A),A.defaultPrevented||a==null||a())},v),R=XR(A=>{const j=A.target;[...d.branches].some(z=>z.contains(j))||(l==null||l(A),c==null||c(A),A.defaultPrevented||a==null||a())},v);return $R(A=>{_===d.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},v),N.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(V_=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),q_(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=V_)}},[p,v,n,d]),N.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),q_())},[p,d]),N.useEffect(()=>{const A=()=>x({});return document.addEventListener(Ym,A),()=>document.removeEventListener(Ym,A)},[]),m.jsx(Ke.div,{...u,ref:C,style:{pointerEvents:b?k?"auto":"none":void 0,...t.style},onFocusCapture:Ie(t.onFocusCapture,R.onFocusCapture),onBlurCapture:Ie(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ie(t.onPointerDownCapture,T.onPointerDownCapture)})});qa.displayName=VR;var GR="DismissableLayerBranch",KR=N.forwardRef((t,e)=>{const n=N.useContext(RS),r=N.useRef(null),o=ct(e,r);return N.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),m.jsx(Ke.div,{...t,ref:o})});KR.displayName=GR;function YR(t,e=globalThis==null?void 0:globalThis.document){const n=An(t),r=N.useRef(!1),o=N.useRef(()=>{});return N.useEffect(()=>{const l=a=>{if(a.target&&!r.current){let u=function(){TS(qR,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",l),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function XR(t,e=globalThis==null?void 0:globalThis.document){const n=An(t),r=N.useRef(!1);return N.useEffect(()=>{const o=l=>{l.target&&!r.current&&TS(WR,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function q_(){const t=new CustomEvent(Ym);document.dispatchEvent(t)}function TS(t,e,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?xS(o,l):o.dispatchEvent(l)}var im="focusScope.autoFocusOnMount",om="focusScope.autoFocusOnUnmount",W_={bubbles:!1,cancelable:!0},QR="FocusScope",Tc=N.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=t,[a,u]=N.useState(null),d=An(o),p=An(l),h=N.useRef(null),v=ct(e,w=>u(w)),x=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let w=function(b){if(x.paused||!a)return;const k=b.target;a.contains(k)?h.current=k:ki(h.current,{select:!0})},y=function(b){if(x.paused||!a)return;const k=b.relatedTarget;k!==null&&(a.contains(k)||ki(h.current,{select:!0}))},S=function(b){if(document.activeElement===document.body)for(const T of b)T.removedNodes.length>0&&ki(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",y);const _=new MutationObserver(S);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",y),_.disconnect()}}},[r,a,x.paused]),N.useEffect(()=>{if(a){K_.add(x);const w=document.activeElement;if(!a.contains(w)){const S=new CustomEvent(im,W_);a.addEventListener(im,d),a.dispatchEvent(S),S.defaultPrevented||(ZR(rT(NS(a)),{select:!0}),document.activeElement===w&&ki(a))}return()=>{a.removeEventListener(im,d),setTimeout(()=>{const S=new CustomEvent(om,W_);a.addEventListener(om,p),a.dispatchEvent(S),S.defaultPrevented||ki(w!=null?w:document.body,{select:!0}),a.removeEventListener(om,p),K_.remove(x)},0)}}},[a,d,p,x]);const C=N.useCallback(w=>{if(!n&&!r||x.paused)return;const y=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(y&&S){const _=w.currentTarget,[b,k]=JR(_);b&&k?!w.shiftKey&&S===k?(w.preventDefault(),n&&ki(b,{select:!0})):w.shiftKey&&S===b&&(w.preventDefault(),n&&ki(k,{select:!0})):S===_&&w.preventDefault()}},[n,r,x.paused]);return m.jsx(Ke.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Tc.displayName=QR;function ZR(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ki(r,{select:e}),document.activeElement!==n)return}function JR(t){const e=NS(t),n=G_(e,t),r=G_(e.reverse(),t);return[n,r]}function NS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function G_(t,e){for(const n of t)if(!eT(n,{upTo:e}))return n}function eT(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function tT(t){return t instanceof HTMLInputElement&&"select"in t}function ki(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&tT(t)&&e&&t.select()}}var K_=nT();function nT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Y_(t,e),t.unshift(e)},remove(e){var n;t=Y_(t,e),(n=t[0])==null||n.resume()}}}function Y_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function rT(t){return t.filter(e=>e.tagName!=="A")}var sT="Portal",Wa=N.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[o,l]=N.useState(!1);_n(()=>l(!0),[]);const c=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return c?_R.createPortal(m.jsx(Ke.div,{...r,ref:e}),c):null});Wa.displayName=sT;var am=0;function rf(){N.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!=null?e:X_()),document.body.insertAdjacentElement("beforeend",(n=t[1])!=null?n:X_()),am++,()=>{am===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),am--}},[])}function X_(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var as=function(){return as=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},as.apply(this,arguments)};function DS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function iT(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,l;r<o;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var _d="right-scroll-bar-position",bd="width-before-scroll-bar",oT="with-scroll-bars-hidden",aT="--removed-body-scroll-bar-size";function lm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function lT(t,e){var n=N.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var cT=typeof window<"u"?N.useLayoutEffect:N.useEffect,Q_=new WeakMap;function uT(t,e){var n=lT(null,function(r){return t.forEach(function(o){return lm(o,r)})});return cT(function(){var r=Q_.get(n);if(r){var o=new Set(r),l=new Set(t),c=n.current;o.forEach(function(a){l.has(a)||lm(a,null)}),l.forEach(function(a){o.has(a)||lm(a,c)})}Q_.set(n,t)},[t]),n}function dT(t){return t}function fT(t,e){e===void 0&&(e=dT);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(l){var c=e(l,r);return n.push(c),function(){n=n.filter(function(a){return a!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(a){return l(a)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var a=n;n=[],a.forEach(l),c=n}var u=function(){var p=c;c=[],p.forEach(l)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),n}}}};return o}function hT(t){t===void 0&&(t={});var e=fT(null);return e.options=as({async:!0,ssr:!1},t),e}var MS=function(t){var e=t.sideCar,n=DS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return N.createElement(r,as({},n))};MS.isSideCarExport=!0;function pT(t,e){return t.useMedium(e),MS}var jS=hT(),cm=function(){},sf=N.forwardRef(function(t,e){var n=N.useRef(null),r=N.useState({onScrollCapture:cm,onWheelCapture:cm,onTouchMoveCapture:cm}),o=r[0],l=r[1],c=t.forwardProps,a=t.children,u=t.className,d=t.removeScrollBar,p=t.enabled,h=t.shards,v=t.sideCar,x=t.noRelative,C=t.noIsolation,w=t.inert,y=t.allowPinchZoom,S=t.as,_=S===void 0?"div":S,b=t.gapMode,k=DS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,R=uT([n,e]),M=as(as({},k),o);return N.createElement(N.Fragment,null,p&&N.createElement(T,{sideCar:jS,removeScrollBar:d,shards:h,noRelative:x,noIsolation:C,inert:w,setCallbacks:l,allowPinchZoom:!!y,lockRef:n,gapMode:b}),c?N.cloneElement(N.Children.only(a),as(as({},M),{ref:R})):N.createElement(_,as({},M,{className:u,ref:R}),a))});sf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sf.classNames={fullWidth:bd,zeroRight:_d};var mT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=mT();return e&&t.setAttribute("nonce",e),t}function vT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function yT(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var _T=function(){var t=0,e=null;return{add:function(n){t==0&&(e=gT())&&(vT(e,n),yT(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},bT=function(){var t=_T();return function(e,n){N.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},OS=function(){var t=bT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},xT={left:0,top:0,right:0,gap:0},um=function(t){return parseInt(t||"",10)||0},ST=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[um(n),um(r),um(o)]},wT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return xT;var e=ST(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},CT=OS(),Aa="data-scroll-locked",kT=function(t,e,n,r){var o=t.left,l=t.top,c=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
498
|
+
.`.concat(oT,` {
|
|
499
|
+
overflow: hidden `).concat(r,`;
|
|
500
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
501
|
+
}
|
|
502
|
+
body[`).concat(Aa,`] {
|
|
503
|
+
overflow: hidden `).concat(r,`;
|
|
504
|
+
overscroll-behavior: contain;
|
|
505
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
506
|
+
padding-left: `.concat(o,`px;
|
|
507
|
+
padding-top: `).concat(l,`px;
|
|
508
|
+
padding-right: `).concat(c,`px;
|
|
509
|
+
margin-left:0;
|
|
510
|
+
margin-top:0;
|
|
511
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
512
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.`).concat(_d,` {
|
|
516
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.`).concat(bd,` {
|
|
520
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.`).concat(_d," .").concat(_d,` {
|
|
524
|
+
right: 0 `).concat(r,`;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.`).concat(bd," .").concat(bd,` {
|
|
528
|
+
margin-right: 0 `).concat(r,`;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
body[`).concat(Aa,`] {
|
|
532
|
+
`).concat(aT,": ").concat(a,`px;
|
|
533
|
+
}
|
|
534
|
+
`)},Z_=function(){var t=parseInt(document.body.getAttribute(Aa)||"0",10);return isFinite(t)?t:0},ET=function(){N.useEffect(function(){return document.body.setAttribute(Aa,(Z_()+1).toString()),function(){var t=Z_()-1;t<=0?document.body.removeAttribute(Aa):document.body.setAttribute(Aa,t.toString())}},[])},AT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;ET();var l=N.useMemo(function(){return wT(o)},[o]);return N.createElement(CT,{styles:kT(l,!e,o,n?"":"!important")})},Xm=!1;if(typeof window<"u")try{var ad=Object.defineProperty({},"passive",{get:function(){return Xm=!0,!0}});window.addEventListener("test",ad,ad),window.removeEventListener("test",ad,ad)}catch{Xm=!1}var va=Xm?{passive:!1}:!1,RT=function(t){return t.tagName==="TEXTAREA"},LS=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!RT(t)&&n[e]==="visible")},TT=function(t){return LS(t,"overflowY")},NT=function(t){return LS(t,"overflowX")},J_=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=IS(t,r);if(o){var l=PS(t,r),c=l[1],a=l[2];if(c>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},DT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},MT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},IS=function(t,e){return t==="v"?TT(e):NT(e)},PS=function(t,e){return t==="v"?DT(e):MT(e)},jT=function(t,e){return t==="h"&&e==="rtl"?-1:1},OT=function(t,e,n,r,o){var l=jT(t,window.getComputedStyle(e).direction),c=l*r,a=n.target,u=e.contains(a),d=!1,p=c>0,h=0,v=0;do{if(!a)break;var x=PS(t,a),C=x[0],w=x[1],y=x[2],S=w-y-l*C;(C||S)&&IS(t,a)&&(h+=S,v+=C);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(p&&Math.abs(h)<1||!p&&Math.abs(v)<1)&&(d=!0),d},ld=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},eb=function(t){return[t.deltaX,t.deltaY]},tb=function(t){return t&&"current"in t?t.current:t},LT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},IT=function(t){return`
|
|
535
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
536
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
537
|
+
`)},PT=0,ya=[];function zT(t){var e=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),o=N.useState(PT++)[0],l=N.useState(OS)[0],c=N.useRef(t);N.useEffect(function(){c.current=t},[t]),N.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var w=iT([t.lockRef.current],(t.shards||[]).map(tb),!0).filter(Boolean);return w.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=N.useCallback(function(w,y){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var S=ld(w),_=n.current,b="deltaX"in w?w.deltaX:_[0]-S[0],k="deltaY"in w?w.deltaY:_[1]-S[1],T,R=w.target,M=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in w&&M==="h"&&R.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,O=j?j===R||j.contains(R):!1;if(O)return!1;var z=J_(M,R);if(!z)return!0;if(z?T=M:(T=M==="v"?"h":"v",z=J_(M,R)),!z)return!1;if(!r.current&&"changedTouches"in w&&(b||k)&&(r.current=T),!T)return!0;var V=r.current||T;return OT(V,y,w,V==="h"?b:k)},[]),u=N.useCallback(function(w){var y=w;if(!(!ya.length||ya[ya.length-1]!==l)){var S="deltaY"in y?eb(y):ld(y),_=e.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&<(T.delta,S)})[0];if(_&&_.should){y.cancelable&&y.preventDefault();return}if(!_){var b=(c.current.shards||[]).map(tb).filter(Boolean).filter(function(T){return T.contains(y.target)}),k=b.length>0?a(y,b[0]):!c.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),d=N.useCallback(function(w,y,S,_){var b={name:w,delta:y,target:S,should:_,shadowParent:BT(S)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(k){return k!==b})},1)},[]),p=N.useCallback(function(w){n.current=ld(w),r.current=void 0},[]),h=N.useCallback(function(w){d(w.type,eb(w),w.target,a(w,t.lockRef.current))},[]),v=N.useCallback(function(w){d(w.type,ld(w),w.target,a(w,t.lockRef.current))},[]);N.useEffect(function(){return ya.push(l),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",u,va),document.addEventListener("touchmove",u,va),document.addEventListener("touchstart",p,va),function(){ya=ya.filter(function(w){return w!==l}),document.removeEventListener("wheel",u,va),document.removeEventListener("touchmove",u,va),document.removeEventListener("touchstart",p,va)}},[]);var x=t.removeScrollBar,C=t.inert;return N.createElement(N.Fragment,null,C?N.createElement(l,{styles:IT(o)}):null,x?N.createElement(AT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function BT(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const FT=pT(jS,zT);var Nc=N.forwardRef(function(t,e){return N.createElement(sf,as({},t,{ref:e,sideCar:FT}))});Nc.classNames=sf.classNames;var HT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_a=new WeakMap,cd=new WeakMap,ud={},dm=0,zS=function(t){return t&&(t.host||zS(t.parentNode))},UT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=zS(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},$T=function(t,e,n,r){var o=UT(e,Array.isArray(t)?t:[t]);ud[n]||(ud[n]=new WeakMap);var l=ud[n],c=[],a=new Set,u=new Set(o),d=function(h){!h||a.has(h)||(a.add(h),d(h.parentNode))};o.forEach(d);var p=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(v){if(a.has(v))p(v);else try{var x=v.getAttribute(r),C=x!==null&&x!=="false",w=(_a.get(v)||0)+1,y=(l.get(v)||0)+1;_a.set(v,w),l.set(v,y),c.push(v),w===1&&C&&cd.set(v,!0),y===1&&v.setAttribute(n,"true"),C||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return p(e),a.clear(),dm++,function(){c.forEach(function(h){var v=_a.get(h)-1,x=l.get(h)-1;_a.set(h,v),l.set(h,x),v||(cd.has(h)||h.removeAttribute(r),cd.delete(h)),x||h.removeAttribute(n)}),dm--,dm||(_a=new WeakMap,_a=new WeakMap,cd=new WeakMap,ud={})}},of=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=HT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),$T(r,o,n,"aria-hidden")):function(){return null}},af="Dialog",[BS]=br(af),[VT,Jr]=BS(af),FS=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!0}=t,a=N.useRef(null),u=N.useRef(null),[d,p]=Us({prop:r,defaultProp:o!=null?o:!1,onChange:l,caller:af});return m.jsx(VT,{scope:e,triggerRef:a,contentRef:u,contentId:mn(),titleId:mn(),descriptionId:mn(),open:d,onOpenChange:p,onOpenToggle:N.useCallback(()=>p(h=>!h),[p]),modal:c,children:n})};FS.displayName=af;var HS="DialogTrigger",US=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Jr(HS,n),l=ct(e,o.triggerRef);return m.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":zg(o.open),...r,ref:l,onClick:Ie(t.onClick,o.onOpenToggle)})});US.displayName=HS;var Ig="DialogPortal",[qT,$S]=BS(Ig,{forceMount:void 0}),VS=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,l=Jr(Ig,e);return m.jsx(qT,{scope:e,forceMount:n,children:N.Children.map(r,c=>m.jsx(bn,{present:n||l.open,children:m.jsx(Wa,{asChild:!0,container:o,children:c})}))})};VS.displayName=Ig;var Rd="DialogOverlay",qS=N.forwardRef((t,e)=>{const n=$S(Rd,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,l=Jr(Rd,t.__scopeDialog);return l.modal?m.jsx(bn,{present:r||l.open,children:m.jsx(GT,{...o,ref:e})}):null});qS.displayName=Rd;var WT=Ri("DialogOverlay.RemoveScroll"),GT=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Jr(Rd,n);return m.jsx(Nc,{as:WT,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(Ke.div,{"data-state":zg(o.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),yo="DialogContent",WS=N.forwardRef((t,e)=>{const n=$S(yo,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,l=Jr(yo,t.__scopeDialog);return m.jsx(bn,{present:r||l.open,children:l.modal?m.jsx(KT,{...o,ref:e}):m.jsx(YT,{...o,ref:e})})});WS.displayName=yo;var KT=N.forwardRef((t,e)=>{const n=Jr(yo,t.__scopeDialog),r=N.useRef(null),o=ct(e,n.contentRef,r);return N.useEffect(()=>{const l=r.current;if(l)return of(l)},[]),m.jsx(GS,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,a=c.button===0&&c.ctrlKey===!0;(c.button===2||a)&&l.preventDefault()}),onFocusOutside:Ie(t.onFocusOutside,l=>l.preventDefault())})}),YT=N.forwardRef((t,e)=>{const n=Jr(yo,t.__scopeDialog),r=N.useRef(!1),o=N.useRef(!1);return m.jsx(GS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),GS=N.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...c}=t,a=Jr(yo,n),u=N.useRef(null),d=ct(e,u);return rf(),m.jsxs(m.Fragment,{children:[m.jsx(Tc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:m.jsx(qa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":zg(a.open),...c,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(XT,{titleId:a.titleId}),m.jsx(ZT,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Pg="DialogTitle",KS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Jr(Pg,n);return m.jsx(Ke.h2,{id:o.titleId,...r,ref:e})});KS.displayName=Pg;var YS="DialogDescription",XS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Jr(YS,n);return m.jsx(Ke.p,{id:o.descriptionId,...r,ref:e})});XS.displayName=YS;var QS="DialogClose",ZS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Jr(QS,n);return m.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>o.onOpenChange(!1))})});ZS.displayName=QS;function zg(t){return t?"open":"closed"}var JS="DialogTitleWarning",[OV,e2]=RR(JS,{contentName:yo,titleName:Pg,docsSlug:"dialog"}),XT=({titleId:t})=>{const e=e2(JS),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
538
|
+
|
|
539
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
540
|
+
|
|
541
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return N.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},QT="DialogDescriptionWarning",ZT=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${e2(QT).contentName}}.`;return N.useEffect(()=>{var l;const o=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Bg=FS,JT=US,Fg=VS,Hg=qS,Ug=WS,t2=KS,n2=XS,lf=ZS;function e6(t){const e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function t6(t){const[e,n]=N.useState(void 0);return _n(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let c,a;if("borderBoxSize"in l){const u=l.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,a=d.blockSize}else c=t.offsetWidth,a=t.offsetHeight;n({width:c,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const n6=["top","right","bottom","left"],Ti=Math.min,gr=Math.max,Td=Math.round,dd=Math.floor,us=t=>({x:t,y:t}),r6={left:"right",right:"left",bottom:"top",top:"bottom"};function Qm(t,e,n){return gr(t,Ti(e,n))}function $s(t,e){return typeof t=="function"?t(e):t}function Vs(t){return t.split("-")[0]}function Ga(t){return t.split("-")[1]}function $g(t){return t==="x"?"y":"x"}function Vg(t){return t==="y"?"height":"width"}function ls(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function qg(t){return $g(ls(t))}function s6(t,e,n){n===void 0&&(n=!1);const r=Ga(t),o=qg(t),l=Vg(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(c=Nd(c)),[c,Nd(c)]}function i6(t){const e=Nd(t);return[Zm(t),e,Zm(e)]}function Zm(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const nb=["left","right"],rb=["right","left"],o6=["top","bottom"],a6=["bottom","top"];function l6(t,e,n){switch(t){case"top":case"bottom":return n?e?rb:nb:e?nb:rb;case"left":case"right":return e?o6:a6;default:return[]}}function c6(t,e,n,r){const o=Ga(t);let l=l6(Vs(t),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),e&&(l=l.concat(l.map(Zm)))),l}function Nd(t){const e=Vs(t);return r6[e]+t.slice(e.length)}function u6(t){return{top:0,right:0,bottom:0,left:0,...t}}function r2(t){return typeof t!="number"?u6(t):{top:t,right:t,bottom:t,left:t}}function Dd(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function sb(t,e,n){let{reference:r,floating:o}=t;const l=ls(e),c=qg(e),a=Vg(c),u=Vs(e),d=l==="y",p=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,v=r[a]/2-o[a]/2;let x;switch(u){case"top":x={x:p,y:r.y-o.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:h};break;case"left":x={x:r.x-o.width,y:h};break;default:x={x:r.x,y:r.y}}switch(Ga(e)){case"start":x[c]-=v*(n&&d?-1:1);break;case"end":x[c]+=v*(n&&d?-1:1);break}return x}async function d6(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:c,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:x=0}=$s(e,t),C=r2(x),y=a[v?h==="floating"?"reference":"floating":h],S=Dd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:u})),_=h==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),k=await(l.isElement==null?void 0:l.isElement(b))?await(l.getScale==null?void 0:l.getScale(b))||{x:1,y:1}:{x:1,y:1},T=Dd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:b,strategy:u}):_);return{top:(S.top-T.top+C.top)/k.y,bottom:(T.bottom-S.bottom+C.bottom)/k.y,left:(S.left-T.left+C.left)/k.x,right:(T.right-S.right+C.right)/k.x}}const f6=50,h6=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,a=c.detectOverflow?c:{...c,detectOverflow:d6},u=await(c.isRTL==null?void 0:c.isRTL(e));let d=await c.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:h}=sb(d,r,u),v=r,x=0;const C={};for(let w=0;w<l.length;w++){const y=l[w];if(!y)continue;const{name:S,fn:_}=y,{x:b,y:k,data:T,reset:R}=await _({x:p,y:h,initialPlacement:r,placement:v,strategy:o,middlewareData:C,rects:d,platform:a,elements:{reference:t,floating:e}});p=b!=null?b:p,h=k!=null?k:h,C[S]={...C[S],...T},R&&x<f6&&(x++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(d=R.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:p,y:h}=sb(d,v,u)),w=-1)}return{x:p,y:h,placement:v,strategy:o,middlewareData:C}},p6=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:l,platform:c,elements:a,middlewareData:u}=e,{element:d,padding:p=0}=$s(t,e)||{};if(d==null)return{};const h=r2(p),v={x:n,y:r},x=qg(o),C=Vg(x),w=await c.getDimensions(d),y=x==="y",S=y?"top":"left",_=y?"bottom":"right",b=y?"clientHeight":"clientWidth",k=l.reference[C]+l.reference[x]-v[x]-l.floating[C],T=v[x]-l.reference[x],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let M=R?R[b]:0;(!M||!await(c.isElement==null?void 0:c.isElement(R)))&&(M=a.floating[b]||l.floating[C]);const A=k/2-T/2,j=M/2-w[C]/2-1,O=Ti(h[S],j),z=Ti(h[_],j),V=O,F=M-w[C]-z,W=M/2-w[C]/2+A,G=Qm(V,W,F),q=!u.arrow&&Ga(o)!=null&&W!==G&&l.reference[C]/2-(W<V?O:z)-w[C]/2<0,X=q?W<V?W-V:W-F:0;return{[x]:v[x]+X,data:{[x]:G,centerOffset:W-G-X,...q&&{alignmentOffset:X}},reset:q}}}),m6=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:a,platform:u,elements:d}=e,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...y}=$s(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Vs(o),_=ls(a),b=Vs(a)===a,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=v||(b||!w?[Nd(a)]:i6(a)),R=C!=="none";!v&&R&&T.push(...c6(a,w,C,k));const M=[a,...T],A=await u.detectOverflow(e,y),j=[];let O=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&j.push(A[S]),h){const W=s6(o,c,k);j.push(A[W[0]],A[W[1]])}if(O=[...O,{placement:o,overflows:j}],!j.every(W=>W<=0)){var z,V;const W=(((z=l.flip)==null?void 0:z.index)||0)+1,G=M[W];if(G&&(!(h==="alignment"?_!==ls(G):!1)||O.every(Y=>ls(Y.placement)===_?Y.overflows[0]>0:!0)))return{data:{index:W,overflows:O},reset:{placement:G}};let q=(V=O.filter(X=>X.overflows[0]<=0).sort((X,Y)=>X.overflows[1]-Y.overflows[1])[0])==null?void 0:V.placement;if(!q)switch(x){case"bestFit":{var F;const X=(F=O.filter(Y=>{if(R){const I=ls(Y.placement);return I===_||I==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(I=>I>0).reduce((I,L)=>I+L,0)]).sort((Y,I)=>Y[1]-I[1])[0])==null?void 0:F[0];X&&(q=X);break}case"initialPlacement":q=a;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function ib(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ob(t){return n6.some(e=>t[e]>=0)}const g6=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...l}=$s(t,e);switch(o){case"referenceHidden":{const c=await r.detectOverflow(e,{...l,elementContext:"reference"}),a=ib(c,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ob(a)}}}case"escaped":{const c=await r.detectOverflow(e,{...l,altBoundary:!0}),a=ib(c,n.floating);return{data:{escapedOffsets:a,escaped:ob(a)}}}default:return{}}}}},s2=new Set(["left","top"]);async function v6(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Vs(n),a=Ga(n),u=ls(n)==="y",d=s2.has(c)?-1:1,p=l&&u?-1:1,h=$s(e,t);let{mainAxis:v,crossAxis:x,alignmentAxis:C}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof C=="number"&&(x=a==="end"?C*-1:C),u?{x:x*p,y:v*d}:{x:v*d,y:x*p}}const y6=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:l,placement:c,middlewareData:a}=e,u=await v6(e,t);return c===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:l+u.y,data:{...u,placement:c}}}}},_6=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:l}=e,{mainAxis:c=!0,crossAxis:a=!1,limiter:u={fn:S=>{let{x:_,y:b}=S;return{x:_,y:b}}},...d}=$s(t,e),p={x:n,y:r},h=await l.detectOverflow(e,d),v=ls(Vs(o)),x=$g(v);let C=p[x],w=p[v];if(c){const S=x==="y"?"top":"left",_=x==="y"?"bottom":"right",b=C+h[S],k=C-h[_];C=Qm(b,C,k)}if(a){const S=v==="y"?"top":"left",_=v==="y"?"bottom":"right",b=w+h[S],k=w-h[_];w=Qm(b,w,k)}const y=u.fn({...e,[x]:C,[v]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[x]:c,[v]:a}}}}}},b6=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:l,middlewareData:c}=e,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=$s(t,e),p={x:n,y:r},h=ls(o),v=$g(h);let x=p[v],C=p[h];const w=$s(a,e),y=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const b=v==="y"?"height":"width",k=l.reference[v]-l.floating[b]+y.mainAxis,T=l.reference[v]+l.reference[b]-y.mainAxis;x<k?x=k:x>T&&(x=T)}if(d){var S,_;const b=v==="y"?"width":"height",k=s2.has(Vs(o)),T=l.reference[h]-l.floating[b]+(k&&((S=c.offset)==null?void 0:S[h])||0)+(k?0:y.crossAxis),R=l.reference[h]+l.reference[b]+(k?0:((_=c.offset)==null?void 0:_[h])||0)-(k?y.crossAxis:0);C<T?C=T:C>R&&(C=R)}return{[v]:x,[h]:C}}}},x6=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:l,platform:c,elements:a}=e,{apply:u=()=>{},...d}=$s(t,e),p=await c.detectOverflow(e,d),h=Vs(o),v=Ga(o),x=ls(o)==="y",{width:C,height:w}=l.floating;let y,S;h==="top"||h==="bottom"?(y=h,S=v===(await(c.isRTL==null?void 0:c.isRTL(a.floating))?"start":"end")?"left":"right"):(S=h,y=v==="end"?"top":"bottom");const _=w-p.top-p.bottom,b=C-p.left-p.right,k=Ti(w-p[y],_),T=Ti(C-p[S],b),R=!e.middlewareData.shift;let M=k,A=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=_),R&&!v){const O=gr(p.left,0),z=gr(p.right,0),V=gr(p.top,0),F=gr(p.bottom,0);x?A=C-2*(O!==0||z!==0?O+z:gr(p.left,p.right)):M=w-2*(V!==0||F!==0?V+F:gr(p.top,p.bottom))}await u({...e,availableWidth:A,availableHeight:M});const j=await c.getDimensions(a.floating);return C!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}};function cf(){return typeof window<"u"}function Ka(t){return i2(t)?(t.nodeName||"").toLowerCase():"#document"}function yr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fs(t){var e;return(e=(i2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function i2(t){return cf()?t instanceof Node||t instanceof yr(t).Node:!1}function Qr(t){return cf()?t instanceof Element||t instanceof yr(t).Element:!1}function qs(t){return cf()?t instanceof HTMLElement||t instanceof yr(t).HTMLElement:!1}function ab(t){return!cf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yr(t).ShadowRoot}function Dc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Zr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function S6(t){return/^(table|td|th)$/.test(Ka(t))}function uf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const w6=/transform|translate|scale|rotate|perspective|filter/,C6=/paint|layout|strict|content/,uo=t=>!!t&&t!=="none";let fm;function Wg(t){const e=Qr(t)?Zr(t):t;return uo(e.transform)||uo(e.translate)||uo(e.scale)||uo(e.rotate)||uo(e.perspective)||!Gg()&&(uo(e.backdropFilter)||uo(e.filter))||w6.test(e.willChange||"")||C6.test(e.contain||"")}function k6(t){let e=Ni(t);for(;qs(e)&&!Ma(e);){if(Wg(e))return e;if(uf(e))return null;e=Ni(e)}return null}function Gg(){return fm==null&&(fm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fm}function Ma(t){return/^(html|body|#document)$/.test(Ka(t))}function Zr(t){return yr(t).getComputedStyle(t)}function df(t){return Qr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ni(t){if(Ka(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ab(t)&&t.host||fs(t);return ab(e)?e.host:e}function o2(t){const e=Ni(t);return Ma(e)?t.ownerDocument?t.ownerDocument.body:t.body:qs(e)&&Dc(e)?e:o2(e)}function gc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=o2(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),c=yr(o);if(l){const a=Jm(c);return e.concat(c,c.visualViewport||[],Dc(o)?o:[],a&&n?gc(a):[])}else return e.concat(o,gc(o,[],n))}function Jm(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function a2(t){const e=Zr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=qs(t),l=o?t.offsetWidth:n,c=o?t.offsetHeight:r,a=Td(n)!==l||Td(r)!==c;return a&&(n=l,r=c),{width:n,height:r,$:a}}function Kg(t){return Qr(t)?t:t.contextElement}function Ra(t){const e=Kg(t);if(!qs(e))return us(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=a2(e);let c=(l?Td(n.width):n.width)/r,a=(l?Td(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!a||!Number.isFinite(a))&&(a=1),{x:c,y:a}}const E6=us(0);function l2(t){const e=yr(t);return!Gg()||!e.visualViewport?E6:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function A6(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==yr(t)?!1:e}function _o(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=Kg(t);let c=us(1);e&&(r?Qr(r)&&(c=Ra(r)):c=Ra(t));const a=A6(l,n,r)?l2(l):us(0);let u=(o.left+a.x)/c.x,d=(o.top+a.y)/c.y,p=o.width/c.x,h=o.height/c.y;if(l){const v=yr(l),x=r&&Qr(r)?yr(r):r;let C=v,w=Jm(C);for(;w&&r&&x!==C;){const y=Ra(w),S=w.getBoundingClientRect(),_=Zr(w),b=S.left+(w.clientLeft+parseFloat(_.paddingLeft))*y.x,k=S.top+(w.clientTop+parseFloat(_.paddingTop))*y.y;u*=y.x,d*=y.y,p*=y.x,h*=y.y,u+=b,d+=k,C=yr(w),w=Jm(C)}}return Dd({width:p,height:h,x:u,y:d})}function ff(t,e){const n=df(t).scrollLeft;return e?e.left+n:_o(fs(t)).left+n}function c2(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ff(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function R6(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",c=fs(r),a=e?uf(e.floating):!1;if(r===c||a&&l)return n;let u={scrollLeft:0,scrollTop:0},d=us(1);const p=us(0),h=qs(r);if((h||!h&&!l)&&((Ka(r)!=="body"||Dc(c))&&(u=df(r)),h)){const x=_o(r);d=Ra(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const v=c&&!h&&!l?c2(c,u):us(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+v.x,y:n.y*d.y-u.scrollTop*d.y+p.y+v.y}}function T6(t){return Array.from(t.getClientRects())}function N6(t){const e=fs(t),n=df(t),r=t.ownerDocument.body,o=gr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=gr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+ff(t);const a=-n.scrollTop;return Zr(r).direction==="rtl"&&(c+=gr(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:a}}const lb=25;function D6(t,e){const n=yr(t),r=fs(t),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,a=0,u=0;if(o){l=o.width,c=o.height;const p=Gg();(!p||p&&e==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const d=ff(r);if(d<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),x=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,C=Math.abs(r.clientWidth-h.clientWidth-x);C<=lb&&(l-=C)}else d<=lb&&(l+=d);return{width:l,height:c,x:a,y:u}}function M6(t,e){const n=_o(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=qs(t)?Ra(t):us(1),c=t.clientWidth*l.x,a=t.clientHeight*l.y,u=o*l.x,d=r*l.y;return{width:c,height:a,x:u,y:d}}function cb(t,e,n){let r;if(e==="viewport")r=D6(t,n);else if(e==="document")r=N6(fs(t));else if(Qr(e))r=M6(e,n);else{const o=l2(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Dd(r)}function u2(t,e){const n=Ni(t);return n===e||!Qr(n)||Ma(n)?!1:Zr(n).position==="fixed"||u2(n,e)}function j6(t,e){const n=e.get(t);if(n)return n;let r=gc(t,[],!1).filter(a=>Qr(a)&&Ka(a)!=="body"),o=null;const l=Zr(t).position==="fixed";let c=l?Ni(t):t;for(;Qr(c)&&!Ma(c);){const a=Zr(c),u=Wg(c);!u&&a.position==="fixed"&&(o=null),(l?!u&&!o:!u&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dc(c)&&!u&&u2(t,c))?r=r.filter(p=>p!==c):o=a,c=Ni(c)}return e.set(t,r),r}function O6(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const c=[...n==="clippingAncestors"?uf(e)?[]:j6(e,this._c):[].concat(n),r],a=cb(e,c[0],o);let u=a.top,d=a.right,p=a.bottom,h=a.left;for(let v=1;v<c.length;v++){const x=cb(e,c[v],o);u=gr(x.top,u),d=Ti(x.right,d),p=Ti(x.bottom,p),h=gr(x.left,h)}return{width:d-h,height:p-u,x:h,y:u}}function L6(t){const{width:e,height:n}=a2(t);return{width:e,height:n}}function I6(t,e,n){const r=qs(e),o=fs(e),l=n==="fixed",c=_o(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const u=us(0);function d(){u.x=ff(o)}if(r||!r&&!l)if((Ka(e)!=="body"||Dc(o))&&(a=df(e)),r){const x=_o(e,!0,l,e);u.x=x.x+e.clientLeft,u.y=x.y+e.clientTop}else o&&d();l&&!r&&o&&d();const p=o&&!r&&!l?c2(o,a):us(0),h=c.left+a.scrollLeft-u.x-p.x,v=c.top+a.scrollTop-u.y-p.y;return{x:h,y:v,width:c.width,height:c.height}}function hm(t){return Zr(t).position==="static"}function ub(t,e){if(!qs(t)||Zr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fs(t)===n&&(n=n.ownerDocument.body),n}function d2(t,e){const n=yr(t);if(uf(t))return n;if(!qs(t)){let o=Ni(t);for(;o&&!Ma(o);){if(Qr(o)&&!hm(o))return o;o=Ni(o)}return n}let r=ub(t,e);for(;r&&S6(r)&&hm(r);)r=ub(r,e);return r&&Ma(r)&&hm(r)&&!Wg(r)?n:r||k6(t)||n}const P6=async function(t){const e=this.getOffsetParent||d2,n=this.getDimensions,r=await n(t.floating);return{reference:I6(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z6(t){return Zr(t).direction==="rtl"}const B6={convertOffsetParentRelativeRectToViewportRelativeRect:R6,getDocumentElement:fs,getClippingRect:O6,getOffsetParent:d2,getElementRects:P6,getClientRects:T6,getDimensions:L6,getScale:Ra,isElement:Qr,isRTL:z6};function f2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function F6(t,e){let n=null,r;const o=fs(t);function l(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function c(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),l();const d=t.getBoundingClientRect(),{left:p,top:h,width:v,height:x}=d;if(a||e(),!v||!x)return;const C=dd(h),w=dd(o.clientWidth-(p+v)),y=dd(o.clientHeight-(h+x)),S=dd(p),b={rootMargin:-C+"px "+-w+"px "+-y+"px "+-S+"px",threshold:gr(0,Ti(1,u))||1};let k=!0;function T(R){const M=R[0].intersectionRatio;if(M!==u){if(!k)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!f2(d,t.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(T,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(t)}return c(!0),l}function H6(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Kg(t),p=o||l?[...d?gc(d):[],...e?gc(e):[]]:[];p.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const h=d&&a?F6(d,n):null;let v=-1,x=null;c&&(x=new ResizeObserver(S=>{let[_]=S;_&&_.target===d&&x&&e&&(x.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(e)})),n()}),d&&!u&&x.observe(d),e&&x.observe(e));let C,w=u?_o(t):null;u&&y();function y(){const S=_o(t);w&&!f2(w,S)&&n(),w=S,C=requestAnimationFrame(y)}return n(),()=>{var S;p.forEach(_=>{o&&_.removeEventListener("scroll",n),l&&_.removeEventListener("resize",n)}),h==null||h(),(S=x)==null||S.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const U6=y6,$6=_6,V6=m6,q6=x6,W6=g6,db=p6,G6=b6,K6=(t,e,n)=>{const r=new Map,o={platform:B6,...n},l={...o.platform,_c:r};return h6(t,e,{...o,platform:l})};var Y6=typeof document<"u",X6=function(){},xd=Y6?N.useLayoutEffect:X6;function Md(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Md(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&t.$$typeof)&&!Md(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function h2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function fb(t,e){const n=h2(t);return Math.round(e*n)/n}function pm(t){const e=N.useRef(t);return xd(()=>{e.current=t}),e}function Q6(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:u,open:d}=t,[p,h]=N.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,x]=N.useState(r);Md(v,r)||x(r);const[C,w]=N.useState(null),[y,S]=N.useState(null),_=N.useCallback(Y=>{Y!==R.current&&(R.current=Y,w(Y))},[]),b=N.useCallback(Y=>{Y!==M.current&&(M.current=Y,S(Y))},[]),k=l||C,T=c||y,R=N.useRef(null),M=N.useRef(null),A=N.useRef(p),j=u!=null,O=pm(u),z=pm(o),V=pm(d),F=N.useCallback(()=>{if(!R.current||!M.current)return;const Y={placement:e,strategy:n,middleware:v};z.current&&(Y.platform=z.current),K6(R.current,M.current,Y).then(I=>{const L={...I,isPositioned:V.current!==!1};W.current&&!Md(A.current,L)&&(A.current=L,Va.flushSync(()=>{h(L)}))})},[v,e,n,z,V]);xd(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(Y=>({...Y,isPositioned:!1})))},[d]);const W=N.useRef(!1);xd(()=>(W.current=!0,()=>{W.current=!1}),[]),xd(()=>{if(k&&(R.current=k),T&&(M.current=T),k&&T){if(O.current)return O.current(k,T,F);F()}},[k,T,F,O,j]);const G=N.useMemo(()=>({reference:R,floating:M,setReference:_,setFloating:b}),[_,b]),q=N.useMemo(()=>({reference:k,floating:T}),[k,T]),X=N.useMemo(()=>{const Y={position:n,left:0,top:0};if(!q.floating)return Y;const I=fb(q.floating,p.x),L=fb(q.floating,p.y);return a?{...Y,transform:"translate("+I+"px, "+L+"px)",...h2(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:L}},[n,a,q.floating,p.x,p.y]);return N.useMemo(()=>({...p,update:F,refs:G,elements:q,floatingStyles:X}),[p,F,G,q,X])}const Z6=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?db({element:r.current,padding:o}).fn(n):{}:r?db({element:r,padding:o}).fn(n):{}}}},J6=(t,e)=>{const n=U6(t);return{name:n.name,fn:n.fn,options:[t,e]}},eN=(t,e)=>{const n=$6(t);return{name:n.name,fn:n.fn,options:[t,e]}},tN=(t,e)=>({fn:G6(t).fn,options:[t,e]}),nN=(t,e)=>{const n=V6(t);return{name:n.name,fn:n.fn,options:[t,e]}},rN=(t,e)=>{const n=q6(t);return{name:n.name,fn:n.fn,options:[t,e]}},sN=(t,e)=>{const n=W6(t);return{name:n.name,fn:n.fn,options:[t,e]}},iN=(t,e)=>{const n=Z6(t);return{name:n.name,fn:n.fn,options:[t,e]}};var oN="Arrow",p2=N.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return m.jsx(Ke.svg,{...l,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});p2.displayName=oN;var aN=p2,Yg="Popper",[m2,Li]=br(Yg),[lN,g2]=m2(Yg),v2=t=>{const{__scopePopper:e,children:n}=t,[r,o]=N.useState(null);return m.jsx(lN,{scope:e,anchor:r,onAnchorChange:o,children:n})};v2.displayName=Yg;var y2="PopperAnchor",_2=N.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=g2(y2,n),c=N.useRef(null),a=ct(e,c),u=N.useRef(null);return N.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||c.current,d!==u.current&&l.onAnchorChange(u.current)}),r?null:m.jsx(Ke.div,{...o,ref:a})});_2.displayName=y2;var Xg="PopperContent",[cN,uN]=m2(Xg),b2=N.forwardRef((t,e)=>{var K,$,te,re,ae,se,_e,Re;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:c=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:C,...w}=t,y=g2(Xg,n),[S,_]=N.useState(null),b=ct(e,je=>_(je)),[k,T]=N.useState(null),R=t6(k),M=(K=R==null?void 0:R.width)!=null?K:0,A=($=R==null?void 0:R.height)!=null?$:0,j=r+(l!=="center"?"-"+l:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},z=Array.isArray(d)?d:[d],V=z.length>0,F={padding:O,boundary:z.filter(fN),altBoundary:V},{refs:W,floatingStyles:G,placement:q,isPositioned:X,middlewareData:Y}=Q6({strategy:"fixed",placement:j,whileElementsMounted:(...je)=>H6(...je,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[J6({mainAxis:o+A,alignmentAxis:c}),u&&eN({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?tN():void 0,...F}),u&&nN({...F}),rN({...F,apply:({elements:je,rects:ze,availableWidth:ce,availableHeight:Te})=>{const{width:ye,height:Pe}=ze.reference,Fe=je.floating.style;Fe.setProperty("--radix-popper-available-width",`${ce}px`),Fe.setProperty("--radix-popper-available-height",`${Te}px`),Fe.setProperty("--radix-popper-anchor-width",`${ye}px`),Fe.setProperty("--radix-popper-anchor-height",`${Pe}px`)}}),k&&iN({element:k,padding:a}),hN({arrowWidth:M,arrowHeight:A}),v&&sN({strategy:"referenceHidden",...F})]}),[I,L]=w2(q),P=An(C);_n(()=>{X&&(P==null||P())},[X,P]);const H=(te=Y.arrow)==null?void 0:te.x,B=(re=Y.arrow)==null?void 0:re.y,Z=((ae=Y.arrow)==null?void 0:ae.centerOffset)!==0,[J,ee]=N.useState();return _n(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]),m.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(se=Y.transformOrigin)==null?void 0:se.x,(_e=Y.transformOrigin)==null?void 0:_e.y].join(" "),...((Re=Y.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(cN,{scope:n,placedSide:I,onArrowChange:T,arrowX:H,arrowY:B,shouldHideArrow:Z,children:m.jsx(Ke.div,{"data-side":I,"data-align":L,...w,ref:b,style:{...w.style,animation:X?void 0:"none"}})})})});b2.displayName=Xg;var x2="PopperArrow",dN={top:"bottom",right:"left",bottom:"top",left:"right"},S2=N.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=uN(x2,r),c=dN[l.placedSide];return m.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:m.jsx(aN,{...o,ref:n,style:{...o.style,display:"block"}})})});S2.displayName=x2;function fN(t){return t!==null}var hN=t=>({name:"transformOrigin",options:t,fn(e){var y,S,_,b,k;const{placement:n,rects:r,middlewareData:o}=e,c=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=c?0:t.arrowWidth,u=c?0:t.arrowHeight,[d,p]=w2(n),h={start:"0%",center:"50%",end:"100%"}[p],v=((_=(S=o.arrow)==null?void 0:S.x)!=null?_:0)+a/2,x=((k=(b=o.arrow)==null?void 0:b.y)!=null?k:0)+u/2;let C="",w="";return d==="bottom"?(C=c?h:`${v}px`,w=`${-u}px`):d==="top"?(C=c?h:`${v}px`,w=`${r.floating.height+u}px`):d==="right"?(C=`${-u}px`,w=c?h:`${x}px`):d==="left"&&(C=`${r.floating.width+u}px`,w=c?h:`${x}px`),{data:{x:C,y:w}}}});function w2(t){const[e,n="center"]=t.split("-");return[e,n]}var hf=v2,Mc=_2,pf=b2,mf=S2,mm="rovingFocusGroup.onEntryFocus",pN={bubbles:!1,cancelable:!0},jc="RovingFocusGroup",[eg,C2,mN]=Mg(jc),[gN,gf]=br(jc,[mN]),[vN,yN]=gN(jc),k2=N.forwardRef((t,e)=>m.jsx(eg.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(eg.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(_N,{...t,ref:e})})}));k2.displayName=jc;var _N=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=t,v=N.useRef(null),x=ct(e,v),C=Rc(l),[w,y]=Us({prop:c,defaultProp:a!=null?a:null,onChange:u,caller:jc}),[S,_]=N.useState(!1),b=An(d),k=C2(n),T=N.useRef(!1),[R,M]=N.useState(0);return N.useEffect(()=>{const A=v.current;if(A)return A.addEventListener(mm,b),()=>A.removeEventListener(mm,b)},[b]),m.jsx(vN,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:w,onItemFocus:N.useCallback(A=>y(A),[y]),onItemShiftTab:N.useCallback(()=>_(!0),[]),onFocusableItemAdd:N.useCallback(()=>M(A=>A+1),[]),onFocusableItemRemove:N.useCallback(()=>M(A=>A-1),[]),children:m.jsx(Ke.div,{tabIndex:S||R===0?-1:0,"data-orientation":r,...h,ref:x,style:{outline:"none",...t.style},onMouseDown:Ie(t.onMouseDown,()=>{T.current=!0}),onFocus:Ie(t.onFocus,A=>{const j=!T.current;if(A.target===A.currentTarget&&j&&!S){const O=new CustomEvent(mm,pN);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const z=k().filter(q=>q.focusable),V=z.find(q=>q.active),F=z.find(q=>q.id===w),G=[V,F,...z].filter(Boolean).map(q=>q.ref.current);R2(G,p)}}T.current=!1}),onBlur:Ie(t.onBlur,()=>_(!1))})})}),E2="RovingFocusGroupItem",A2=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:c,...a}=t,u=mn(),d=l||u,p=yN(E2,n),h=p.currentTabStopId===d,v=C2(n),{onFocusableItemAdd:x,onFocusableItemRemove:C,currentTabStopId:w}=p;return N.useEffect(()=>{if(r)return x(),()=>C()},[r,x,C]),m.jsx(eg.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:m.jsx(Ke.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...a,ref:e,onMouseDown:Ie(t.onMouseDown,y=>{r?p.onItemFocus(d):y.preventDefault()}),onFocus:Ie(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:Ie(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=SN(y,p.orientation,p.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=v().filter(k=>k.focusable).map(k=>k.ref.current);if(S==="last")b.reverse();else if(S==="prev"||S==="next"){S==="prev"&&b.reverse();const k=b.indexOf(y.currentTarget);b=p.loop?wN(b,k+1):b.slice(k+1)}setTimeout(()=>R2(b))}}),children:typeof c=="function"?c({isCurrentTabStop:h,hasTabStop:w!=null}):c})})});A2.displayName=E2;var bN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xN(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function SN(t,e,n){const r=xN(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return bN[r]}function R2(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function wN(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var T2=k2,N2=A2,tg=["Enter"," "],CN=["ArrowDown","PageUp","Home"],D2=["ArrowUp","PageDown","End"],kN=[...CN,...D2],EN={ltr:[...tg,"ArrowRight"],rtl:[...tg,"ArrowLeft"]},AN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Oc="Menu",[vc,RN,TN]=Mg(Oc),[Co,M2]=br(Oc,[TN,Li,gf]),vf=Li(),j2=gf(),[NN,ko]=Co(Oc),[DN,Lc]=Co(Oc),O2=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:c=!0}=t,a=vf(e),[u,d]=N.useState(null),p=N.useRef(!1),h=An(l),v=Rc(o);return N.useEffect(()=>{const x=()=>{p.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>p.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),m.jsx(hf,{...a,children:m.jsx(NN,{scope:e,open:n,onOpenChange:h,content:u,onContentChange:d,children:m.jsx(DN,{scope:e,onClose:N.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:v,modal:c,children:r})})})};O2.displayName=Oc;var MN="MenuAnchor",Qg=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=vf(n);return m.jsx(Mc,{...o,...r,ref:e})});Qg.displayName=MN;var Zg="MenuPortal",[jN,L2]=Co(Zg,{forceMount:void 0}),I2=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=ko(Zg,e);return m.jsx(jN,{scope:e,forceMount:n,children:m.jsx(bn,{present:n||l.open,children:m.jsx(Wa,{asChild:!0,container:o,children:r})})})};I2.displayName=Zg;var Pr="MenuContent",[ON,Jg]=Co(Pr),P2=N.forwardRef((t,e)=>{const n=L2(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=ko(Pr,t.__scopeMenu),c=Lc(Pr,t.__scopeMenu);return m.jsx(vc.Provider,{scope:t.__scopeMenu,children:m.jsx(bn,{present:r||l.open,children:m.jsx(vc.Slot,{scope:t.__scopeMenu,children:c.modal?m.jsx(LN,{...o,ref:e}):m.jsx(IN,{...o,ref:e})})})})}),LN=N.forwardRef((t,e)=>{const n=ko(Pr,t.__scopeMenu),r=N.useRef(null),o=ct(e,r);return N.useEffect(()=>{const l=r.current;if(l)return of(l)},[]),m.jsx(ev,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),IN=N.forwardRef((t,e)=>{const n=ko(Pr,t.__scopeMenu);return m.jsx(ev,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),PN=Ri("MenuContent.ScrollLock"),ev=N.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:v,onDismiss:x,disableOutsideScroll:C,...w}=t,y=ko(Pr,n),S=Lc(Pr,n),_=vf(n),b=j2(n),k=RN(n),[T,R]=N.useState(null),M=N.useRef(null),A=ct(e,M,y.onContentChange),j=N.useRef(0),O=N.useRef(""),z=N.useRef(0),V=N.useRef(null),F=N.useRef("right"),W=N.useRef(0),G=C?Nc:N.Fragment,q=C?{as:PN,allowPinchZoom:!0}:void 0,X=I=>{var K,$;const L=O.current+I,P=k().filter(te=>!te.disabled),H=document.activeElement,B=(K=P.find(te=>te.ref.current===H))==null?void 0:K.textValue,Z=P.map(te=>te.textValue),J=YN(Z,L,B),ee=($=P.find(te=>te.textValue===J))==null?void 0:$.ref.current;(function te(re){O.current=re,window.clearTimeout(j.current),re!==""&&(j.current=window.setTimeout(()=>te(""),1e3))})(L),ee&&setTimeout(()=>ee.focus())};N.useEffect(()=>()=>window.clearTimeout(j.current),[]),rf();const Y=N.useCallback(I=>{var P,H;return F.current===((P=V.current)==null?void 0:P.side)&&QN(I,(H=V.current)==null?void 0:H.area)},[]);return m.jsx(ON,{scope:n,searchRef:O,onItemEnter:N.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),onItemLeave:N.useCallback(I=>{var L;Y(I)||((L=M.current)==null||L.focus(),R(null))},[Y]),onTriggerLeave:N.useCallback(I=>{Y(I)&&I.preventDefault()},[Y]),pointerGraceTimerRef:z,onPointerGraceIntentChange:N.useCallback(I=>{V.current=I},[]),children:m.jsx(G,{...q,children:m.jsx(Tc,{asChild:!0,trapped:o,onMountAutoFocus:Ie(l,I=>{var L;I.preventDefault(),(L=M.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:m.jsx(qa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:v,onDismiss:x,children:m.jsx(T2,{asChild:!0,...b,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:R,onEntryFocus:Ie(u,I=>{S.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(pf,{role:"menu","aria-orientation":"vertical","data-state":J2(y.open),"data-radix-menu-content":"",dir:S.dir,..._,...w,ref:A,style:{outline:"none",...w.style},onKeyDown:Ie(w.onKeyDown,I=>{const P=I.target.closest("[data-radix-menu-content]")===I.currentTarget,H=I.ctrlKey||I.altKey||I.metaKey,B=I.key.length===1;P&&(I.key==="Tab"&&I.preventDefault(),!H&&B&&X(I.key));const Z=M.current;if(I.target!==Z||!kN.includes(I.key))return;I.preventDefault();const ee=k().filter(K=>!K.disabled).map(K=>K.ref.current);D2.includes(I.key)&&ee.reverse(),GN(ee)}),onBlur:Ie(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(j.current),O.current="")}),onPointerMove:Ie(t.onPointerMove,yc(I=>{const L=I.target,P=W.current!==I.clientX;if(I.currentTarget.contains(L)&&P){const H=I.clientX>W.current?"right":"left";F.current=H,W.current=I.clientX}}))})})})})})})});P2.displayName=Pr;var zN="MenuGroup",tv=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Ke.div,{role:"group",...r,ref:e})});tv.displayName=zN;var BN="MenuLabel",z2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Ke.div,{...r,ref:e})});z2.displayName=BN;var jd="MenuItem",hb="menu.itemSelect",yf=N.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=N.useRef(null),c=Lc(jd,t.__scopeMenu),a=Jg(jd,t.__scopeMenu),u=ct(e,l),d=N.useRef(!1),p=()=>{const h=l.current;if(!n&&h){const v=new CustomEvent(hb,{bubbles:!0,cancelable:!0});h.addEventListener(hb,x=>r==null?void 0:r(x),{once:!0}),xS(h,v),v.defaultPrevented?d.current=!1:c.onClose()}};return m.jsx(B2,{...o,ref:u,disabled:n,onClick:Ie(t.onClick,p),onPointerDown:h=>{var v;(v=t.onPointerDown)==null||v.call(t,h),d.current=!0},onPointerUp:Ie(t.onPointerUp,h=>{var v;d.current||(v=h.currentTarget)==null||v.click()}),onKeyDown:Ie(t.onKeyDown,h=>{const v=a.searchRef.current!=="";n||v&&h.key===" "||tg.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});yf.displayName=jd;var B2=N.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,c=Jg(jd,n),a=j2(n),u=N.useRef(null),d=ct(e,u),[p,h]=N.useState(!1),[v,x]=N.useState("");return N.useEffect(()=>{var w;const C=u.current;C&&x(((w=C.textContent)!=null?w:"").trim())},[l.children]),m.jsx(vc.ItemSlot,{scope:n,disabled:r,textValue:o!=null?o:v,children:m.jsx(N2,{asChild:!0,...a,focusable:!r,children:m.jsx(Ke.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:Ie(t.onPointerMove,yc(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(t.onPointerLeave,yc(C=>c.onItemLeave(C))),onFocus:Ie(t.onFocus,()=>h(!0)),onBlur:Ie(t.onBlur,()=>h(!1))})})})}),FN="MenuCheckboxItem",F2=N.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return m.jsx(q2,{scope:t.__scopeMenu,checked:n,children:m.jsx(yf,{role:"menuitemcheckbox","aria-checked":Od(n)?"mixed":n,...o,ref:e,"data-state":rv(n),onSelect:Ie(o.onSelect,()=>r==null?void 0:r(Od(n)?!0:!n),{checkForDefaultPrevented:!1})})})});F2.displayName=FN;var H2="MenuRadioGroup",[HN,UN]=Co(H2,{value:void 0,onValueChange:()=>{}}),U2=N.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=An(r);return m.jsx(HN,{scope:t.__scopeMenu,value:n,onValueChange:l,children:m.jsx(tv,{...o,ref:e})})});U2.displayName=H2;var $2="MenuRadioItem",V2=N.forwardRef((t,e)=>{const{value:n,...r}=t,o=UN($2,t.__scopeMenu),l=n===o.value;return m.jsx(q2,{scope:t.__scopeMenu,checked:l,children:m.jsx(yf,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":rv(l),onSelect:Ie(r.onSelect,()=>{var c;return(c=o.onValueChange)==null?void 0:c.call(o,n)},{checkForDefaultPrevented:!1})})})});V2.displayName=$2;var nv="MenuItemIndicator",[q2,$N]=Co(nv,{checked:!1}),W2=N.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=$N(nv,n);return m.jsx(bn,{present:r||Od(l.checked)||l.checked===!0,children:m.jsx(Ke.span,{...o,ref:e,"data-state":rv(l.checked)})})});W2.displayName=nv;var VN="MenuSeparator",G2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});G2.displayName=VN;var qN="MenuArrow",K2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=vf(n);return m.jsx(mf,{...o,...r,ref:e})});K2.displayName=qN;var WN="MenuSub",[LV,Y2]=Co(WN),lc="MenuSubTrigger",X2=N.forwardRef((t,e)=>{const n=ko(lc,t.__scopeMenu),r=Lc(lc,t.__scopeMenu),o=Y2(lc,t.__scopeMenu),l=Jg(lc,t.__scopeMenu),c=N.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=l,d={__scopeMenu:t.__scopeMenu},p=N.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return N.useEffect(()=>p,[p]),N.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),u(null)}},[a,u]),m.jsx(Qg,{asChild:!0,...d,children:m.jsx(B2,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":J2(n.open),...t,ref:Hs(e,o.onTriggerChange),onClick:h=>{var v;(v=t.onClick)==null||v.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(t.onPointerMove,yc(h=>{l.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Ie(t.onPointerLeave,yc(h=>{var x,C;p();const v=(x=n.content)==null?void 0:x.getBoundingClientRect();if(v){const w=(C=n.content)==null?void 0:C.dataset.side,y=w==="right",S=y?-5:5,_=v[y?"left":"right"],b=v[y?"right":"left"];l.onPointerGraceIntentChange({area:[{x:h.clientX+S,y:h.clientY},{x:_,y:v.top},{x:b,y:v.top},{x:b,y:v.bottom},{x:_,y:v.bottom}],side:w}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(h),h.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(t.onKeyDown,h=>{var x;const v=l.searchRef.current!=="";t.disabled||v&&h.key===" "||EN[r.dir].includes(h.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),h.preventDefault())})})})});X2.displayName=lc;var Q2="MenuSubContent",Z2=N.forwardRef((t,e)=>{const n=L2(Pr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=ko(Pr,t.__scopeMenu),c=Lc(Pr,t.__scopeMenu),a=Y2(Q2,t.__scopeMenu),u=N.useRef(null),d=ct(e,u);return m.jsx(vc.Provider,{scope:t.__scopeMenu,children:m.jsx(bn,{present:r||l.open,children:m.jsx(vc.Slot,{scope:t.__scopeMenu,children:m.jsx(ev,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var h;c.isUsingKeyboardRef.current&&((h=u.current)==null||h.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ie(t.onFocusOutside,p=>{p.target!==a.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Ie(t.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:Ie(t.onKeyDown,p=>{var x;const h=p.currentTarget.contains(p.target),v=AN[c.dir].includes(p.key);h&&v&&(l.onOpenChange(!1),(x=a.trigger)==null||x.focus(),p.preventDefault())})})})})})});Z2.displayName=Q2;function J2(t){return t?"open":"closed"}function Od(t){return t==="indeterminate"}function rv(t){return Od(t)?"indeterminate":t?"checked":"unchecked"}function GN(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function KN(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function YN(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=KN(t,Math.max(l,0));o.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function XN(t,e){const{x:n,y:r}=t;let o=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,p=a.y,h=u.x,v=u.y;p>r!=v>r&&n<(h-d)*(r-p)/(v-p)+d&&(o=!o)}return o}function QN(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return XN(n,e)}function yc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ZN=O2,JN=Qg,eD=I2,tD=P2,nD=tv,rD=z2,sD=yf,iD=F2,oD=U2,aD=V2,lD=W2,cD=G2,uD=K2,dD=X2,fD=Z2,_f="DropdownMenu",[hD]=br(_f,[M2]),Vn=M2(),[pD,ew]=hD(_f),tw=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:c,modal:a=!0}=t,u=Vn(e),d=N.useRef(null),[p,h]=Us({prop:o,defaultProp:l!=null?l:!1,onChange:c,caller:_f});return m.jsx(pD,{scope:e,triggerId:mn(),triggerRef:d,contentId:mn(),open:p,onOpenChange:h,onOpenToggle:N.useCallback(()=>h(v=>!v),[h]),modal:a,children:m.jsx(ZN,{...u,open:p,onOpenChange:h,dir:r,modal:a,children:n})})};tw.displayName=_f;var nw="DropdownMenuTrigger",rw=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=ew(nw,n),c=Vn(n);return m.jsx(JN,{asChild:!0,...c,children:m.jsx(Ke.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Hs(e,l.triggerRef),onPointerDown:Ie(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(l.onOpenToggle(),l.open||a.preventDefault())}),onKeyDown:Ie(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&l.onOpenToggle(),a.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});rw.displayName=nw;var mD="DropdownMenuPortal",sw=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Vn(e);return m.jsx(eD,{...r,...n})};sw.displayName=mD;var iw="DropdownMenuContent",ow=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ew(iw,n),l=Vn(n),c=N.useRef(!1);return m.jsx(tD,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:Ie(t.onCloseAutoFocus,a=>{var u;c.current||(u=o.triggerRef.current)==null||u.focus(),c.current=!1,a.preventDefault()}),onInteractOutside:Ie(t.onInteractOutside,a=>{const u=a.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!o.modal||p)&&(c.current=!0)}),style:{...t.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)"}})});ow.displayName=iw;var gD="DropdownMenuGroup",vD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(nD,{...o,...r,ref:e})});vD.displayName=gD;var yD="DropdownMenuLabel",_D=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(rD,{...o,...r,ref:e})});_D.displayName=yD;var bD="DropdownMenuItem",aw=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(sD,{...o,...r,ref:e})});aw.displayName=bD;var xD="DropdownMenuCheckboxItem",SD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(iD,{...o,...r,ref:e})});SD.displayName=xD;var wD="DropdownMenuRadioGroup",CD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(oD,{...o,...r,ref:e})});CD.displayName=wD;var kD="DropdownMenuRadioItem",ED=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(aD,{...o,...r,ref:e})});ED.displayName=kD;var AD="DropdownMenuItemIndicator",RD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(lD,{...o,...r,ref:e})});RD.displayName=AD;var TD="DropdownMenuSeparator",ND=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(cD,{...o,...r,ref:e})});ND.displayName=TD;var DD="DropdownMenuArrow",MD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(uD,{...o,...r,ref:e})});MD.displayName=DD;var jD="DropdownMenuSubTrigger",OD=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(dD,{...o,...r,ref:e})});OD.displayName=jD;var LD="DropdownMenuSubContent",ID=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(fD,{...o,...r,ref:e,style:{...t.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)"}})});ID.displayName=LD;var PD=tw,zD=rw,BD=sw,FD=ow,HD=aw,UD="Label",lw=N.forwardRef((t,e)=>m.jsx(Ke.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));lw.displayName=UD;var $D=lw;function ng(t,[e,n]){return Math.min(n,Math.max(e,t))}var bf="Popover",[cw]=br(bf,[Li]),Ic=Li(),[VD,Ii]=cw(bf),uw=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!1}=t,a=Ic(e),u=N.useRef(null),[d,p]=N.useState(!1),[h,v]=Us({prop:r,defaultProp:o!=null?o:!1,onChange:l,caller:bf});return m.jsx(hf,{...a,children:m.jsx(VD,{scope:e,contentId:mn(),triggerRef:u,open:h,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:d,onCustomAnchorAdd:N.useCallback(()=>p(!0),[]),onCustomAnchorRemove:N.useCallback(()=>p(!1),[]),modal:c,children:n})})};uw.displayName=bf;var dw="PopoverAnchor",fw=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ii(dw,n),l=Ic(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:a}=o;return N.useEffect(()=>(c(),()=>a()),[c,a]),m.jsx(Mc,{...l,...r,ref:e})});fw.displayName=dw;var hw="PopoverTrigger",pw=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ii(hw,n),l=Ic(n),c=ct(e,o.triggerRef),a=m.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_w(o.open),...r,ref:c,onClick:Ie(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:m.jsx(Mc,{asChild:!0,...l,children:a})});pw.displayName=hw;var sv="PopoverPortal",[qD,WD]=cw(sv,{forceMount:void 0}),mw=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,l=Ii(sv,e);return m.jsx(qD,{scope:e,forceMount:n,children:m.jsx(bn,{present:n||l.open,children:m.jsx(Wa,{asChild:!0,container:o,children:r})})})};mw.displayName=sv;var ja="PopoverContent",gw=N.forwardRef((t,e)=>{const n=WD(ja,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,l=Ii(ja,t.__scopePopover);return m.jsx(bn,{present:r||l.open,children:l.modal?m.jsx(KD,{...o,ref:e}):m.jsx(YD,{...o,ref:e})})});gw.displayName=ja;var GD=Ri("PopoverContent.RemoveScroll"),KD=N.forwardRef((t,e)=>{const n=Ii(ja,t.__scopePopover),r=N.useRef(null),o=ct(e,r),l=N.useRef(!1);return N.useEffect(()=>{const c=r.current;if(c)return of(c)},[]),m.jsx(Nc,{as:GD,allowPinchZoom:!0,children:m.jsx(vw,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,c=>{var a;c.preventDefault(),l.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,c=>{const a=c.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,d=a.button===2||u;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),YD=N.forwardRef((t,e)=>{const n=Ii(ja,t.__scopePopover),r=N.useRef(!1),o=N.useRef(!1);return m.jsx(vw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,a;(c=t.onCloseAutoFocus)==null||c.call(t,l),l.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),vw=N.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...h}=t,v=Ii(ja,n),x=Ic(n);return rf(),m.jsx(Tc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:m.jsx(qa,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:m.jsx(pf,{"data-state":_w(v.open),role:"dialog",id:v.contentId,...x,...h,ref:e,style:{...h.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)"}})})})}),yw="PopoverClose",XD=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ii(yw,n);return m.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>o.onOpenChange(!1))})});XD.displayName=yw;var QD="PopoverArrow",ZD=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ic(n);return m.jsx(mf,{...o,...r,ref:e})});ZD.displayName=QD;function _w(t){return t?"open":"closed"}var JD=uw,eM=fw,tM=pw,nM=mw,rM=gw,iv="Progress",ov=100,[sM]=br(iv),[iM,oM]=sM(iv),bw=N.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:l=aM,...c}=t;(o||o===0)&&!pb(o)&&console.error(lM(`${o}`,"Progress"));const a=pb(o)?o:ov;r!==null&&!mb(r,a)&&console.error(cM(`${r}`,"Progress"));const u=mb(r,a)?r:null,d=Ld(u)?l(u,a):void 0;return m.jsx(iM,{scope:n,value:u,max:a,children:m.jsx(Ke.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Ld(u)?u:void 0,"aria-valuetext":d,role:"progressbar","data-state":ww(u,a),"data-value":u!=null?u:void 0,"data-max":a,...c,ref:e})})});bw.displayName=iv;var xw="ProgressIndicator",Sw=N.forwardRef((t,e)=>{var l;const{__scopeProgress:n,...r}=t,o=oM(xw,n);return m.jsx(Ke.div,{"data-state":ww(o.value,o.max),"data-value":(l=o.value)!=null?l:void 0,"data-max":o.max,...r,ref:e})});Sw.displayName=xw;function aM(t,e){return`${Math.round(t/e*100)}%`}function ww(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Ld(t){return typeof t=="number"}function pb(t){return Ld(t)&&!isNaN(t)&&t>0}function mb(t,e){return Ld(t)&&!isNaN(t)&&t<=e&&t>=0}function lM(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ov}\`.`}function cM(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
|
542
|
+
- a positive number
|
|
543
|
+
- less than the value passed to \`max\` (or ${ov} if no \`max\` prop is set)
|
|
544
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
545
|
+
|
|
546
|
+
Defaulting to \`null\`.`}var uM=bw,dM=Sw;function fM(t,e){return N.useReducer((n,r)=>{const o=e[n][r];return o!=null?o:n},t)}var av="ScrollArea",[Cw]=br(av),[hM,zr]=Cw(av),kw=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:l=600,...c}=t,[a,u]=N.useState(null),[d,p]=N.useState(null),[h,v]=N.useState(null),[x,C]=N.useState(null),[w,y]=N.useState(null),[S,_]=N.useState(0),[b,k]=N.useState(0),[T,R]=N.useState(!1),[M,A]=N.useState(!1),j=ct(e,z=>u(z)),O=Rc(o);return m.jsx(hM,{scope:n,type:r,dir:O,scrollHideDelay:l,scrollArea:a,viewport:d,onViewportChange:p,content:h,onContentChange:v,scrollbarX:x,onScrollbarXChange:C,scrollbarXEnabled:T,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:y,scrollbarYEnabled:M,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:k,children:m.jsx(Ke.div,{dir:O,...c,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":b+"px",...t.style}})})});kw.displayName=av;var Ew="ScrollAreaViewport",Aw=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:o,...l}=t,c=zr(Ew,n),a=N.useRef(null),u=ct(e,a,c.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:o}),m.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:m.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Aw.displayName=Ew;var hs="ScrollAreaScrollbar",Rw=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=zr(hs,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=o,a=t.orientation==="horizontal";return N.useEffect(()=>(a?l(!0):c(!0),()=>{a?l(!1):c(!1)}),[a,l,c]),o.type==="hover"?m.jsx(pM,{...r,ref:e,forceMount:n}):o.type==="scroll"?m.jsx(mM,{...r,ref:e,forceMount:n}):o.type==="auto"?m.jsx(Tw,{...r,ref:e,forceMount:n}):o.type==="always"?m.jsx(lv,{...r,ref:e}):null});Rw.displayName=hs;var pM=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=zr(hs,t.__scopeScrollArea),[l,c]=N.useState(!1);return N.useEffect(()=>{const a=o.scrollArea;let u=0;if(a){const d=()=>{window.clearTimeout(u),c(!0)},p=()=>{u=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(bn,{present:n||l,children:m.jsx(Tw,{"data-state":l?"visible":"hidden",...r,ref:e})})}),mM=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=zr(hs,t.__scopeScrollArea),l=t.orientation==="horizontal",c=Sf(()=>u("SCROLL_END"),100),[a,u]=fM("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 N.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,o.scrollHideDelay,u]),N.useEffect(()=>{const d=o.viewport,p=l?"scrollLeft":"scrollTop";if(d){let h=d[p];const v=()=>{const x=d[p];h!==x&&(u("SCROLL"),c()),h=x};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[o.viewport,l,u,c]),m.jsx(bn,{present:n||a!=="hidden",children:m.jsx(lv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ie(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ie(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Tw=N.forwardRef((t,e)=>{const n=zr(hs,t.__scopeScrollArea),{forceMount:r,...o}=t,[l,c]=N.useState(!1),a=t.orientation==="horizontal",u=Sf(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;c(a?d:p)}},10);return Oa(n.viewport,u),Oa(n.content,u),m.jsx(bn,{present:r||l,children:m.jsx(lv,{"data-state":l?"visible":"hidden",...o,ref:e})})}),lv=N.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=zr(hs,t.__scopeScrollArea),l=N.useRef(null),c=N.useRef(0),[a,u]=N.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Ow(a.viewport,a.content),p={...r,sizes:a,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:v=>l.current=v,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:v=>c.current=v};function h(v,x){return xM(v,c.current,a,x)}return n==="horizontal"?m.jsx(gM,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const v=o.viewport.scrollLeft,x=gb(v,a,o.dir);l.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=h(v,o.dir))}}):n==="vertical"?m.jsx(vM,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&l.current){const v=o.viewport.scrollTop,x=gb(v,a);l.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=h(v))}}):null}),gM=N.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,l=zr(hs,t.__scopeScrollArea),[c,a]=N.useState(),u=N.useRef(null),d=ct(e,u,l.onScrollbarXChange);return N.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),m.jsx(Dw,{"data-orientation":"horizontal",...o,ref:d,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xf(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,h)=>{if(l.viewport){const v=l.viewport.scrollLeft+p.deltaX;t.onWheelScroll(v),Iw(v,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Pd(c.paddingLeft),paddingEnd:Pd(c.paddingRight)}})}})}),vM=N.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,l=zr(hs,t.__scopeScrollArea),[c,a]=N.useState(),u=N.useRef(null),d=ct(e,u,l.onScrollbarYChange);return N.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),m.jsx(Dw,{"data-orientation":"vertical",...o,ref:d,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xf(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,h)=>{if(l.viewport){const v=l.viewport.scrollTop+p.deltaY;t.onWheelScroll(v),Iw(v,h)&&p.preventDefault()}},onResize:()=>{u.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Pd(c.paddingTop),paddingEnd:Pd(c.paddingBottom)}})}})}),[yM,Nw]=Cw(hs),Dw=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...v}=t,x=zr(hs,n),[C,w]=N.useState(null),y=ct(e,j=>w(j)),S=N.useRef(null),_=N.useRef(""),b=x.viewport,k=r.content-r.viewport,T=An(p),R=An(u),M=Sf(h,10);function A(j){if(S.current){const O=j.clientX-S.current.left,z=j.clientY-S.current.top;d({x:O,y:z})}}return N.useEffect(()=>{const j=O=>{const z=O.target;(C==null?void 0:C.contains(z))&&T(O,k)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[b,C,k,T]),N.useEffect(R,[r,R]),Oa(C,M),Oa(x.content,M),m.jsx(yM,{scope:n,scrollbar:C,hasThumb:o,onThumbChange:An(l),onThumbPointerUp:An(c),onThumbPositionChange:R,onThumbPointerDown:An(a),children:m.jsx(Ke.div,{...v,ref:y,style:{position:"absolute",...v.style},onPointerDown:Ie(t.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),S.current=C.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),A(j))}),onPointerMove:Ie(t.onPointerMove,A),onPointerUp:Ie(t.onPointerUp,j=>{const O=j.target;O.hasPointerCapture(j.pointerId)&&O.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=_.current,x.viewport&&(x.viewport.style.scrollBehavior=""),S.current=null})})})}),Id="ScrollAreaThumb",Mw=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Nw(Id,t.__scopeScrollArea);return m.jsx(bn,{present:n||o.hasThumb,children:m.jsx(_M,{ref:e,...r})})}),_M=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,l=zr(Id,n),c=Nw(Id,n),{onThumbPositionChange:a}=c,u=ct(e,h=>c.onThumbChange(h)),d=N.useRef(void 0),p=Sf(()=>{d.current&&(d.current(),d.current=void 0)},100);return N.useEffect(()=>{const h=l.viewport;if(h){const v=()=>{if(p(),!d.current){const x=SM(h,a);d.current=x,a()}};return a(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[l.viewport,p,a]),m.jsx(Ke.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ie(t.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),C=h.clientX-x.left,w=h.clientY-x.top;c.onThumbPointerDown({x:C,y:w})}),onPointerUp:Ie(t.onPointerUp,c.onThumbPointerUp)})});Mw.displayName=Id;var cv="ScrollAreaCorner",jw=N.forwardRef((t,e)=>{const n=zr(cv,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(bM,{...t,ref:e}):null});jw.displayName=cv;var bM=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,o=zr(cv,n),[l,c]=N.useState(0),[a,u]=N.useState(0),d=!!(l&&a);return Oa(o.scrollbarX,()=>{var h;const p=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),Oa(o.scrollbarY,()=>{var h;const p=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(p),c(p)}),d?m.jsx(Ke.div,{...r,ref:e,style:{width:l,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Pd(t){return t?parseInt(t,10):0}function Ow(t,e){const n=t/e;return isNaN(n)?0:n}function xf(t){const e=Ow(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function xM(t,e,n,r="ltr"){const o=xf(n),l=o/2,c=e||l,a=o-c,u=n.scrollbar.paddingStart+c,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,p=n.content-n.viewport,h=r==="ltr"?[0,p]:[p*-1,0];return Lw([u,d],h)(t)}function gb(t,e,n="ltr"){const r=xf(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=e.scrollbar.size-o,c=e.content-e.viewport,a=l-r,u=n==="ltr"?[0,c]:[c*-1,0],d=ng(t,u);return Lw([0,c],[0,a])(d)}function Lw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Iw(t,e){return t>0&&t<e}var SM=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function o(){const l={left:t.scrollLeft,top:t.scrollTop},c=n.left!==l.left,a=n.top!==l.top;(c||a)&&e(),n=l,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Sf(t,e){const n=An(t),r=N.useRef(0);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),N.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Oa(t,e){const n=An(e);_n(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}var wM=kw,CM=Aw,kM=jw,EM=[" ","Enter","ArrowUp","ArrowDown"],AM=[" ","Enter"],bo="Select",[wf,Cf,RM]=Mg(bo),[Ya]=br(bo,[RM,Li]),kf=Li(),[TM,Pi]=Ya(bo),[NM,DM]=Ya(bo),Pw=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:l,value:c,defaultValue:a,onValueChange:u,dir:d,name:p,autoComplete:h,disabled:v,required:x,form:C}=t,w=kf(e),[y,S]=N.useState(null),[_,b]=N.useState(null),[k,T]=N.useState(!1),R=Rc(d),[M,A]=Us({prop:r,defaultProp:o!=null?o:!1,onChange:l,caller:bo}),[j,O]=Us({prop:c,defaultProp:a,onChange:u,caller:bo}),z=N.useRef(null),V=y?C||!!y.closest("form"):!0,[F,W]=N.useState(new Set),G=Array.from(F).map(q=>q.props.value).join(";");return m.jsx(hf,{...w,children:m.jsxs(TM,{required:x,scope:e,trigger:y,onTriggerChange:S,valueNode:_,onValueNodeChange:b,valueNodeHasChildren:k,onValueNodeHasChildrenChange:T,contentId:mn(),value:j,onValueChange:O,open:M,onOpenChange:A,dir:R,triggerPointerDownPosRef:z,disabled:v,children:[m.jsx(wf.Provider,{scope:e,children:m.jsx(NM,{scope:t.__scopeSelect,onNativeOptionAdd:N.useCallback(q=>{W(X=>new Set(X).add(q))},[]),onNativeOptionRemove:N.useCallback(q=>{W(X=>{const Y=new Set(X);return Y.delete(q),Y})},[]),children:n})}),V?m.jsxs(aC,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:q=>O(q.target.value),disabled:v,form:C,children:[j===void 0?m.jsx("option",{value:""}):null,Array.from(F)]},G):null]})})};Pw.displayName=bo;var zw="SelectTrigger",Bw=N.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,l=kf(n),c=Pi(zw,n),a=c.disabled||r,u=ct(e,c.onTriggerChange),d=Cf(n),p=N.useRef("touch"),[h,v,x]=cC(w=>{const y=d().filter(b=>!b.disabled),S=y.find(b=>b.value===c.value),_=uC(y,w,S);_!==void 0&&c.onValueChange(_.value)}),C=w=>{a||(c.onOpenChange(!0),x()),w&&(c.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return m.jsx(Mc,{asChild:!0,...l,children:m.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":lC(c.value)?"":void 0,...o,ref:u,onClick:Ie(o.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&C(w)}),onPointerDown:Ie(o.onPointerDown,w=>{p.current=w.pointerType;const y=w.target;y.hasPointerCapture(w.pointerId)&&y.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(C(w),w.preventDefault())}),onKeyDown:Ie(o.onKeyDown,w=>{const y=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&v(w.key),!(y&&w.key===" ")&&EM.includes(w.key)&&(C(),w.preventDefault())})})})});Bw.displayName=zw;var Fw="SelectValue",Hw=N.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:l,placeholder:c="",...a}=t,u=Pi(Fw,n),{onValueNodeHasChildrenChange:d}=u,p=l!==void 0,h=ct(e,u.onValueNodeChange);return _n(()=>{d(p)},[d,p]),m.jsx(Ke.span,{...a,ref:h,style:{pointerEvents:"none"},children:lC(u.value)?m.jsx(m.Fragment,{children:c}):l})});Hw.displayName=Fw;var MM="SelectIcon",Uw=N.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return m.jsx(Ke.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});Uw.displayName=MM;var jM="SelectPortal",$w=t=>m.jsx(Wa,{asChild:!0,...t});$w.displayName=jM;var xo="SelectContent",Vw=N.forwardRef((t,e)=>{const n=Pi(xo,t.__scopeSelect),[r,o]=N.useState();if(_n(()=>{o(new DocumentFragment)},[]),!n.open){const l=r;return l?Va.createPortal(m.jsx(qw,{scope:t.__scopeSelect,children:m.jsx(wf.Slot,{scope:t.__scopeSelect,children:m.jsx("div",{children:t.children})})}),l):null}return m.jsx(Ww,{...t,ref:e})});Vw.displayName=xo;var Gr=10,[qw,zi]=Ya(xo),OM="SelectContentImpl",LM=Ri("SelectContent.RemoveScroll"),Ww=N.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,side:a,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:x,sticky:C,hideWhenDetached:w,avoidCollisions:y,...S}=t,_=Pi(xo,n),[b,k]=N.useState(null),[T,R]=N.useState(null),M=ct(e,K=>k(K)),[A,j]=N.useState(null),[O,z]=N.useState(null),V=Cf(n),[F,W]=N.useState(!1),G=N.useRef(!1);N.useEffect(()=>{if(b)return of(b)},[b]),rf();const q=N.useCallback(K=>{const[$,...te]=V().map(se=>se.ref.current),[re]=te.slice(-1),ae=document.activeElement;for(const se of K)if(se===ae||(se==null||se.scrollIntoView({block:"nearest"}),se===$&&T&&(T.scrollTop=0),se===re&&T&&(T.scrollTop=T.scrollHeight),se==null||se.focus(),document.activeElement!==ae))return},[V,T]),X=N.useCallback(()=>q([A,b]),[q,A,b]);N.useEffect(()=>{F&&X()},[F,X]);const{onOpenChange:Y,triggerPointerDownPosRef:I}=_;N.useEffect(()=>{if(b){let K={x:0,y:0};const $=re=>{var ae,se,_e,Re;K={x:Math.abs(Math.round(re.pageX)-((se=(ae=I.current)==null?void 0:ae.x)!=null?se:0)),y:Math.abs(Math.round(re.pageY)-((Re=(_e=I.current)==null?void 0:_e.y)!=null?Re:0))}},te=re=>{K.x<=10&&K.y<=10?re.preventDefault():b.contains(re.target)||Y(!1),document.removeEventListener("pointermove",$),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",te,{capture:!0})}}},[b,Y,I]),N.useEffect(()=>{const K=()=>Y(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[Y]);const[L,P]=cC(K=>{const $=V().filter(ae=>!ae.disabled),te=$.find(ae=>ae.ref.current===document.activeElement),re=uC($,K,te);re&&setTimeout(()=>re.ref.current.focus())}),H=N.useCallback((K,$,te)=>{const re=!G.current&&!te;(_.value!==void 0&&_.value===$||re)&&(j(K),re&&(G.current=!0))},[_.value]),B=N.useCallback(()=>b==null?void 0:b.focus(),[b]),Z=N.useCallback((K,$,te)=>{const re=!G.current&&!te;(_.value!==void 0&&_.value===$||re)&&z(K)},[_.value]),J=r==="popper"?rg:Gw,ee=J===rg?{side:a,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:v,collisionPadding:x,sticky:C,hideWhenDetached:w,avoidCollisions:y}:{};return m.jsx(qw,{scope:n,content:b,viewport:T,onViewportChange:R,itemRefCallback:H,selectedItem:A,onItemLeave:B,itemTextRefCallback:Z,focusSelectedItem:X,selectedItemText:O,position:r,isPositioned:F,searchRef:L,children:m.jsx(Nc,{as:LM,allowPinchZoom:!0,children:m.jsx(Tc,{asChild:!0,trapped:_.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Ie(o,K=>{var $;($=_.trigger)==null||$.focus({preventScroll:!0}),K.preventDefault()}),children:m.jsx(qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:m.jsx(J,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:K=>K.preventDefault(),...S,...ee,onPlaced:()=>W(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ie(S.onKeyDown,K=>{const $=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!$&&K.key.length===1&&P(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let re=V().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,se=re.indexOf(ae);re=re.slice(se+1)}setTimeout(()=>q(re)),K.preventDefault()}})})})})})})});Ww.displayName=OM;var IM="SelectItemAlignedPosition",Gw=N.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,l=Pi(xo,n),c=zi(xo,n),[a,u]=N.useState(null),[d,p]=N.useState(null),h=ct(e,M=>p(M)),v=Cf(n),x=N.useRef(!1),C=N.useRef(!0),{viewport:w,selectedItem:y,selectedItemText:S,focusSelectedItem:_}=c,b=N.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&d&&w&&y&&S){const M=l.trigger.getBoundingClientRect(),A=d.getBoundingClientRect(),j=l.valueNode.getBoundingClientRect(),O=S.getBoundingClientRect();if(l.dir!=="rtl"){const ae=O.left-A.left,se=j.left-ae,_e=M.left-se,Re=M.width+_e,je=Math.max(Re,A.width),ze=window.innerWidth-Gr,ce=ng(se,[Gr,Math.max(Gr,ze-je)]);a.style.minWidth=Re+"px",a.style.left=ce+"px"}else{const ae=A.right-O.right,se=window.innerWidth-j.right-ae,_e=window.innerWidth-M.right-se,Re=M.width+_e,je=Math.max(Re,A.width),ze=window.innerWidth-Gr,ce=ng(se,[Gr,Math.max(Gr,ze-je)]);a.style.minWidth=Re+"px",a.style.right=ce+"px"}const z=v(),V=window.innerHeight-Gr*2,F=w.scrollHeight,W=window.getComputedStyle(d),G=parseInt(W.borderTopWidth,10),q=parseInt(W.paddingTop,10),X=parseInt(W.borderBottomWidth,10),Y=parseInt(W.paddingBottom,10),I=G+q+F+Y+X,L=Math.min(y.offsetHeight*5,I),P=window.getComputedStyle(w),H=parseInt(P.paddingTop,10),B=parseInt(P.paddingBottom,10),Z=M.top+M.height/2-Gr,J=V-Z,ee=y.offsetHeight/2,K=y.offsetTop+ee,$=G+q+K,te=I-$;if($<=Z){const ae=z.length>0&&y===z[z.length-1].ref.current;a.style.bottom="0px";const se=d.clientHeight-w.offsetTop-w.offsetHeight,_e=Math.max(J,ee+(ae?B:0)+se+X),Re=$+_e;a.style.height=Re+"px"}else{const ae=z.length>0&&y===z[0].ref.current;a.style.top="0px";const _e=Math.max(Z,G+w.offsetTop+(ae?H:0)+ee)+te;a.style.height=_e+"px",w.scrollTop=$-Z+w.offsetTop}a.style.margin=`${Gr}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[v,l.trigger,l.valueNode,a,d,w,y,S,l.dir,r]);_n(()=>b(),[b]);const[k,T]=N.useState();_n(()=>{d&&T(window.getComputedStyle(d).zIndex)},[d]);const R=N.useCallback(M=>{M&&C.current===!0&&(b(),_==null||_(),C.current=!1)},[b,_]);return m.jsx(zM,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:x,onScrollButtonChange:R,children:m.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:m.jsx(Ke.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Gw.displayName=IM;var PM="SelectPopperPosition",rg=N.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Gr,...l}=t,c=kf(n);return m.jsx(pf,{...c,...l,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...l.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)"}})});rg.displayName=PM;var[zM,uv]=Ya(xo,{}),sg="SelectViewport",Kw=N.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,l=zi(sg,n),c=uv(sg,n),a=ct(e,l.onViewportChange),u=N.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:r}),m.jsx(wf.Slot,{scope:n,children:m.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ie(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=c;if(v!=null&&v.current&&h){const x=Math.abs(u.current-p.scrollTop);if(x>0){const C=window.innerHeight-Gr*2,w=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),S=Math.max(w,y);if(S<C){const _=S+x,b=Math.min(C,_),k=_-b;h.style.height=b+"px",h.style.bottom==="0px"&&(p.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});Kw.displayName=sg;var Yw="SelectGroup",[BM,FM]=Ya(Yw),Xw=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=mn();return m.jsx(BM,{scope:n,id:o,children:m.jsx(Ke.div,{role:"group","aria-labelledby":o,...r,ref:e})})});Xw.displayName=Yw;var Qw="SelectLabel",Zw=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=FM(Qw,n);return m.jsx(Ke.div,{id:o.id,...r,ref:e})});Zw.displayName=Qw;var zd="SelectItem",[HM,Jw]=Ya(zd),eC=N.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:l,...c}=t,a=Pi(zd,n),u=zi(zd,n),d=a.value===r,[p,h]=N.useState(l!=null?l:""),[v,x]=N.useState(!1),C=ct(e,_=>{var b;return(b=u.itemRefCallback)==null?void 0:b.call(u,_,r,o)}),w=mn(),y=N.useRef("touch"),S=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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(HM,{scope:n,value:r,disabled:o,textId:w,isSelected:d,onItemTextChange:N.useCallback(_=>{h(b=>{var k;return b||((k=_==null?void 0:_.textContent)!=null?k:"").trim()})},[]),children:m.jsx(wf.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:m.jsx(Ke.div,{role:"option","aria-labelledby":w,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:C,onFocus:Ie(c.onFocus,()=>x(!0)),onBlur:Ie(c.onBlur,()=>x(!1)),onClick:Ie(c.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Ie(c.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Ie(c.onPointerDown,_=>{y.current=_.pointerType}),onPointerMove:Ie(c.onPointerMove,_=>{var b;y.current=_.pointerType,o?(b=u.onItemLeave)==null||b.call(u):y.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(c.onPointerLeave,_=>{var b;_.currentTarget===document.activeElement&&((b=u.onItemLeave)==null||b.call(u))}),onKeyDown:Ie(c.onKeyDown,_=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&_.key===" "||(AM.includes(_.key)&&S(),_.key===" "&&_.preventDefault())})})})})});eC.displayName=zd;var cc="SelectItemText",tC=N.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...l}=t,c=Pi(cc,n),a=zi(cc,n),u=Jw(cc,n),d=DM(cc,n),[p,h]=N.useState(null),v=ct(e,S=>h(S),u.onItemTextChange,S=>{var _;return(_=a.itemTextRefCallback)==null?void 0:_.call(a,S,u.value,u.disabled)}),x=p==null?void 0:p.textContent,C=N.useMemo(()=>m.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:w,onNativeOptionRemove:y}=d;return _n(()=>(w(C),()=>y(C)),[w,y,C]),m.jsxs(m.Fragment,{children:[m.jsx(Ke.span,{id:u.textId,...l,ref:v}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Va.createPortal(l.children,c.valueNode):null]})});tC.displayName=cc;var nC="SelectItemIndicator",rC=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return Jw(nC,n).isSelected?m.jsx(Ke.span,{"aria-hidden":!0,...r,ref:e}):null});rC.displayName=nC;var ig="SelectScrollUpButton",sC=N.forwardRef((t,e)=>{const n=zi(ig,t.__scopeSelect),r=uv(ig,t.__scopeSelect),[o,l]=N.useState(!1),c=ct(e,r.onScrollButtonChange);return _n(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollTop>0;l(d)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(oC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});sC.displayName=ig;var og="SelectScrollDownButton",iC=N.forwardRef((t,e)=>{const n=zi(og,t.__scopeSelect),r=uv(og,t.__scopeSelect),[o,l]=N.useState(!1),c=ct(e,r.onScrollButtonChange);return _n(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;l(p)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(oC,{...t,ref:c,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});iC.displayName=og;var oC=N.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,l=zi("SelectScrollButton",n),c=N.useRef(null),a=Cf(n),u=N.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return N.useEffect(()=>()=>u(),[u]),_n(()=>{var p;const d=a().find(h=>h.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[a]),m.jsx(Ke.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ie(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ie(o.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ie(o.onPointerLeave,()=>{u()})})}),UM="SelectSeparator",$M=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return m.jsx(Ke.div,{"aria-hidden":!0,...r,ref:e})});$M.displayName=UM;var ag="SelectArrow",VM=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=kf(n),l=Pi(ag,n),c=zi(ag,n);return l.open&&c.position==="popper"?m.jsx(mf,{...o,...r,ref:e}):null});VM.displayName=ag;var qM="SelectBubbleInput",aC=N.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=N.useRef(null),l=ct(r,o),c=e6(e);return N.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(c!==e&&p){const h=new Event("change",{bubbles:!0});p.call(a,e),a.dispatchEvent(h)}},[c,e]),m.jsx(Ke.select,{...n,style:{...SS,...n.style},ref:l,defaultValue:e})});aC.displayName=qM;function lC(t){return t===""||t===void 0}function cC(t){const e=An(t),n=N.useRef(""),r=N.useRef(0),o=N.useCallback(c=>{const a=n.current+c;e(a),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(a)},[e]),l=N.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,l]}function uC(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let c=WM(t,Math.max(l,0));o.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function WM(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var GM=Pw,KM=Bw,YM=Hw,XM=Uw,QM=$w,ZM=Vw,JM=Kw,ej=Xw,tj=Zw,nj=eC,rj=tC,sj=rC,ij=sC,oj=iC,aj="Separator",vb="horizontal",lj=["horizontal","vertical"],dC=N.forwardRef((t,e)=>{const{decorative:n,orientation:r=vb,...o}=t,l=cj(r)?r:vb,a=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return m.jsx(Ke.div,{"data-orientation":l,...a,...o,ref:e})});dC.displayName=aj;function cj(t){return lj.includes(t)}var uj=dC,Ef="Tabs",[dj]=br(Ef,[gf]),fC=gf(),[fj,dv]=dj(Ef),hC=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:l,orientation:c="horizontal",dir:a,activationMode:u="automatic",...d}=t,p=Rc(a),[h,v]=Us({prop:r,onChange:o,defaultProp:l!=null?l:"",caller:Ef});return m.jsx(fj,{scope:n,baseId:mn(),value:h,onValueChange:v,orientation:c,dir:p,activationMode:u,children:m.jsx(Ke.div,{dir:p,"data-orientation":c,...d,ref:e})})});hC.displayName=Ef;var pC="TabsList",mC=N.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,l=dv(pC,n),c=fC(n);return m.jsx(T2,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:m.jsx(Ke.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:e})})});mC.displayName=pC;var gC="TabsTrigger",vC=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...l}=t,c=dv(gC,n),a=fC(n),u=bC(c.baseId,r),d=xC(c.baseId,r),p=r===c.value;return m.jsx(N2,{asChild:!0,...a,focusable:!o,active:p,children:m.jsx(Ke.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...l,ref:e,onMouseDown:Ie(t.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?c.onValueChange(r):h.preventDefault()}),onKeyDown:Ie(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&c.onValueChange(r)}),onFocus:Ie(t.onFocus,()=>{const h=c.activationMode!=="manual";!p&&!o&&h&&c.onValueChange(r)})})})});vC.displayName=gC;var yC="TabsContent",_C=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:l,...c}=t,a=dv(yC,n),u=bC(a.baseId,r),d=xC(a.baseId,r),p=r===a.value,h=N.useRef(p);return N.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),m.jsx(bn,{present:o||p,children:({present:v})=>m.jsx(Ke.div,{"data-state":p?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...c,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:v&&l})})});_C.displayName=yC;function bC(t,e){return`${t}-trigger-${e}`}function xC(t,e){return`${t}-content-${e}`}var hj=hC,pj=mC,mj=vC,gj=_C,[Af]=br("Tooltip",[Li]),Rf=Li(),SC="TooltipProvider",vj=700,lg="tooltip.open",[yj,fv]=Af(SC),wC=t=>{const{__scopeTooltip:e,delayDuration:n=vj,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=t,c=N.useRef(!0),a=N.useRef(!1),u=N.useRef(0);return N.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),m.jsx(yj,{scope:e,isOpenDelayedRef:c,delayDuration:n,onOpen:N.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:N.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:N.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:l})};wC.displayName=SC;var _c="Tooltip",[_j,Pc]=Af(_c),CC=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:c,delayDuration:a}=t,u=fv(_c,t.__scopeTooltip),d=Rf(e),[p,h]=N.useState(null),v=mn(),x=N.useRef(0),C=c!=null?c:u.disableHoverableContent,w=a!=null?a:u.delayDuration,y=N.useRef(!1),[S,_]=Us({prop:r,defaultProp:o!=null?o:!1,onChange:M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(lg))):u.onClose(),l==null||l(M)},caller:_c}),b=N.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),k=N.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,_(!0)},[_]),T=N.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_(!1)},[_]),R=N.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,_(!0),x.current=0},w)},[w,_]);return N.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),m.jsx(hf,{...d,children:m.jsx(_j,{scope:e,contentId:v,open:S,stateAttribute:b,trigger:p,onTriggerChange:h,onTriggerEnter:N.useCallback(()=>{u.isOpenDelayedRef.current?R():k()},[u.isOpenDelayedRef,R,k]),onTriggerLeave:N.useCallback(()=>{C?T():(window.clearTimeout(x.current),x.current=0)},[T,C]),onOpen:k,onClose:T,disableHoverableContent:C,children:n})})};CC.displayName=_c;var cg="TooltipTrigger",kC=N.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Pc(cg,n),l=fv(cg,n),c=Rf(n),a=N.useRef(null),u=ct(e,a,o.onTriggerChange),d=N.useRef(!1),p=N.useRef(!1),h=N.useCallback(()=>d.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),m.jsx(Mc,{asChild:!0,...c,children:m.jsx(Ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ie(t.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ie(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ie(t.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ie(t.onFocus,()=>{d.current||o.onOpen()}),onBlur:Ie(t.onBlur,o.onClose),onClick:Ie(t.onClick,o.onClose)})})});kC.displayName=cg;var hv="TooltipPortal",[bj,xj]=Af(hv,{forceMount:void 0}),EC=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,l=Pc(hv,e);return m.jsx(bj,{scope:e,forceMount:n,children:m.jsx(bn,{present:n||l.open,children:m.jsx(Wa,{asChild:!0,container:o,children:r})})})};EC.displayName=hv;var La="TooltipContent",AC=N.forwardRef((t,e)=>{const n=xj(La,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=t,c=Pc(La,t.__scopeTooltip);return m.jsx(bn,{present:r||c.open,children:c.disableHoverableContent?m.jsx(RC,{side:o,...l,ref:e}):m.jsx(Sj,{side:o,...l,ref:e})})}),Sj=N.forwardRef((t,e)=>{const n=Pc(La,t.__scopeTooltip),r=fv(La,t.__scopeTooltip),o=N.useRef(null),l=ct(e,o),[c,a]=N.useState(null),{trigger:u,onClose:d}=n,p=o.current,{onPointerInTransitChange:h}=r,v=N.useCallback(()=>{a(null),h(!1)},[h]),x=N.useCallback((C,w)=>{const y=C.currentTarget,S={x:C.clientX,y:C.clientY},_=Ej(S,y.getBoundingClientRect()),b=Aj(S,_),k=Rj(w.getBoundingClientRect()),T=Nj([...b,...k]);a(T),h(!0)},[h]);return N.useEffect(()=>()=>v(),[v]),N.useEffect(()=>{if(u&&p){const C=y=>x(y,p),w=y=>x(y,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",w)}}},[u,p,x,v]),N.useEffect(()=>{if(c){const C=w=>{const y=w.target,S={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(y))||(p==null?void 0:p.contains(y)),b=!Tj(S,c);_?v():b&&(v(),d())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,c,d,v]),m.jsx(RC,{...t,ref:l})}),[wj,Cj]=Af(_c,{isInside:!1}),kj=xR("TooltipContent"),RC=N.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:c,...a}=t,u=Pc(La,n),d=Rf(n),{onClose:p}=u;return N.useEffect(()=>(document.addEventListener(lg,p),()=>document.removeEventListener(lg,p)),[p]),N.useEffect(()=>{if(u.trigger){const h=v=>{const x=v.target;x!=null&&x.contains(u.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,p]),m.jsx(qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:m.jsxs(pf,{"data-state":u.stateAttribute,...d,...a,ref:e,style:{...a.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(kj,{children:r}),m.jsx(wj,{scope:n,isInside:!0,children:m.jsx(AR,{id:u.contentId,role:"tooltip",children:o||r})})]})})});AC.displayName=La;var TC="TooltipArrow",NC=N.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Rf(n);return Cj(TC,n).isInside?null:m.jsx(mf,{...o,...r,ref:e})});NC.displayName=TC;function Ej(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),l=Math.abs(e.left-t.x);switch(Math.min(n,r,o,l)){case l:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Aj(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function Rj(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function Tj(t,e){const{x:n,y:r}=t;let o=!1;for(let l=0,c=e.length-1;l<e.length;c=l++){const a=e[l],u=e[c],d=a.x,p=a.y,h=u.x,v=u.y;p>r!=v>r&&n<(h-d)*(r-p)/(v-p)+d&&(o=!o)}return o}function Nj(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Dj(e)}function Dj(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const l=e[e.length-1],c=e[e.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var Mj=wC,jj=CC,Oj=kC,Lj=EC,Ij=AC,Pj=NC;const zj=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Bj=(t,e)=>({classGroupId:t,validator:e}),DC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Bd="-",yb=[],Fj="arbitrary..",Hj=t=>{const e=$j(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Uj(c);const a=c.split(Bd),u=a[0]===""&&a.length>1?1:0;return MC(a,u,e)},getConflictingClassGroupIds:(c,a)=>{if(a){const u=r[c],d=n[c];return u?d?zj(d,u):u:d||yb}return n[c]||yb}}},MC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const d=MC(t,e+1,l);if(d)return d}const c=n.validators;if(c===null)return;const a=e===0?t.join(Bd):t.slice(e).join(Bd),u=c.length;for(let d=0;d<u;d++){const p=c[d];if(p.validator(a))return p.classGroupId}},Uj=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Fj+r:void 0})(),$j=t=>{const{theme:e,classGroups:n}=t;return Vj(n,e)},Vj=(t,e)=>{const n=DC();for(const r in t){const o=t[r];pv(o,n,r,e)}return n},pv=(t,e,n,r)=>{const o=t.length;for(let l=0;l<o;l++){const c=t[l];qj(c,e,n,r)}},qj=(t,e,n,r)=>{if(typeof t=="string"){Wj(t,e,n);return}if(typeof t=="function"){Gj(t,e,n,r);return}Kj(t,e,n,r)},Wj=(t,e,n)=>{const r=t===""?e:jC(e,t);r.classGroupId=n},Gj=(t,e,n,r)=>{if(Yj(t)){pv(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Bj(n,t))},Kj=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let c=0;c<l;c++){const[a,u]=o[c];pv(u,jC(e,a),n,r)}},jC=(t,e)=>{let n=t;const r=e.split(Bd),o=r.length;for(let l=0;l<o;l++){const c=r[l];let a=n.nextPart.get(c);a||(a=DC(),n.nextPart.set(c,a)),n=a}return n},Yj=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Xj=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,c)=>{n[l]=c,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return o(l,c),c},set(l,c){l in n?n[l]=c:o(l,c)}}},ug="!",_b=":",Qj=[],bb=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Zj=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let c=0,a=0,u=0,d;const p=o.length;for(let w=0;w<p;w++){const y=o[w];if(c===0&&a===0){if(y===_b){l.push(o.slice(u,w)),u=w+1;continue}if(y==="/"){d=w;continue}}y==="["?c++:y==="]"?c--:y==="("?a++:y===")"&&a--}const h=l.length===0?o:o.slice(u);let v=h,x=!1;h.endsWith(ug)?(v=h.slice(0,-1),x=!0):h.startsWith(ug)&&(v=h.slice(1),x=!0);const C=d&&d>u?d-u:void 0;return bb(l,x,v,C)};if(e){const o=e+_b,l=r;r=c=>c.startsWith(o)?l(c.slice(o.length)):bb(Qj,!1,c,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},Jj=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const c=n[l],a=c[0]==="[",u=e.has(c);a||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},eO=t=>({cache:Xj(t.cacheSize),parseClassName:Zj(t),sortModifiers:Jj(t),...Hj(t)}),tO=/\s+/,nO=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,c=[],a=t.trim().split(tO);let u="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:h,modifiers:v,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let y=!!w,S=r(y?C.substring(0,w):C);if(!S){if(!y){u=p+(u.length>0?" "+u:u);continue}if(S=r(C),!S){u=p+(u.length>0?" "+u:u);continue}y=!1}const _=v.length===0?"":v.length===1?v[0]:l(v).join(":"),b=x?_+ug:_,k=b+S;if(c.indexOf(k)>-1)continue;c.push(k);const T=o(S,y);for(let R=0;R<T.length;++R){const M=T[R];c.push(b+M)}u=p+(u.length>0?" "+u:u)}return u},rO=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=OC(n))&&(o&&(o+=" "),o+=r);return o},OC=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=OC(t[r]))&&(n&&(n+=" "),n+=e);return n},sO=(t,...e)=>{let n,r,o,l;const c=u=>{const d=e.reduce((p,h)=>h(p),t());return n=eO(d),r=n.cache.get,o=n.cache.set,l=a,a(u)},a=u=>{const d=r(u);if(d)return d;const p=nO(u,n);return o(u,p),p};return l=c,(...u)=>l(rO(...u))},iO=[],pn=t=>{const e=n=>n[t]||iO;return e.isThemeGetter=!0,e},LC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,IC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lO=/\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$/,cO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xi=t=>oO.test(t),lt=t=>!!t&&!Number.isNaN(Number(t)),Si=t=>!!t&&Number.isInteger(Number(t)),gm=t=>t.endsWith("%")&<(t.slice(0,-1)),Is=t=>aO.test(t),PC=()=>!0,fO=t=>lO.test(t)&&!cO.test(t),mv=()=>!1,hO=t=>uO.test(t),pO=t=>dO.test(t),mO=t=>!Ve(t)&&!qe(t),gO=t=>Bi(t,FC,mv),Ve=t=>LC.test(t),fo=t=>Bi(t,HC,fO),xb=t=>Bi(t,CO,lt),vO=t=>Bi(t,$C,PC),yO=t=>Bi(t,UC,mv),Sb=t=>Bi(t,zC,mv),_O=t=>Bi(t,BC,pO),fd=t=>Bi(t,VC,hO),qe=t=>IC.test(t),Jl=t=>Eo(t,HC),bO=t=>Eo(t,UC),wb=t=>Eo(t,zC),xO=t=>Eo(t,FC),SO=t=>Eo(t,BC),hd=t=>Eo(t,VC,!0),wO=t=>Eo(t,$C,!0),Bi=(t,e,n)=>{const r=LC.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Eo=(t,e,n=!1)=>{const r=IC.exec(t);return r?r[1]?e(r[1]):n:!1},zC=t=>t==="position"||t==="percentage",BC=t=>t==="image"||t==="url",FC=t=>t==="length"||t==="size"||t==="bg-size",HC=t=>t==="length",CO=t=>t==="number",UC=t=>t==="family-name",$C=t=>t==="number"||t==="weight",VC=t=>t==="shadow",kO=()=>{const t=pn("color"),e=pn("font"),n=pn("text"),r=pn("font-weight"),o=pn("tracking"),l=pn("leading"),c=pn("breakpoint"),a=pn("container"),u=pn("spacing"),d=pn("radius"),p=pn("shadow"),h=pn("inset-shadow"),v=pn("text-shadow"),x=pn("drop-shadow"),C=pn("blur"),w=pn("perspective"),y=pn("aspect"),S=pn("ease"),_=pn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...k(),qe,Ve],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[qe,Ve,u],j=()=>[xi,"full","auto",...A()],O=()=>[Si,"none","subgrid",qe,Ve],z=()=>["auto",{span:["full",Si,qe,Ve]},Si,qe,Ve],V=()=>[Si,"auto",qe,Ve],F=()=>["auto","min","max","fr",qe,Ve],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...A()],X=()=>[xi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],Y=()=>[xi,"screen","full","dvw","lvw","svw","min","max","fit",...A()],I=()=>[xi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],L=()=>[t,qe,Ve],P=()=>[...k(),wb,Sb,{position:[qe,Ve]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",xO,gO,{size:[qe,Ve]}],Z=()=>[gm,Jl,fo],J=()=>["","none","full",d,qe,Ve],ee=()=>["",lt,Jl,fo],K=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[lt,gm,wb,Sb],re=()=>["","none",C,qe,Ve],ae=()=>["none",lt,qe,Ve],se=()=>["none",lt,qe,Ve],_e=()=>[lt,qe,Ve],Re=()=>[xi,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Is],breakpoint:[Is],color:[PC],container:[Is],"drop-shadow":[Is],ease:["in","out","in-out"],font:[mO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Is],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Is],shadow:[Is],spacing:["px",lt],text:[Is],"text-shadow":[Is],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xi,Ve,qe,y]}],container:["container"],columns:[{columns:[lt,Ve,qe,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:T()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[Si,"auto",qe,Ve]}],basis:[{basis:[xi,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,xi,"auto","initial","none",Ve]}],grow:[{grow:["",lt,qe,Ve]}],shrink:[{shrink:["",lt,qe,Ve]}],order:[{order:[Si,"first","last","none",qe,Ve]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[c]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Jl,fo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wO,vO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gm,Ve]}],"font-family":[{font:[bO,yO,e]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,qe,Ve]}],"line-clamp":[{"line-clamp":[lt,"none",qe,xb]}],leading:[{leading:[l,...A()]}],"list-image":[{"list-image":["none",qe,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",qe,fo]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[lt,"auto",qe,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,Ve]}],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",qe,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Si,qe,Ve],radial:["",qe,Ve],conic:[Si,qe,Ve]},SO,_O]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,qe,Ve]}],"outline-w":[{outline:["",lt,Jl,fo]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,hd,fd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,hd,fd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[lt,fo]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",v,hd,fd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[lt,qe,Ve]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"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":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[qe,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,Ve]}],filter:[{filter:["","none",qe,Ve]}],blur:[{blur:re()}],brightness:[{brightness:[lt,qe,Ve]}],contrast:[{contrast:[lt,qe,Ve]}],"drop-shadow":[{"drop-shadow":["","none",x,hd,fd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",lt,qe,Ve]}],"hue-rotate":[{"hue-rotate":[lt,qe,Ve]}],invert:[{invert:["",lt,qe,Ve]}],saturate:[{saturate:[lt,qe,Ve]}],sepia:[{sepia:["",lt,qe,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,Ve]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[lt,qe,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[lt,qe,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,qe,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,qe,Ve]}],"backdrop-invert":[{"backdrop-invert":["",lt,qe,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[lt,qe,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[lt,qe,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,qe,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",qe,Ve]}],ease:[{ease:["linear","initial",S,qe,Ve]}],delay:[{delay:[lt,qe,Ve]}],animate:[{animate:["none",_,qe,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,qe,Ve]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[qe,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",qe,Ve]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",qe,Ve]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[lt,Jl,fo,xb]}],stroke:[{stroke:["none",...L()]}],"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"]}},EO=sO(kO);function Ee(...t){return EO(tf(t))}const AO=$a("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 He(t){const e=fe.c(16);let n,r,o,l,c;e[0]!==t?({className:n,variant:o,size:l,asChild:c,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c):(n=e[1],r=e[2],o=e[3],l=e[4],c=e[5]);const a=o===void 0?"default":o,u=l===void 0?"default":l,p=(c===void 0?!1:c)?Ac:"button";let h;e[6]!==n||e[7]!==u||e[8]!==a?(h=Ee(AO({variant:a,size:u,className:n})),e[6]=n,e[7]=u,e[8]=a,e[9]=h):h=e[9];let v;return e[10]!==p||e[11]!==r||e[12]!==u||e[13]!==h||e[14]!==a?(v=m.jsx(p,{"data-slot":"button","data-variant":a,"data-size":u,className:h,...r}),e[10]=p,e[11]=r,e[12]=u,e[13]=h,e[14]=a,e[15]=v):v=e[15],v}function Xa(){const t=fe.c(1),e=RO;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function RO(t,e,n){const r=e===void 0?{}:e,{serverUrl:o,token:l}=n||{};let c=t;t.startsWith("/")&&o&&(c=`http://${o}${t}`);const a=new Headers(r.headers||{});return l&&a.set("Authorization",`Bearer ${l}`),fetch(c,{...r,headers:a})}function TO(...t){return t.map((e,n)=>n===0?e.replace(/\/+$/,""):e.replace(/^\/+|\/+$/g,"")).filter(Boolean).join("/")}function Ao(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Bg,{"data-slot":"dialog",...n}),e[2]=n,e[3]=r):r=e[3],r}function NO(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Fg,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function DO(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(lf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=r):r=e[3],r}function MO(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Hg,{"data-slot":"dialog-overlay",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Ro(t){const e=fe.c(15);let n,r,o,l;e[0]!==t?({className:r,children:n,showCloseButton:l,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(MO,{}),e[5]=a):a=e[5];let u;e[6]!==r?(u=Ee("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",r),e[6]=r,e[7]=u):u=e[7];let d;e[8]!==c?(d=c&&m.jsx(lf,{"data-slot":"dialog-close",asChild:!0,children:m.jsxs(He,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[m.jsx(Bs,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=c,e[9]=d):d=e[9];let p;return e[10]!==n||e[11]!==o||e[12]!==u||e[13]!==d?(p=m.jsxs(NO,{children:[a,m.jsxs(Ug,{"data-slot":"dialog-content",className:u,...o,children:[n,d]})]}),e[10]=n,e[11]=o,e[12]=u,e[13]=d,e[14]=p):p=e[14],p}function To(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex flex-col gap-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"dialog-header",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Tf(t){const e=fe.c(14);let n,r,o,l;e[0]!==t?({className:r,showCloseButton:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?!1:l;let a;e[5]!==r?(a=Ee("-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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&m.jsx(lf,{asChild:!0,children:m.jsx(He,{variant:"outline",children:"Close"})}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==o||e[11]!==a||e[12]!==u?(d=m.jsxs("div",{"data-slot":"dialog-footer",className:a,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function No(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("text-base leading-none font-medium",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(t2,{"data-slot":"dialog-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Qa(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(n2,{"data-slot":"dialog-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Sd(t){const e=fe.c(10);let n,r,o;e[0]!==t?({className:n,type:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n?(l=Ee("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",n),e[4]=n,e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==o?(c=m.jsx("input",{type:o,"data-slot":"input",className:l,...r}),e[6]=r,e[7]=l,e[8]=o,e[9]=c):c=e[9],c}const zc=N.forwardRef((t,e)=>{const n=fe.c(16);let r,o,l;n[0]!==t?({className:o,children:r,...l}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=l):(r=n[1],o=n[2],l=n[3]);let c;n[4]!==o?(c=Ee("relative overflow-hidden",o),n[4]=o,n[5]=c):c=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a={WebkitOverflowScrolling:"touch"},n[6]=a):a=n[6];let u;n[7]!==r||n[8]!==e?(u=m.jsx(CM,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:a,children:r}),n[7]=r,n[8]=e,n[9]=u):u=n[9];let d,p;n[10]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(jO,{}),p=m.jsx(kM,{}),n[10]=d,n[11]=p):(d=n[10],p=n[11]);let h;return n[12]!==l||n[13]!==c||n[14]!==u?(h=m.jsxs(wM,{"data-slot":"scroll-area",className:c,...l,children:[u,d,p]}),n[12]=l,n[13]=c,n[14]=u,n[15]=h):h=n[15],h});zc.displayName="ScrollArea";function jO(t){const e=fe.c(11);let n,r,o;e[0]!==t?({className:n,orientation:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const l=o===void 0?"vertical":o;let c;e[4]!==n?(c=Ee("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",n),e[4]=n,e[5]=c):c=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Mw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==r||e[9]!==c?(u=m.jsx(Rw,{"data-slot":"scroll-area-scrollbar","data-orientation":l,orientation:l,className:c,...r,children:a}),e[7]=l,e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function OO({open:t,onOpenChange:e,onSelect:n,initialPath:r,title:o="Select Folder"}){var B;const[l,c]=N.useState(r||""),[a,u]=N.useState([]),[d,p]=N.useState(!1),[h,v]=N.useState(0),[x,C]=N.useState(null),[w,y]=N.useState(""),[S,_]=N.useState(!1),[b,k]=N.useState([]),[T,R]=N.useState(!1),M=N.useRef(null),A=N.useRef(null),{fetchWithAuth:j}=Xa(),{activeServer:O}=Ba(),z=N.useCallback(async Z=>{var J;p(!0),C(null),v(0),y(""),R(!1);try{const ee=await j(`/api/fs/browse?path=${encodeURIComponent(Z)}`,{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token}),K=await ee.json();if(!ee.ok)throw new Error(K.message||"Failed to browse directory");const $=K.files.filter(te=>te.type==="directory");u($),c(K.currentPath),_((J=K.isRoot)!=null?J:!1)}catch(ee){C(ee instanceof Error?ee.message:"Failed to load directory"),u([])}finally{p(!1)}},[j,O]),V=N.useCallback(async()=>{try{const J=await(await j("/api/fs/drives",{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token})).json();k(J.drives||[])}catch{}},[j,O]);N.useEffect(()=>{t&&(z(r||""),V())},[t,r,z,V]),N.useEffect(()=>{v(0)},[w]);const F=a.filter(Z=>Z.name.toLowerCase().includes(w.toLowerCase())),W=(B=F[h])!=null?B:null,G=N.useCallback(Z=>TO(l,Z.name),[l]),q=W?G(W):l,X=!W,Y=async()=>{var Z;p(!0),C(null);try{const J=await j(`/api/fs/parent?path=${encodeURIComponent(l)}`,{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token}),ee=await J.json();if(!J.ok)throw new Error(ee.message||"Failed to navigate up");const K=ee.files.filter($=>$.type==="directory");u(K),c(ee.currentPath),_((Z=ee.isRoot)!=null?Z:!1),v(0),y("")}catch(J){C(J instanceof Error?J.message:"Failed to navigate up")}finally{p(!1)}},I=()=>{q&&(n(q),e(!1))},L=Z=>{const J=G(Z);z(J)},P=Z=>{if(F.length!==0)switch(Z.key){case"ArrowDown":Z.preventDefault(),v(J=>Math.min(J+1,F.length-1));break;case"ArrowRight":F[h]&&(Z.preventDefault(),L(F[h]));break;case"ArrowUp":Z.preventDefault(),v(J=>Math.max(J-1,0));break;case"Enter":Z.preventDefault(),I();break;case"Escape":w&&(Z.preventDefault(),y(""));break}};N.useEffect(()=>{if(A.current&&F.length>0){const Z=A.current.children[h];Z&&Z.scrollIntoView({block:"nearest"})}},[h,F.length]),N.useEffect(()=>{t&&setTimeout(()=>{var Z;return(Z=M.current)==null?void 0:Z.focus()},100)},[t]),N.useEffect(()=>{R(!1)},[l]);const H=(Z,J=50)=>{if(Z.length<=J)return Z;const ee=Z.split(/[/\\]/);return ee.length<=2?Z:".../"+ee.slice(-2).join("/")};return m.jsx(Ao,{open:t,onOpenChange:e,children:m.jsxs(Ro,{className:"sm:max-w-lg",onKeyDown:P,children:[m.jsx(To,{children:m.jsx(No,{children:o})}),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(He,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:Y,disabled:d||!l||S,children:m.jsx(_5,{className:"w-4 h-4"})}),b.length>1&&m.jsxs("div",{className:"relative",children:[m.jsx(He,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:()=>R(Z=>!Z),disabled:d,children:m.jsx(sA,{className:"w-4 h-4"})}),T&&m.jsx("div",{className:"absolute top-full left-0 mt-1 bg-popover border rounded-md shadow-md z-50 min-w-[120px]",children:b.map(Z=>m.jsxs("button",{onClick:()=>{z(Z),R(!1)},className:Ee("flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-muted",l===Z&&"bg-primary/20 text-primary font-medium"),children:[m.jsx(zs,{className:"w-3.5 h-3.5 text-amber-500"}),Z]},Z))})]}),m.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:q,children:W?m.jsx("span",{className:"text-primary",children:H(G(W),45)}):H(l)||"Home"})]}),m.jsxs("div",{className:"relative",children:[m.jsx(Dg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(Sd,{ref:M,placeholder:"Filter folders...",value:w,onChange:Z=>y(Z.target.value),className:"pl-8"})]}),m.jsx(zc,{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(nr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):x?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[m.jsx("span",{className:"text-destructive",children:x}),m.jsx(He,{variant:"ghost",size:"sm",onClick:()=>z(l),className:"mt-2",children:"Retry"})]}):F.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[m.jsx(zs,{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:A,children:F.map((Z,J)=>m.jsxs("button",{onClick:()=>v(J),onDoubleClick:()=>L(Z),className:Ee("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",J===h&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(zs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:Z.name}),J===h&&m.jsx(Fs,{className:"w-4 h-4 text-primary"})]},Z.path))})}),x&&m.jsx("p",{className:"text-xs text-destructive",children:x})]}),m.jsxs(Tf,{children:[m.jsx(He,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),m.jsx(He,{onClick:I,disabled:!q||d,children:X?"Use This Folder":"Add Selected Folder"})]})]})})}function dg(t){const e=fe.c(26),{open:n,onOpenChange:r,title:o,description:l,confirmLabel:c,cancelLabel:a,onConfirm:u,variant:d}=t,p=c===void 0?"Confirm":c,h=a===void 0?"Cancel":a,v=d===void 0?"default":d;let x;e[0]!==u||e[1]!==r?(x=()=>{u(),r(!1)},e[0]=u,e[1]=r,e[2]=x):x=e[2];const C=x;let w;e[3]!==o?(w=m.jsx(No,{children:o}),e[3]=o,e[4]=w):w=e[4];let y;e[5]!==l?(y=m.jsx(Qa,{children:l}),e[5]=l,e[6]=y):y=e[6];let S;e[7]!==w||e[8]!==y?(S=m.jsxs(To,{children:[w,y]}),e[7]=w,e[8]=y,e[9]=S):S=e[9];let _;e[10]!==h?(_=m.jsx(DO,{asChild:!0,children:m.jsx(He,{variant:"outline",children:h})}),e[10]=h,e[11]=_):_=e[11];const b=v==="destructive"?"destructive":"default";let k;e[12]!==p||e[13]!==C||e[14]!==b?(k=m.jsx(He,{onClick:C,variant:b,children:p}),e[12]=p,e[13]=C,e[14]=b,e[15]=k):k=e[15];let T;e[16]!==k||e[17]!==_?(T=m.jsxs(Tf,{children:[_,k]}),e[16]=k,e[17]=_,e[18]=T):T=e[18];let R;e[19]!==T||e[20]!==S?(R=m.jsxs(Ro,{showCloseButton:!1,children:[S,T]}),e[19]=T,e[20]=S,e[21]=R):R=e[21];let M;return e[22]!==r||e[23]!==n||e[24]!==R?(M=m.jsx(Ao,{open:n,onOpenChange:r,children:R}),e[22]=r,e[23]=n,e[24]=R,e[25]=M):M=e[25],M}function qC(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(PD,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function WC(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(zD,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function GC(t){const e=fe.c(12);let n,r,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=o===void 0?"start":o,a=l===void 0?4:l;let u;e[5]!==n?(u=Ee("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",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=m.jsx(BD,{children:m.jsx(FD,{"data-slot":"dropdown-menu-content",sideOffset:a,align:c,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function uc(t){const e=fe.c(12);let n,r,o,l;e[0]!==t?({className:n,inset:r,variant:l,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==n?(a=Ee("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",n),e[5]=n,e[6]=a):a=e[6];let u;return e[7]!==r||e[8]!==o||e[9]!==a||e[10]!==c?(u=m.jsx(HD,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":c,className:a,...o}),e[7]=r,e[8]=o,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}var Cb=1,LO=.9,IO=.8,PO=.17,vm=.1,ym=.999,zO=.9999,BO=.99,FO=/[\\\/_+.#"@\[\(\{&]/,HO=/[\\\/_+.#"@\[\(\{&]/g,UO=/[\s-]/,KC=/[\s-]/g;function fg(t,e,n,r,o,l,c){if(l===e.length)return o===t.length?Cb:BO;var a=`${o},${l}`;if(c[a]!==void 0)return c[a];for(var u=r.charAt(l),d=n.indexOf(u,o),p=0,h,v,x,C;d>=0;)h=fg(t,e,n,r,d+1,l+1,c),h>p&&(d===o?h*=Cb:FO.test(t.charAt(d-1))?(h*=IO,x=t.slice(o,d-1).match(HO),x&&o>0&&(h*=Math.pow(ym,x.length))):UO.test(t.charAt(d-1))?(h*=LO,C=t.slice(o,d-1).match(KC),C&&o>0&&(h*=Math.pow(ym,C.length))):(h*=PO,o>0&&(h*=Math.pow(ym,d-o))),t.charAt(d)!==e.charAt(l)&&(h*=zO)),(h<vm&&n.charAt(d-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(d-1)!==r.charAt(l))&&(v=fg(t,e,n,r,d+1,l+2,c),v*vm>h&&(h=v*vm)),h>p&&(p=h),d=n.indexOf(u,d+1);return c[a]=p,p}function kb(t){return t.toLowerCase().replace(KC," ")}function $O(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,fg(t,e,kb(t),kb(e),0,0,{})}var ec='[cmdk-group=""]',_m='[cmdk-group-items=""]',VO='[cmdk-group-heading=""]',YC='[cmdk-item=""]',Eb=`${YC}:not([aria-disabled="true"])`,hg="cmdk-item-select",wa="data-value",qO=(t,e,n)=>$O(t,e,n),XC=N.createContext(void 0),Bc=()=>N.useContext(XC),QC=N.createContext(void 0),gv=()=>N.useContext(QC),ZC=N.createContext(void 0),JC=N.forwardRef((t,e)=>{let n=Ca(()=>{var H,B;return{search:"",value:(B=(H=t.value)!=null?H:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ca(()=>new Set),o=Ca(()=>new Map),l=Ca(()=>new Map),c=Ca(()=>new Set),a=ek(t),{label:u,children:d,value:p,onValueChange:h,filter:v,shouldFilter:x,loop:C,disablePointerSelection:w=!1,vimBindings:y=!0,...S}=t,_=mn(),b=mn(),k=mn(),T=N.useRef(null),R=n8();So(()=>{if(p!==void 0){let H=p.trim();n.current.value=H,M.emit()}},[p]),So(()=>{R(6,F)},[]);let M=N.useMemo(()=>({subscribe:H=>(c.current.add(H),()=>c.current.delete(H)),snapshot:()=>n.current,setState:(H,B,Z)=>{var J,ee,K,$;if(!Object.is(n.current[H],B)){if(n.current[H]=B,H==="search")V(),O(),R(1,z);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(k);te?te.focus():(J=document.getElementById(_))==null||J.focus()}if(R(7,()=>{var te;n.current.selectedItemId=(te=W())==null?void 0:te.id,M.emit()}),Z||R(5,F),((ee=a.current)==null?void 0:ee.value)!==void 0){let te=B!=null?B:"";($=(K=a.current).onValueChange)==null||$.call(K,te);return}}M.emit()}},emit:()=>{c.current.forEach(H=>H())}}),[]),A=N.useMemo(()=>({value:(H,B,Z)=>{var J;B!==((J=l.current.get(H))==null?void 0:J.value)&&(l.current.set(H,{value:B,keywords:Z}),n.current.filtered.items.set(H,j(B,Z)),R(2,()=>{O(),M.emit()}))},item:(H,B)=>(r.current.add(H),B&&(o.current.has(B)?o.current.get(B).add(H):o.current.set(B,new Set([H]))),R(3,()=>{V(),O(),n.current.value||z(),M.emit()}),()=>{l.current.delete(H),r.current.delete(H),n.current.filtered.items.delete(H);let Z=W();R(4,()=>{V(),(Z==null?void 0:Z.getAttribute("id"))===H&&z(),M.emit()})}),group:H=>(o.current.has(H)||o.current.set(H,new Set),()=>{l.current.delete(H),o.current.delete(H)}),filter:()=>a.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:_,inputId:k,labelId:b,listInnerRef:T}),[]);function j(H,B){var Z,J;let ee=(J=(Z=a.current)==null?void 0:Z.filter)!=null?J:qO;return H?ee(H,n.current.search,B):0}function O(){if(!n.current.search||a.current.shouldFilter===!1)return;let H=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(J=>{let ee=o.current.get(J),K=0;ee.forEach($=>{let te=H.get($);K=Math.max(te,K)}),B.push([J,K])});let Z=T.current;G().sort((J,ee)=>{var K,$;let te=J.getAttribute("id"),re=ee.getAttribute("id");return((K=H.get(re))!=null?K:0)-(($=H.get(te))!=null?$:0)}).forEach(J=>{let ee=J.closest(_m);ee?ee.appendChild(J.parentElement===ee?J:J.closest(`${_m} > *`)):Z.appendChild(J.parentElement===Z?J:J.closest(`${_m} > *`))}),B.sort((J,ee)=>ee[1]-J[1]).forEach(J=>{var ee;let K=(ee=T.current)==null?void 0:ee.querySelector(`${ec}[${wa}="${encodeURIComponent(J[0])}"]`);K==null||K.parentElement.appendChild(K)})}function z(){let H=G().find(Z=>Z.getAttribute("aria-disabled")!=="true"),B=H==null?void 0:H.getAttribute(wa);M.setState("value",B||void 0)}function V(){var H,B,Z,J;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let K of r.current){let $=(B=(H=l.current.get(K))==null?void 0:H.value)!=null?B:"",te=(J=(Z=l.current.get(K))==null?void 0:Z.keywords)!=null?J:[],re=j($,te);n.current.filtered.items.set(K,re),re>0&&ee++}for(let[K,$]of o.current)for(let te of $)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=ee}function F(){var H,B,Z;let J=W();J&&(((H=J.parentElement)==null?void 0:H.firstChild)===J&&((Z=(B=J.closest(ec))==null?void 0:B.querySelector(VO))==null||Z.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function W(){var H;return(H=T.current)==null?void 0:H.querySelector(`${YC}[aria-selected="true"]`)}function G(){var H;return Array.from(((H=T.current)==null?void 0:H.querySelectorAll(Eb))||[])}function q(H){let B=G()[H];B&&M.setState("value",B.getAttribute(wa))}function X(H){var B;let Z=W(),J=G(),ee=J.findIndex($=>$===Z),K=J[ee+H];(B=a.current)!=null&&B.loop&&(K=ee+H<0?J[J.length-1]:ee+H===J.length?J[0]:J[ee+H]),K&&M.setState("value",K.getAttribute(wa))}function Y(H){let B=W(),Z=B==null?void 0:B.closest(ec),J;for(;Z&&!J;)Z=H>0?e8(Z,ec):t8(Z,ec),J=Z==null?void 0:Z.querySelector(Eb);J?M.setState("value",J.getAttribute(wa)):X(H)}let I=()=>q(G().length-1),L=H=>{H.preventDefault(),H.metaKey?I():H.altKey?Y(1):X(1)},P=H=>{H.preventDefault(),H.metaKey?q(0):H.altKey?Y(-1):X(-1)};return N.createElement(Ke.div,{ref:e,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:H=>{var B;(B=S.onKeyDown)==null||B.call(S,H);let Z=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||Z))switch(H.key){case"n":case"j":{y&&H.ctrlKey&&L(H);break}case"ArrowDown":{L(H);break}case"p":case"k":{y&&H.ctrlKey&&P(H);break}case"ArrowUp":{P(H);break}case"Home":{H.preventDefault(),q(0);break}case"End":{H.preventDefault(),I();break}case"Enter":{H.preventDefault();let J=W();if(J){let ee=new Event(hg);J.dispatchEvent(ee)}}}}},N.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:s8},u),Nf(t,H=>N.createElement(QC.Provider,{value:M},N.createElement(XC.Provider,{value:A},H))))}),WO=N.forwardRef((t,e)=>{var n,r;let o=mn(),l=N.useRef(null),c=N.useContext(ZC),a=Bc(),u=ek(t),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;So(()=>{if(!d)return a.item(o,c==null?void 0:c.id)},[d]);let p=tk(o,l,[t.value,t.children,l],t.keywords),h=gv(),v=Di(R=>R.value&&R.value===p.current),x=Di(R=>d||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);N.useEffect(()=>{let R=l.current;if(!(!R||t.disabled))return R.addEventListener(hg,C),()=>R.removeEventListener(hg,C)},[x,t.onSelect,t.disabled]);function C(){var R,M;w(),(M=(R=u.current).onSelect)==null||M.call(R,p.current)}function w(){h.setState("value",p.current,!0)}if(!x)return null;let{disabled:y,value:S,onSelect:_,forceMount:b,keywords:k,...T}=t;return N.createElement(Ke.div,{ref:Hs(l,e),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!v,"data-disabled":!!y,"data-selected":!!v,onPointerMove:y||a.getDisablePointerSelection()?void 0:w,onClick:y?void 0:C},t.children)}),GO=N.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...l}=t,c=mn(),a=N.useRef(null),u=N.useRef(null),d=mn(),p=Bc(),h=Di(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(c):!0);So(()=>p.group(c),[]),tk(c,a,[t.value,t.heading,u]);let v=N.useMemo(()=>({id:c,forceMount:o}),[o]);return N.createElement(Ke.div,{ref:Hs(a,e),...l,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&N.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Nf(t,x=>N.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},N.createElement(ZC.Provider,{value:v},x))))}),KO=N.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=N.useRef(null),l=Di(c=>!c.search);return!n&&!l?null:N.createElement(Ke.div,{ref:Hs(o,e),...r,"cmdk-separator":"",role:"separator"})}),YO=N.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,l=gv(),c=Di(d=>d.search),a=Di(d=>d.selectedItemId),u=Bc();return N.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),N.createElement(Ke.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":a,id:u.inputId,type:"text",value:o?t.value:c,onChange:d=>{o||l.setState("search",d.target.value),n==null||n(d.target.value)}})}),XO=N.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,l=N.useRef(null),c=N.useRef(null),a=Di(d=>d.selectedItemId),u=Bc();return N.useEffect(()=>{if(c.current&&l.current){let d=c.current,p=l.current,h,v=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let x=d.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(h),v.unobserve(d)}}},[]),N.createElement(Ke.div,{ref:Hs(l,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:u.listId},Nf(t,d=>N.createElement("div",{ref:Hs(c,u.listInnerRef),"cmdk-list-sizer":""},d)))}),QO=N.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:l,container:c,...a}=t;return N.createElement(Bg,{open:n,onOpenChange:r},N.createElement(Fg,{container:c},N.createElement(Hg,{"cmdk-overlay":"",className:o}),N.createElement(Ug,{"aria-label":t.label,"cmdk-dialog":"",className:l},N.createElement(JC,{ref:e,...a}))))}),ZO=N.forwardRef((t,e)=>Di(n=>n.filtered.count===0)?N.createElement(Ke.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),JO=N.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...l}=t;return N.createElement(Ke.div,{ref:e,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Nf(t,c=>N.createElement("div",{"aria-hidden":!0},c)))}),Do=Object.assign(JC,{List:XO,Item:WO,Input:YO,Group:GO,Separator:KO,Dialog:QO,Empty:ZO,Loading:JO});function e8(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function t8(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function ek(t){let e=N.useRef(t);return So(()=>{e.current=t}),e}var So=typeof window>"u"?N.useEffect:N.useLayoutEffect;function Ca(t){let e=N.useRef();return e.current===void 0&&(e.current=t()),e}function Di(t){let e=gv(),n=()=>t(e.snapshot());return N.useSyncExternalStore(e.subscribe,n,n)}function tk(t,e,n,r=[]){let o=N.useRef(),l=Bc();return So(()=>{var c;let a=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():o.current}})(),u=r.map(d=>d.trim());l.value(t,a,u),(c=e.current)==null||c.setAttribute(wa,a),o.current=a}),o}var n8=()=>{let[t,e]=N.useState(),n=Ca(()=>new Map);return So(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function r8(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Nf({asChild:t,children:e},n){return t&&N.isValidElement(e)?N.cloneElement(r8(e),{ref:e.ref},n(e.props.children)):n(e)}var s8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function i8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("textarea",{"data-slot":"textarea",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function o8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"input-group",role:"group",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const a8=$a("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 l8(t){const e=fe.c(11);let n,r,o;e[0]!==t?({className:n,align:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const l=o===void 0?"inline-start":o;let c;e[4]!==l||e[5]!==n?(c=Ee(a8({align:l}),n),e[4]=l,e[5]=n,e[6]=c):c=e[6];let a;return e[7]!==l||e[8]!==r||e[9]!==c?(a=m.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":l,className:c,onClick:c8,...r}),e[7]=l,e[8]=r,e[9]=c,e[10]=a):a=e[10],a}function c8(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function vv(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Do,{"data-slot":"command",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function nk(t){const e=fe.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=o):o=e[4];let l;e[5]!==r||e[6]!==o?(l=m.jsx(Do.Input,{"data-slot":"command-input",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(l8,{children:m.jsx(Dg,{className:"size-4 shrink-0 opacity-50"})}),e[8]=c):c=e[8];let a;return e[9]!==l?(a=m.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:m.jsxs(o8,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[l,c]})}),e[9]=l,e[10]=a):a=e[10],a}function yv(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Do.List,{"data-slot":"command-list",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function _v(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("py-6 text-center text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Do.Empty,{"data-slot":"command-empty",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function bc(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Do.Group,{"data-slot":"command-group",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function rk(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("-mx-1 h-px bg-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Do.Separator,{"data-slot":"command-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Ta(t){const e=fe.c(14);let n,r,o,l;e[0]!==t?({className:r,children:n,showCheck:l,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?!0:l;let a;e[5]!==r?(a=Ee("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==c?(u=c&&m.jsx(Fs,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[7]=c,e[8]=u):u=e[8];let d;return e[9]!==n||e[10]!==o||e[11]!==a||e[12]!==u?(d=m.jsxs(Do.Item,{"data-slot":"command-item",className:a,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=a,e[12]=u,e[13]=d):d=e[13],d}function Df(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(JD,{"data-slot":"popover",...n}),e[2]=n,e[3]=r):r=e[3],r}function bv(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(tM,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Mf(t){const e=fe.c(12);let n,r,o,l;e[0]!==t?({className:n,align:o,sideOffset:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=o===void 0?"center":o,a=l===void 0?4:l;let u;e[5]!==n?(u=Ee("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",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==r||e[9]!==a||e[10]!==u?(d=m.jsx(nM,{children:m.jsx(rM,{"data-slot":"popover-content",align:c,sideOffset:a,className:u,...r})}),e[7]=c,e[8]=r,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function u8(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(eM,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=r):r=e[3],r}function d8(t){const e=fe.c(59),{workspaces:n,activeWorkspace:r,onSelectWorkspace:o,onCreateVirtualWorkspace:l,onCreatePhysicalWorkspace:c,isWorkspaceFavorited:a,onToggleFavorite:u,onDeleteWorkspace:d}=t,[p,h]=N.useState(!1),[v,x]=N.useState(!1),[C,w]=N.useState(null);let y;e[0]!==(r==null?void 0:r.isVirtual)?(y=r!=null&&r.isVirtual?m.jsx(Gm,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(zs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=r==null?void 0:r.isVirtual,e[1]=y):y=e[1];const S=(r==null?void 0:r.name)||"Select workspace";let _;e[2]!==S?(_=m.jsx("span",{className:"truncate",children:S}),e[2]=S,e[3]=_):_=e[3];let b;e[4]!==y||e[5]!==_?(b=m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[y,_]}),e[4]=y,e[5]=_,e[6]=b):b=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(aS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=k):k=e[7];let T;e[8]!==p||e[9]!==b?(T=m.jsx(bv,{asChild:!0,children:m.jsxs(He,{variant:"outline",role:"combobox","aria-expanded":p,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[b,k]})}),e[8]=p,e[9]=b,e[10]=T):T=e[10];let R;e[11]===Symbol.for("react.memo_cache_sentinel")?(R=m.jsx(nk,{placeholder:"Search workspace..."}),e[11]=R):R=e[11];let M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(_v,{children:"No workspace found."}),e[12]=M):M=e[12];let A;if(e[13]!==(r==null?void 0:r.id)||e[14]!==a||e[15]!==o||e[16]!==u||e[17]!==n){let ee;e[19]!==(r==null?void 0:r.id)||e[20]!==a||e[21]!==o||e[22]!==u?(ee=K=>m.jsxs(Ta,{showCheck:!1,onSelect:()=>{o(K),h(!1)},children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[K.isVirtual?m.jsx(Gm,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(zs,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:K.name})]}),m.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[m.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:$=>{$.stopPropagation(),u(K.id,K.name)},title:a(K.id)?"Remove from favorites":"Add to favorites",children:a(K.id)?m.jsx(B_,{className:"size-4 fill-primary text-primary"}):m.jsx(B_,{className:"size-4 text-muted-foreground"})}),m.jsx(Fs,{className:Ee("size-4",(r==null?void 0:r.id)===K.id?"opacity-100":"opacity-0")}),m.jsxs(qC,{children:[m.jsx(WC,{asChild:!0,children:m.jsxs("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:f8,children:[m.jsx(cS,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Workspace actions"})]})}),m.jsx(GC,{align:"end",children:m.jsxs(uc,{onClick:$=>{$.stopPropagation(),w(K)},className:"text-destructive focus:text-destructive",children:[m.jsx(Ua,{className:"size-4"}),"Delete workspace"]})})]})]})]},K.id),e[19]=r==null?void 0:r.id,e[20]=a,e[21]=o,e[22]=u,e[23]=ee):ee=e[23],A=n.map(ee),e[13]=r==null?void 0:r.id,e[14]=a,e[15]=o,e[16]=u,e[17]=n,e[18]=A}else A=e[18];let j;e[24]!==A?(j=m.jsx(bc,{heading:"Workspaces",children:A}),e[24]=A,e[25]=j):j=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx(rk,{}),e[26]=O):O=e[26];let z;e[27]!==l?(z=()=>{l(),h(!1)},e[27]=l,e[28]=z):z=e[28];let V;e[29]===Symbol.for("react.memo_cache_sentinel")?(V=m.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),e[29]=V):V=e[29];let F;e[30]!==z?(F=m.jsxs(Ta,{onSelect:z,children:[V,"Create virtual workspace"]}),e[30]=z,e[31]=F):F=e[31];let W;e[32]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsxs(Ta,{onSelect:()=>{h(!1),x(!0)},children:[m.jsx(zs,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=W):W=e[32];let G;e[33]!==F?(G=m.jsxs(bc,{children:[F,W]}),e[33]=F,e[34]=G):G=e[34];let q;e[35]!==j||e[36]!==G?(q=m.jsx(Mf,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(vv,{children:[R,m.jsxs(yv,{className:"max-h-[50vh] overflow-y-auto",children:[M,j,O,G]})]})}),e[35]=j,e[36]=G,e[37]=q):q=e[37];let X;e[38]!==p||e[39]!==q||e[40]!==T?(X=m.jsxs(Df,{open:p,onOpenChange:h,children:[T,q]}),e[38]=p,e[39]=q,e[40]=T,e[41]=X):X=e[41];let Y;e[42]!==c?(Y=ee=>{c(ee),x(!1)},e[42]=c,e[43]=Y):Y=e[43];let I;e[44]!==v||e[45]!==Y?(I=m.jsx(OO,{open:v,onOpenChange:x,onSelect:Y,title:"Select Workspace Folder"}),e[44]=v,e[45]=Y,e[46]=I):I=e[46];const L=C!==null;let P;e[47]===Symbol.for("react.memo_cache_sentinel")?(P=ee=>!ee&&w(null),e[47]=P):P=e[47];const H=C?`Are you sure you want to delete "${C.name}"? This will permanently remove the workspace and all associated Jean data, including sessions, messages, and temporary files. The actual files in "${C.name}" on disk will not be deleted.`:"";let B;e[48]!==d||e[49]!==C?(B=()=>{C&&(d(C.id),w(null))},e[48]=d,e[49]=C,e[50]=B):B=e[50];let Z;e[51]!==L||e[52]!==H||e[53]!==B?(Z=m.jsx(dg,{open:L,onOpenChange:P,title:"Delete Workspace",description:H,confirmLabel:"Delete",variant:"destructive",onConfirm:B}),e[51]=L,e[52]=H,e[53]=B,e[54]=Z):Z=e[54];let J;return e[55]!==X||e[56]!==I||e[57]!==Z?(J=m.jsxs(m.Fragment,{children:[X,I,Z]}),e[55]=X,e[56]=I,e[57]=Z,e[58]=J):J=e[58],J}function f8(t){return t.stopPropagation()}function h8(t){const e=fe.c(33),{onOpenAddServer:n,onServerSwitch:r}=t,[o,l]=N.useState(!1),{servers:c,activeServer:a,switchServer:u}=Ba();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(go,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];const p=(a==null?void 0:a.name)||"Select server";let h;e[1]!==p?(h=m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[d,m.jsx("span",{className:"truncate",children:p})]}),e[1]=p,e[2]=h):h=e[2];let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(aS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=v):v=e[3];let x;e[4]!==o||e[5]!==h?(x=m.jsx(bv,{asChild:!0,children:m.jsxs(He,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select server",className:"w-full justify-between h-9",children:[h,v]})}),e[4]=o,e[5]=h,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(nk,{placeholder:"Search server..."}),e[7]=C):C=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(_v,{children:"No server found."}),e[8]=w):w=e[8];let y;if(e[9]!==(a==null?void 0:a.id)||e[10]!==r||e[11]!==c||e[12]!==u){let A;e[14]!==(a==null?void 0:a.id)||e[15]!==r||e[16]!==u?(A=j=>m.jsxs(Ta,{onSelect:()=>{u(j.id),r==null||r(),l(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(go,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:j.name})]}),m.jsx(Fs,{className:Ee("size-4",(a==null?void 0:a.id)===j.id?"opacity-100":"opacity-0")})]},j.id),e[14]=a==null?void 0:a.id,e[15]=r,e[16]=u,e[17]=A):A=e[17],y=c.map(A),e[9]=a==null?void 0:a.id,e[10]=r,e[11]=c,e[12]=u,e[13]=y}else y=e[13];let S;e[18]!==y?(S=m.jsx(bc,{heading:"Servers",children:y}),e[18]=y,e[19]=S):S=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsx(rk,{}),e[20]=_):_=e[20];let b;e[21]!==n?(b=()=>{n(),l(!1)},e[21]=n,e[22]=b):b=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),e[23]=k):k=e[23];let T;e[24]!==b?(T=m.jsx(bc,{children:m.jsxs(Ta,{onSelect:b,children:[k,"Add Server..."]})}),e[24]=b,e[25]=T):T=e[25];let R;e[26]!==T||e[27]!==S?(R=m.jsx(Mf,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(vv,{children:[C,m.jsxs(yv,{className:"max-h-[50vh] overflow-y-auto",children:[w,S,_,T]})]})}),e[26]=T,e[27]=S,e[28]=R):R=e[28];let M;return e[29]!==o||e[30]!==R||e[31]!==x?(M=m.jsxs(Df,{open:o,onOpenChange:l,children:[x,R]}),e[29]=o,e[30]=R,e[31]=x,e[32]=M):M=e[32],M}const bm=640,xm=1700;function Za(){const t=fe.c(2),[e,n]=N.useState(void 0);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${bm-1}px)`),c=()=>{n(window.innerWidth<bm)};return l.addEventListener("change",c),n(window.innerWidth<bm),()=>l.removeEventListener("change",c)},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),!!e}function p8(){const t=fe.c(2),[e,n]=N.useState(void 0);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.matchMedia(`(max-width: ${xm-1}px)`),c=()=>{n(window.innerWidth<xm)};return l.addEventListener("change",c),n(window.innerWidth<xm),()=>l.removeEventListener("change",c)},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),!!e}function cs(t){const e=fe.c(12);let n,r,o,l;e[0]!==t?({className:n,orientation:o,decorative:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=o===void 0?"horizontal":o,a=l===void 0?!0:l;let u;e[5]!==n?(u=Ee("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==c||e[9]!==r||e[10]!==u?(d=m.jsx(uj,{"data-slot":"separator",decorative:a,orientation:c,className:u,...r}),e[7]=a,e[8]=c,e[9]=r,e[10]=u,e[11]=d):d=e[11],d}function jf(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Bg,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function m8(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(JT,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function g8(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Fg,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function v8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(Hg,{"data-slot":"sheet-overlay",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Of(t){const e=fe.c(24);let n,r,o,l,c,a;e[0]!==t?({className:r,children:n,side:c,showCloseButton:a,style:l,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c,e[6]=a):(n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],a=e[6]);const u=c===void 0?"right":c,d=a===void 0?!0:a;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(v8,{}),e[7]=p):p=e[7];let h;e[8]!==r?(h=Ee("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",r),e[8]=r,e[9]=h):h=e[9];let v;e[10]!==u?(v=u==="left"||u==="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))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=v):v=e[11];const x=v;let C;e[12]!==x||e[13]!==l?(C=x?{...x,...l}:l,e[12]=x,e[13]=l,e[14]=C):C=e[14];const w=C;let y;e[15]!==d?(y=d&&m.jsx(lf,{"data-slot":"sheet-close",asChild:!0,children:m.jsxs(He,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[m.jsx(Bs,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=d,e[16]=y):y=e[16];let S;return e[17]!==n||e[18]!==o||e[19]!==u||e[20]!==h||e[21]!==w||e[22]!==y?(S=m.jsxs(g8,{children:[p,m.jsxs(Ug,{"data-slot":"sheet-content","data-side":u,className:h,style:w,...o,children:[n,y]})]}),e[17]=n,e[18]=o,e[19]=u,e[20]=h,e[21]=w,e[22]=y,e[23]=S):S=e[23],S}function Lf(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"sheet-header",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function If(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("text-base font-medium text-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(t2,{"data-slot":"sheet-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function y8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(n2,{"data-slot":"sheet-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Sm(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("animate-pulse rounded-md bg-muted",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"skeleton",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Fd(t){const e=fe.c(6);let n,r;e[0]!==t?({delayDuration:r,...n}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const o=r===void 0?0:r;let l;return e[3]!==o||e[4]!==n?(l=m.jsx(Mj,{"data-slot":"tooltip-provider",delayDuration:o,...n}),e[3]=o,e[4]=n,e[5]=l):l=e[5],l}function xc(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(jj,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=r):r=e[3],r}function Sc(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Oj,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function wc(t){const e=fe.c(13);let n,r,o,l;e[0]!==t?({className:r,sideOffset:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?0:l;let a;e[5]!==r?(a=Ee("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Pj,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==o||e[10]!==c||e[11]!==a?(d=m.jsx(Lj,{children:m.jsxs(Ij,{"data-slot":"tooltip-content",sideOffset:c,className:a,...o,children:[n,u]})}),e[8]=n,e[9]=o,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}const _8="sidebar_state",b8=3600*24*7,x8="16rem",S8="18rem",w8="3rem",sk=N.createContext(null);function Fc(){const t=N.useContext(sk);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function ik(t){const e=fe.c(35);let n,r,o,l,c,a,u,d;e[0]!==t?({defaultOpen:d,open:o,onOpenChange:a,className:r,style:u,children:n,panelId:l,...c}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d):(n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8]);const p=d===void 0?!0:d,h=Za(),[v,x]=N.useState(!1),[C,w]=N.useState(p),y=o!=null?o:C;let S;e[9]!==y||e[10]!==a?(S=F=>{const W=typeof F=="function"?F(y):F;a?a(W):w(W),document.cookie=`${_8}=${W}; path=/; max-age=${b8}`},e[9]=y,e[10]=a,e[11]=S):S=e[11];const _=S;let b;e[12]!==h||e[13]!==_?(b=()=>h?x(k8):_(C8),e[12]=h,e[13]=_,e[14]=b):b=e[14];const k=b,T=y?"expanded":"collapsed";let R;e[15]!==h||e[16]!==y||e[17]!==v||e[18]!==_||e[19]!==T||e[20]!==k?(R={state:T,open:y,setOpen:_,isMobile:h,openMobile:v,setOpenMobile:x,toggleSidebar:k},e[15]=h,e[16]=y,e[17]=v,e[18]=_,e[19]=T,e[20]=k,e[21]=R):R=e[21];const M=R;let A;e[22]!==u?(A={"--sidebar-width":x8,"--sidebar-width-icon":w8,...u},e[22]=u,e[23]=A):A=e[23];const j=A;let O;e[24]!==r?(O=Ee("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",r),e[24]=r,e[25]=O):O=e[25];let z;e[26]!==n||e[27]!==l||e[28]!==c||e[29]!==j||e[30]!==O?(z=m.jsx("div",{"data-slot":"sidebar-wrapper","data-panel-id":l,style:j,className:O,...c,children:n}),e[26]=n,e[27]=l,e[28]=c,e[29]=j,e[30]=O,e[31]=z):z=e[31];let V;return e[32]!==M||e[33]!==z?(V=m.jsx(sk.Provider,{value:M,children:z}),e[32]=M,e[33]=z,e[34]=V):V=e[34],V}function C8(t){return!t}function k8(t){return!t}function ok(t){const e=fe.c(53);let n,r,o,l,c,a,u,d;if(e[0]!==t){const{side:X,variant:Y,collapsible:I,className:L,children:P,dir:H,isOpen:B,onOpenChange:Z,...J}=t;a=X,u=Y,d=I,r=L,n=P,o=H,l=B,c=J,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c,e[6]=a,e[7]=u,e[8]=d}else n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],a=e[6],u=e[7],d=e[8];const p=a===void 0?"left":a,h=u===void 0?"sidebar":u,v=d===void 0?"offcanvas":d,{isMobile:x,state:C,openMobile:w,setOpenMobile:y}=Fc(),_=l!==void 0?l:void 0,b=_!==void 0?_?"expanded":"collapsed":C;if(v==="none"){let X;e[9]!==r?(X=Ee("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),e[9]=r,e[10]=X):X=e[10];let Y;return e[11]!==n||e[12]!==c||e[13]!==X?(Y=m.jsx("div",{"data-slot":"sidebar",className:X,...c,children:n}),e[11]=n,e[12]=c,e[13]=X,e[14]=Y):Y=e[14],Y}if(x){let X;e[15]===Symbol.for("react.memo_cache_sentinel")?(X={"--sidebar-width":S8},e[15]=X):X=e[15];let Y;e[16]===Symbol.for("react.memo_cache_sentinel")?(Y=m.jsxs(Lf,{className:"sr-only",children:[m.jsx(If,{children:"Sidebar"}),m.jsx(y8,{children:"Displays the mobile sidebar."})]}),e[16]=Y):Y=e[16];let I;e[17]!==n?(I=m.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[17]=n,e[18]=I):I=e[18];let L;e[19]!==o||e[20]!==p||e[21]!==I?(L=m.jsxs(Of,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:X,side:p,children:[Y,I]}),e[19]=o,e[20]=p,e[21]=I,e[22]=L):L=e[22];let P;return e[23]!==w||e[24]!==c||e[25]!==y||e[26]!==L?(P=m.jsx(jf,{open:w,onOpenChange:y,...c,children:L}),e[23]=w,e[24]=c,e[25]=y,e[26]=L,e[27]=P):P=e[27],P}const k=b==="collapsed"?v:"",T=_!==void 0&&!_&&"w-0",R=h==="floating"||h==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let M;e[28]!==T||e[29]!==R?(M=Ee("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",T,"group-data-[side=right]:rotate-180",R),e[28]=T,e[29]=R,e[30]=M):M=e[30];let A;e[31]!==M?(A=m.jsx("div",{"data-slot":"sidebar-gap",className:M}),e[31]=M,e[32]=A):A=e[32];const j=p==="left"&&_!==void 0&&!_&&"left-[calc(var(--sidebar-width)*-1)]",O=p==="right"&&_!==void 0&&!_&&"right-[calc(var(--sidebar-width)*-1)]",z=h==="floating"||h==="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";let V;e[33]!==r||e[34]!==O||e[35]!==z||e[36]!==j?(V=Ee("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",j,O,z,r),e[33]=r,e[34]=O,e[35]=z,e[36]=j,e[37]=V):V=e[37];let F;e[38]===Symbol.for("react.memo_cache_sentinel")?(F={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))"},e[38]=F):F=e[38];let W;e[39]!==n?(W=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:n}),e[39]=n,e[40]=W):W=e[40];let G;e[41]!==c||e[42]!==p||e[43]!==V||e[44]!==W?(G=m.jsx("div",{"data-slot":"sidebar-container","data-side":p,className:V,style:F,...c,children:W}),e[41]=c,e[42]=p,e[43]=V,e[44]=W,e[45]=G):G=e[45];let q;return e[46]!==b||e[47]!==p||e[48]!==G||e[49]!==k||e[50]!==A||e[51]!==h?(q=m.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":b,"data-collapsible":k,"data-variant":h,"data-side":p,"data-slot":"sidebar",children:[A,G]}),e[46]=b,e[47]=p,e[48]=G,e[49]=k,e[50]=A,e[51]=h,e[52]=q):q=e[52],q}function Ab(t){const e=fe.c(15);let n,r,o;e[0]!==t?({className:n,onClick:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const{toggleSidebar:l}=Fc();let c;e[4]!==n?(c=Ee(n),e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r||e[7]!==l?(a=h=>{r==null||r(h),l()},e[6]=r,e[7]=l,e[8]=a):a=e[8];let u,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(NA,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=d):(u=e[9],d=e[10]);let p;return e[11]!==o||e[12]!==c||e[13]!==a?(p=m.jsxs(He,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:c,onClick:a,...o,children:[u,d]}),e[11]=o,e[12]=c,e[13]=a,e[14]=p):p=e[14],p}function ak(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function E8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function A8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(cs,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const lk=N.forwardRef((t,e)=>{const n=fe.c(9);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let l;n[3]!==r?(l=Ee("no-scrollbar flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=l):l=n[4];let c;return n[5]!==o||n[6]!==e||n[7]!==l?(c=m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l,ref:e,...o}),n[5]=o,n[6]=e,n[7]=l,n[8]=c):c=n[8],c});function Hd(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Ud(t){const e=fe.c(10);let n,r,o;e[0]!==t?({className:n,asChild:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const c=(o===void 0?!1:o)?Ac:"div";let a;e[4]!==n?(a=Ee("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:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=a):a=e[5];let u;return e[6]!==c||e[7]!==r||e[8]!==a?(u=m.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a,...r}),e[6]=c,e[7]=r,e[8]=a,e[9]=u):u=e[9],u}function $d(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function mo(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Ei(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const R8=$a("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:ring-1 focus:ring-inset 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 vo(t){const e=fe.c(28);let n,r,o,l,c,a,u;e[0]!==t?({asChild:o,isActive:l,variant:c,size:a,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c,e[6]=a,e[7]=u):(n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],a=e[6],u=e[7]);const d=o===void 0?!1:o,p=l===void 0?!1:l,h=c===void 0?"default":c,v=a===void 0?"default":a,x=d?Ac:"button",{isMobile:C,state:w}=Fc();let y;e[8]!==n||e[9]!==v||e[10]!==h?(y=Ee(R8({variant:h,size:v}),n),e[8]=n,e[9]=v,e[10]=h,e[11]=y):y=e[11];let S;e[12]!==x||e[13]!==p||e[14]!==r||e[15]!==v||e[16]!==y?(S=m.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":v,"data-active":p,className:y,...r}),e[12]=x,e[13]=p,e[14]=r,e[15]=v,e[16]=y,e[17]=S):S=e[17];const _=S;if(!u)return _;if(typeof u=="string"){let M;e[18]!==u?(M={children:u},e[18]=u,e[19]=M):M=e[19],u=M}let b;e[20]!==_?(b=m.jsx(Sc,{asChild:!0,children:_}),e[20]=_,e[21]=b):b=e[21];const k=w!=="collapsed"||C;let T;e[22]!==k||e[23]!==u?(T=m.jsx(wc,{side:"right",align:"center",hidden:k,...u}),e[22]=k,e[23]=u,e[24]=T):T=e[24];let R;return e[25]!==b||e[26]!==T?(R=m.jsxs(xc,{children:[b,T]}),e[25]=b,e[26]=T,e[27]=R):R=e[27],R}function T8(t){const e=fe.c(12);let n,r,o,l;e[0]!==t?({className:n,asChild:o,showOnHover:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=o===void 0?!1:o,a=l===void 0?!1:l,u=c?Ac:"button",d=a&&"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";let p;e[5]!==n||e[6]!==d?(p=Ee("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:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",d,n),e[5]=n,e[6]=d,e[7]=p):p=e[7];let h;return e[8]!==u||e[9]!==r||e[10]!==p?(h=m.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:p,...r}),e[8]=u,e[9]=r,e[10]=p,e[11]=h):h=e[11],h}function N8(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function ck(t){const e=fe.c(29);let n,r,o,l;e[0]!==t?({side:l,panelId:r,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=Za(),a=zt(O8),u=zt(j8),d=zt(M8),p=zt(D8),h=r==="sessions"?a:d,v=r==="sessions"?u:p,[x,C]=N.useState(!1),w=N.useRef(!1),y=N.useRef(0),S=N.useRef(0),_=N.useRef(0),b=N.useRef(null),k=N.useRef(null);let T;e[5]!==c||e[6]!==r?(T=X=>{if(c)return;X.preventDefault(),X.stopPropagation(),w.current=!0,C(!0),y.current=X.clientX,S.current=_.current,document.body.style.cursor="ew-resize",document.body.style.userSelect="none";const Y=document.querySelector(`[data-panel-id="${r}"]`);b.current=Y,Y&&(k.current=Y.style.getPropertyValue("--sidebar-width")||null,Y.classList.add("no-transition"))},e[5]=c,e[6]=r,e[7]=T):T=e[7];const R=T;let M,A;e[8]!==h?(M=()=>{_.current=h},A=[h],e[8]=h,e[9]=M,e[10]=A):(M=e[9],A=e[10]),N.useEffect(M,A);let j,O;if(e[11]!==r||e[12]!==v||e[13]!==l?(j=()=>{const X=I=>{if(!w.current)return;const L=l==="left"?I.clientX-y.current:y.current-I.clientX,P=Ed(S.current+L);_.current=P;const H=b.current||document.querySelector(`[data-panel-id="${r}"]`);H&&(H.style.setProperty("--sidebar-width",`${Math.round(P)}px`),b.current=H);const B=document.querySelector(`[data-panel-gap="${r}"]`);B&&(B.style.width=`${Math.round(P)}px`)},Y=()=>{if(!w.current)return;w.current=!1,C(!1),document.body.style.cursor="",document.body.style.userSelect="";const I=b.current||document.querySelector(`[data-panel-id="${r}"]`);I&&(I.classList.remove("no-transition"),k.current!==null?I.style.setProperty("--sidebar-width",k.current):I.style.removeProperty("--sidebar-width"));const L=document.querySelector(`[data-panel-gap="${r}"]`);L&&(L.classList.add("no-transition"),L.style.width=`${Math.round(_.current)}px`,requestAnimationFrame(()=>{L==null||L.classList.remove("no-transition")})),v(Math.round(_.current))};return document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)}},O=[v,l,r],e[11]=r,e[12]=v,e[13]=l,e[14]=j,e[15]=O):(j=e[14],O=e[15]),N.useEffect(j,O),c)return null;const z=l==="left"?"absolute top-0 right-0":"absolute top-0 left-0";let V;e[16]!==n||e[17]!==z?(V=Ee("z-30 flex h-full w-2 cursor-ew-resize items-center justify-center group/sidebar-resize",z,n),e[16]=n,e[17]=z,e[18]=V):V=e[18];const F=x?"bg-primary":"group-active/sidebar-resize:bg-primary";let W;e[19]!==F?(W=Ee("h-8 w-0.5 rounded-full transition-colors duration-100","bg-transparent group-hover/sidebar-resize:bg-border",F),e[19]=F,e[20]=W):W=e[20];let G;e[21]!==W?(G=m.jsx("div",{className:W}),e[21]=W,e[22]=G):G=e[22];let q;return e[23]!==R||e[24]!==r||e[25]!==o||e[26]!==V||e[27]!==G?(q=m.jsx("div",{"data-slot":"panel-resize-handle","data-panel-id":r,className:V,onMouseDown:R,...o,children:G}),e[23]=R,e[24]=r,e[25]=o,e[26]=V,e[27]=G,e[28]=q):q=e[28],q}function D8(t){return t.setFilesPanelWidth}function M8(t){return t.filesPanelWidth}function j8(t){return t.setSessionsPanelWidth}function O8(t){return t.sessionsPanelWidth}function L8(t){const e=fe.c(6);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;return e[3]!==n||e[4]!==r?(o=m.jsx(ck,{side:"left",panelId:"sessions",className:n,...r}),e[3]=n,e[4]=r,e[5]=o):o=e[5],o}function Mi(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(HR,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function ji(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(ES,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Oi(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(AS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}const Rb=En.memo(function(e){const n=fe.c(13),{isClosed:r,isEditing:o,onRename:l,onReopen:c,onClose:a,onDelete:u}=e;if(o){let C;return n[0]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx("div",{className:"shrink-0 size-7"}),n[0]=C):C=n[0],C}let d;n[1]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(WC,{asChild:!0,children:m.jsxs(T8,{showOnHover:!0,children:[m.jsx(cS,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[1]=d):d=n[1];let p;n[2]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(LA,{className:"size-4"}),n[2]=p):p=n[2];let h;n[3]!==l?(h=m.jsxs(uc,{onClick:l,children:[p,"Rename"]}),n[3]=l,n[4]=h):h=n[4];let v;n[5]!==r||n[6]!==a||n[7]!==u||n[8]!==c?(v=r?m.jsxs(m.Fragment,{children:[m.jsxs(uc,{onClick:c,children:[m.jsx(hS,{className:"size-4"}),"Restore"]}),m.jsxs(uc,{onClick:u,className:"text-destructive focus:text-destructive",children:[m.jsx(Ua,{className:"size-4"}),"Delete permanently"]})]}):m.jsxs(uc,{onClick:a,children:[m.jsx(Bs,{className:"size-4"}),"Archive"]}),n[5]=r,n[6]=a,n[7]=u,n[8]=c,n[9]=v):v=n[9];let x;return n[10]!==h||n[11]!==v?(x=m.jsxs(qC,{children:[d,m.jsxs(GC,{align:"end",children:[h,v]})]}),n[10]=h,n[11]=v,n[12]=x):x=n[12],x}),Tb=En.memo(function(e){const n=fe.c(4),{status:r,isStreaming:o,runningAt:l}=e;if(o||r==="running"||!!l){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(nr,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(r==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(ef,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(r==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(fS,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Ec,{className:"size-3.5 shrink-0"}),n[3]=a):a=n[3],a}),pg=En.memo(function t({session:e,childrenMap:n,sessionDerivedValues:r,isActive:o,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:p}){var X,Y;const[h,v]=N.useState(!1),[x,C]=N.useState(e.title||""),w=N.useRef(null),y=(X=r.get(e.id))!=null?X:{isStreaming:!1,hasPendingPermission:!1},S=(Y=n.get(e.id))!=null?Y:[],_=S.length>0,b=e.status==="closed",k=S.some(I=>I.id===l),T=zt(U4(e.id)),R=zt(I=>I.clearCompletion),[M,A]=N.useState(()=>Date.now());N.useEffect(()=>{const I=setInterval(()=>A(Date.now()),500);return()=>clearInterval(I)},[]);const j=!!T&&M-T.flashStartedAt<j_,O=(T==null?void 0:T.type)==="flash-then-sticky";N.useEffect(()=>{if(!T||T.type!=="flash-only")return;const I=j_-(M-T.flashStartedAt);if(I<=0){R(e.id);return}const L=setTimeout(()=>{R(e.id)},I);return()=>clearTimeout(L)},[T,e.id,R,M]);const z=j?"animate-completion-flash rounded-md":O?"bg-[oklch(0.85_0.15_145_/_0.15)] rounded-md":"",V=N.useRef(!1);N.useEffect(()=>{h&&w.current?V.current||(w.current.focus(),w.current.select(),V.current=!0):V.current=!1},[h]),N.useEffect(()=>{h||C(e.title||"")},[h,e.title]);const F=()=>{C(e.title||""),v(!0)},W=()=>{const I=x.trim();I&&I!==e.title&&p(e.id,I),v(!1)},G=()=>{v(!1),C(e.title||"")},q=I=>{I.key==="Enter"?(I.preventDefault(),W()):I.key==="Escape"&&(I.preventDefault(),G())};return _?m.jsx(Fd,{delayDuration:300,children:m.jsx(Mi,{defaultOpen:o||k,className:"group/collapsible",children:m.jsxs(Ei,{children:[m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx(ji,{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(Xr,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),h?m.jsx("input",{ref:w,type:"text",value:x,onChange:I=>C(I.target.value),onKeyDown:q,onBlur:W,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):m.jsx(vo,{"data-session-id":e.id,isActive:o,onClick:()=>c(e.id),className:Ee("flex-1 min-w-0",z),children:m.jsxs(xc,{children:[m.jsx(Sc,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(Tb,{status:e.subagentStatus,isStreaming:o?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&m.jsx(Da,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),m.jsx(wc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),m.jsx(Rb,{isClosed:b,isEditing:h,onRename:F,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]}),m.jsx(Oi,{children:m.jsx(N8,{children:S.map(I=>m.jsx(t,{session:I,childrenMap:n,sessionDerivedValues:r,isActive:l===I.id,currentSessionId:l,onResumeSession:c,onCloseSession:a,onReopenSession:u,onDeleteSession:d,onRename:p},I.id))})})]})})}):m.jsx(Fd,{delayDuration:300,children:m.jsx(Ei,{children:m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx("div",{className:"shrink-0 size-7 p-1"}),h?m.jsx("input",{ref:w,type:"text",value:x,onChange:I=>C(I.target.value),onKeyDown:q,onBlur:W,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):m.jsx(vo,{"data-session-id":e.id,isActive:o,onClick:()=>c(e.id),className:Ee("flex-1 min-w-0",z),children:m.jsxs(xc,{children:[m.jsx(Sc,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(Tb,{status:e.subagentStatus,isStreaming:o?y.isStreaming:!1,runningAt:e.runningAt}),y.hasPendingPermission&&m.jsx(Da,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),m.jsx(wc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),m.jsx(Rb,{isClosed:b,isEditing:h,onRename:F,onReopen:()=>u(e.id),onClose:()=>a(e.id),onDelete:()=>d(e.id)})]})})})}),I8=$a("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(t){const e=fe.c(13);let n,r,o,l;e[0]!==t?({className:n,variant:o,asChild:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=o===void 0?"default":o,u=(l===void 0?!1:l)?Ac:"span";let d;e[5]!==n||e[6]!==c?(d=Ee(I8({variant:c}),n),e[5]=n,e[6]=c,e[7]=d):d=e[7];let p;return e[8]!==u||e[9]!==r||e[10]!==d||e[11]!==c?(p=m.jsx(u,{"data-slot":"badge","data-variant":c,className:d,...r}),e[8]=u,e[9]=r,e[10]=d,e[11]=c,e[12]=p):p=e[12],p}const P8=En.memo(function(e){const n=fe.c(43),{allSessions:r,childrenMap:o,sessionDerivedValues:l,currentSession:c,currentSessionId:a,favoritedWorkspaceIds:u,workspaces:d,activeWorkspace:p,onSelectWorkspace:h,onResumeSession:v,onCloseSession:x,onReopenSession:C,onDeleteSession:w,onRenameSession:y,onCreateSessionInWorkspace:S,connected:_}=e;let b;if(n[0]!==u||n[1]!==d){const j=new Map(d.map(z8));b=u.map(O=>j.get(O)).filter(B8),n[0]=u,n[1]=d,n[2]=b}else b=n[2];const k=b;let T;if(n[3]!==r||n[4]!==k){T=new Map;for(const j of k){const O=r.filter(z=>z.workspaceId===j.id&&z.status==="active"&&z.parentId===null).sort(F8);T.set(j.id,O)}n[3]=r,n[4]=k,n[5]=T}else T=n[5];const R=T;if(k.length===0){let j;n[6]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx(Ud,{children:"Overview"}),n[6]=j):j=n[6];let O;return n[7]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsxs(Hd,{children:[j,m.jsx($d,{children:m.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=O):O=n[7],O}let M;if(n[8]!==(p==null?void 0:p.id)||n[9]!==o||n[10]!==_||n[11]!==(c==null?void 0:c.id)||n[12]!==(c==null?void 0:c.workspaceId)||n[13]!==a||n[14]!==k||n[15]!==x||n[16]!==S||n[17]!==w||n[18]!==y||n[19]!==C||n[20]!==v||n[21]!==h||n[22]!==l||n[23]!==R){let j;n[25]!==(p==null?void 0:p.id)||n[26]!==o||n[27]!==_||n[28]!==(c==null?void 0:c.id)||n[29]!==(c==null?void 0:c.workspaceId)||n[30]!==a||n[31]!==x||n[32]!==S||n[33]!==w||n[34]!==y||n[35]!==C||n[36]!==v||n[37]!==h||n[38]!==l||n[39]!==R?(j=O=>{const z=O.id===(p==null?void 0:p.id),V=(c==null?void 0:c.workspaceId)===O.id,F=R.get(O.id)||[];return m.jsx(Mi,{defaultOpen:z,className:"group/collapsible",children:m.jsxs(Hd,{children:[m.jsx(Ud,{asChild:!0,children:m.jsxs(ji,{className:"flex items-center justify-between w-full",onClick:()=>h(O),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Xr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),O.isVirtual?m.jsx(Gm,{className:"size-3.5"}):m.jsx(zs,{className:"size-3.5"}),m.jsx("span",{className:V?"truncate text-sidebar-foreground font-medium":"truncate",children:O.name})]}),m.jsx(Un,{variant:"secondary",children:F.length})]})}),m.jsx(Oi,{children:m.jsxs($d,{children:[m.jsx(mo,{children:m.jsx(Ei,{children:m.jsxs(vo,{onClick:()=>S(O.id),disabled:!_,className:"w-full",children:[m.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),m.jsx(A8,{}),m.jsx(mo,{children:F.length===0?m.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):F.map(W=>m.jsx(pg,{session:W,childrenMap:o,sessionDerivedValues:l,isActive:(c==null?void 0:c.id)===W.id,currentSessionId:a,onResumeSession:v,onCloseSession:x,onReopenSession:C,onDeleteSession:w,onRename:y},W.id))})]})})]})},O.id)},n[25]=p==null?void 0:p.id,n[26]=o,n[27]=_,n[28]=c==null?void 0:c.id,n[29]=c==null?void 0:c.workspaceId,n[30]=a,n[31]=x,n[32]=S,n[33]=w,n[34]=y,n[35]=C,n[36]=v,n[37]=h,n[38]=l,n[39]=R,n[40]=j):j=n[40],M=k.map(j),n[8]=p==null?void 0:p.id,n[9]=o,n[10]=_,n[11]=c==null?void 0:c.id,n[12]=c==null?void 0:c.workspaceId,n[13]=a,n[14]=k,n[15]=x,n[16]=S,n[17]=w,n[18]=y,n[19]=C,n[20]=v,n[21]=h,n[22]=l,n[23]=R,n[24]=M}else M=n[24];let A;return n[41]!==M?(A=m.jsx(m.Fragment,{children:M}),n[41]=M,n[42]=A):A=n[42],A});function z8(t){return[t.id,t]}function B8(t){return t!==void 0}function F8(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const H8=N.forwardRef((t,e)=>{var Gt;const n=fe.c(101),{sessions:r,currentSession:o,currentSessionId:l,streamingSessionIds:c,pendingPermissions:a,connected:u,workspaces:d,activeWorkspace:p,allSessions:h,favoritedWorkspaceIds:v,onCreateSession:x,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRenameSession:_,onSelectWorkspace:b,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:T,onDeleteWorkspace:R,onCreateSessionInWorkspace:M,onOpenSettings:A,onOpenMCP:j,onOpenAddServer:O,onServerSwitch:z,onEscape:V}=t,F=zt(U8),{quickConnections:W,addToQuickConnections:G,removeFromQuickConnections:q,activeServer:X}=Ba();Fc();const Y=N.useRef(null),I=N.useRef(null);let L,P;n[0]!==l?(L=()=>{I.current=l},P=[l],n[0]=l,n[1]=L,n[2]=P):(L=n[1],P=n[2]),N.useEffect(L,P);let H;n[3]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{var $t;const Qe=Y.current;if(!Qe)return;const yt=Array.from(Qe.querySelectorAll('[data-sidebar="menu-button"]'));if(yt.length===0){Qe.focus();return}const It=yt.find(Qt=>Qt.getAttribute("data-session-id")===I.current);It?It.focus():($t=yt[0])==null||$t.focus()},n[3]=H):H=n[3];const B=H;let Z,J;n[4]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>({focusSessionPanel:B}),J=[B],n[4]=Z,n[5]=J):(Z=n[4],J=n[5]),N.useImperativeHandle(e,Z,J);let ee;n[6]!==V?(ee=Qe=>{var In,xr,Pn,qn,zn;const yt=Y.current;if(!yt)return;const It=document.activeElement;if(It instanceof HTMLInputElement||It instanceof HTMLTextAreaElement||It instanceof HTMLElement&&It.contentEditable==="true")return;const $t=Array.from(yt.querySelectorAll('[data-sidebar="menu-button"]')),Qt=$t.indexOf(document.activeElement);e:switch(Qe.key){case"ArrowDown":{Qe.preventDefault();const Zt=Qt<$t.length-1?Qt+1:0;(In=$t[Zt])==null||In.focus();break e}case"ArrowUp":{Qe.preventDefault();const Zt=Qt>0?Qt-1:$t.length-1;(xr=$t[Zt])==null||xr.focus();break e}case"ArrowRight":{const Zt=(Pn=document.activeElement)==null?void 0:Pn.parentElement;if(!Zt)break e;const Jt=Zt.querySelector('button[aria-label="Toggle child sessions"]');if(!Jt)break e;const fn=Zt.closest("[data-state]");(fn==null?void 0:fn.dataset.state)==="closed"&&(Qe.preventDefault(),Jt.click());break e}case"ArrowLeft":{const Zt=(qn=document.activeElement)==null?void 0:qn.parentElement;if(!Zt)break e;const Jt=Zt.querySelector('button[aria-label="Toggle child sessions"]');if(!Jt)break e;const fn=Zt.closest("[data-state]");(fn==null?void 0:fn.dataset.state)==="open"&&(Qe.preventDefault(),Jt.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":Qe.preventDefault(),(zn=document.activeElement)==null||zn.blur(),V==null||V()}},n[6]=V,n[7]=ee):ee=n[7];const K=ee;let $;if(n[8]!==h){$=new Map;for(const Qe of h)if(Qe.parentId){const yt=(Gt=$.get(Qe.parentId))!=null?Gt:[];yt.push(Qe),$.set(Qe.parentId,yt)}n[8]=h,n[9]=$}else $=n[9];const te=$;let re;n[10]!==a?(re=new Set(a.map($8)),n[10]=a,n[11]=re):re=n[11];const ae=re;let se;if(n[12]!==h||n[13]!==l||n[14]!==ae||n[15]!==c){se=new Map;for(const Qe of h){const yt=c.has(Qe.id),It=ae.has(Qe.id),Qt=Qe.id===l&&yt||Qe.subagentStatus==="running"||!!Qe.runningAt;se.set(Qe.id,{isStreaming:yt,hasPendingPermission:It,isRunning:Qt})}n[12]=h,n[13]=l,n[14]=ae,n[15]=c,n[16]=se}else se=n[16];const _e=se;let Re,je;if(n[17]!==r){const Qe=r.filter(V8);Re=Qe.filter(q8),je=Qe.filter(W8),n[17]=r,n[18]=Re,n[19]=je}else Re=n[18],je=n[19];let ze;n[20]!==Re||n[21]!==je?(ze={activeSessions:Re,archivedSessions:je},n[20]=Re,n[21]=je,n[22]=ze):ze=n[22];const{activeSessions:ce,archivedSessions:Te}=ze;let ye;n[23]!==(X==null?void 0:X.id)||n[24]!==W?(ye=Qe=>W.some(yt=>yt.workspaceId===Qe&&yt.serverId===(X==null?void 0:X.id)),n[23]=X==null?void 0:X.id,n[24]=W,n[25]=ye):ye=n[25];const Pe=ye;let Fe;n[26]!==X||n[27]!==G||n[28]!==W||n[29]!==q?(Fe=(Qe,yt)=>{if(!X)return;const It=W.find($t=>$t.workspaceId===Qe&&$t.serverId===X.id);It?q(It.id):G(X.id,X.name,Qe,yt)},n[26]=X,n[27]=G,n[28]=W,n[29]=q,n[30]=Fe):Fe=n[30];const ve=Fe;let Ne;n[31]===Symbol.for("react.memo_cache_sentinel")?(Ne=m.jsx(L8,{}),n[31]=Ne):Ne=n[31];let Ae;n[32]!==O||n[33]!==z?(Ae=m.jsx(h8,{onOpenAddServer:O,onServerSwitch:z}),n[32]=O,n[33]=z,n[34]=Ae):Ae=n[34];let Ce;n[35]!==p||n[36]!==ve||n[37]!==Pe||n[38]!==T||n[39]!==k||n[40]!==R||n[41]!==b||n[42]!==F||n[43]!==d?(Ce=F!=="overview"&&m.jsx(d8,{workspaces:d,activeWorkspace:p,onSelectWorkspace:b,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:T,isWorkspaceFavorited:Pe,onToggleFavorite:ve,onDeleteWorkspace:R}),n[35]=p,n[36]=ve,n[37]=Pe,n[38]=T,n[39]=k,n[40]=R,n[41]=b,n[42]=F,n[43]=d,n[44]=Ce):Ce=n[44];let oe;n[45]!==Ae||n[46]!==Ce?(oe=m.jsxs("div",{className:"p-2 space-y-2",children:[Ae,Ce]}),n[45]=Ae,n[46]=Ce,n[47]=oe):oe=n[47];let me;n[48]!==u||n[49]!==x||n[50]!==F?(me=F!=="overview"&&m.jsx(mo,{children:m.jsx(Ei,{children:m.jsxs(vo,{onClick:x,disabled:!u,className:"w-full",children:[m.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),n[48]=u,n[49]=x,n[50]=F,n[51]=me):me=n[51];let ke;n[52]!==oe||n[53]!==me?(ke=m.jsxs(ak,{children:[oe,me]}),n[52]=oe,n[53]=me,n[54]=ke):ke=n[54];let De;n[55]!==ce||n[56]!==p||n[57]!==h||n[58]!==Te||n[59]!==te||n[60]!==u||n[61]!==o||n[62]!==l||n[63]!==v||n[64]!==w||n[65]!==M||n[66]!==S||n[67]!==_||n[68]!==y||n[69]!==C||n[70]!==b||n[71]!==_e||n[72]!==F||n[73]!==d?(De=F==="overview"?m.jsx(P8,{allSessions:h,childrenMap:te,sessionDerivedValues:_e,currentSession:o,currentSessionId:l,favoritedWorkspaceIds:v,workspaces:d,activeWorkspace:p,onSelectWorkspace:b,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRenameSession:_,onCreateSessionInWorkspace:M,connected:u}):m.jsxs(m.Fragment,{children:[ce.length>0&&m.jsx(Mi,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(Hd,{children:[m.jsx(Ud,{asChild:!0,children:m.jsxs(ji,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Xr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),m.jsx(Un,{variant:"secondary",children:ce.length})]})}),m.jsx(Oi,{children:m.jsx($d,{children:m.jsx(mo,{children:ce.map(Qe=>m.jsx(pg,{session:Qe,childrenMap:te,sessionDerivedValues:_e,isActive:(o==null?void 0:o.id)===Qe.id,currentSessionId:l,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRename:_},Qe.id))})})})]})}),Te.length>0&&m.jsx(Mi,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(Hd,{children:[m.jsx(Ud,{asChild:!0,children:m.jsxs(ji,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Xr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),m.jsx(Un,{variant:"secondary",children:Te.length})]})}),m.jsx(Oi,{children:m.jsx($d,{children:m.jsx(mo,{children:Te.map(Qe=>m.jsx(pg,{session:Qe,childrenMap:te,sessionDerivedValues:_e,isActive:(o==null?void 0:o.id)===Qe.id,currentSessionId:l,onResumeSession:C,onCloseSession:w,onReopenSession:y,onDeleteSession:S,onRename:_},Qe.id))})})})]})}),ce.length===0&&Te.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."]})]}),n[55]=ce,n[56]=p,n[57]=h,n[58]=Te,n[59]=te,n[60]=u,n[61]=o,n[62]=l,n[63]=v,n[64]=w,n[65]=M,n[66]=S,n[67]=_,n[68]=y,n[69]=C,n[70]=b,n[71]=_e,n[72]=F,n[73]=d,n[74]=De):De=n[74];let Be;n[75]!==K||n[76]!==De?(Be=m.jsx(lk,{ref:Y,tabIndex:-1,onKeyDown:K,className:"outline-none",children:De}),n[75]=K,n[76]=De,n[77]=Be):Be=n[77];let nt;n[78]!==u?(nt=u?m.jsx(pR,{className:"size-3.5 text-success"}):m.jsx(yS,{className:"size-3.5 text-destructive"}),n[78]=u,n[79]=nt):nt=n[79];const Ye=u?"Connected":"Disconnected";let Ue;n[80]!==Ye?(Ue=m.jsx("span",{className:"text-xs text-muted-foreground",children:Ye}),n[80]=Ye,n[81]=Ue):Ue=n[81];let Me;n[82]!==nt||n[83]!==Ue?(Me=m.jsx(Ei,{children:m.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[nt,Ue]})}),n[82]=nt,n[83]=Ue,n[84]=Me):Me=n[84];let We,Xe;n[85]===Symbol.for("react.memo_cache_sentinel")?(We=m.jsx(go,{className:"size-4","data-icon":"inline-start"}),Xe=m.jsx("span",{children:"MCP Servers"}),n[85]=We,n[86]=Xe):(We=n[85],Xe=n[86]);let vt;n[87]!==j?(vt=m.jsx(Ei,{children:m.jsxs(vo,{onClick:j,children:[We,Xe]})}),n[87]=j,n[88]=vt):vt=n[88];let Lt,Rn;n[89]===Symbol.for("react.memo_cache_sentinel")?(Lt=m.jsx(pS,{className:"size-4","data-icon":"inline-start"}),Rn=m.jsx("span",{children:"Settings"}),n[89]=Lt,n[90]=Rn):(Lt=n[89],Rn=n[90]);let Ut;n[91]!==A?(Ut=m.jsx(Ei,{children:m.jsx("div",{className:"flex items-center gap-1",children:m.jsxs(vo,{onClick:A,children:[Lt,Rn]})})}),n[91]=A,n[92]=Ut):Ut=n[92];let et;n[93]!==Me||n[94]!==vt||n[95]!==Ut?(et=m.jsx(E8,{className:"pb-4",children:m.jsxs(mo,{children:[Me,vt,Ut]})}),n[93]=Me,n[94]=vt,n[95]=Ut,n[96]=et):et=n[96];let at;return n[97]!==ke||n[98]!==Be||n[99]!==et?(at=m.jsxs(ok,{collapsible:"offcanvas",children:[Ne,ke,Be,et]}),n[97]=ke,n[98]=Be,n[99]=et,n[100]=at):at=n[100],at});function U8(t){return t.sidebarViewMode}function $8(t){return t.sessionId}function V8(t){return!t.parentId}function q8(t){return t.status==="active"}function W8(t){return t.status==="closed"}function G8(t){const e=fe.c(10);let n,r,o;e[0]!==t?({className:n,orientation:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const l=o===void 0?"horizontal":o;let c;e[4]!==n?(c=Ee("group/tabs flex gap-2 data-horizontal:flex-col",n),e[4]=n,e[5]=c):c=e[5];let a;return e[6]!==l||e[7]!==r||e[8]!==c?(a=m.jsx(hj,{"data-slot":"tabs","data-orientation":l,className:c,...r}),e[6]=l,e[7]=r,e[8]=c,e[9]=a):a=e[9],a}const K8=$a("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 Y8(t){const e=fe.c(11);let n,r,o;e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const l=o===void 0?"default":o;let c;e[4]!==n||e[5]!==l?(c=Ee(K8({variant:l}),n),e[4]=n,e[5]=l,e[6]=c):c=e[6];let a;return e[7]!==r||e[8]!==c||e[9]!==l?(a=m.jsx(pj,{"data-slot":"tabs-list","data-variant":l,className:c,...r}),e[7]=r,e[8]=c,e[9]=l,e[10]=a):a=e[10],a}function tc(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(mj,{"data-slot":"tabs-trigger",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function nc(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("flex-1 text-sm outline-none",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(gj,{"data-slot":"tabs-content",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Ir(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx($D,{"data-slot":"label",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Nb(t){return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Db(t){const e=fe.c(29),{permission:n,onRevoke:r}=t,o=!!n.revokedAt,l=o?"outline":"secondary";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(mS,{className:"size-3","data-icon":"inline-start"}),e[0]=c):c=e[0];let a;e[1]!==n.permissionType||e[2]!==l?(a=m.jsxs(Un,{variant:l,children:[c,n.permissionType]}),e[1]=n.permissionType,e[2]=l,e[3]=a):a=e[3];let u;e[4]!==o?(u=o&&m.jsx(Un,{variant:"outline",className:"text-muted-foreground",children:"Revoked"}),e[4]=o,e[5]=u):u=e[5];let d;e[6]!==a||e[7]!==u?(d=m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a,u]}),e[6]=a,e[7]=u,e[8]=d):d=e[8];let p;e[9]!==n.permissionKey?(p=m.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:n.permissionKey}),e[9]=n.permissionKey,e[10]=p):p=e[10];let h;e[11]!==n.grantedAt?(h=Nb(n.grantedAt),e[11]=n.grantedAt,e[12]=h):h=e[12];let v;e[13]!==n.revokedAt?(v=n.revokedAt&&` • Revoked ${Nb(n.revokedAt)}`,e[13]=n.revokedAt,e[14]=v):v=e[14];let x;e[15]!==h||e[16]!==v?(x=m.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",h,v]}),e[15]=h,e[16]=v,e[17]=x):x=e[17];let C;e[18]!==d||e[19]!==p||e[20]!==x?(C=m.jsxs("div",{className:"flex-1 min-w-0",children:[d,p,x]}),e[18]=d,e[19]=p,e[20]=x,e[21]=C):C=e[21];let w;e[22]!==o||e[23]!==r||e[24]!==n.id?(w=!o&&m.jsx(He,{variant:"ghost",size:"icon",onClick:()=>r(n.id),className:"size-8 text-destructive hover:text-destructive",children:m.jsx(Ua,{className:"size-4"})}),e[22]=o,e[23]=r,e[24]=n.id,e[25]=w):w=e[25];let y;return e[26]!==C||e[27]!==w?(y=m.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[C,w]}),e[26]=C,e[27]=w,e[28]=y):y=e[28],y}function X8(t){const e=fe.c(30),{open:n,onOpenChange:r,title:o,description:l,confirmLabel:c,cancelLabel:a,variant:u,onConfirm:d,onCancel:p}=t,h=c===void 0?"Confirm":c,v=a===void 0?"Cancel":a,x=u===void 0?"default":u;let C;e[0]!==p||e[1]!==r?(C=()=>{p==null||p(),r(!1)},e[0]=p,e[1]=r,e[2]=C):C=e[2];const w=C;let y;e[3]!==d||e[4]!==r?(y=()=>{d(),r(!1)},e[3]=d,e[4]=r,e[5]=y):y=e[5];const S=y;let _;e[6]!==o?(_=m.jsx(No,{children:o}),e[6]=o,e[7]=_):_=e[7];let b;e[8]!==l?(b=m.jsx(Qa,{children:l}),e[8]=l,e[9]=b):b=e[9];let k;e[10]!==_||e[11]!==b?(k=m.jsxs(To,{children:[_,b]}),e[10]=_,e[11]=b,e[12]=k):k=e[12];let T;e[13]!==v||e[14]!==w?(T=m.jsx(He,{variant:"outline",onClick:w,children:v}),e[13]=v,e[14]=w,e[15]=T):T=e[15];const R=x==="destructive"?"destructive":"default";let M;e[16]!==h||e[17]!==S||e[18]!==R?(M=m.jsx(He,{variant:R,onClick:S,children:h}),e[16]=h,e[17]=S,e[18]=R,e[19]=M):M=e[19];let A;e[20]!==M||e[21]!==T?(A=m.jsxs(Tf,{children:[T,M]}),e[20]=M,e[21]=T,e[22]=A):A=e[22];let j;e[23]!==A||e[24]!==k?(j=m.jsxs(Ro,{className:"sm:max-w-[425px]",children:[k,A]}),e[23]=A,e[24]=k,e[25]=j):j=e[25];let O;return e[26]!==r||e[27]!==n||e[28]!==j?(O=m.jsx(Ao,{open:n,onOpenChange:r,children:j}),e[26]=r,e[27]=n,e[28]=j,e[29]=O):O=e[29],O}function Q8(t){const e=fe.c(48),{provider:n,onConnect:r,onDisconnect:o}=t,[l,c]=N.useState(!1);let a,u;e[0]!==n.connected||e[1]!==n.error?(a=()=>{(n.error||n.connected)&&c(!1)},u=[n.error,n.connected],e[0]=n.connected,e[1]=n.error,e[2]=a,e[3]=u):(a=e[2],u=e[3]),N.useEffect(a,u);let d,p;e[4]!==n.authorizationUrl?(d=()=>{n.authorizationUrl&&c(!1)},p=[n.authorizationUrl],e[4]=n.authorizationUrl,e[5]=d,e[6]=p):(d=e[5],p=e[6]),N.useEffect(d,p);let h;e[7]!==r?(h=()=>{c(!0),r()},e[7]=r,e[8]=h):h=e[8];const v=h;let x;e[9]!==o?(x=()=>{o()},e[9]=o,e[10]=x):x=e[10];const C=x,w=`size-2 rounded-full ${n.connected?"bg-green-500":"bg-muted-foreground"}`;let y;e[11]!==w?(y=m.jsx("div",{className:w}),e[11]=w,e[12]=y):y=e[12];const S=n.displayName||n.provider;let _;e[13]!==S?(_=m.jsx("span",{className:"text-sm font-medium",children:S}),e[13]=S,e[14]=_):_=e[14];let b;e[15]!==_||e[16]!==y?(b=m.jsxs("div",{className:"flex items-center gap-2",children:[y,_]}),e[15]=_,e[16]=y,e[17]=b):b=e[17];let k;e[18]!==n.connected?(k=n.connected&&m.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"}),e[18]=n.connected,e[19]=k):k=e[19];let T;e[20]!==b||e[21]!==k?(T=m.jsxs("div",{className:"flex items-center justify-between",children:[b,k]}),e[20]=b,e[21]=k,e[22]=T):T=e[22];let R;e[23]!==n.error?(R=n.error&&m.jsx("p",{className:"text-xs text-destructive",children:n.error}),e[23]=n.error,e[24]=R):R=e[24];let M;e[25]!==n.connected||e[26]!==n.connectedAt?(M=n.connected&&n.connectedAt&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(n.connectedAt).toLocaleDateString()]}),e[25]=n.connected,e[26]=n.connectedAt,e[27]=M):M=e[27];let A;e[28]!==v||e[29]!==l||e[30]!==n.authorizationUrl||e[31]!==n.connected?(A=!n.connected&&!n.authorizationUrl&&m.jsxs(He,{size:"sm",onClick:v,disabled:l,children:[l?m.jsx(nr,{className:"size-3 animate-spin","data-icon":"inline-start"}):null,"Connect"]}),e[28]=v,e[29]=l,e[30]=n.authorizationUrl,e[31]=n.connected,e[32]=A):A=e[32];let j;e[33]!==n.authorizationUrl||e[34]!==n.connected?(j=!n.connected&&n.authorizationUrl&&m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("a",{href:n.authorizationUrl,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:n.authorizationUrl}),m.jsxs(He,{variant:"outline",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.authorizationUrl)}catch{}},children:[m.jsx(pc,{className:"size-3","data-icon":"inline-start"}),"Copy URL"]})]}),e[33]=n.authorizationUrl,e[34]=n.connected,e[35]=j):j=e[35];let O;e[36]!==C||e[37]!==n.connected?(O=n.connected&&m.jsxs(He,{variant:"destructive",size:"sm",onClick:C,children:[m.jsx(oR,{className:"size-3","data-icon":"inline-start"}),"Disconnect"]}),e[36]=C,e[37]=n.connected,e[38]=O):O=e[38];let z;e[39]!==A||e[40]!==j||e[41]!==O?(z=m.jsxs("div",{className:"flex gap-2",children:[A,j,O]}),e[39]=A,e[40]=j,e[41]=O,e[42]=z):z=e[42];let V;return e[43]!==T||e[44]!==R||e[45]!==M||e[46]!==z?(V=m.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[T,R,M,z]}),e[43]=T,e[44]=R,e[45]=M,e[46]=z,e[47]=V):V=e[47],V}function Z8(t){const e=fe.c(10),{token:n,onLogout:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted-foreground",children:"Token:"}),e[0]=o):o=e[0];let l;e[1]!==n?(l=J4(n),e[1]=n,e[2]=l):l=e[2];let c;e[3]!==l?(c=m.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o,m.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:l})]}),e[3]=l,e[4]=c):c=e[4];let a;e[5]!==r?(a=m.jsx(He,{variant:"destructive",size:"sm",onClick:r,title:"Disconnect and clear token",children:"Logout"}),e[5]=r,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=m.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const Mb="0.7.0";function jb(t){const e=t.trim().match(/^v?(\d+)\.(\d+)\.(\d+)$/);return e?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]:null}function J8(t,e){const n=jb(t),r=jb(e);if(!n&&!r)return 0;if(!n)return-1;if(!r)return 1;for(let o=0;o<3;o++)if(n[o]!==r[o])return n[o]-r[o];return 0}function Ob(t,e){return e?J8(t,e)>=0?"up-to-date":"update-available":"unknown"}const uk="rabbyte-tech/jean2",eL=300*1e3,dk=1e4,Vd=new Map;function fk(t){const e=Vd.get(t);return e?Date.now()-e.timestamp>eL?(Vd.delete(t),null):e.value:null}function hk(t,e){Vd.set(t,{value:e,timestamp:Date.now()})}function tL(){Vd.clear()}async function pk(t,e){const n=new AbortController,r=setTimeout(()=>n.abort(),e);try{return await fetch(t,{signal:n.signal})}finally{clearTimeout(r)}}async function nL(){const t=fk("latest-server");if(t)return t;try{const e=`https://raw.githubusercontent.com/${uk}/refs/heads/main/packages/server/VERSION`,n=await pk(e,dk);if(!n.ok)return null;const r=(await n.text()).trim();return/^\d+\.\d+\.\d+$/.test(r)?(hk("latest-server",r),r):null}catch{return null}}async function rL(){const t=fk("latest-client");if(t)return t;try{const e=`https://api.github.com/repos/${uk}/releases?per_page=20`,n=await pk(e,dk);if(!n.ok)return null;const o=(await n.json()).find(c=>c.tag_name.startsWith("client/")&&!c.prerelease);if(!o)return null;const l=o.tag_name.replace(/^client\/v?/,"");return/^\d+\.\d+\.\d+$/.test(l)?(hk("latest-client",l),l):null}catch{return null}}function sL(t){if(!t)return"";const e=Math.floor((Date.now()-t)/1e3);if(e<10)return"just now";if(e<60)return`${e}s ago`;const n=Math.floor(e/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function Lb(t){const e=fe.c(3),{status:n}=t;if(n==="up-to-date"){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[m.jsx("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),"Up to date"]}),e[0]=o):o=e[0],o}if(n==="update-available"){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"Update available"}),e[1]=o):o=e[1],o}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("span",{className:"text-xs text-muted-foreground",children:"Unknown"}),e[2]=r):r=e[2],r}function iL({serverUrl:t,enabled:e}){const n=N.useRef(0),[r,o]=N.useState({serverVersion:null,latestServer:null,latestClient:null,loading:!0,lastChecked:null,fetchError:null}),l=N.useCallback(async(u=!1)=>{u&&tL();const d=++n.current;o(p=>({...p,loading:!0,fetchError:null}));try{const p=await Promise.allSettled([t?fetch(`${t.startsWith("http")?t:`http://${t}`}/api/info`).then(C=>C.ok?C.json():null).then(C=>{var w;return(w=C==null?void 0:C.version)!=null?w:null}):Promise.resolve(null),nL(),rL()]);if(n.current!==d)return;const h=p[0].status==="fulfilled"?p[0].value:null,v=p[1].status==="fulfilled"?p[1].value:null,x=p[2].status==="fulfilled"?p[2].value:null;o({serverVersion:h,latestServer:v,latestClient:x,loading:!1,lastChecked:Date.now(),fetchError:null})}catch{if(n.current!==d)return;o(p=>({...p,loading:!1,fetchError:"Unable to check for updates"}))}},[t]);N.useEffect(()=>{e&&l()},[l,e]);const c=Ob(Mb,r.latestClient),a=t&&r.serverVersion?Ob(r.serverVersion,r.latestServer):"unknown";return m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsxs("div",{children:[m.jsx(Ir,{className:"text-sm font-medium",children:"Versions"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Check for updates to client and server"})]}),m.jsx(cs,{}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Client"}),r.loading?m.jsx(Sm,{className:"h-5 w-32"}):m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",Mb]}),m.jsx(Lb,{status:c})]})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Server"}),r.loading?m.jsx(Sm,{className:"h-5 w-32"}):r.serverVersion?m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.serverVersion]}),m.jsx(Lb,{status:a})]}):m.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Latest"}),r.loading?m.jsx(Sm,{className:"h-5 w-48"}):m.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.latestServer?`v${r.latestServer} (server)`:"",r.latestServer&&r.latestClient&&" · ",r.latestClient?`v${r.latestClient} (client)`:"",!r.latestServer&&!r.latestClient&&"Unknown"]})]})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[r.lastChecked&&!r.loading&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last checked: ",sL(r.lastChecked)]}),m.jsxs(He,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:r.loading,className:"ml-auto",children:[m.jsx(Ai,{className:`size-3.5 ${r.loading?"animate-spin":""}`}),"Check for Updates"]})]})]})}const oL={neutral:{label:"Neutral",colors:["bg-zinc-400","bg-zinc-600","bg-zinc-800"]},ocean:{label:"Ocean",colors:["bg-sky-300","bg-sky-500","bg-slate-700"]},forest:{label:"Forest",colors:["bg-emerald-300","bg-emerald-500","bg-green-800"]},sunset:{label:"Sunset",colors:["bg-orange-300","bg-amber-500","bg-orange-800"]},amethyst:{label:"Amethyst",colors:["bg-violet-300","bg-violet-500","bg-purple-800"]}};function rc(t){const e=fe.c(15),{scheme:n,currentScheme:r,onClick:o}=t,l=n===r,c=oL[n];let a;e[0]!==o||e[1]!==n?(a=()=>o(n),e[0]=o,e[1]=n,e[2]=a):a=e[2];const u=`
|
|
547
|
+
flex flex-col items-center gap-1.5 p-2 rounded-lg border transition-all
|
|
548
|
+
${l?"border-primary bg-primary/5":"border-border bg-transparent hover:bg-muted/50"}
|
|
549
|
+
`,d=c.label;let p;e[3]!==c.colors?(p=c.colors.map(aL),e[3]=c.colors,e[4]=p):p=e[4];let h;e[5]!==p?(h=m.jsx("div",{className:"flex gap-0.5",children:p}),e[5]=p,e[6]=h):h=e[6];let v;e[7]!==n?(v=m.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:n}),e[7]=n,e[8]=v):v=e[8];let x;return e[9]!==c.label||e[10]!==a||e[11]!==u||e[12]!==h||e[13]!==v?(x=m.jsxs("button",{type:"button",onClick:a,className:u,title:d,children:[h,v]}),e[9]=c.label,e[10]=a,e[11]=u,e[12]=h,e[13]=v,e[14]=x):x=e[14],x}function aL(t,e){return m.jsx("div",{className:`w-4 h-4 rounded-full ${t}`},e)}function lL(t){var ze;const e=fe.c(227),{open:n,onOpenChange:r,permissions:o,onRefreshPermissions:l,onRevokePermission:c,onRevokeAllPermissions:a,apiToken:u,onLogout:d,providerStatuses:p,onConnectProvider:h,onDisconnectProvider:v,chatFinishSoundEnabled:x,onChatFinishSoundEnabledChange:C,permissionSoundEnabled:w,onPermissionSoundEnabledChange:y,serverUrl:S}=t,{mode:_,scheme:b,setMode:k,setScheme:T}=C4(),[R,M]=N.useState(!1),j=((ze=navigator.userAgentData)==null?void 0:ze.platform)==="macOS"||/mac|iphone|ipad|ipod/i.test(navigator.userAgent)?"⌘":"Ctrl";let O,z,V,F,W,G,q,X,Y,I,L,P,H,B,Z,J,ee,K,$;if(e[0]!==u||e[1]!==x||e[2]!==_||e[3]!==C||e[4]!==h||e[5]!==v||e[6]!==d||e[7]!==r||e[8]!==y||e[9]!==l||e[10]!==c||e[11]!==n||e[12]!==w||e[13]!==o||e[14]!==p||e[15]!==b||e[16]!==S||e[17]!==k||e[18]!==T){const ce=[{keys:[j,"1"],description:"Open session list"},{keys:[j,"2"],description:"Open files panel"},{keys:[j,"T"],description:"Open terminal"},{keys:[j,"O"],description:"Toggle overview mode"},{keys:[j,"N"],description:"New session"},{keys:[j,"Shift","N"],description:"New window"},{keys:[j,"Shift","F"],description:"Toggle follow/free mode"},{keys:["Shift","Esc"],description:"Close focused panel"},{keys:["Shift","Enter"],description:"New line in input"},{keys:["Enter"],description:"Send message"},{keys:["↑","↓","←","→"],description:"Navigate sessions"},{keys:["Esc"],description:"Focus chat input"},{keys:["Esc","Esc"],description:"Stop streaming (chat input focused)"}];let Te,ye,Pe,Fe,ve,Ne,Ae,Ce,oe,me,ke;if(e[38]!==u||e[39]!==x||e[40]!==_||e[41]!==C||e[42]!==d||e[43]!==r||e[44]!==y||e[45]!==l||e[46]!==c||e[47]!==n||e[48]!==w||e[49]!==o||e[50]!==b||e[51]!==S||e[52]!==k||e[53]!==T){const Ue=o.filter(dL),Me=o.filter(uL);F=Ao,I=n,L=r,V=Ro,X="sm:max-w-[700px] max-h-[80vh]",e[77]===Symbol.for("react.memo_cache_sentinel")?(Y=m.jsxs(To,{children:[m.jsx(No,{children:"Settings"}),m.jsx(Qa,{children:"Manage your preferences and permissions"})]}),e[77]=Y):Y=e[77],z=G8,Z="account",J="mt-4";let We;e[78]===Symbol.for("react.memo_cache_sentinel")?(We=m.jsxs(tc,{value:"account",children:[m.jsx(vS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),e[78]=We):We=e[78];let Xe;e[79]===Symbol.for("react.memo_cache_sentinel")?(Xe=m.jsxs(tc,{value:"appearance",children:[m.jsx(RA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),e[79]=Xe):Xe=e[79];let vt,Lt;e[80]===Symbol.for("react.memo_cache_sentinel")?(vt=m.jsx(mS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),Lt=m.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),e[80]=vt,e[81]=Lt):(vt=e[80],Lt=e[81]);const Rn=Ue.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:Ue.length});let Ut;e[82]!==Rn?(Ut=m.jsxs(tc,{value:"permissions",children:[vt,Lt,Rn]}),e[82]=Rn,e[83]=Ut):Ut=e[83];let et;e[84]===Symbol.for("react.memo_cache_sentinel")?(et=m.jsxs(tc,{value:"providers",children:[m.jsx(gA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Providers"})]}),e[84]=et):et=e[84];let at;e[85]===Symbol.for("react.memo_cache_sentinel")?(at=m.jsxs(tc,{value:"keybinds",children:[m.jsx(uA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Keybinds"})]}),e[85]=at):at=e[85],e[86]!==Ut?(ee=m.jsxs(Y8,{className:"grid w-full grid-cols-5",children:[We,Xe,Ut,et,at]}),e[86]=Ut,e[87]=ee):ee=e[87];let Gt,Qe;e[88]===Symbol.for("react.memo_cache_sentinel")?(Gt=m.jsx(Ir,{className:"text-sm font-medium",children:"Session"}),Qe=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),e[88]=Gt,e[89]=Qe):(Gt=e[88],Qe=e[89]);let yt;e[90]!==u||e[91]!==d?(yt=m.jsxs("div",{children:[Gt,Qe,u?m.jsx(Z8,{token:u,onLogout:d}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]}),e[90]=u,e[91]=d,e[92]=yt):yt=e[92];let It;e[93]===Symbol.for("react.memo_cache_sentinel")?(It=m.jsx(cs,{}),e[93]=It):It=e[93];let $t;e[94]!==n||e[95]!==S?($t=m.jsx(iL,{serverUrl:S,enabled:n}),e[94]=n,e[95]=S,e[96]=$t):$t=e[96],e[97]!==yt||e[98]!==$t?(K=m.jsx(nc,{value:"account",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[yt,It,$t]})}),e[97]=yt,e[98]=$t,e[99]=K):K=e[99];let Qt,In;e[100]===Symbol.for("react.memo_cache_sentinel")?(Qt=m.jsx(Ir,{className:"text-sm font-medium",children:"Mode"}),In=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose light, dark, or system theme"}),e[100]=Qt,e[101]=In):(Qt=e[100],In=e[101]);const xr=_==="light"?"default":"outline";let Pn;e[102]!==k?(Pn=()=>k("light"),e[102]=k,e[103]=Pn):Pn=e[103];let qn;e[104]===Symbol.for("react.memo_cache_sentinel")?(qn=m.jsx(JA,{className:"size-4","data-icon":"inline-start"}),e[104]=qn):qn=e[104];let zn;e[105]!==xr||e[106]!==Pn?(zn=m.jsxs(He,{variant:xr,className:"justify-start",onClick:Pn,children:[qn,"Light"]}),e[105]=xr,e[106]=Pn,e[107]=zn):zn=e[107];const Zt=_==="dark"?"default":"outline";let Jt;e[108]!==k?(Jt=()=>k("dark"),e[108]=k,e[109]=Jt):Jt=e[109];let fn;e[110]===Symbol.for("react.memo_cache_sentinel")?(fn=m.jsx(EA,{className:"size-4","data-icon":"inline-start"}),e[110]=fn):fn=e[110];let Sr;e[111]!==Zt||e[112]!==Jt?(Sr=m.jsxs(He,{variant:Zt,className:"justify-start",onClick:Jt,children:[fn,"Dark"]}),e[111]=Zt,e[112]=Jt,e[113]=Sr):Sr=e[113];const Bn=_==="system"?"default":"outline";let Rt;e[114]!==k?(Rt=()=>k("system"),e[114]=k,e[115]=Rt):Rt=e[115];let en;e[116]===Symbol.for("react.memo_cache_sentinel")?(en=m.jsx(CA,{className:"size-4","data-icon":"inline-start"}),e[116]=en):en=e[116];let Tn;e[117]!==Bn||e[118]!==Rt?(Tn=m.jsxs(He,{variant:Bn,className:"justify-start",onClick:Rt,children:[en,"System"]}),e[117]=Bn,e[118]=Rt,e[119]=Tn):Tn=e[119];let sr;e[120]!==zn||e[121]!==Sr||e[122]!==Tn?(sr=m.jsxs("div",{children:[Qt,In,m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[zn,Sr,Tn]})]}),e[120]=zn,e[121]=Sr,e[122]=Tn,e[123]=sr):sr=e[123];let ms,Gs;e[124]===Symbol.for("react.memo_cache_sentinel")?(ms=m.jsx(cs,{}),Gs=m.jsx(Ir,{className:"text-sm font-medium mb-3 block",children:"Notification Sounds"}),e[124]=ms,e[125]=Gs):(ms=e[124],Gs=e[125]);let Br;e[126]===Symbol.for("react.memo_cache_sentinel")?(Br=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(cR,{className:"size-4 text-muted-foreground"}),m.jsx("span",{className:"text-sm",children:"Chat completion"})]}),e[126]=Br):Br=e[126];let Fn;e[127]!==x||e[128]!==C?(Fn=()=>C(!x),e[127]=x,e[128]=C,e[129]=Fn):Fn=e[129];const wr=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x?"bg-primary":"bg-muted"}`,ir=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${x?"translate-x-6":"translate-x-1"}`;let gn;e[130]!==ir?(gn=m.jsx("span",{className:ir}),e[130]=ir,e[131]=gn):gn=e[131];let Wn;e[132]!==Fn||e[133]!==wr||e[134]!==gn?(Wn=m.jsxs("div",{className:"flex items-center justify-between",children:[Br,m.jsx("button",{type:"button",onClick:Fn,className:wr,children:gn})]}),e[132]=Fn,e[133]=wr,e[134]=gn,e[135]=Wn):Wn=e[135];let Nn;e[136]===Symbol.for("react.memo_cache_sentinel")?(Nn=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(dR,{className:"size-4 text-muted-foreground"}),m.jsx("span",{className:"text-sm",children:"Permission requests"})]}),e[136]=Nn):Nn=e[136];let Tt;e[137]!==y||e[138]!==w?(Tt=()=>y(!w),e[137]=y,e[138]=w,e[139]=Tt):Tt=e[139];const gs=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${w?"bg-primary":"bg-muted"}`,vs=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${w?"translate-x-6":"translate-x-1"}`;let Dn;e[140]!==vs?(Dn=m.jsx("span",{className:vs}),e[140]=vs,e[141]=Dn):Dn=e[141];let vn;e[142]!==Tt||e[143]!==gs||e[144]!==Dn?(vn=m.jsxs("div",{className:"flex items-center justify-between",children:[Nn,m.jsx("button",{type:"button",onClick:Tt,className:gs,children:Dn})]}),e[142]=Tt,e[143]=gs,e[144]=Dn,e[145]=vn):vn=e[145];let or;e[146]!==Wn||e[147]!==vn?(or=m.jsxs("div",{children:[Gs,m.jsxs("div",{className:"flex flex-col gap-3",children:[Wn,vn]})]}),e[146]=Wn,e[147]=vn,e[148]=or):or=e[148];let Fr,Mn,Gn;e[149]===Symbol.for("react.memo_cache_sentinel")?(Fr=m.jsx(cs,{}),Mn=m.jsx(Ir,{className:"text-sm font-medium",children:"Color Scheme"}),Gn=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color palette"}),e[149]=Fr,e[150]=Mn,e[151]=Gn):(Fr=e[149],Mn=e[150],Gn=e[151]);let tn;e[152]!==b||e[153]!==T?(tn=m.jsxs("div",{children:[Mn,Gn,m.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[m.jsx(rc,{scheme:"neutral",currentScheme:b,onClick:T}),m.jsx(rc,{scheme:"ocean",currentScheme:b,onClick:T}),m.jsx(rc,{scheme:"forest",currentScheme:b,onClick:T}),m.jsx(rc,{scheme:"sunset",currentScheme:b,onClick:T}),m.jsx(rc,{scheme:"amethyst",currentScheme:b,onClick:T})]})]}),e[152]=b,e[153]=T,e[154]=tn):tn=e[154],e[155]!==sr||e[156]!==or||e[157]!==tn?($=m.jsx(nc,{value:"appearance",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[sr,ms,or,Fr,tn]})}),e[155]=sr,e[156]=or,e[157]=tn,e[158]=$):$=e[158],ye=nc,me="permissions",ke="mt-4",Ae="flex flex-col gap-4";let Kn;e[159]===Symbol.for("react.memo_cache_sentinel")?(Kn=m.jsxs("div",{children:[m.jsx(Ir,{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"})]}),e[159]=Kn):Kn=e[159];let qt;e[160]===Symbol.for("react.memo_cache_sentinel")?(qt=m.jsx(Ai,{className:"size-4"}),e[160]=qt):qt=e[160];let Kt;e[161]!==l?(Kt=m.jsx(He,{variant:"outline",size:"icon",onClick:l,className:"size-8",children:qt}),e[161]=l,e[162]=Kt):Kt=e[162];const ys=Ue.length>0&&m.jsxs(He,{variant:"destructive",size:"sm",onClick:()=>M(!0),children:[m.jsx(Ua,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]});e[163]!==Kt||e[164]!==ys?(Ce=m.jsxs("div",{className:"flex items-center justify-between",children:[Kn,m.jsxs("div",{className:"flex gap-2",children:[Kt,ys]})]}),e[163]=Kt,e[164]=ys,e[165]=Ce):Ce=e[165],e[166]===Symbol.for("react.memo_cache_sentinel")?(oe=m.jsx(cs,{}),e[166]=oe):oe=e[166],Te=zc,Pe="h-[300px]",Fe=Ue.length===0&&Me.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.']}),ve=Ue.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 (",Ue.length,")"]}),Ue.map(es=>m.jsx(Db,{permission:es,onRevoke:c},es.id))]}),Ne=Me.length>0&&m.jsxs("div",{children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",Me.length,")"]}),Me.map(es=>m.jsx(Db,{permission:es,onRevoke:c},es.id))]}),e[38]=u,e[39]=x,e[40]=_,e[41]=C,e[42]=d,e[43]=r,e[44]=y,e[45]=l,e[46]=c,e[47]=n,e[48]=w,e[49]=o,e[50]=b,e[51]=S,e[52]=k,e[53]=T,e[54]=z,e[55]=V,e[56]=F,e[57]=Te,e[58]=ye,e[59]=X,e[60]=Y,e[61]=I,e[62]=L,e[63]=Pe,e[64]=Fe,e[65]=ve,e[66]=Ne,e[67]=Ae,e[68]=Ce,e[69]=oe,e[70]=me,e[71]=ke,e[72]=Z,e[73]=J,e[74]=ee,e[75]=K,e[76]=$}else z=e[54],V=e[55],F=e[56],Te=e[57],ye=e[58],X=e[59],Y=e[60],I=e[61],L=e[62],Pe=e[63],Fe=e[64],ve=e[65],Ne=e[66],Ae=e[67],Ce=e[68],oe=e[69],me=e[70],ke=e[71],Z=e[72],J=e[73],ee=e[74],K=e[75],$=e[76];let De;e[167]!==Te||e[168]!==Pe||e[169]!==Fe||e[170]!==ve||e[171]!==Ne?(De=m.jsxs(Te,{className:Pe,children:[Fe,ve,Ne]}),e[167]=Te,e[168]=Pe,e[169]=Fe,e[170]=ve,e[171]=Ne,e[172]=De):De=e[172];let Be;e[173]!==Ae||e[174]!==Ce||e[175]!==oe||e[176]!==De?(Be=m.jsxs("div",{className:Ae,children:[Ce,oe,De]}),e[173]=Ae,e[174]=Ce,e[175]=oe,e[176]=De,e[177]=Be):Be=e[177],e[178]!==ye||e[179]!==me||e[180]!==ke||e[181]!==Be?(G=m.jsx(ye,{value:me,className:ke,children:Be}),e[178]=ye,e[179]=me,e[180]=ke,e[181]=Be,e[182]=G):G=e[182];let nt;e[183]===Symbol.for("react.memo_cache_sentinel")?(nt=m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect subscription-based providers to use models without API keys."}),e[183]=nt):nt=e[183];let Ye;if(e[184]!==h||e[185]!==v||e[186]!==p){let Ue;e[188]!==h||e[189]!==v?(Ue=Me=>m.jsx(Q8,{provider:Me,onConnect:()=>h(Me.provider),onDisconnect:()=>v(Me.provider)},Me.provider),e[188]=h,e[189]=v,e[190]=Ue):Ue=e[190],Ye=p.map(Ue),e[184]=h,e[185]=v,e[186]=p,e[187]=Ye}else Ye=e[187];e[191]!==Ye?(q=m.jsx(nc,{value:"providers",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[nt,m.jsx("div",{className:"flex flex-col gap-3",children:Ye})]})})}),e[191]=Ye,e[192]=q):q=e[192],O=nc,H="keybinds",B="mt-4",W="flex flex-col gap-2",P=ce.map(cL),e[0]=u,e[1]=x,e[2]=_,e[3]=C,e[4]=h,e[5]=v,e[6]=d,e[7]=r,e[8]=y,e[9]=l,e[10]=c,e[11]=n,e[12]=w,e[13]=o,e[14]=p,e[15]=b,e[16]=S,e[17]=k,e[18]=T,e[19]=O,e[20]=z,e[21]=V,e[22]=F,e[23]=W,e[24]=G,e[25]=q,e[26]=X,e[27]=Y,e[28]=I,e[29]=L,e[30]=P,e[31]=H,e[32]=B,e[33]=Z,e[34]=J,e[35]=ee,e[36]=K,e[37]=$}else O=e[19],z=e[20],V=e[21],F=e[22],W=e[23],G=e[24],q=e[25],X=e[26],Y=e[27],I=e[28],L=e[29],P=e[30],H=e[31],B=e[32],Z=e[33],J=e[34],ee=e[35],K=e[36],$=e[37];let te;e[193]!==W||e[194]!==P?(te=m.jsx("div",{className:W,children:P}),e[193]=W,e[194]=P,e[195]=te):te=e[195];let re;e[196]!==O||e[197]!==te||e[198]!==H||e[199]!==B?(re=m.jsx(O,{value:H,className:B,children:te}),e[196]=O,e[197]=te,e[198]=H,e[199]=B,e[200]=re):re=e[200];let ae;e[201]!==z||e[202]!==G||e[203]!==q||e[204]!==re||e[205]!==Z||e[206]!==J||e[207]!==ee||e[208]!==K||e[209]!==$?(ae=m.jsxs(z,{defaultValue:Z,className:J,children:[ee,K,$,G,q,re]}),e[201]=z,e[202]=G,e[203]=q,e[204]=re,e[205]=Z,e[206]=J,e[207]=ee,e[208]=K,e[209]=$,e[210]=ae):ae=e[210];let se;e[211]!==V||e[212]!==X||e[213]!==Y||e[214]!==ae?(se=m.jsxs(V,{className:X,children:[Y,ae]}),e[211]=V,e[212]=X,e[213]=Y,e[214]=ae,e[215]=se):se=e[215];let _e;e[216]!==a?(_e=()=>{a(),M(!1)},e[216]=a,e[217]=_e):_e=e[217];let Re;e[218]!==R||e[219]!==_e?(Re=m.jsx(X8,{open:R,onOpenChange:M,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:_e}),e[218]=R,e[219]=_e,e[220]=Re):Re=e[220];let je;return e[221]!==F||e[222]!==I||e[223]!==L||e[224]!==se||e[225]!==Re?(je=m.jsxs(F,{open:I,onOpenChange:L,children:[se,Re]}),e[221]=F,e[222]=I,e[223]=L,e[224]=se,e[225]=Re,e[226]=je):je=e[226],je}function cL(t,e){return m.jsxs("div",{className:"flex items-center justify-between py-1",children:[m.jsx("div",{className:"flex items-center gap-1",children:t.keys.map((n,r)=>m.jsxs("span",{children:[m.jsx("kbd",{className:"font-mono bg-muted rounded px-2 py-1 text-xs",children:n}),r<t.keys.length-1&&m.jsx("span",{className:"mx-1 text-muted-foreground",children:"+"})]},r))}),m.jsx("span",{className:"text-sm text-muted-foreground",children:t.description})]},e)}function uL(t){return t.revokedAt}function dL(t){return!t.revokedAt}const fL=$a("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 wd(t){const e=fe.c(10);let n,r,o;e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n||e[5]!==o?(l=Ee(fL({variant:o}),n),e[4]=n,e[5]=o,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==l?(c=m.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=c):c=e[9],c}function Cd(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("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",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx("div",{"data-slot":"alert-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function hL(t){const e=fe.c(6),{status:n}=t;switch(n.status){case"connected":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(Un,{variant:"default",className:"bg-green-600",children:[m.jsx(Ec,{className:"size-3 mr-1"}),"Connected"]}),e[0]=r):r=e[0],r}case"disabled":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(Un,{variant:"secondary",children:[m.jsx(ef,{className:"size-3 mr-1"}),"Disabled"]}),e[1]=r):r=e[1],r}case"failed":{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(Un,{variant:"destructive",children:[m.jsx(Ea,{className:"size-3 mr-1"}),"Failed"]}),e[2]=r):r=e[2],r}case"needs_auth":{let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(Un,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[m.jsx(Ea,{className:"size-3 mr-1"}),"Needs Auth"]}),e[3]=r):r=e[3],r}case"needs_client_registration":{let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(Un,{variant:"outline",className:"border-orange-500 text-orange-600",children:[m.jsx(Ea,{className:"size-3 mr-1"}),"Needs Registration"]}),e[4]=r):r=e[4],r}default:{let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(Un,{variant:"secondary",children:"Unknown"}),e[5]=r):r=e[5],r}}}function pL({open:t,onOpenChange:e,workspaceId:n,workspacePath:r,serverUrl:o,apiToken:l}){const{fetchWithAuth:c}=Xa(),[a,u]=N.useState({}),[d,p]=N.useState(!1),[h,v]=N.useState(null),[x,C]=N.useState(null),w=N.useCallback(async()=>{if(n){p(!0),C(null);try{const k=await c(`/api/workspaces/${n}/mcp/status`,{},{serverUrl:o,token:l});if(!k.ok)throw new Error("Failed to load MCP status");const T=await k.json();u(T.status||{})}catch(k){const T=k instanceof Error?k.message:"Unknown error";C(T)}finally{p(!1)}}},[n,c,o,l]);N.useEffect(()=>{t&&n&&w()},[t,n,w]);const y=async k=>{if(n){v(k);try{if(!(await c(`/api/workspaces/${n}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:l})).ok)throw new Error("Failed to connect");await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{v(null)}}},S=async k=>{if(n){v(k);try{if(!(await c(`/api/workspaces/${n}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:l})).ok)throw new Error("Failed to disconnect");await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{v(null)}}},_=async k=>{if(n){v(k);try{const T=await c(`/api/workspaces/${n}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:l});if(!T.ok)throw new Error("Failed to start auth");const R=await T.json();R.authorizationUrl&&window.open(R.authorizationUrl,"_blank"),await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{v(null)}}},b=Object.entries(a);return m.jsx(Ao,{open:t,onOpenChange:e,children:m.jsxs(Ro,{className:"sm:max-w-[600px] max-h-[80vh]",children:[m.jsxs(To,{children:[m.jsxs(No,{className:"flex items-center gap-2",children:[m.jsx(go,{className:"size-5"}),"MCP Servers"]}),m.jsx(Qa,{children:"Manage Model Context Protocol servers for this workspace"})]}),m.jsxs("div",{className:"mt-4 space-y-4",children:[x&&m.jsxs(wd,{variant:"destructive",children:[m.jsx(Ea,{className:"size-4"}),m.jsx(Cd,{children:x})]}),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(He,{variant:"outline",size:"sm",onClick:w,disabled:d,children:m.jsx(Ai,{className:`size-4 ${d?"animate-spin":""}`})})]}),m.jsx(zc,{className:"h-[400px]",children:d&&b.length===0?m.jsx("div",{className:"flex items-center justify-center py-8",children:m.jsx(nr,{className:"size-6 animate-spin text-muted-foreground"})}):b.length===0?m.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[m.jsx(go,{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:b.map(([k,{config:T,status:R}])=>{var M;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(go,{className:"size-5 text-muted-foreground mt-0.5"}),m.jsxs("div",{children:[m.jsx("div",{className:"font-medium",children:k}),m.jsx("div",{className:"text-sm text-muted-foreground",children:(T==null?void 0:T.type)==="local"?m.jsxs("span",{children:["Local - ",((M=T.command)==null?void 0:M[0])||"command"]}):(T==null?void 0:T.type)==="remote"?m.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",T.url]}):"Unknown type"}),R.status==="failed"&&"error"in R&&m.jsx(wd,{variant:"destructive",className:"mt-2 py-2",children:m.jsx(Cd,{className:"text-xs",children:R.error})}),R.status==="needs_client_registration"&&"error"in R&&m.jsx(wd,{className:"mt-2 py-2 border-orange-500",children:m.jsx(Cd,{className:"text-xs",children:R.error})})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsx(hL,{status:R})})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[R.status==="connected"&&m.jsxs(He,{variant:"outline",size:"sm",onClick:()=>S(k),disabled:h===k,children:[h===k?m.jsx(nr,{className:"size-4 animate-spin"}):m.jsx(PA,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(R.status==="disabled"||R.status==="failed")&&m.jsxs(He,{variant:"outline",size:"sm",onClick:()=>y(k),disabled:h===k,children:[h===k?m.jsx(nr,{className:"size-4 animate-spin"}):m.jsx(BA,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Connect"})]}),R.status==="needs_auth"&&m.jsxs(He,{variant:"default",size:"sm",onClick:()=>_(k),disabled:h===k,children:[h===k?m.jsx(nr,{className:"size-4 animate-spin"}):m.jsx(mc,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},k)})})})]})]})})}function mL(t){const e=fe.c(70),{open:n,onOpenChange:r,editServer:o}=t,{prepareForServerAdd:l,addServer:c,editServer:a}=Ba(),[u,d]=N.useState(""),[p,h]=N.useState(""),[v,x]=N.useState(""),[C,w]=N.useState(!1),[y,S]=N.useState(null),_=o!=null;let b;e[0]!==o?(b=()=>{o?(d(o.name),h(o.url),x(o.token)):(d(""),h("localhost:8742"),x("")),S(null),w(!1)},e[0]=o,e[1]=b):b=e[1];let k;e[2]!==o||e[3]!==n?(k=[o,n],e[2]=o,e[3]=n,e[4]=k):k=e[4],N.useEffect(b,k);let T;e[5]!==c||e[6]!==o||e[7]!==_||e[8]!==u||e[9]!==r||e[10]!==l||e[11]!==v||e[12]!==a||e[13]!==p?(T=je=>{je.preventDefault(),S(null);const ze=u.trim(),ce=p.trim(),Te=v.trim();if(!ze){S("Name is required");return}if(!ce){S("Server URL is required");return}if(!Te){S("API token is required");return}if(!sS(Te)){S("Token must be 64 hexadecimal characters");return}const ye=Ad(ce);_?a(o.id,{name:ze,url:ye,token:Te}):(l(),c(ze,ye,Te)),r(!1)},e[5]=c,e[6]=o,e[7]=_,e[8]=u,e[9]=r,e[10]=l,e[11]=v,e[12]=a,e[13]=p,e[14]=T):T=e[14];const R=T,M=_?"Edit Server":"Add Server";let A;e[15]!==M?(A=m.jsx(No,{children:M}),e[15]=M,e[16]=A):A=e[16];const j=_?"Update server details":"Enter your server details";let O;e[17]!==j?(O=m.jsx(Qa,{children:j}),e[17]=j,e[18]=O):O=e[18];let z;e[19]!==A||e[20]!==O?(z=m.jsxs(To,{children:[A,O]}),e[19]=A,e[20]=O,e[21]=z):z=e[21];let V;e[22]===Symbol.for("react.memo_cache_sentinel")?(V=m.jsx(Ir,{htmlFor:"server-name",children:"Name"}),e[22]=V):V=e[22];let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F=je=>d(je.target.value),e[23]=F):F=e[23];let W;e[24]!==u?(W=m.jsxs("div",{className:"grid gap-2",children:[V,m.jsx(Sd,{id:"server-name",value:u,onChange:F,placeholder:"My Server"})]}),e[24]=u,e[25]=W):W=e[25];let G;e[26]===Symbol.for("react.memo_cache_sentinel")?(G=m.jsx(Ir,{htmlFor:"server-url",children:"Server URL"}),e[26]=G):G=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=je=>h(je.target.value),e[27]=q):q=e[27];let X;e[28]!==p?(X=m.jsxs("div",{className:"grid gap-2",children:[G,m.jsx(Sd,{id:"server-url",value:p,onChange:q,placeholder:"localhost:8742"})]}),e[28]=p,e[29]=X):X=e[29];let Y;e[30]===Symbol.for("react.memo_cache_sentinel")?(Y=m.jsx(Ir,{htmlFor:"server-token",children:"API Token"}),e[30]=Y):Y=e[30];const I=C?"text":"password";let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=je=>x(je.target.value),e[31]=L):L=e[31];let P;e[32]!==I||e[33]!==v?(P=m.jsx(Sd,{id:"server-token",type:I,value:v,onChange:L,placeholder:"64-character hex string",className:"pr-10"}),e[32]=I,e[33]=v,e[34]=P):P=e[34];let H;e[35]!==C?(H=()=>w(!C),e[35]=C,e[36]=H):H=e[36];let B;e[37]!==C?(B=C?m.jsx(H5,{className:"size-4 text-muted-foreground"}):m.jsx(uS,{className:"size-4 text-muted-foreground"}),e[37]=C,e[38]=B):B=e[38];let Z;e[39]!==H||e[40]!==B?(Z=m.jsx("button",{type:"button",onClick:H,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:B}),e[39]=H,e[40]=B,e[41]=Z):Z=e[41];let J;e[42]!==P||e[43]!==Z?(J=m.jsxs("div",{className:"grid gap-2",children:[Y,m.jsxs("div",{className:"relative",children:[P,Z]})]}),e[42]=P,e[43]=Z,e[44]=J):J=e[44];let ee;e[45]!==y?(ee=y&&m.jsx("p",{className:"text-sm text-destructive",children:y}),e[45]=y,e[46]=ee):ee=e[46];let K;e[47]!==W||e[48]!==X||e[49]!==J||e[50]!==ee?(K=m.jsxs("div",{className:"grid gap-4 py-4",children:[W,X,J,ee]}),e[47]=W,e[48]=X,e[49]=J,e[50]=ee,e[51]=K):K=e[51];let $;e[52]!==r?($=m.jsx(He,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[52]=r,e[53]=$):$=e[53];const te=_?"Save":"Add";let re;e[54]!==te?(re=m.jsx(He,{type:"submit",children:te}),e[54]=te,e[55]=re):re=e[55];let ae;e[56]!==$||e[57]!==re?(ae=m.jsxs(Tf,{children:[$,re]}),e[56]=$,e[57]=re,e[58]=ae):ae=e[58];let se;e[59]!==R||e[60]!==K||e[61]!==ae?(se=m.jsxs("form",{onSubmit:R,children:[K,ae]}),e[59]=R,e[60]=K,e[61]=ae,e[62]=se):se=e[62];let _e;e[63]!==se||e[64]!==z?(_e=m.jsxs(Ro,{className:"sm:max-w-[425px]",children:[z,se]}),e[63]=se,e[64]=z,e[65]=_e):_e=e[65];let Re;return e[66]!==r||e[67]!==n||e[68]!==_e?(Re=m.jsx(Ao,{open:n,onOpenChange:r,children:_e}),e[66]=r,e[67]=n,e[68]=_e,e[69]=Re):Re=e[69],Re}function gL(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_L={};function Ib(t,e){return(_L.jsx?yL:vL).test(t)}const bL=/[ \t\n\f\r]/g;function xL(t){return typeof t=="object"?t.type==="text"?Pb(t.value):!1:Pb(t)}function Pb(t){return t.replace(bL,"")===""}class Hc{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Hc.prototype.normal={};Hc.prototype.property={};Hc.prototype.space=void 0;function mk(t,e){const n={},r={};for(const o of t)Object.assign(n,o.property),Object.assign(r,o.normal);return new Hc(n,r,e)}function mg(t){return t.toLowerCase()}class rr{constructor(e,n){this.attribute=n,this.property=e}}rr.prototype.attribute="";rr.prototype.booleanish=!1;rr.prototype.boolean=!1;rr.prototype.commaOrSpaceSeparated=!1;rr.prototype.commaSeparated=!1;rr.prototype.defined=!1;rr.prototype.mustUseProperty=!1;rr.prototype.number=!1;rr.prototype.overloadedBoolean=!1;rr.prototype.property="";rr.prototype.spaceSeparated=!1;rr.prototype.space=void 0;let SL=0;const ot=Mo(),dn=Mo(),gg=Mo(),Oe=Mo(),Pt=Mo(),Na=Mo(),mr=Mo();function Mo(){return 2**++SL}const vg=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:dn,commaOrSpaceSeparated:mr,commaSeparated:Na,number:Oe,overloadedBoolean:gg,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),wm=Object.keys(vg);class xv extends rr{constructor(e,n,r,o){let l=-1;if(super(e,n),zb(this,"space",o),typeof r=="number")for(;++l<wm.length;){const c=wm[l];zb(this,wm[l],(r&vg[c])===vg[c])}}}xv.prototype.defined=!0;function zb(t,e,n){n&&(t[e]=n)}function Ja(t){const e={},n={};for(const[r,o]of Object.entries(t.properties)){const l=new xv(r,t.transform(t.attributes||{},r),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),e[r]=l,n[mg(r)]=r,n[mg(l.attribute)]=r}return new Hc(e,n,t.space)}const gk=Ja({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:Pt,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:Oe,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:Pt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:dn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function vk(t,e){return e in t?t[e]:e}function yk(t,e){return vk(t,e.toLowerCase())}const wL=Ja({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Na,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Pt,autoFocus:ot,autoPlay:ot,blocking:Pt,capture:null,charSet:null,checked:ot,cite:null,className:Pt,cols:Oe,colSpan:null,content:null,contentEditable:dn,controls:ot,controlsList:Pt,coords:Oe|Na,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:gg,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Pt,height:Oe,hidden:gg,high:Oe,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:ot,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,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:ot,optimum:Oe,pattern:null,ping:Pt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Pt,required:ot,reversed:ot,rows:Oe,rowSpan:Oe,sandbox:Pt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:dn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:yk}),CL=Ja({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:mr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Pt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:Na,g2:Na,glyphName:Na,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mr,rev:mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mr,requiredFeatures:mr,requiredFonts:mr,requiredFormats:mr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vk}),_k=Ja({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bk=Ja({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yk}),xk=Ja({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),kL={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"},EL=/[A-Z]/g,Bb=/-[a-z]/g,AL=/^data[-\w.:]+$/i;function RL(t,e){const n=mg(e);let r=e,o=rr;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&AL.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace(Bb,NL);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!Bb.test(l)){let c=l.replace(EL,TL);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}o=xv}return new o(r,e)}function TL(t){return"-"+t.toLowerCase()}function NL(t){return t.charAt(1).toUpperCase()}const DL=mk([gk,wL,_k,bk,xk],"html"),Sv=mk([gk,CL,_k,bk,xk],"svg");function ML(t){return t.join(" ").trim()}var ba={},Cm,Fb;function jL(){if(Fb)return Cm;Fb=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
550
|
+
`,d="/",p="*",h="",v="comment",x="declaration";function C(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var _=1,b=1;function k(W){var G=W.match(e);G&&(_+=G.length);var q=W.lastIndexOf(u);b=~q?W.length-q:b+W.length}function T(){var W={line:_,column:b};return function(G){return G.position=new R(W),j(),G}}function R(W){this.start=W,this.end={line:_,column:b},this.source=S.source}R.prototype.content=y;function M(W){var G=new Error(S.source+":"+_+":"+b+": "+W);if(G.reason=W,G.filename=S.source,G.line=_,G.column=b,G.source=y,!S.silent)throw G}function A(W){var G=W.exec(y);if(G){var q=G[0];return k(q),y=y.slice(q.length),G}}function j(){A(n)}function O(W){var G;for(W=W||[];G=z();)G!==!1&&W.push(G);return W}function z(){var W=T();if(!(d!=y.charAt(0)||p!=y.charAt(1))){for(var G=2;h!=y.charAt(G)&&(p!=y.charAt(G)||d!=y.charAt(G+1));)++G;if(G+=2,h===y.charAt(G-1))return M("End of comment missing");var q=y.slice(2,G-2);return b+=2,k(q),y=y.slice(G),b+=2,W({type:v,comment:q})}}function V(){var W=T(),G=A(r);if(G){if(z(),!A(o))return M("property missing ':'");var q=A(l),X=W({type:x,property:w(G[0].replace(t,h)),value:q?w(q[0].replace(t,h)):h});return A(c),X}}function F(){var W=[];O(W);for(var G;G=V();)G!==!1&&(W.push(G),O(W));return W}return j(),F()}function w(y){return y?y.replace(a,h):h}return Cm=C,Cm}var Hb;function OL(){if(Hb)return ba;Hb=1;var t=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0}),ba.default=n;const e=t(jL());function n(r,o){let l=null;if(!r||typeof r!="string")return l;const c=(0,e.default)(r),a=typeof o=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:p}=u;a?o(d,p,u):p&&(l=l||{},l[d]=p)}),l}return ba}var sc={},Ub;function LL(){if(Ub)return sc;Ub=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(d){return!d||n.test(d)||t.test(d)},c=function(d,p){return p.toUpperCase()},a=function(d,p){return"".concat(p,"-")},u=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(o,a):d=d.replace(r,a),d.replace(e,c))};return sc.camelCase=u,sc}var ic,$b;function IL(){if($b)return ic;$b=1;var t=ic&&ic.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},e=t(OL()),n=LL();function r(o,l){var c={};return!o||typeof o!="string"||(0,e.default)(o,function(a,u){a&&u&&(c[(0,n.camelCase)(a,l)]=u)}),c}return r.default=r,ic=r,ic}var PL=IL();const zL=Xd(PL),Sk=wk("end"),wv=wk("start");function wk(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function BL(t){const e=wv(t),n=Sk(t);if(e&&n)return{start:e,end:n}}function dc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Vb(t.position):"start"in t||"end"in t?Vb(t):"line"in t||"column"in t?yg(t):""}function yg(t){return qb(t&&t.line)+":"+qb(t&&t.column)}function Vb(t){return yg(t&&t.start)+"-"+yg(t&&t.end)}function qb(t){return t&&typeof t=="number"?t:1}class Ln extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof e=="string"?o=e:!l.cause&&e&&(c=!0,o=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=dc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;const Cv={}.hasOwnProperty,FL=new Map,HL=/[A-Z]/g,UL=new Set(["table","tbody","thead","tfoot","tr"]),$L=new Set(["td","th"]),Ck="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VL(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ZL(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=QL(n,e.jsx,e.jsxs)}const o={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Sv:DL,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=kk(o,t,void 0);return l&&typeof l!="string"?l:o.create(t,o.Fragment,{children:l||void 0},void 0)}function kk(t,e,n){if(e.type==="element")return qL(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return WL(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return KL(t,e,n);if(e.type==="mdxjsEsm")return GL(t,e);if(e.type==="root")return YL(t,e,n);if(e.type==="text")return XL(t,e)}function qL(t,e,n){const r=t.schema;let o=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Sv,t.schema=o),t.ancestors.push(e);const l=Ak(t,e.tagName,!1),c=JL(t,e);let a=Ev(t,e);return UL.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!xL(u):!0})),Ek(t,c,l,e),kv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function WL(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Cc(t,e.position)}function GL(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Cc(t,e.position)}function KL(t,e,n){const r=t.schema;let o=r;e.name==="svg"&&r.space==="html"&&(o=Sv,t.schema=o),t.ancestors.push(e);const l=e.name===null?t.Fragment:Ak(t,e.name,!0),c=e7(t,e),a=Ev(t,e);return Ek(t,c,l,e),kv(c,a),t.ancestors.pop(),t.schema=r,t.create(e,l,c,n)}function YL(t,e,n){const r={};return kv(r,Ev(t,e)),t.create(e,t.Fragment,r,n)}function XL(t,e){return e.value}function Ek(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function kv(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function QL(t,e,n){return r;function r(o,l,c,a){const d=Array.isArray(c.children)?n:e;return a?d(l,c,a):d(l,c)}}function ZL(t,e){return n;function n(r,o,l,c){const a=Array.isArray(l.children),u=wv(r);return e(o,l,c,a,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function JL(t,e){const n={};let r,o;for(o in e.properties)if(o!=="children"&&Cv.call(e.properties,o)){const l=t7(t,o,e.properties[o]);if(l){const[c,a]=l;t.tableCellAlignToStyle&&c==="align"&&typeof a=="string"&&$L.has(e.tagName)?r=a:n[c]=a}}if(r){const l=n.style||(n.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function e7(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];l.type;const c=l.expression;c.type;const a=c.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else Cc(t,e.position);else{const o=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,l=t.evaluater.evaluateExpression(a.expression)}else Cc(t,e.position);else l=r.value===null?!0:r.value;n[o]=l}return n}function Ev(t,e){const n=[];let r=-1;const o=t.passKeys?new Map:FL;for(;++r<e.children.length;){const l=e.children[r];let c;if(t.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const d=o.get(u)||0;c=u+"-"+d,o.set(u,d+1)}}const a=kk(t,l,c);a!==void 0&&n.push(a)}return n}function t7(t,e,n){const r=RL(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?gL(n):ML(n)),r.property==="style"){let o=typeof n=="object"?n:n7(t,String(n));return t.stylePropertyNameCase==="css"&&(o=r7(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&r.space?kL[r.property]||r.property:r.attribute,n]}}function n7(t,e){try{return zL(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,o=new Ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=t.filePath||void 0,o.url=Ck+"#cannot-parse-style-attribute",o}}function Ak(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const o=e.split(".");let l=-1,c;for(;++l<o.length;){const a=Ib(o[l])?{type:"Identifier",name:o[l]}:{type:"Literal",value:o[l]};c=c?{type:"MemberExpression",object:c,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=c}else r=Ib(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const o=r.value;return Cv.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(r);Cc(t)}function Cc(t,e){const n=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Ck+"#cannot-handle-mdx-estrees-without-createevaluater",n}function r7(t){const e={};let n;for(n in t)Cv.call(t,n)&&(e[s7(n)]=t[n]);return e}function s7(t){let e=t.replace(HL,i7);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function i7(t){return"-"+t.toLowerCase()}const km={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"]},o7={};function Av(t,e){const n=o7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Rk(t,r,o)}function Rk(t,e,n){if(a7(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Wb(t.children,e,n)}return Array.isArray(t)?Wb(t,e,n):""}function Wb(t,e,n){const r=[];let o=-1;for(;++o<t.length;)r[o]=Rk(t[o],e,n);return r.join("")}function a7(t){return!!(t&&typeof t=="object")}const Gb=document.createElement("i");function Rv(t){const e="&"+t+";";Gb.innerHTML=e;const n=Gb.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function _r(t,e,n,r){const o=t.length;let l=0,c;if(e<0?e=-e>o?0:o+e:e=e>o?o:e,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(e,n),t.splice(...c);else for(n&&t.splice(e,n);l<r.length;)c=r.slice(l,l+1e4),c.unshift(e,0),t.splice(...c),l+=1e4,e+=1e4}function Lr(t,e){return t.length>0?(_r(t,t.length,0,e),t):e}const Kb={}.hasOwnProperty;function Tk(t){const e={};let n=-1;for(;++n<t.length;)l7(e,t[n]);return e}function l7(t,e){let n;for(n in e){const o=(Kb.call(t,n)?t[n]:void 0)||(t[n]={}),l=e[n];let c;if(l)for(c in l){Kb.call(o,c)||(o[c]=[]);const a=l[c];c7(o[c],Array.isArray(a)?a:a?[a]:[])}}}function c7(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);_r(t,0,0,r)}function Nk(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Yr(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $n=Fi(/[A-Za-z]/),On=Fi(/[\dA-Za-z]/),u7=Fi(/[#-'*+\--9=?A-Z^-~]/);function qd(t){return t!==null&&(t<32||t===127)}const _g=Fi(/\d/),d7=Fi(/[\dA-Fa-f]/),f7=Fi(/[!-/:-@[-`{-~]/);function Je(t){return t!==null&&t<-2}function Ot(t){return t!==null&&(t<0||t===32)}function ft(t){return t===-2||t===-1||t===32}const Pf=Fi(new RegExp("\\p{P}|\\p{S}","u")),wo=Fi(/\s/);function Fi(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function el(t){const e=[];let n=-1,r=0,o=0;for(;++n<t.length;){const l=t.charCodeAt(n);let c="";if(l===37&&On(t.charCodeAt(n+1))&&On(t.charCodeAt(n+2)))o=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const a=t.charCodeAt(n+1);l<56320&&a>56319&&a<57344?(c=String.fromCharCode(l,a),o=1):c="�"}else c=String.fromCharCode(l);c&&(e.push(t.slice(r,n),encodeURIComponent(c)),r=n+o+1,c=""),o&&(n+=o,o=0)}return e.join("")+t.slice(r)}function gt(t,e,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(u){return ft(u)?(t.enter(n),a(u)):e(u)}function a(u){return ft(u)&&l++<o?(t.consume(u),a):(t.exit(n),e(u))}}const h7={tokenize:p7};function p7(t){const e=t.attempt(this.parser.constructs.contentInitial,r,o);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),gt(t,e,"linePrefix")}function o(a){return t.enter("paragraph"),l(a)}function l(a){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,c(a)}function c(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return Je(a)?(t.consume(a),t.exit("chunkText"),l):(t.consume(a),c)}}const m7={tokenize:g7},Yb={tokenize:v7};function g7(t){const e=this,n=[];let r=0,o,l,c;return a;function a(b){if(r<n.length){const k=n[r];return e.containerState=k[1],t.attempt(k[0].continuation,u,d)(b)}return d(b)}function u(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&_();const k=e.events.length;let T=k,R;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){R=e.events[T][1].end;break}S(r);let M=k;for(;M<e.events.length;)e.events[M][1].end={...R},M++;return _r(e.events,T+1,0,e.events.slice(k)),e.events.length=M,d(b)}return a(b)}function d(b){if(r===n.length){if(!o)return v(b);if(o.currentConstruct&&o.currentConstruct.concrete)return C(b);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Yb,p,h)(b)}function p(b){return o&&_(),S(r),v(b)}function h(b){return e.parser.lazy[e.now().line]=r!==n.length,c=e.now().offset,C(b)}function v(b){return e.containerState={},t.attempt(Yb,x,C)(b)}function x(b){return r++,n.push([e.currentConstruct,e.containerState]),v(b)}function C(b){if(b===null){o&&_(),S(0),t.consume(b);return}return o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:l}),w(b)}function w(b){if(b===null){y(t.exit("chunkFlow"),!0),S(0),t.consume(b);return}return Je(b)?(t.consume(b),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(b),w)}function y(b,k){const T=e.sliceStream(b);if(k&&T.push(null),b.previous=l,l&&(l.next=b),l=b,o.defineSkip(b.start),o.write(T),e.parser.lazy[b.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<c&&(!o.events[R][1].end||o.events[R][1].end.offset>c))return;const M=e.events.length;let A=M,j,O;for(;A--;)if(e.events[A][0]==="exit"&&e.events[A][1].type==="chunkFlow"){if(j){O=e.events[A][1].end;break}j=!0}for(S(r),R=M;R<e.events.length;)e.events[R][1].end={...O},R++;_r(e.events,A+1,0,e.events.slice(M)),e.events.length=R}}function S(b){let k=n.length;for(;k-- >b;){const T=n[k];e.containerState=T[1],T[0].exit.call(e,t)}n.length=b}function _(){o.write([null]),l=void 0,o=void 0,e.containerState._closeFlow=void 0}}function v7(t,e,n){return gt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ia(t){if(t===null||Ot(t)||wo(t))return 1;if(Pf(t))return 2}function zf(t,e,n){const r=[];let o=-1;for(;++o<t.length;){const l=t[o].resolveAll;l&&!r.includes(l)&&(e=l(e,n),r.push(l))}return e}const bg={name:"attention",resolveAll:y7,tokenize:_7};function y7(t,e){let n=-1,r,o,l,c,a,u,d,p;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},v={...t[n][1].start};Xb(h,-u),Xb(v,u),c={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:v},l={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},o={type:u>1?"strong":"emphasis",start:{...c.start},end:{...a.end}},t[r][1].end={...c.start},t[n][1].start={...a.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=Lr(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=Lr(d,[["enter",o,e],["enter",c,e],["exit",c,e],["enter",l,e]]),d=Lr(d,zf(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=Lr(d,[["exit",l,e],["enter",a,e],["exit",a,e],["exit",o,e]]),t[n][1].end.offset-t[n][1].start.offset?(p=2,d=Lr(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):p=0,_r(t,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function _7(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ia(r);let l;return c;function c(u){return l=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===l)return t.consume(u),a;const d=t.exit("attentionSequence"),p=Ia(u),h=!p||p===2&&o||n.includes(u),v=!o||o===2&&p||n.includes(r);return d._open=!!(l===42?h:h&&(o||!v)),d._close=!!(l===42?v:v&&(p||!h)),e(u)}}function Xb(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const b7={name:"autolink",tokenize:x7};function x7(t,e,n){let r=0;return o;function o(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(x){return $n(x)?(t.consume(x),c):x===64?n(x):d(x)}function c(x){return x===43||x===45||x===46||On(x)?(r=1,a(x)):d(x)}function a(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||On(x))&&r++<32?(t.consume(x),a):(r=0,d(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||qd(x)?n(x):(t.consume(x),u)}function d(x){return x===64?(t.consume(x),p):u7(x)?(t.consume(x),d):n(x)}function p(x){return On(x)?h(x):n(x)}function h(x){return x===46?(t.consume(x),r=0,p):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):v(x)}function v(x){if((x===45||On(x))&&r++<63){const C=x===45?v:h;return t.consume(x),C}return n(x)}}const Uc={partial:!0,tokenize:S7};function S7(t,e,n){return r;function r(l){return ft(l)?gt(t,o,"linePrefix")(l):o(l)}function o(l){return l===null||Je(l)?e(l):n(l)}}const Dk={continuation:{tokenize:C7},exit:k7,name:"blockQuote",tokenize:w7};function w7(t,e,n){const r=this;return o;function o(c){if(c===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),l}return n(c)}function l(c){return ft(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(c))}}function C7(t,e,n){const r=this;return o;function o(c){return ft(c)?gt(t,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return t.attempt(Dk,e,n)(c)}}function k7(t){t.exit("blockQuote")}const Mk={name:"characterEscape",tokenize:E7};function E7(t,e,n){return r;function r(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),o}function o(l){return f7(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(l)}}const jk={name:"characterReference",tokenize:A7};function A7(t,e,n){const r=this;let o=0,l,c;return a;function a(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),u}function u(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),l=31,c=On,p(h))}function d(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,c=d7,p):(t.enter("characterReferenceValue"),l=7,c=_g,p(h))}function p(h){if(h===59&&o){const v=t.exit("characterReferenceValue");return c===On&&!Rv(r.sliceSerialize(v))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return c(h)&&o++<l?(t.consume(h),p):n(h)}}const Qb={partial:!0,tokenize:T7},Zb={concrete:!0,name:"codeFenced",tokenize:R7};function R7(t,e,n){const r=this,o={partial:!0,tokenize:T};let l=0,c=0,a;return u;function u(R){return d(R)}function d(R){const M=r.events[r.events.length-1];return l=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===a?(c++,t.consume(R),p):c<3?n(R):(t.exit("codeFencedFenceSequence"),ft(R)?gt(t,h,"whitespace")(R):h(R))}function h(R){return R===null||Je(R)?(t.exit("codeFencedFence"),r.interrupt?e(R):t.check(Qb,w,k)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Je(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(R)):ft(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),gt(t,x,"whitespace")(R)):R===96&&R===a?n(R):(t.consume(R),v)}function x(R){return R===null||Je(R)?h(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Je(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(R)):R===96&&R===a?n(R):(t.consume(R),C)}function w(R){return t.attempt(o,k,y)(R)}function y(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),S}function S(R){return l>0&&ft(R)?gt(t,_,"linePrefix",l+1)(R):_(R)}function _(R){return R===null||Je(R)?t.check(Qb,w,k)(R):(t.enter("codeFlowValue"),b(R))}function b(R){return R===null||Je(R)?(t.exit("codeFlowValue"),_(R)):(t.consume(R),b)}function k(R){return t.exit("codeFenced"),e(R)}function T(R,M,A){let j=0;return O;function O(G){return R.enter("lineEnding"),R.consume(G),R.exit("lineEnding"),z}function z(G){return R.enter("codeFencedFence"),ft(G)?gt(R,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):V(G)}function V(G){return G===a?(R.enter("codeFencedFenceSequence"),F(G)):A(G)}function F(G){return G===a?(j++,R.consume(G),F):j>=c?(R.exit("codeFencedFenceSequence"),ft(G)?gt(R,W,"whitespace")(G):W(G)):A(G)}function W(G){return G===null||Je(G)?(R.exit("codeFencedFence"),M(G)):A(G)}}}function T7(t,e,n){const r=this;return o;function o(c){return c===null?n(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}const Em={name:"codeIndented",tokenize:D7},N7={partial:!0,tokenize:M7};function D7(t,e,n){const r=this;return o;function o(d){return t.enter("codeIndented"),gt(t,l,"linePrefix",5)(d)}function l(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(d):n(d)}function c(d){return d===null?u(d):Je(d)?t.attempt(N7,c,u)(d):(t.enter("codeFlowValue"),a(d))}function a(d){return d===null||Je(d)?(t.exit("codeFlowValue"),c(d)):(t.consume(d),a)}function u(d){return t.exit("codeIndented"),e(d)}}function M7(t,e,n){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?n(c):Je(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):gt(t,l,"linePrefix",5)(c)}function l(c){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):Je(c)?o(c):n(c)}}const j7={name:"codeText",previous:L7,resolve:O7,tokenize:I7};function O7(t){let e=t.length-4,n=3,r,o;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)o===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(o=r):(r===e||t[r][1].type==="lineEnding")&&(t[o][1].type="codeTextData",r!==o+2&&(t[o][1].end=t[r-1][1].end,t.splice(o+2,r-o-2),e-=r-o-2,r=o+2),o=void 0);return t}function L7(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function I7(t,e,n){let r=0,o,l;return c;function c(h){return t.enter("codeText"),t.enter("codeTextSequence"),a(h)}function a(h){return h===96?(t.consume(h),r++,a):(t.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),u):h===96?(l=t.enter("codeTextSequence"),o=0,p(h)):Je(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||Je(h)?(t.exit("codeTextData"),u(h)):(t.consume(h),d)}function p(h){return h===96?(t.consume(h),o++,p):o===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(l.type="codeTextData",d(h))}}class P7{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const o=n||0;this.setCursor(Math.trunc(e));const l=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&oc(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),oc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),oc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);oc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);oc(this.left,n.reverse())}}}function oc(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ok(t){const e={};let n=-1,r,o,l,c,a,u,d;const p=new P7(t);for(;++n<p.length;){for(;n in e;)n=e[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,z7(p,n)),n=e[n],d=!0);else if(r[1]._container){for(l=n,o=void 0;l--;)if(c=p.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},a=p.slice(o,n),a.unshift(r),p.splice(o,n-o+1,a))}}return _r(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function z7(t,e){const n=t.get(e)[1],r=t.get(e)[2];let o=e-1;const l=[];let c=n._tokenizer;c||(c=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const a=c.events,u=[],d={};let p,h,v=-1,x=n,C=0,w=0;const y=[w];for(;x;){for(;t.get(++o)[1]!==x;);l.push(o),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),h&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),h=x,x=x.next}for(x=n;++v<a.length;)a[v][0]==="exit"&&a[v-1][0]==="enter"&&a[v][1].type===a[v-1][1].type&&a[v][1].start.line!==a[v][1].end.line&&(w=v+1,y.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):y.pop(),v=y.length;v--;){const S=a.slice(y[v],y[v+1]),_=l.pop();u.push([_,_+S.length-1]),t.splice(_,2,S)}for(u.reverse(),v=-1;++v<u.length;)d[C+u[v][0]]=C+u[v][1],C+=u[v][1]-u[v][0]-1;return d}const B7={resolve:H7,tokenize:U7},F7={partial:!0,tokenize:$7};function H7(t){return Ok(t),t}function U7(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?l(a):Je(a)?t.check(F7,c,l)(a):(t.consume(a),o)}function l(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function c(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function $7(t,e,n){const r=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),gt(t,l,"linePrefix")}function l(c){if(c===null||Je(c))return n(c);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(c):t.interrupt(r.parser.constructs.flow,n,e)(c)}}function Lk(t,e,n,r,o,l,c,a,u){const d=u||Number.POSITIVE_INFINITY;let p=0;return h;function h(S){return S===60?(t.enter(r),t.enter(o),t.enter(l),t.consume(S),t.exit(l),v):S===null||S===32||S===41||qd(S)?n(S):(t.enter(r),t.enter(c),t.enter(a),t.enter("chunkString",{contentType:"string"}),w(S))}function v(S){return S===62?(t.enter(l),t.consume(S),t.exit(l),t.exit(o),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(t.exit("chunkString"),t.exit(a),v(S)):S===null||S===60||Je(S)?n(S):(t.consume(S),S===92?C:x)}function C(S){return S===60||S===62||S===92?(t.consume(S),x):x(S)}function w(S){return!p&&(S===null||S===41||Ot(S))?(t.exit("chunkString"),t.exit(a),t.exit(c),t.exit(r),e(S)):p<d&&S===40?(t.consume(S),p++,w):S===41?(t.consume(S),p--,w):S===null||S===32||S===40||qd(S)?n(S):(t.consume(S),S===92?y:w)}function y(S){return S===40||S===41||S===92?(t.consume(S),w):w(S)}}function Ik(t,e,n,r,o,l){const c=this;let a=0,u;return d;function d(x){return t.enter(r),t.enter(o),t.consume(x),t.exit(o),t.enter(l),p}function p(x){return a>999||x===null||x===91||x===93&&!u||x===94&&!a&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(t.exit(l),t.enter(o),t.consume(x),t.exit(o),t.exit(r),e):Je(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||x===91||x===93||Je(x)||a++>999?(t.exit("chunkString"),p(x)):(t.consume(x),u||(u=!ft(x)),x===92?v:h)}function v(x){return x===91||x===92||x===93?(t.consume(x),a++,h):h(x)}}function Pk(t,e,n,r,o,l){let c;return a;function a(v){return v===34||v===39||v===40?(t.enter(r),t.enter(o),t.consume(v),t.exit(o),c=v===40?41:v,u):n(v)}function u(v){return v===c?(t.enter(o),t.consume(v),t.exit(o),t.exit(r),e):(t.enter(l),d(v))}function d(v){return v===c?(t.exit(l),u(c)):v===null?n(v):Je(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),gt(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===c||v===null||Je(v)?(t.exit("chunkString"),d(v)):(t.consume(v),v===92?h:p)}function h(v){return v===c||v===92?(t.consume(v),p):p(v)}}function fc(t,e){let n;return r;function r(o){return Je(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),n=!0,r):ft(o)?gt(t,r,n?"linePrefix":"lineSuffix")(o):e(o)}}const V7={name:"definition",tokenize:W7},q7={partial:!0,tokenize:G7};function W7(t,e,n){const r=this;let o;return l;function l(x){return t.enter("definition"),c(x)}function c(x){return Ik.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function a(x){return o=Yr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return Ot(x)?fc(t,d)(x):d(x)}function d(x){return Lk(t,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return t.attempt(q7,h,h)(x)}function h(x){return ft(x)?gt(t,v,"whitespace")(x):v(x)}function v(x){return x===null||Je(x)?(t.exit("definition"),r.parser.defined.push(o),e(x)):n(x)}}function G7(t,e,n){return r;function r(a){return Ot(a)?fc(t,o)(a):n(a)}function o(a){return Pk(t,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return ft(a)?gt(t,c,"whitespace")(a):c(a)}function c(a){return a===null||Je(a)?e(a):n(a)}}const K7={name:"hardBreakEscape",tokenize:Y7};function Y7(t,e,n){return r;function r(l){return t.enter("hardBreakEscape"),t.consume(l),o}function o(l){return Je(l)?(t.exit("hardBreakEscape"),e(l)):n(l)}}const X7={name:"headingAtx",resolve:Q7,tokenize:Z7};function Q7(t,e){let n=t.length-2,r=3,o,l;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},l={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},_r(t,r,n-r+1,[["enter",o,e],["enter",l,e],["exit",l,e],["exit",o,e]])),t}function Z7(t,e,n){let r=0;return o;function o(p){return t.enter("atxHeading"),l(p)}function l(p){return t.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&r++<6?(t.consume(p),c):p===null||Ot(p)?(t.exit("atxHeadingSequence"),a(p)):n(p)}function a(p){return p===35?(t.enter("atxHeadingSequence"),u(p)):p===null||Je(p)?(t.exit("atxHeading"),e(p)):ft(p)?gt(t,a,"whitespace")(p):(t.enter("atxHeadingText"),d(p))}function u(p){return p===35?(t.consume(p),u):(t.exit("atxHeadingSequence"),a(p))}function d(p){return p===null||p===35||Ot(p)?(t.exit("atxHeadingText"),a(p)):(t.consume(p),d)}}const J7=["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"],Jb=["pre","script","style","textarea"],eI={concrete:!0,name:"htmlFlow",resolveTo:rI,tokenize:sI},tI={partial:!0,tokenize:oI},nI={partial:!0,tokenize:iI};function rI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function sI(t,e,n){const r=this;let o,l,c,a,u;return d;function d(B){return p(B)}function p(B){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(B),h}function h(B){return B===33?(t.consume(B),v):B===47?(t.consume(B),l=!0,w):B===63?(t.consume(B),o=3,r.interrupt?e:L):$n(B)?(t.consume(B),c=String.fromCharCode(B),y):n(B)}function v(B){return B===45?(t.consume(B),o=2,x):B===91?(t.consume(B),o=5,a=0,C):$n(B)?(t.consume(B),o=4,r.interrupt?e:L):n(B)}function x(B){return B===45?(t.consume(B),r.interrupt?e:L):n(B)}function C(B){const Z="CDATA[";return B===Z.charCodeAt(a++)?(t.consume(B),a===Z.length?r.interrupt?e:V:C):n(B)}function w(B){return $n(B)?(t.consume(B),c=String.fromCharCode(B),y):n(B)}function y(B){if(B===null||B===47||B===62||Ot(B)){const Z=B===47,J=c.toLowerCase();return!Z&&!l&&Jb.includes(J)?(o=1,r.interrupt?e(B):V(B)):J7.includes(c.toLowerCase())?(o=6,Z?(t.consume(B),S):r.interrupt?e(B):V(B)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):l?_(B):b(B))}return B===45||On(B)?(t.consume(B),c+=String.fromCharCode(B),y):n(B)}function S(B){return B===62?(t.consume(B),r.interrupt?e:V):n(B)}function _(B){return ft(B)?(t.consume(B),_):O(B)}function b(B){return B===47?(t.consume(B),O):B===58||B===95||$n(B)?(t.consume(B),k):ft(B)?(t.consume(B),b):O(B)}function k(B){return B===45||B===46||B===58||B===95||On(B)?(t.consume(B),k):T(B)}function T(B){return B===61?(t.consume(B),R):ft(B)?(t.consume(B),T):b(B)}function R(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),u=B,M):ft(B)?(t.consume(B),R):A(B)}function M(B){return B===u?(t.consume(B),u=null,j):B===null||Je(B)?n(B):(t.consume(B),M)}function A(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Ot(B)?T(B):(t.consume(B),A)}function j(B){return B===47||B===62||ft(B)?b(B):n(B)}function O(B){return B===62?(t.consume(B),z):n(B)}function z(B){return B===null||Je(B)?V(B):ft(B)?(t.consume(B),z):n(B)}function V(B){return B===45&&o===2?(t.consume(B),q):B===60&&o===1?(t.consume(B),X):B===62&&o===4?(t.consume(B),P):B===63&&o===3?(t.consume(B),L):B===93&&o===5?(t.consume(B),I):Je(B)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(tI,H,F)(B)):B===null||Je(B)?(t.exit("htmlFlowData"),F(B)):(t.consume(B),V)}function F(B){return t.check(nI,W,H)(B)}function W(B){return t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),G}function G(B){return B===null||Je(B)?F(B):(t.enter("htmlFlowData"),V(B))}function q(B){return B===45?(t.consume(B),L):V(B)}function X(B){return B===47?(t.consume(B),c="",Y):V(B)}function Y(B){if(B===62){const Z=c.toLowerCase();return Jb.includes(Z)?(t.consume(B),P):V(B)}return $n(B)&&c.length<8?(t.consume(B),c+=String.fromCharCode(B),Y):V(B)}function I(B){return B===93?(t.consume(B),L):V(B)}function L(B){return B===62?(t.consume(B),P):B===45&&o===2?(t.consume(B),L):V(B)}function P(B){return B===null||Je(B)?(t.exit("htmlFlowData"),H(B)):(t.consume(B),P)}function H(B){return t.exit("htmlFlow"),e(B)}}function iI(t,e,n){const r=this;return o;function o(c){return Je(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l):n(c)}function l(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}function oI(t,e,n){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Uc,e,n)}}const aI={name:"htmlText",tokenize:lI};function lI(t,e,n){const r=this;let o,l,c;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),u}function u(L){return L===33?(t.consume(L),d):L===47?(t.consume(L),T):L===63?(t.consume(L),b):$n(L)?(t.consume(L),A):n(L)}function d(L){return L===45?(t.consume(L),p):L===91?(t.consume(L),l=0,C):$n(L)?(t.consume(L),_):n(L)}function p(L){return L===45?(t.consume(L),x):n(L)}function h(L){return L===null?n(L):L===45?(t.consume(L),v):Je(L)?(c=h,X(L)):(t.consume(L),h)}function v(L){return L===45?(t.consume(L),x):h(L)}function x(L){return L===62?q(L):L===45?v(L):h(L)}function C(L){const P="CDATA[";return L===P.charCodeAt(l++)?(t.consume(L),l===P.length?w:C):n(L)}function w(L){return L===null?n(L):L===93?(t.consume(L),y):Je(L)?(c=w,X(L)):(t.consume(L),w)}function y(L){return L===93?(t.consume(L),S):w(L)}function S(L){return L===62?q(L):L===93?(t.consume(L),S):w(L)}function _(L){return L===null||L===62?q(L):Je(L)?(c=_,X(L)):(t.consume(L),_)}function b(L){return L===null?n(L):L===63?(t.consume(L),k):Je(L)?(c=b,X(L)):(t.consume(L),b)}function k(L){return L===62?q(L):b(L)}function T(L){return $n(L)?(t.consume(L),R):n(L)}function R(L){return L===45||On(L)?(t.consume(L),R):M(L)}function M(L){return Je(L)?(c=M,X(L)):ft(L)?(t.consume(L),M):q(L)}function A(L){return L===45||On(L)?(t.consume(L),A):L===47||L===62||Ot(L)?j(L):n(L)}function j(L){return L===47?(t.consume(L),q):L===58||L===95||$n(L)?(t.consume(L),O):Je(L)?(c=j,X(L)):ft(L)?(t.consume(L),j):q(L)}function O(L){return L===45||L===46||L===58||L===95||On(L)?(t.consume(L),O):z(L)}function z(L){return L===61?(t.consume(L),V):Je(L)?(c=z,X(L)):ft(L)?(t.consume(L),z):j(L)}function V(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),o=L,F):Je(L)?(c=V,X(L)):ft(L)?(t.consume(L),V):(t.consume(L),W)}function F(L){return L===o?(t.consume(L),o=void 0,G):L===null?n(L):Je(L)?(c=F,X(L)):(t.consume(L),F)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Ot(L)?j(L):(t.consume(L),W)}function G(L){return L===47||L===62||Ot(L)?j(L):n(L)}function q(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function X(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),Y}function Y(L){return ft(L)?gt(t,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return t.enter("htmlTextData"),c(L)}}const Tv={name:"labelEnd",resolveAll:fI,resolveTo:hI,tokenize:pI},cI={tokenize:mI},uI={tokenize:gI},dI={tokenize:vI};function fI(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",e+=o}}return t.length!==n.length&&_r(t,0,t.length,n),t}function hI(t,e){let n=t.length,r=0,o,l,c,a;for(;n--;)if(o=t[n][1],l){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(t[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(l=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=n);const u={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[l][1].start},end:{...t[c][1].end}},p={type:"labelText",start:{...t[l+r+2][1].end},end:{...t[c-2][1].start}};return a=[["enter",u,e],["enter",d,e]],a=Lr(a,t.slice(l+1,l+r+3)),a=Lr(a,[["enter",p,e]]),a=Lr(a,zf(e.parser.constructs.insideSpan.null,t.slice(l+r+4,c-3),e)),a=Lr(a,[["exit",p,e],t[c-2],t[c-1],["exit",d,e]]),a=Lr(a,t.slice(c+1)),a=Lr(a,[["exit",u,e]]),_r(t,l,t.length,a),t}function pI(t,e,n){const r=this;let o=r.events.length,l,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){l=r.events[o][1];break}return a;function a(v){return l?l._inactive?h(v):(c=r.parser.defined.includes(Yr(r.sliceSerialize({start:l.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(v),t.exit("labelMarker"),t.exit("labelEnd"),u):n(v)}function u(v){return v===40?t.attempt(cI,p,c?p:h)(v):v===91?t.attempt(uI,p,c?d:h)(v):c?p(v):h(v)}function d(v){return t.attempt(dI,p,h)(v)}function p(v){return e(v)}function h(v){return l._balanced=!0,n(v)}}function mI(t,e,n){return r;function r(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),o}function o(h){return Ot(h)?fc(t,l)(h):l(h)}function l(h){return h===41?p(h):Lk(t,c,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function c(h){return Ot(h)?fc(t,u)(h):p(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?Pk(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function d(h){return Ot(h)?fc(t,p)(h):p(h)}function p(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function gI(t,e,n){const r=this;return o;function o(a){return Ik.call(r,t,l,c,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Yr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function c(a){return n(a)}}function vI(t,e,n){return r;function r(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),o}function o(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),e):n(l)}}const yI={name:"labelStartImage",resolveAll:Tv.resolveAll,tokenize:_I};function _I(t,e,n){const r=this;return o;function o(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),l}function l(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),c):n(a)}function c(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const bI={name:"labelStartLink",resolveAll:Tv.resolveAll,tokenize:xI};function xI(t,e,n){const r=this;return o;function o(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const Am={name:"lineEnding",tokenize:SI};function SI(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),gt(t,e,"linePrefix")}}const kd={name:"thematicBreak",tokenize:wI};function wI(t,e,n){let r=0,o;return l;function l(d){return t.enter("thematicBreak"),c(d)}function c(d){return o=d,a(d)}function a(d){return d===o?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||Je(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===o?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),ft(d)?gt(t,a,"whitespace")(d):a(d))}}const tr={continuation:{tokenize:AI},exit:TI,name:"list",tokenize:EI},CI={partial:!0,tokenize:NI},kI={partial:!0,tokenize:RI};function EI(t,e,n){const r=this,o=r.events[r.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return a;function a(x){const C=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:_g(x)){if(r.containerState.type||(r.containerState.type=C,t.enter(C,{_container:!0})),C==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(kd,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return _g(x)&&++c<10?(t.consume(x),u):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(Uc,r.interrupt?n:p,t.attempt(CI,v,h))}function p(x){return r.containerState.initialBlankLine=!0,l++,v(x)}function h(x){return ft(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),v):n(x)}function v(x){return r.containerState.size=l+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function AI(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Uc,o,l);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,gt(t,e,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!ft(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(kI,e,c)(a))}function c(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,gt(t,t.attempt(tr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function RI(t,e,n){const r=this;return gt(t,o,"listItemIndent",r.containerState.size+1);function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?e(l):n(l)}}function TI(t){t.exit(this.containerState.type)}function NI(t,e,n){const r=this;return gt(t,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const c=r.events[r.events.length-1];return!ft(l)&&c&&c[1].type==="listItemPrefixWhitespace"?e(l):n(l)}}const ex={name:"setextUnderline",resolveTo:DI,tokenize:MI};function DI(t,e){let n=t.length,r,o,l;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(o=n)}else t[n][1].type==="content"&&t.splice(n,1),!l&&t[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",l?(t.splice(o,0,["enter",c,e]),t.splice(l+1,0,["exit",t[r][1],e]),t[r][1].end={...t[l][1].end}):t[r][1]=c,t.push(["exit",c,e]),t}function MI(t,e,n){const r=this;let o;return l;function l(d){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),o=d,c(d)):n(d)}function c(d){return t.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===o?(t.consume(d),a):(t.exit("setextHeadingLineSequence"),ft(d)?gt(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Je(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const jI={tokenize:OI};function OI(t){const e=this,n=t.attempt(Uc,r,t.attempt(this.parser.constructs.flowInitial,o,gt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(B7,o)),"linePrefix")));return n;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function o(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const LI={resolveAll:Bk()},II=zk("string"),PI=zk("text");function zk(t){return{resolveAll:Bk(t==="text"?zI:void 0),tokenize:e};function e(n){const r=this,o=this.parser.constructs[t],l=n.attempt(o,c,a);return c;function c(p){return d(p)?l(p):a(p)}function a(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return d(p)?(n.exit("data"),l(p)):(n.consume(p),u)}function d(p){if(p===null)return!0;const h=o[p];let v=-1;if(h)for(;++v<h.length;){const x=h[v];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function Bk(t){return e;function e(n,r){let o=-1,l;for(;++o<=n.length;)l===void 0?n[o]&&n[o][1].type==="data"&&(l=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==l+2&&(n[l][1].end=n[o-1][1].end,n.splice(l+2,o-l-2),o=l+2),l=void 0);return t?t(n,r):n}}function zI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],o=e.sliceStream(r);let l=o.length,c=-1,a=0,u;for(;l--;){const d=o[l];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)a++,c--;if(c)break;c=-1}else if(d===-2)u=!0,a++;else if(d!==-1){l++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){const d={type:n===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:r.start._bufferIndex+c,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const BI={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:Dk},FI={91:V7},HI={[-2]:Em,[-1]:Em,32:Em},UI={35:X7,42:kd,45:[ex,kd],60:eI,61:ex,95:kd,96:Zb,126:Zb},$I={38:jk,92:Mk},VI={[-5]:Am,[-4]:Am,[-3]:Am,33:yI,38:jk,42:bg,60:[b7,aI],91:bI,92:[K7,Mk],93:Tv,95:bg,96:j7},qI={null:[bg,LI]},WI={null:[42,95]},GI={null:[]},KI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WI,contentInitial:FI,disable:GI,document:BI,flow:UI,flowInitial:HI,insideSpan:qI,string:$I,text:VI},Symbol.toStringTag,{value:"Module"}));function YI(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},l=[];let c=[],a=[];const u={attempt:M(T),check:M(R),consume:_,enter:b,exit:k,interrupt:M(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:C,parser:t,previous:null,sliceSerialize:v,sliceStream:x,write:h};let p=e.tokenize.call(d,u);return e.resolveAll&&l.push(e),d;function h(z){return c=Lr(c,z),y(),c[c.length-1]!==null?[]:(A(e,0),d.events=zf(l,d.events,d),d.events)}function v(z,V){return QI(x(z),V)}function x(z){return XI(c,z)}function C(){const{_bufferIndex:z,_index:V,line:F,column:W,offset:G}=r;return{_bufferIndex:z,_index:V,line:F,column:W,offset:G}}function w(z){o[z.line]=z.column,O()}function y(){let z;for(;r._index<c.length;){const V=c[r._index];if(typeof V=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<V.length;)S(V.charCodeAt(r._bufferIndex));else S(V)}}function S(z){p=p(z)}function _(z){Je(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,O()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=z}function b(z,V){const F=V||{};return F.type=z,F.start=C(),d.events.push(["enter",F,d]),a.push(F),F}function k(z){const V=a.pop();return V.end=C(),d.events.push(["exit",V,d]),V}function T(z,V){A(z,V.from)}function R(z,V){V.restore()}function M(z,V){return F;function F(W,G,q){let X,Y,I,L;return Array.isArray(W)?H(W):"tokenize"in W?H([W]):P(W);function P(ee){return K;function K($){const te=$!==null&&ee[$],re=$!==null&&ee.null,ae=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(re)?re:re?[re]:[]];return H(ae)($)}}function H(ee){return X=ee,Y=0,ee.length===0?q:B(ee[Y])}function B(ee){return K;function K($){return L=j(),I=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?J():ee.tokenize.call(V?Object.assign(Object.create(d),V):d,u,Z,J)($)}}function Z(ee){return z(I,L),G}function J(ee){return L.restore(),++Y<X.length?B(X[Y]):q}}}function A(z,V){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&_r(d.events,V,d.events.length-V,z.resolve(d.events.slice(V),d)),z.resolveTo&&(d.events=z.resolveTo(d.events,d))}function j(){const z=C(),V=d.previous,F=d.currentConstruct,W=d.events.length,G=Array.from(a);return{from:W,restore:q};function q(){r=z,d.previous=V,d.currentConstruct=F,d.events.length=W,a=G,O()}}function O(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function XI(t,e){const n=e.start._index,r=e.start._bufferIndex,o=e.end._index,l=e.end._bufferIndex;let c;if(n===o)c=[t[n].slice(r,l)];else{if(c=t.slice(n,o),r>-1){const a=c[0];typeof a=="string"?c[0]=a.slice(r):c.shift()}l>0&&c.push(t[o].slice(0,l))}return c}function QI(t,e){let n=-1;const r=[];let o;for(;++n<t.length;){const l=t[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
551
|
+
`;break}case-3:{c=`\r
|
|
552
|
+
`;break}case-2:{c=e?" ":" ";break}case-1:{if(!e&&o)continue;c=" ";break}default:c=String.fromCharCode(l)}o=l===-2,r.push(c)}return r.join("")}function ZI(t){const r={constructs:Tk([KI,...(t||{}).extensions||[]]),content:o(h7),defined:[],document:o(m7),flow:o(jI),lazy:{},string:o(II),text:o(PI)};return r;function o(l){return c;function c(a){return YI(r,l,a)}}}function JI(t){for(;!Ok(t););return t}const tx=/[\0\t\n\r]/g;function e9(){let t=1,e="",n=!0,r;return o;function o(l,c,a){const u=[];let d,p,h,v,x;for(l=e+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),h=0,e="",n&&(l.charCodeAt(0)===65279&&h++,n=void 0);h<l.length;){if(tx.lastIndex=h,d=tx.exec(l),v=d&&d.index!==void 0?d.index:l.length,x=l.charCodeAt(v),!d){e=l.slice(h);break}if(x===10&&h===v&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<v&&(u.push(l.slice(h,v)),t+=v-h),x){case 0:{u.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,u.push(-2);t++<p;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}h=v+1}return a&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const t9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function n9(t){return t.replace(t9,r9)}function r9(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),l=o===120||o===88;return Nk(n.slice(l?2:1),l?16:10)}return Rv(n)||t}const Fk={}.hasOwnProperty;function s9(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),i9(n)(JI(ZI(n).document().write(e9()(t,e,!0))))}function i9(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ye),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(je),blockQuote:l(re),characterEscape:j,characterReference:j,codeFenced:l(ae),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(ae,c),codeText:l(se,c),codeTextData:j,data:j,codeFlowValue:j,definition:l(_e),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Re),hardBreakEscape:l(ze),hardBreakTrailing:l(ze),htmlFlow:l(ce,c),htmlFlowData:j,htmlText:l(ce,c),htmlTextData:j,image:l(Te),label:c,link:l(ye),listItem:l(Fe),listItemValue:v,listOrdered:l(Pe,h),listUnordered:l(Pe),paragraph:l(ve),reference:B,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(je),strong:l(Ne),thematicBreak:l(Ce)},exit:{atxHeading:u(),atxHeadingSequence:T,autolink:u(),autolinkEmail:te,autolinkProtocol:$,blockQuote:u(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,characterReference:K,codeFenced:u(y),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:C,codeFlowValue:O,codeIndented:u(S),codeText:u(G),codeTextData:O,data:O,definition:u(),definitionDestinationString:k,definitionLabelString:_,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(V),hardBreakTrailing:u(V),htmlFlow:u(F),htmlFlowData:O,htmlText:u(W),htmlTextData:O,image:u(X),label:I,labelText:Y,lineEnding:z,link:u(q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:L,resourceTitleString:P,resource:H,setextHeading:u(A),setextHeadingLineSequence:M,setextHeadingText:R,strong:u(),thematicBreak:u()}};Hk(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let me={type:"root",children:[]};const ke={stack:[me],tokenStack:[],config:e,enter:a,exit:d,buffer:c,resume:p,data:n},De=[];let Be=-1;for(;++Be<oe.length;)if(oe[Be][1].type==="listOrdered"||oe[Be][1].type==="listUnordered")if(oe[Be][0]==="enter")De.push(Be);else{const nt=De.pop();Be=o(oe,nt,Be)}for(Be=-1;++Be<oe.length;){const nt=e[oe[Be][0]];Fk.call(nt,oe[Be][1].type)&&nt[oe[Be][1].type].call(Object.assign({sliceSerialize:oe[Be][2].sliceSerialize},ke),oe[Be][1])}if(ke.tokenStack.length>0){const nt=ke.tokenStack[ke.tokenStack.length-1];(nt[1]||nx).call(ke,void 0,nt[0])}for(me.position={start:wi(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:wi(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<e.transforms.length;)me=e.transforms[Be](me)||me;return me}function o(oe,me,ke){let De=me-1,Be=-1,nt=!1,Ye,Ue,Me,We;for(;++De<=ke;){const Xe=oe[De];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Be++:Be--,We=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ye&&!We&&!Be&&!Me&&(Me=De),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!Be&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Be===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ye){let vt=De;for(Ue=void 0;vt--;){const Lt=oe[vt];if(Lt[1].type==="lineEnding"||Lt[1].type==="lineEndingBlank"){if(Lt[0]==="exit")continue;Ue&&(oe[Ue][1].type="lineEndingBlank",nt=!0),Lt[1].type="lineEnding",Ue=vt}else if(!(Lt[1].type==="linePrefix"||Lt[1].type==="blockQuotePrefix"||Lt[1].type==="blockQuotePrefixWhitespace"||Lt[1].type==="blockQuoteMarker"||Lt[1].type==="listItemIndent"))break}Me&&(!Ue||Me<Ue)&&(Ye._spread=!0),Ye.end=Object.assign({},Ue?oe[Ue][1].start:Xe[1].end),oe.splice(Ue||De,0,["exit",Ye,Xe[2]]),De++,ke++}if(Xe[1].type==="listItemPrefix"){const vt={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ye=vt,oe.splice(De,0,["enter",vt,Xe[2]]),De++,ke++,Me=void 0,We=!0}}}return oe[me][1]._spread=nt,ke}function l(oe,me){return ke;function ke(De){a.call(this,oe(De),De),me&&me.call(this,De)}}function c(){this.stack.push({type:"fragment",children:[]})}function a(oe,me,ke){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([me,ke||void 0]),oe.position={start:wi(me.start),end:void 0}}function u(oe){return me;function me(ke){oe&&oe.call(this,ke),d.call(this,ke)}}function d(oe,me){const ke=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==oe.type&&(me?me.call(this,oe,De[0]):(De[1]||nx).call(this,oe,De[0]));else throw new Error("Cannot close `"+oe.type+"` ("+dc({start:oe.start,end:oe.end})+"): it’s not open");ke.position.end=wi(oe.end)}function p(){return Av(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(oe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function x(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.lang=oe}function C(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.meta=oe}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/(\r?\n|\r)$/g,"")}function _(oe){const me=this.resume(),ke=this.stack[this.stack.length-1];ke.label=me,ke.identifier=Yr(this.sliceSerialize(oe)).toLowerCase()}function b(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function k(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function T(oe){const me=this.stack[this.stack.length-1];if(!me.depth){const ke=this.sliceSerialize(oe).length;me.depth=ke}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function M(oe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function j(oe){const ke=this.stack[this.stack.length-1].children;let De=ke[ke.length-1];(!De||De.type!=="text")&&(De=Ae(),De.position={start:wi(oe.start),end:void 0},ke.push(De)),this.stack.push(De)}function O(oe){const me=this.stack.pop();me.value+=this.sliceSerialize(oe),me.position.end=wi(oe.end)}function z(oe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=me.children[me.children.length-1];ke.position.end=wi(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(j.call(this,oe),O.call(this,oe))}function V(){this.data.atHardBreak=!0}function F(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function W(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function G(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function q(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Y(oe){const me=this.sliceSerialize(oe),ke=this.stack[this.stack.length-2];ke.label=n9(me),ke.identifier=Yr(me).toLowerCase()}function I(){const oe=this.stack[this.stack.length-1],me=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const De=oe.children;ke.children=De}else ke.alt=me}function L(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function P(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function H(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Z(oe){const me=this.resume(),ke=this.stack[this.stack.length-1];ke.label=me,ke.identifier=Yr(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function J(oe){this.data.characterReferenceType=oe.type}function ee(oe){const me=this.sliceSerialize(oe),ke=this.data.characterReferenceType;let De;ke?(De=Nk(me,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Rv(me);const Be=this.stack[this.stack.length-1];Be.value+=De}function K(oe){const me=this.stack.pop();me.position.end=wi(oe.end)}function $(oe){O.call(this,oe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(oe)}function te(oe){O.call(this,oe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(oe)}function re(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function ce(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function Pe(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Fe(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function Ne(){return{type:"strong",children:[]}}function Ae(){return{type:"text",value:""}}function Ce(){return{type:"thematicBreak"}}}function wi(t){return{line:t.line,column:t.column,offset:t.offset}}function Hk(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Hk(t,r):o9(t,r)}}function o9(t,e){let n;for(n in e)if(Fk.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function nx(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+dc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+dc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+dc({start:e.start,end:e.end})+") is still open")}function a9(t){const e=this;e.parser=n;function n(r){return s9(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function l9(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function c9(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
553
|
+
`}]}function u9(t,e){const n=e.value?e.value+`
|
|
554
|
+
`:"",r={},o=e.lang?e.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(l.data={meta:e.meta}),t.patch(e,l),l=t.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(e,l),l}function d9(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function f9(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function h9(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),o=el(r.toLowerCase()),l=t.footnoteOrder.indexOf(r);let c,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),c=t.footnoteOrder.length):c=l+1,a+=1,t.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function p9(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function m9(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Uk(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const o=t.all(e),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function g9(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Uk(t,e);const o={src:el(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const l={type:"element",tagName:"img",properties:o,children:[]};return t.patch(e,l),t.applyData(e,l)}function v9(t,e){const n={src:el(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function y9(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function _9(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Uk(t,e);const o={href:el(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const l={type:"element",tagName:"a",properties:o,children:t.all(e)};return t.patch(e,l),t.applyData(e,l)}function b9(t,e){const n={href:el(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function x9(t,e,n){const r=t.all(e),o=n?S9(n):$k(e),l={},c=[];if(typeof e.checked=="boolean"){const p=r[0];let h;p&&p.type==="element"&&p.tagName==="p"?h=p:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const p=r[a];(o||a!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
555
|
+
`}),p.type==="element"&&p.tagName==="p"&&!o?c.push(...p.children):c.push(p)}const u=r[r.length-1];u&&(o||u.type!=="element"||u.tagName!=="p")&&c.push({type:"text",value:`
|
|
556
|
+
`});const d={type:"element",tagName:"li",properties:l,children:c};return t.patch(e,d),t.applyData(e,d)}function S9(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=$k(n[r])}return e}function $k(t){const e=t.spread;return e==null?t.children.length>1:e}function w9(t,e){const n={},r=t.all(e);let o=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,l),t.applyData(e,l)}function C9(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function k9(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function E9(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function A9(t,e){const n=t.all(e),r=n.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],c),o.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=wv(e.children[1]),u=Sk(e.children[e.children.length-1]);a&&u&&(c.position={start:a,end:u}),o.push(c)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(e,l),t.applyData(e,l)}function R9(t,e,n){const r=n?n.children:void 0,l=(r?r.indexOf(e):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,a=c?c.length:e.children.length;let u=-1;const d=[];for(;++u<a;){const h=e.children[u],v={},x=c?c[u]:void 0;x&&(v.align=x);let C={type:"element",tagName:l,properties:v,children:[]};h&&(C.children=t.all(h),t.patch(h,C),C=t.applyData(h,C)),d.push(C)}const p={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,p),t.applyData(e,p)}function T9(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const rx=9,sx=32;function N9(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),o=0;const l=[];for(;r;)l.push(ix(e.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(e);return l.push(ix(e.slice(o),o>0,!1)),l.join("")}function ix(t,e,n){let r=0,o=t.length;if(e){let l=t.codePointAt(r);for(;l===rx||l===sx;)r++,l=t.codePointAt(r)}if(n){let l=t.codePointAt(o-1);for(;l===rx||l===sx;)o--,l=t.codePointAt(o-1)}return o>r?t.slice(r,o):""}function D9(t,e){const n={type:"text",value:N9(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function M9(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const j9={blockquote:l9,break:c9,code:u9,delete:d9,emphasis:f9,footnoteReference:h9,heading:p9,html:m9,imageReference:g9,image:v9,inlineCode:y9,linkReference:_9,link:b9,listItem:x9,list:w9,paragraph:C9,root:k9,strong:E9,table:A9,tableCell:T9,tableRow:R9,text:D9,thematicBreak:M9,toml:pd,yaml:pd,definition:pd,footnoteDefinition:pd};function pd(){}const Vk=-1,Bf=0,hc=1,Wd=2,Nv=3,Dv=4,Mv=5,jv=6,qk=7,Wk=8,ox=typeof self=="object"?self:globalThis,O9=(t,e)=>{const n=(o,l)=>(t.set(l,o),o),r=o=>{if(t.has(o))return t.get(o);const[l,c]=e[o];switch(l){case Bf:case Vk:return n(c,o);case hc:{const a=n([],o);for(const u of c)a.push(r(u));return a}case Wd:{const a=n({},o);for(const[u,d]of c)a[r(u)]=r(d);return a}case Nv:return n(new Date(c),o);case Dv:{const{source:a,flags:u}=c;return n(new RegExp(a,u),o)}case Mv:{const a=n(new Map,o);for(const[u,d]of c)a.set(r(u),r(d));return a}case jv:{const a=n(new Set,o);for(const u of c)a.add(r(u));return a}case qk:{const{name:a,message:u}=c;return n(new ox[a](u),o)}case Wk:return n(BigInt(c),o);case"BigInt":return n(Object(BigInt(c)),o);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:a}=new Uint8Array(c);return n(new DataView(a),c)}}return n(new ox[l](c),o)};return r},ax=t=>O9(new Map,t)(0),xa="",{toString:L9}={},{keys:I9}=Object,ac=t=>{const e=typeof t;if(e!=="object"||!t)return[Bf,e];const n=L9.call(t).slice(8,-1);switch(n){case"Array":return[hc,xa];case"Object":return[Wd,xa];case"Date":return[Nv,xa];case"RegExp":return[Dv,xa];case"Map":return[Mv,xa];case"Set":return[jv,xa];case"DataView":return[hc,n]}return n.includes("Array")?[hc,n]:n.includes("Error")?[qk,n]:[Wd,n]},md=([t,e])=>t===Bf&&(e==="function"||e==="symbol"),P9=(t,e,n,r)=>{const o=(c,a)=>{const u=r.push(c)-1;return n.set(a,u),u},l=c=>{if(n.has(c))return n.get(c);let[a,u]=ac(c);switch(a){case Bf:{let p=c;switch(u){case"bigint":a=Wk,p=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return o([Vk],c)}return o([a,p],c)}case hc:{if(u){let v=c;return u==="DataView"?v=new Uint8Array(c.buffer):u==="ArrayBuffer"&&(v=new Uint8Array(c)),o([u,[...v]],c)}const p=[],h=o([a,p],c);for(const v of c)p.push(l(v));return h}case Wd:{if(u)switch(u){case"BigInt":return o([u,c.toString()],c);case"Boolean":case"Number":case"String":return o([u,c.valueOf()],c)}if(e&&"toJSON"in c)return l(c.toJSON());const p=[],h=o([a,p],c);for(const v of I9(c))(t||!md(ac(c[v])))&&p.push([l(v),l(c[v])]);return h}case Nv:return o([a,c.toISOString()],c);case Dv:{const{source:p,flags:h}=c;return o([a,{source:p,flags:h}],c)}case Mv:{const p=[],h=o([a,p],c);for(const[v,x]of c)(t||!(md(ac(v))||md(ac(x))))&&p.push([l(v),l(x)]);return h}case jv:{const p=[],h=o([a,p],c);for(const v of c)(t||!md(ac(v)))&&p.push(l(v));return h}}const{message:d}=c;return o([a,{name:u,message:d}],c)};return l},lx=(t,{json:e,lossy:n}={})=>{const r=[];return P9(!(e||n),!!e,new Map,r)(t),r},Gd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?ax(lx(t,e)):structuredClone(t):(t,e)=>ax(lx(t,e));function z9(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function B9(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function F9(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||z9,r=t.options.footnoteBackLabel||B9,o=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const p=t.all(d),h=String(d.identifier).toUpperCase(),v=el(h.toLowerCase());let x=0;const C=[],w=t.footnoteCounts.get(h);for(;w!==void 0&&++x<=w;){C.length>0&&C.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,x);typeof _=="string"&&(_={type:"text",value:_}),C.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const y=p[p.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const _=y.children[y.children.length-1];_&&_.type==="text"?_.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...C)}else p.push(...C);const S={type:"element",tagName:"li",properties:{id:e+"fn-"+v},children:t.wrap(p,!0)};t.patch(d,S),a.push(S)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Gd(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
557
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
|
|
558
|
+
`}]}}const Ff=(function(t){if(t==null)return V9;if(typeof t=="function")return Hf(t);if(typeof t=="object")return Array.isArray(t)?H9(t):U9(t);if(typeof t=="string")return $9(t);throw new Error("Expected function, string, or object as test")});function H9(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ff(t[n]);return Hf(r);function r(...o){let l=-1;for(;++l<e.length;)if(e[l].apply(this,o))return!0;return!1}}function U9(t){const e=t;return Hf(n);function n(r){const o=r;let l;for(l in t)if(o[l]!==e[l])return!1;return!0}}function $9(t){return Hf(e);function e(n){return n&&n.type===t}}function Hf(t){return e;function e(n,r,o){return!!(q9(n)&&t.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function V9(){return!0}function q9(t){return t!==null&&typeof t=="object"&&"type"in t}const Gk=[],W9=!0,xg=!1,G9="skip";function Kk(t,e,n,r){let o;typeof e=="function"&&typeof n!="function"?(r=n,n=e):o=e;const l=Ff(o),c=r?-1:1;a(t,void 0,[])();function a(u,d,p){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const x=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=Gk,C,w,y;if((!e||l(u,d,p[p.length-1]||void 0))&&(x=K9(n(u,p)),x[0]===xg))return x;if("children"in u&&u.children){const S=u;if(S.children&&x[0]!==G9)for(w=(r?S.children.length:-1)+c,y=p.concat(S);w>-1&&w<S.children.length;){const _=S.children[w];if(C=a(_,w,y)(),C[0]===xg)return C;w=typeof C[1]=="number"?C[1]:w+c}}return x}}}function K9(t){return Array.isArray(t)?t:typeof t=="number"?[W9,t]:t==null?Gk:[t]}function Ov(t,e,n,r){let o,l,c;typeof e=="function"&&typeof n!="function"?(l=void 0,c=e,o=n):(l=e,c=n,o=r),Kk(t,l,a,o);function a(u,d){const p=d[d.length-1],h=p?p.children.indexOf(u):void 0;return c(u,h,p)}}const Sg={}.hasOwnProperty,Y9={};function X9(t,e){const n=e||Y9,r=new Map,o=new Map,l=new Map,c={...j9,...n.handlers},a={all:d,applyData:Z9,definitionById:r,footnoteById:o,footnoteCounts:l,footnoteOrder:[],handlers:c,one:u,options:n,patch:Q9,wrap:eP};return Ov(t,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:o,v=String(p.identifier).toUpperCase();h.has(v)||h.set(v,p)}}),a;function u(p,h){const v=p.type,x=a.handlers[v];if(Sg.call(a.handlers,v)&&x)return x(a,p,h);if(a.options.passThrough&&a.options.passThrough.includes(v)){if("children"in p){const{children:w,...y}=p,S=Gd(y);return S.children=a.all(p),S}return Gd(p)}return(a.options.unknownHandler||J9)(a,p,h)}function d(p){const h=[];if("children"in p){const v=p.children;let x=-1;for(;++x<v.length;){const C=a.one(v[x],p);if(C){if(x&&v[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=cx(C.value)),!Array.isArray(C)&&C.type==="element")){const w=C.children[0];w&&w.type==="text"&&(w.value=cx(w.value))}Array.isArray(C)?h.push(...C):h.push(C)}}}return h}}function Q9(t,e){t.position&&(e.position=BL(t))}function Z9(t,e){let n=e;if(t&&t.data){const r=t.data.hName,o=t.data.hChildren,l=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const c="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,Gd(l)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function J9(t,e){const n=e.data||{},r="value"in e&&!(Sg.call(n,"hProperties")||Sg.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function eP(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
559
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
560
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
561
|
+
`}),n}function cx(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function ux(t,e){const n=X9(t,e),r=n.one(t,void 0),o=F9(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&l.children.push({type:"text",value:`
|
|
562
|
+
`},o),l}function tP(t,e){return t&&"run"in t?async function(n,r){const o=ux(n,{file:r,...e});await t.run(o,r)}:function(n,r){return ux(n,{file:r,...t||e})}}function dx(t){if(t)throw t}var Rm,fx;function nP(){if(fx)return Rm;fx=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},l=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var p=t.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!h)return!1;var v;for(v in d);return typeof v>"u"||t.call(d,v)},c=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},a=function(d,p){if(p==="__proto__")if(t.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Rm=function u(){var d,p,h,v,x,C,w=arguments[0],y=1,S=arguments.length,_=!1;for(typeof w=="boolean"&&(_=w,w=arguments[1]||{},y=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});y<S;++y)if(d=arguments[y],d!=null)for(p in d)h=a(w,p),v=a(d,p),w!==v&&(_&&v&&(l(v)||(x=o(v)))?(x?(x=!1,C=h&&o(h)?h:[]):C=h&&l(h)?h:{},c(w,{name:p,newValue:u(_,C,v)})):typeof v<"u"&&c(w,{name:p,newValue:v}));return w},Rm}var rP=nP();const Tm=Xd(rP);function wg(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function sP(){const t=[],e={run:n,use:r};return e;function n(...o){let l=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);a(null,...o);function a(u,...d){const p=t[++l];let h=-1;if(u){c(u);return}for(;++h<o.length;)(d[h]===null||d[h]===void 0)&&(d[h]=o[h]);o=d,p?iP(p,a)(...d):c(null,...d)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),e}}function iP(t,e){let n;return r;function r(...c){const a=t.length>c.length;let u;a&&c.push(o);try{u=t.apply(this,c)}catch(d){const p=d;if(a&&n)throw p;return o(p)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,o):u instanceof Error?o(u):l(u))}function o(c,...a){n||(n=!0,e(c,...a))}function l(c){o(null,c)}}const os={basename:oP,dirname:aP,extname:lP,join:cP,sep:"/"};function oP(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');$c(t);let n=0,r=-1,o=t.length,l;if(e===void 0||e.length===0||e.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(l){n=o+1;break}}else r<0&&(l=!0,r=o+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let c=-1,a=e.length-1;for(;o--;)if(t.codePointAt(o)===47){if(l){n=o+1;break}}else c<0&&(l=!0,c=o+1),a>-1&&(t.codePointAt(o)===e.codePointAt(a--)?a<0&&(r=o):(a=-1,r=c));return n===r?r=c:r<0&&(r=t.length),t.slice(n,r)}function aP(t){if($c(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function lP(t){$c(t);let e=t.length,n=-1,r=0,o=-1,l=0,c;for(;e--;){const a=t.codePointAt(e);if(a===47){if(c){r=e+1;break}continue}n<0&&(c=!0,n=e+1),a===46?o<0?o=e:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||n<0||l===0||l===1&&o===n-1&&o===r+1?"":t.slice(o,n)}function cP(...t){let e=-1,n;for(;++e<t.length;)$c(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":uP(n)}function uP(t){$c(t);const e=t.codePointAt(0)===47;let n=dP(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function dP(t,e){let n="",r=0,o=-1,l=0,c=-1,a,u;for(;++c<=t.length;){if(c<t.length)a=t.codePointAt(c);else{if(a===47)break;a=47}if(a===47){if(!(o===c-1||l===1))if(o!==c-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),o=c,l=0;continue}}else if(n.length>0){n="",r=0,o=c,l=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(o+1,c):n=t.slice(o+1,c),r=c-o-1;o=c,l=0}else a===46&&l>-1?l++:l=-1}return n}function $c(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const fP={cwd:hP};function hP(){return"/"}function Cg(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function pP(t){if(typeof t=="string")t=new URL(t);else if(!Cg(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return mP(t)}function mP(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(e)}const Nm=["history","path","basename","stem","extname","dirname"];class Yk{constructor(e){let n;e?Cg(e)?n={path:e}:typeof e=="string"||gP(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":fP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Nm.length;){const l=Nm[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let o;for(o in n)Nm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?os.basename(this.path):void 0}set basename(e){Mm(e,"basename"),Dm(e,"basename"),this.path=os.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?os.dirname(this.path):void 0}set dirname(e){hx(this.basename,"dirname"),this.path=os.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?os.extname(this.path):void 0}set extname(e){if(Dm(e,"extname"),hx(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=os.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Cg(e)&&(e=pP(e)),Mm(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?os.basename(this.path,this.extname):void 0}set stem(e){Mm(e,"stem"),Dm(e,"stem"),this.path=os.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const o=this.message(e,n,r);throw o.fatal=!0,o}info(e,n,r){const o=this.message(e,n,r);return o.fatal=void 0,o}message(e,n,r){const o=new Ln(e,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Dm(t,e){if(t&&t.includes(os.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+os.sep+"`")}function Mm(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function hx(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function gP(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const vP=(function(t){const r=this.constructor.prototype,o=r[t],l=function(){return o.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),yP={}.hasOwnProperty;class Lv extends vP{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=sP()}copy(){const e=new Lv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Tm(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Lm("data",this.frozen),this.namespace[e]=n,this):yP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Lm("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(e,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=gd(e),r=this.parser||this.Parser;return jm("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),jm("process",this.parser||this.Parser),Om("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(l,c){const a=gd(e),u=r.parse(a);r.run(u,a,function(p,h,v){if(p||!h||!v)return d(p);const x=h,C=r.stringify(x,v);xP(C)?v.value=C:v.result=C,d(p,v)});function d(p,h){p||!h?c(p):l?l(h):n(void 0,h)}}}processSync(e){let n=!1,r;return this.freeze(),jm("processSync",this.parser||this.Parser),Om("processSync",this.compiler||this.Compiler),this.process(e,o),mx("processSync","process",n),r;function o(l,c){n=!0,dx(l),r=c}}run(e,n,r){px(e),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(c,a){const u=gd(n);o.run(e,u,d);function d(p,h,v){const x=h||e;p?a(p):c?c(x):r(void 0,x,v)}}}runSync(e,n){let r=!1,o;return this.run(e,n,l),mx("runSync","run",r),o;function l(c,a){dx(c),o=a,r=!0}}stringify(e,n){this.freeze();const r=gd(n),o=this.compiler||this.Compiler;return Om("stringify",o),px(e),o(e,r)}use(e,...n){const r=this.attachers,o=this.namespace;if(Lm("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):c(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function l(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...h]=d;u(p,h)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(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");a(d.plugins),d.settings&&(o.settings=Tm(!0,o.settings,d.settings))}function a(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const h=d[p];l(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,p){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===d){v=h;break}if(v===-1)r.push([d,...p]);else if(p.length>0){let[x,...C]=p;const w=r[v][1];wg(w)&&wg(x)&&(x=Tm(!0,w,x)),r[v]=[d,x,...C]}}}}const _P=new Lv().freeze();function jm(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Om(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Lm(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function px(t){if(!wg(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function mx(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function gd(t){return bP(t)?t:new Yk(t)}function bP(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function xP(t){return typeof t=="string"||SP(t)}function SP(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const wP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gx=[],vx={allowDangerousHtml:!0},CP=/^(https?|ircs?|mailto|xmpp)$/i,kP=[{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 EP(t){const e=AP(t),n=RP(t);return TP(e.runSync(e.parse(n),n),t)}function AP(t){const e=t.rehypePlugins||gx,n=t.remarkPlugins||gx,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...vx}:vx;return _P().use(a9).use(n).use(tP,r).use(e)}function RP(t){const e=t.children||"",n=new Yk;return typeof e=="string"&&(n.value=e),n}function TP(t,e){const n=e.allowedElements,r=e.allowElement,o=e.components,l=e.disallowedElements,c=e.skipHtml,a=e.unwrapDisallowed,u=e.urlTransform||NP;for(const p of kP)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+wP+p.id,void 0);return Ov(t,d),VL(t,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function d(p,h,v){if(p.type==="raw"&&v&&typeof h=="number")return c?v.children.splice(h,1):v.children[h]={type:"text",value:p.value},h;if(p.type==="element"){let x;for(x in km)if(Object.hasOwn(km,x)&&Object.hasOwn(p.properties,x)){const C=p.properties[x],w=km[x];(w===null||w.includes(p.tagName))&&(p.properties[x]=u(String(C||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!x&&r&&typeof h=="number"&&(x=!r(p,h,v)),x&&v&&typeof h=="number")return a&&p.children?v.children.splice(h,1,...p.children):v.children.splice(h,1),h}}}function NP(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),o=t.indexOf("/");return e===-1||o!==-1&&e>o||n!==-1&&e>n||r!==-1&&e>r||CP.test(t.slice(0,e))?t:""}function yx(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(e);for(;o!==-1;)r++,o=n.indexOf(e,o+e.length);return r}function DP(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function MP(t,e,n){const o=Ff((n||{}).ignore||[]),l=jP(e);let c=-1;for(;++c<l.length;)Kk(t,"text",a);function a(d,p){let h=-1,v;for(;++h<p.length;){const x=p[h],C=v?v.children:void 0;if(o(x,C?C.indexOf(x):void 0,v))return;v=x}if(v)return u(d,p)}function u(d,p){const h=p[p.length-1],v=l[c][0],x=l[c][1];let C=0;const y=h.children.indexOf(d);let S=!1,_=[];v.lastIndex=0;let b=v.exec(d.value);for(;b;){const k=b.index,T={index:b.index,input:b.input,stack:[...p,d]};let R=x(...b,T);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?v.lastIndex=k+1:(C!==k&&_.push({type:"text",value:d.value.slice(C,k)}),Array.isArray(R)?_.push(...R):R&&_.push(R),C=k+b[0].length,S=!0),!v.global)break;b=v.exec(d.value)}return S?(C<d.value.length&&_.push({type:"text",value:d.value.slice(C)}),h.children.splice(y,1,..._)):_=[d],y+_.length}}function jP(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const o=n[r];e.push([OP(o[0]),LP(o[1])])}return e}function OP(t){return typeof t=="string"?new RegExp(DP(t),"g"):t}function LP(t){return typeof t=="function"?t:function(){return t}}const Im="phrasing",Pm=["autolink","link","image","label"];function IP(){return{transforms:[$P],enter:{literalAutolink:zP,literalAutolinkEmail:zm,literalAutolinkHttp:zm,literalAutolinkWww:zm},exit:{literalAutolink:UP,literalAutolinkEmail:HP,literalAutolinkHttp:BP,literalAutolinkWww:FP}}}function PP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Im,notInConstruct:Pm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Im,notInConstruct:Pm},{character:":",before:"[ps]",after:"\\/",inConstruct:Im,notInConstruct:Pm}]}}function zP(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function zm(t){this.config.enter.autolinkProtocol.call(this,t)}function BP(t){this.config.exit.autolinkProtocol.call(this,t)}function FP(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function HP(t){this.config.exit.autolinkEmail.call(this,t)}function UP(t){this.exit(t)}function $P(t){MP(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qP]],{ignore:["link","linkReference"]})}function VP(t,e,n,r,o){let l="";if(!Xk(o)||(/^w/i.test(e)&&(n=e+n,e="",l="http://"),!WP(n)))return!1;const c=GP(n+r);if(!c[0])return!1;const a={type:"link",title:null,url:l+e+c[0],children:[{type:"text",value:e+c[0]}]};return c[1]?[a,{type:"text",value:c[1]}]:a}function qP(t,e,n,r){return!Xk(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function WP(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function GP(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const o=yx(t,"(");let l=yx(t,")");for(;r!==-1&&o>l;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[t,n]}function Xk(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||wo(n)||Pf(n))&&(!e||n!==47)}Qk.peek=nz;function KP(){this.buffer()}function YP(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function XP(){this.buffer()}function QP(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function ZP(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Yr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function JP(t){this.exit(t)}function ez(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Yr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function tz(t){this.exit(t)}function nz(){return"["}function Qk(t,e,n,r){const o=n.createTracker(r);let l=o.move("[^");const c=n.enter("footnoteReference"),a=n.enter("reference");return l+=o.move(n.safe(n.associationId(t),{after:"]",before:l})),a(),c(),l+=o.move("]"),l}function rz(){return{enter:{gfmFootnoteCallString:KP,gfmFootnoteCall:YP,gfmFootnoteDefinitionLabelString:XP,gfmFootnoteDefinition:QP},exit:{gfmFootnoteCallString:ZP,gfmFootnoteCall:JP,gfmFootnoteDefinitionLabelString:ez,gfmFootnoteDefinition:tz}}}function sz(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,l,c){const a=l.createTracker(c);let u=a.move("[^");const d=l.enter("footnoteDefinition"),p=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),p(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((e?`
|
|
563
|
+
`:" ")+l.indentLines(l.containerFlow(r,a.current()),e?Zk:iz))),d(),u}}function iz(t,e,n){return e===0?t:Zk(t,e,n)}function Zk(t,e,n){return(n?"":" ")+t}const oz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jk.peek=dz;function az(){return{canContainEols:["delete"],enter:{strikethrough:cz},exit:{strikethrough:uz}}}function lz(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oz}],handlers:{delete:Jk}}}function cz(t){this.enter({type:"delete",children:[]},t)}function uz(t){this.exit(t)}function Jk(t,e,n,r){const o=n.createTracker(r),l=n.enter("strikethrough");let c=o.move("~~");return c+=n.containerPhrasing(t,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),l(),c}function dz(){return"~"}function fz(t){return t.length}function hz(t,e){const n=e||{},r=(n.align||[]).concat(),o=n.stringLength||fz,l=[],c=[],a=[],u=[];let d=0,p=-1;for(;++p<t.length;){const w=[],y=[];let S=-1;for(t[p].length>d&&(d=t[p].length);++S<t[p].length;){const _=pz(t[p][S]);if(n.alignDelimiters!==!1){const b=o(_);y[S]=b,(u[S]===void 0||b>u[S])&&(u[S]=b)}w.push(_)}c[p]=w,a[p]=y}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)l[h]=_x(r[h]);else{const w=_x(r);for(;++h<d;)l[h]=w}h=-1;const v=[],x=[];for(;++h<d;){const w=l[h];let y="",S="";w===99?(y=":",S=":"):w===108?y=":":w===114&&(S=":");let _=n.alignDelimiters===!1?1:Math.max(1,u[h]-y.length-S.length);const b=y+"-".repeat(_)+S;n.alignDelimiters!==!1&&(_=y.length+_+S.length,_>u[h]&&(u[h]=_),x[h]=_),v[h]=b}c.splice(1,0,v),a.splice(1,0,x),p=-1;const C=[];for(;++p<c.length;){const w=c[p],y=a[p];h=-1;const S=[];for(;++h<d;){const _=w[h]||"";let b="",k="";if(n.alignDelimiters!==!1){const T=u[h]-(y[h]||0),R=l[h];R===114?b=" ".repeat(T):R===99?T%2?(b=" ".repeat(T/2+.5),k=" ".repeat(T/2-.5)):(b=" ".repeat(T/2),k=b):k=" ".repeat(T)}n.delimiterStart!==!1&&!h&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||h)&&S.push(" "),n.alignDelimiters!==!1&&S.push(b),S.push(_),n.alignDelimiters!==!1&&S.push(k),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&S.push("|")}C.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return C.join(`
|
|
564
|
+
`)}function pz(t){return t==null?"":String(t)}function _x(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function mz(t,e,n,r){const o=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const c=n.indentLines(n.containerFlow(t,l.current()),gz);return o(),c}function gz(t,e,n){return">"+(n?"":" ")+t}function vz(t,e){return bx(t,e.inConstruct,!0)&&!bx(t,e.notInConstruct,!1)}function bx(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function xx(t,e,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
565
|
+
`&&vz(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
566
|
+
`}function yz(t,e){const n=String(t);let r=n.indexOf(e),o=r,l=0,c=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++l>c&&(c=l):l=1,o=r+e.length,r=n.indexOf(e,o);return c}function _z(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function bz(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function xz(t,e,n,r){const o=bz(n),l=t.value||"",c=o==="`"?"GraveAccent":"Tilde";if(_z(t,n)){const h=n.enter("codeIndented"),v=n.indentLines(l,Sz);return h(),v}const a=n.createTracker(r),u=o.repeat(Math.max(yz(l,o)+1,3)),d=n.enter("codeFenced");let p=a.move(u);if(t.lang){const h=n.enter(`codeFencedLang${c}`);p+=a.move(n.safe(t.lang,{before:p,after:" ",encode:["`"],...a.current()})),h()}if(t.lang&&t.meta){const h=n.enter(`codeFencedMeta${c}`);p+=a.move(" "),p+=a.move(n.safe(t.meta,{before:p,after:`
|
|
567
|
+
`,encode:["`"],...a.current()})),h()}return p+=a.move(`
|
|
568
|
+
`),l&&(p+=a.move(l+`
|
|
569
|
+
`)),p+=a.move(u),d(),p}function Sz(t,e,n){return(n?"":" ")+t}function Iv(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function wz(t,e,n,r){const o=Iv(n),l=o==='"'?"Quote":"Apostrophe",c=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(t),{before:d,after:"]",...u.current()})),d+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":`
|
|
570
|
+
`,...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+o),d+=u.move(n.safe(t.title,{before:d,after:o,...u.current()})),d+=u.move(o),a()),c(),d}function Cz(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function kc(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Kd(t,e,n){const r=Ia(t),o=Ia(e);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}eE.peek=kz;function eE(t,e,n,r){const o=Cz(n),l=n.enter("emphasis"),c=n.createTracker(r),a=c.move(o);let u=c.move(n.containerPhrasing(t,{after:o,before:a,...c.current()}));const d=u.charCodeAt(0),p=Kd(r.before.charCodeAt(r.before.length-1),d,o);p.inside&&(u=kc(d)+u.slice(1));const h=u.charCodeAt(u.length-1),v=Kd(r.after.charCodeAt(0),h,o);v.inside&&(u=u.slice(0,-1)+kc(h));const x=c.move(o);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},a+u+x}function kz(t,e,n){return n.options.emphasis||"*"}function Ez(t,e){let n=!1;return Ov(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,xg}),!!((!t.depth||t.depth<3)&&Av(t)&&(e.options.setext||n))}function Az(t,e,n,r){const o=Math.max(Math.min(6,t.depth||1),1),l=n.createTracker(r);if(Ez(t,n)){const p=n.enter("headingSetext"),h=n.enter("phrasing"),v=n.containerPhrasing(t,{...l.current(),before:`
|
|
571
|
+
`,after:`
|
|
572
|
+
`});return h(),p(),v+`
|
|
573
|
+
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
574
|
+
`))+1))}const c="#".repeat(o),a=n.enter("headingAtx"),u=n.enter("phrasing");l.move(c+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
|
|
575
|
+
`,...l.current()});return/^[\t ]/.test(d)&&(d=kc(d.charCodeAt(0))+d.slice(1)),d=d?c+" "+d:c,n.options.closeAtx&&(d+=" "+c),u(),a(),d}tE.peek=Rz;function tE(t){return t.value||""}function Rz(){return"<"}nE.peek=Tz;function nE(t,e,n,r){const o=Iv(n),l=o==='"'?"Quote":"Apostrophe",c=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=n.enter(`title${l}`),d+=u.move(" "+o),d+=u.move(n.safe(t.title,{before:d,after:o,...u.current()})),d+=u.move(o),a()),d+=u.move(")"),c(),d}function Tz(){return"!"}rE.peek=Nz;function rE(t,e,n,r){const o=t.referenceType,l=n.enter("imageReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const d=n.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=p,l(),o==="full"||!d||d!==h?u+=a.move(h+"]"):o==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Nz(){return"!"}sE.peek=Dz;function sE(t,e,n){let r=t.value||"",o="`",l=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const c=n.unsafe[l],a=n.compilePattern(c);let u;if(c.atBreak)for(;u=a.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return o+r+o}function Dz(){return"`"}function iE(t,e){const n=Av(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}oE.peek=Mz;function oE(t,e,n,r){const o=Iv(n),l=o==='"'?"Quote":"Apostrophe",c=n.createTracker(r);let a,u;if(iE(t,n)){const p=n.stack;n.stack=[],a=n.enter("autolink");let h=c.move("<");return h+=c.move(n.containerPhrasing(t,{before:h,after:">",...c.current()})),h+=c.move(">"),a(),n.stack=p,h}a=n.enter("link"),u=n.enter("label");let d=c.move("[");return d+=c.move(n.containerPhrasing(t,{before:d,after:"](",...c.current()})),d+=c.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(u=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),u(),t.title&&(u=n.enter(`title${l}`),d+=c.move(" "+o),d+=c.move(n.safe(t.title,{before:d,after:o,...c.current()})),d+=c.move(o),u()),d+=c.move(")"),a(),d}function Mz(t,e,n){return iE(t,n)?"<":"["}aE.peek=jz;function aE(t,e,n,r){const o=t.referenceType,l=n.enter("linkReference");let c=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...a.current()});return c(),n.stack=p,l(),o==="full"||!d||d!==h?u+=a.move(h+"]"):o==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function jz(){return"["}function Pv(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Oz(t){const e=Pv(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Lz(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function lE(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Iz(t,e,n,r){const o=n.enter("list"),l=n.bulletCurrent;let c=t.ordered?Lz(n):Pv(n);const a=t.ordered?c==="."?")":".":Oz(n);let u=e&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),lE(n)===c&&p){let h=-1;for(;++h<t.children.length;){const v=t.children[h];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(c=a),n.bulletCurrent=c;const d=n.containerFlow(t,r);return n.bulletLastUsed=c,n.bulletCurrent=l,o(),d}function Pz(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function zz(t,e,n,r){const o=Pz(n);let l=n.bulletCurrent||Pv(n);e&&e.type==="list"&&e.ordered&&(l=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+l);let c=l.length+1;(o==="tab"||o==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(c=Math.ceil(c/4)*4);const a=n.createTracker(r);a.move(l+" ".repeat(c-l.length)),a.shift(c);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,a.current()),p);return u(),d;function p(h,v,x){return v?(x?"":" ".repeat(c))+h:(x?l:l+" ".repeat(c-l.length))+h}}function Bz(t,e,n,r){const o=n.enter("paragraph"),l=n.enter("phrasing"),c=n.containerPhrasing(t,r);return l(),o(),c}const Fz=Ff(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Hz(t,e,n,r){return(t.children.some(function(c){return Fz(c)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Uz(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}cE.peek=$z;function cE(t,e,n,r){const o=Uz(n),l=n.enter("strong"),c=n.createTracker(r),a=c.move(o+o);let u=c.move(n.containerPhrasing(t,{after:o,before:a,...c.current()}));const d=u.charCodeAt(0),p=Kd(r.before.charCodeAt(r.before.length-1),d,o);p.inside&&(u=kc(d)+u.slice(1));const h=u.charCodeAt(u.length-1),v=Kd(r.after.charCodeAt(0),h,o);v.inside&&(u=u.slice(0,-1)+kc(h));const x=c.move(o+o);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},a+u+x}function $z(t,e,n){return n.options.strong||"*"}function Vz(t,e,n,r){return n.safe(t.value,r)}function qz(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Wz(t,e,n){const r=(lE(n)+(n.options.ruleSpaces?" ":"")).repeat(qz(n));return n.options.ruleSpaces?r.slice(0,-1):r}const uE={blockquote:mz,break:xx,code:xz,definition:wz,emphasis:eE,hardBreak:xx,heading:Az,html:tE,image:nE,imageReference:rE,inlineCode:sE,link:oE,linkReference:aE,list:Iz,listItem:zz,paragraph:Bz,root:Hz,strong:cE,text:Vz,thematicBreak:Wz};function Gz(){return{enter:{table:Kz,tableData:Sx,tableHeader:Sx,tableRow:Xz},exit:{codeText:Qz,table:Yz,tableData:Bm,tableHeader:Bm,tableRow:Bm}}}function Kz(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function Yz(t){this.exit(t),this.data.inTable=void 0}function Xz(t){this.enter({type:"tableRow",children:[]},t)}function Bm(t){this.exit(t)}function Sx(t){this.enter({type:"tableCell",children:[]},t)}function Qz(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Zz));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function Zz(t,e){return e==="|"?e:t}function Jz(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,o=e.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
576
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:c,tableCell:u,tableRow:a}};function c(x,C,w,y){return d(p(x,w,y),x.align)}function a(x,C,w,y){const S=h(x,w,y),_=d([S]);return _.slice(0,_.indexOf(`
|
|
577
|
+
`))}function u(x,C,w,y){const S=w.enter("tableCell"),_=w.enter("phrasing"),b=w.containerPhrasing(x,{...y,before:l,after:l});return _(),S(),b}function d(x,C){return hz(x,{align:C,alignDelimiters:r,padding:n,stringLength:o})}function p(x,C,w){const y=x.children;let S=-1;const _=[],b=C.enter("table");for(;++S<y.length;)_[S]=h(y[S],C,w);return b(),_}function h(x,C,w){const y=x.children;let S=-1;const _=[],b=C.enter("tableRow");for(;++S<y.length;)_[S]=u(y[S],x,C,w);return b(),_}function v(x,C,w){let y=uE.inlineCode(x,C,w);return w.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function eB(){return{exit:{taskListCheckValueChecked:wx,taskListCheckValueUnchecked:wx,paragraph:nB}}}function tB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rB}}}function wx(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function nB(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=e.children;let l=-1,c;for(;++l<o.length;){const a=o[l];if(a.type==="paragraph"){c=a;break}}c===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function rB(t,e,n,r){const o=t.children[0],l=typeof t.checked=="boolean"&&o&&o.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);l&&a.move(c);let u=uE.listItem(t,e,n,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(p){return p+c}}function sB(){return[IP(),rz(),az(),Gz(),eB()]}function iB(t){return{extensions:[PP(),sz(t),lz(),Jz(t),tB()]}}const oB={tokenize:fB,partial:!0},dE={tokenize:hB,partial:!0},fE={tokenize:pB,partial:!0},hE={tokenize:mB,partial:!0},aB={tokenize:gB,partial:!0},pE={name:"wwwAutolink",tokenize:uB,previous:gE},mE={name:"protocolAutolink",tokenize:dB,previous:vE},Ws={name:"emailAutolink",tokenize:cB,previous:yE},ps={};function lB(){return{text:ps}}let ho=48;for(;ho<123;)ps[ho]=Ws,ho++,ho===58?ho=65:ho===91&&(ho=97);ps[43]=Ws;ps[45]=Ws;ps[46]=Ws;ps[95]=Ws;ps[72]=[Ws,mE];ps[104]=[Ws,mE];ps[87]=[Ws,pE];ps[119]=[Ws,pE];function cB(t,e,n){const r=this;let o,l;return c;function c(h){return!kg(h)||!yE.call(r,r.previous)||zv(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(h))}function a(h){return kg(h)?(t.consume(h),a):h===64?(t.consume(h),u):n(h)}function u(h){return h===46?t.check(aB,p,d)(h):h===45||h===95||On(h)?(l=!0,t.consume(h),u):p(h)}function d(h){return t.consume(h),o=!0,u}function p(h){return l&&o&&$n(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function uB(t,e,n){const r=this;return o;function o(c){return c!==87&&c!==119||!gE.call(r,r.previous)||zv(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(oB,t.attempt(dE,t.attempt(fE,l),n),n)(c))}function l(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(c)}}function dB(t,e,n){const r=this;let o="",l=!1;return c;function c(h){return(h===72||h===104)&&vE.call(r,r.previous)&&!zv(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),t.consume(h),a):n(h)}function a(h){if($n(h)&&o.length<5)return o+=String.fromCodePoint(h),t.consume(h),a;if(h===58){const v=o.toLowerCase();if(v==="http"||v==="https")return t.consume(h),u}return n(h)}function u(h){return h===47?(t.consume(h),l?d:(l=!0,u)):n(h)}function d(h){return h===null||qd(h)||Ot(h)||wo(h)||Pf(h)?n(h):t.attempt(dE,t.attempt(fE,p),n)(h)}function p(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function fB(t,e,n){let r=0;return o;function o(c){return(c===87||c===119)&&r<3?(r++,t.consume(c),o):c===46&&r===3?(t.consume(c),l):n(c)}function l(c){return c===null?n(c):e(c)}}function hB(t,e,n){let r,o,l;return c;function c(d){return d===46||d===95?t.check(hE,u,a)(d):d===null||Ot(d)||wo(d)||d!==45&&Pf(d)?u(d):(l=!0,t.consume(d),c)}function a(d){return d===95?r=!0:(o=r,r=void 0),t.consume(d),c}function u(d){return o||r||!l?n(d):e(d)}}function pB(t,e){let n=0,r=0;return o;function o(c){return c===40?(n++,t.consume(c),o):c===41&&r<n?l(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(hE,e,l)(c):c===null||Ot(c)||wo(c)?e(c):(t.consume(c),o)}function l(c){return c===41&&r++,t.consume(c),o}}function mB(t,e,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),r):a===38?(t.consume(a),l):a===93?(t.consume(a),o):a===60||a===null||Ot(a)||wo(a)?e(a):n(a)}function o(a){return a===null||a===40||a===91||Ot(a)||wo(a)?e(a):r(a)}function l(a){return $n(a)?c(a):n(a)}function c(a){return a===59?(t.consume(a),r):$n(a)?(t.consume(a),c):n(a)}}function gB(t,e,n){return r;function r(l){return t.consume(l),o}function o(l){return On(l)?n(l):e(l)}}function gE(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ot(t)}function vE(t){return!$n(t)}function yE(t){return!(t===47||kg(t))}function kg(t){return t===43||t===45||t===46||t===95||On(t)}function zv(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const vB={tokenize:kB,partial:!0};function yB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SB,continuation:{tokenize:wB},exit:CB}},text:{91:{name:"gfmFootnoteCall",tokenize:xB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_B,resolveTo:bB}}}}function _B(t,e,n){const r=this;let o=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;o--;){const u=r.events[o][1];if(u.type==="labelImage"){c=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!c||!c._balanced)return n(u);const d=Yr(r.sliceSerialize({start:c.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function bB(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",o,e],["exit",o,e],["enter",l,e],["enter",c,e],["exit",c,e],["exit",l,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function xB(t,e,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,c;return a;function a(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(h){if(l>999||h===93&&!c||h===null||h===91||Ot(h))return n(h);if(h===93){t.exit("chunkString");const v=t.exit("gfmFootnoteCallString");return o.includes(Yr(r.sliceSerialize(v)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return Ot(h)||(c=!0),l++,t.consume(h),h===92?p:d}function p(h){return h===91||h===92||h===93?(t.consume(h),l++,d):d(h)}}function SB(t,e,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,c=0,a;return u;function u(C){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(C){return C===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(C)}function p(C){if(c>999||C===93&&!a||C===null||C===91||Ot(C))return n(C);if(C===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return l=Yr(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),v}return Ot(C)||(a=!0),c++,t.consume(C),C===92?h:p}function h(C){return C===91||C===92||C===93?(t.consume(C),c++,p):p(C)}function v(C){return C===58?(t.enter("definitionMarker"),t.consume(C),t.exit("definitionMarker"),o.includes(l)||o.push(l),gt(t,x,"gfmFootnoteDefinitionWhitespace")):n(C)}function x(C){return e(C)}}function wB(t,e,n){return t.check(Uc,e,t.attempt(vB,e,n))}function CB(t){t.exit("gfmFootnoteDefinition")}function kB(t,e,n){const r=this;return gt(t,o,"gfmFootnoteDefinitionIndent",5);function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?e(l):n(l)}}function EB(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(c,a){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let d=u;for(;d--;)if(c[d][0]==="exit"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[d][1].end.offset-c[d][1].start.offset){c[u][1].type="strikethroughSequence",c[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[d][1].start),end:Object.assign({},c[u][1].end)},h={type:"strikethroughText",start:Object.assign({},c[d][1].end),end:Object.assign({},c[u][1].start)},v=[["enter",p,a],["enter",c[d][1],a],["exit",c[d][1],a],["enter",h,a]],x=a.parser.constructs.insideSpan.null;x&&_r(v,v.length,0,zf(x,c.slice(d+1,u),a)),_r(v,v.length,0,[["exit",h,a],["enter",c[u][1],a],["exit",c[u][1],a],["exit",p,a]]),_r(c,d-1,u-d+3,v),u=d+v.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function l(c,a,u){const d=this.previous,p=this.events;let h=0;return v;function v(C){return d===126&&p[p.length-1][1].type!=="characterEscape"?u(C):(c.enter("strikethroughSequenceTemporary"),x(C))}function x(C){const w=Ia(d);if(C===126)return h>1?u(C):(c.consume(C),h++,x);if(h<2&&!n)return u(C);const y=c.exit("strikethroughSequenceTemporary"),S=Ia(C);return y._open=!S||S===2&&!!w,y._close=!w||w===2&&!!S,a(C)}}}class AB{constructor(){this.map=[]}add(e,n,r){RB(this,e,n,r)}consume(e){if(this.map.sort(function(l,c){return l[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let o=r.pop();for(;o;){for(const l of o)e.push(l);o=r.pop()}this.map.length=0}}function RB(t,e,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<t.map.length;){if(t.map[o][0]===e){t.map[o][1]+=n,t.map[o][2].push(...r);return}o+=1}t.map.push([e,n,r])}}function TB(t,e){let n=!1;const r=[];for(;e<t.length;){const o=t[e];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function NB(){return{flow:{null:{name:"table",tokenize:DB,resolveAll:MB}}}}function DB(t,e,n){const r=this;let o=0,l=0,c;return a;function a(O){let z=r.events.length-1;for(;z>-1;){const W=r.events[z][1].type;if(W==="lineEnding"||W==="linePrefix")z--;else break}const V=z>-1?r.events[z][1].type:null,F=V==="tableHead"||V==="tableRow"?R:u;return F===R&&r.parser.lazy[r.now().line]?n(O):F(O)}function u(O){return t.enter("tableHead"),t.enter("tableRow"),d(O)}function d(O){return O===124||(c=!0,l+=1),p(O)}function p(O){return O===null?n(O):Je(O)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),x):n(O):ft(O)?gt(t,p,"whitespace")(O):(l+=1,c&&(c=!1,o+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),c=!0,p):(t.enter("data"),h(O)))}function h(O){return O===null||O===124||Ot(O)?(t.exit("data"),p(O)):(t.consume(O),O===92?v:h)}function v(O){return O===92||O===124?(t.consume(O),h):h(O)}function x(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(t.enter("tableDelimiterRow"),c=!1,ft(O)?gt(t,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):C(O))}function C(O){return O===45||O===58?y(O):O===124?(c=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),w):T(O)}function w(O){return ft(O)?gt(t,y,"whitespace")(O):y(O)}function y(O){return O===58?(l+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),S):O===45?(l+=1,S(O)):O===null||Je(O)?k(O):T(O)}function S(O){return O===45?(t.enter("tableDelimiterFiller"),_(O)):T(O)}function _(O){return O===45?(t.consume(O),_):O===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(O))}function b(O){return ft(O)?gt(t,k,"whitespace")(O):k(O)}function k(O){return O===124?C(O):O===null||Je(O)?!c||o!==l?T(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(O)):T(O)}function T(O){return n(O)}function R(O){return t.enter("tableRow"),M(O)}function M(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),M):O===null||Je(O)?(t.exit("tableRow"),e(O)):ft(O)?gt(t,M,"whitespace")(O):(t.enter("data"),A(O))}function A(O){return O===null||O===124||Ot(O)?(t.exit("data"),M(O)):(t.consume(O),O===92?j:A)}function j(O){return O===92||O===124?(t.consume(O),A):A(O)}}function MB(t,e){let n=-1,r=!0,o=0,l=[0,0,0,0],c=[0,0,0,0],a=!1,u=0,d,p,h;const v=new AB;for(;++n<t.length;){const x=t[n],C=x[1];x[0]==="enter"?C.type==="tableHead"?(a=!1,u!==0&&(Cx(v,e,u,d,p),p=void 0,u=0),d={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(n,0,[["enter",d,e]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(r=!0,h=void 0,l=[0,0,0,0],c=[0,n+1,0,0],a&&(a=!1,p={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(n,0,[["enter",p,e]])),o=C.type==="tableDelimiterRow"?2:p?3:1):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(l[1]!==0&&(c[0]=c[1],h=vd(v,e,l,o,void 0,h),l=[0,0,0,0]),c[2]=n)):C.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(c[0]=c[1],h=vd(v,e,l,o,void 0,h)),l=c,c=[l[1],n,0,0])):C.type==="tableHead"?(a=!0,u=n):C.type==="tableRow"||C.type==="tableDelimiterRow"?(u=n,l[1]!==0?(c[0]=c[1],h=vd(v,e,l,o,n,h)):c[1]!==0&&(h=vd(v,e,c,o,n,h)),o=0):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(c[3]=n)}for(u!==0&&Cx(v,e,u,d,p),v.consume(e.events),n=-1;++n<e.events.length;){const x=e.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=TB(e.events,n))}return t}function vd(t,e,n,r,o,l){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(l.end=Object.assign({},ka(e.events,n[0])),t.add(n[0],0,[["exit",l,e]]));const u=ka(e.events,n[1]);if(l={type:c,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",l,e]]),n[2]!==0){const d=ka(e.events,n[2]),p=ka(e.events,n[3]),h={type:a,start:Object.assign({},d),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const v=e.events[n[2]],x=e.events[n[3]];if(v[1].end=Object.assign({},x[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;t.add(C,w,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return o!==void 0&&(l.end=Object.assign({},ka(e.events,o)),t.add(o,0,[["exit",l,e]]),l=void 0),l}function Cx(t,e,n,r,o){const l=[],c=ka(e.events,n);o&&(o.end=Object.assign({},c),l.push(["exit",o,e])),r.end=Object.assign({},c),l.push(["exit",r,e]),t.add(n+1,0,l)}function ka(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const jB={name:"tasklistCheck",tokenize:LB};function OB(){return{text:{91:jB}}}function LB(t,e,n){const r=this;return o;function o(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),l)}function l(u){return Ot(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),c):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),c):n(u)}function c(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(u)}function a(u){return Je(u)?e(u):ft(u)?t.check({tokenize:IB},e,n)(u):n(u)}}function IB(t,e,n){return gt(t,r,"whitespace");function r(o){return o===null?n(o):e(o)}}function PB(t){return Tk([lB(),yB(),EB(t),NB(),OB()])}const zB={};function BB(t){const e=this,n=t||zB,r=e.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(PB(n)),l.push(sB()),c.push(iB(n))}var FB=Object.create,Uf=Object.defineProperty,HB=Object.defineProperties,UB=Object.getOwnPropertyDescriptor,$B=Object.getOwnPropertyDescriptors,_E=Object.getOwnPropertyNames,Yd=Object.getOwnPropertySymbols,VB=Object.getPrototypeOf,Bv=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,kx=(t,e,n)=>e in t?Uf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ds=(t,e)=>{for(var n in e||(e={}))Bv.call(e,n)&&kx(t,n,e[n]);if(Yd)for(var n of Yd(e))bE.call(e,n)&&kx(t,n,e[n]);return t},$f=(t,e)=>HB(t,$B(e)),xE=(t,e)=>{var n={};for(var r in t)Bv.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Yd)for(var r of Yd(t))e.indexOf(r)<0&&bE.call(t,r)&&(n[r]=t[r]);return n},qB=(t,e)=>function(){return e||(0,t[_E(t)[0]])((e={exports:{}}).exports,e),e.exports},WB=(t,e)=>{for(var n in e)Uf(t,n,{get:e[n],enumerable:!0})},GB=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _E(e))!Bv.call(t,o)&&o!==n&&Uf(t,o,{get:()=>e[o],enumerable:!(r=UB(e,o))||r.enumerable});return t},KB=(t,e,n)=>(n=t!=null?FB(VB(t)):{},GB(!t||!t.__esModule?Uf(n,"default",{value:t,enumerable:!0}):n,t)),YB=qB({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,e){var n=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,l={},c={util:{encode:function C(w){return w instanceof a?new a(w.type,C(w.content),w.alias):Array.isArray(w)?w.map(C):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++o}),C.__id},clone:function C(w,y){y=y||{};var S,_;switch(c.util.type(w)){case"Object":if(_=c.util.objId(w),y[_])return y[_];S={},y[_]=S;for(var b in w)w.hasOwnProperty(b)&&(S[b]=C(w[b],y));return S;case"Array":return _=c.util.objId(w),y[_]?y[_]:(S=[],y[_]=S,w.forEach(function(k,T){S[T]=C(k,y)}),S);default:return w}},getLanguage:function(C){for(;C;){var w=r.exec(C.className);if(w)return w[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,w){C.className=C.className.replace(RegExp(r,"gi"),""),C.classList.add("language-"+w)},isActive:function(C,w,y){for(var S="no-"+w;C;){var _=C.classList;if(_.contains(w))return!0;if(_.contains(S))return!1;C=C.parentElement}return!!y}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(C,w){var y=c.util.clone(c.languages[C]);for(var S in w)y[S]=w[S];return y},insertBefore:function(C,w,y,S){S=S||c.languages;var _=S[C],b={};for(var k in _)if(_.hasOwnProperty(k)){if(k==w)for(var T in y)y.hasOwnProperty(T)&&(b[T]=y[T]);y.hasOwnProperty(k)||(b[k]=_[k])}var R=S[C];return S[C]=b,c.languages.DFS(c.languages,function(M,A){A===R&&M!=C&&(this[M]=b)}),b},DFS:function C(w,y,S,_){_=_||{};var b=c.util.objId;for(var k in w)if(w.hasOwnProperty(k)){y.call(w,k,w[k],S||k);var T=w[k],R=c.util.type(T);R==="Object"&&!_[b(T)]?(_[b(T)]=!0,C(T,y,null,_)):R==="Array"&&!_[b(T)]&&(_[b(T)]=!0,C(T,y,k,_))}}},plugins:{},highlight:function(C,w,y){var S={code:C,grammar:w,language:y};if(c.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=c.tokenize(S.code,S.grammar),c.hooks.run("after-tokenize",S),a.stringify(c.util.encode(S.tokens),S.language)},tokenize:function(C,w){var y=w.rest;if(y){for(var S in y)w[S]=y[S];delete w.rest}var _=new p;return h(_,_.head,C),d(C,_,w,_.head,0),x(_)},hooks:{all:{},add:function(C,w){var y=c.hooks.all;y[C]=y[C]||[],y[C].push(w)},run:function(C,w){var y=c.hooks.all[C];if(!(!y||!y.length))for(var S=0,_;_=y[S++];)_(w)}},Token:a};function a(C,w,y,S){this.type=C,this.content=w,this.alias=y,this.length=(S||"").length|0}a.stringify=function C(w,y){if(typeof w=="string")return w;if(Array.isArray(w)){var S="";return w.forEach(function(R){S+=C(R,y)}),S}var _={type:w.type,content:C(w.content,y),tag:"span",classes:["token",w.type],attributes:{},language:y},b=w.alias;b&&(Array.isArray(b)?Array.prototype.push.apply(_.classes,b):_.classes.push(b)),c.hooks.run("wrap",_);var k="";for(var T in _.attributes)k+=" "+T+'="'+(_.attributes[T]||"").replace(/"/g,""")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+k+">"+_.content+"</"+_.tag+">"};function u(C,w,y,S){C.lastIndex=w;var _=C.exec(y);if(_&&S&&_[1]){var b=_[1].length;_.index+=b,_[0]=_[0].slice(b)}return _}function d(C,w,y,S,_,b){for(var k in y)if(!(!y.hasOwnProperty(k)||!y[k])){var T=y[k];T=Array.isArray(T)?T:[T];for(var R=0;R<T.length;++R){if(b&&b.cause==k+","+R)return;var M=T[R],A=M.inside,j=!!M.lookbehind,O=!!M.greedy,z=M.alias;if(O&&!M.pattern.global){var V=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,V+"g")}for(var F=M.pattern||M,W=S.next,G=_;W!==w.tail&&!(b&&G>=b.reach);G+=W.value.length,W=W.next){var q=W.value;if(w.length>C.length)return;if(!(q instanceof a)){var X=1,Y;if(O){if(Y=u(F,G,C,j),!Y||Y.index>=C.length)break;var H=Y.index,I=Y.index+Y[0].length,L=G;for(L+=W.value.length;H>=L;)W=W.next,L+=W.value.length;if(L-=W.value.length,G=L,W.value instanceof a)continue;for(var P=W;P!==w.tail&&(L<I||typeof P.value=="string");P=P.next)X++,L+=P.value.length;X--,q=C.slice(G,L),Y.index-=G}else if(Y=u(F,0,q,j),!Y)continue;var H=Y.index,B=Y[0],Z=q.slice(0,H),J=q.slice(H+B.length),ee=G+q.length;b&&ee>b.reach&&(b.reach=ee);var K=W.prev;Z&&(K=h(w,K,Z),G+=Z.length),v(w,K,X);var $=new a(k,A?c.tokenize(B,A):B,z,B);if(W=h(w,K,$),J&&h(w,W,J),X>1){var te={cause:k+","+R,reach:ee};d(C,w,y,W.prev,G,te),b&&te.reach>b.reach&&(b.reach=te.reach)}}}}}}function p(){var C={value:null,prev:null,next:null},w={value:null,prev:C,next:null};C.next=w,this.head=C,this.tail=w,this.length=0}function h(C,w,y){var S=w.next,_={value:y,prev:w,next:S};return w.next=_,S.prev=_,C.length++,_}function v(C,w,y){for(var S=w.next,_=0;_<y&&S!==C.tail;_++)S=S.next;w.next=S,S.prev=w,C.length-=_}function x(C){for(var w=[],y=C.head.next;y!==C.tail;)w.push(y.value),y=y.next;return w}return c})();e.exports=n,n.default=n}}),we=KB(YB());we.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]},we.languages.markup.tag.inside["attr-value"].inside.entity=we.languages.markup.entity,we.languages.markup.doctype.inside["internal-subset"].inside=we.languages.markup,we.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(we.languages.markup.tag,"addInlined",{value:function(t,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:we.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:we.languages[r]},{});r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},we.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(we.languages.markup.tag,"addAttribute",{value:function(t,e){we.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\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:[e,"language-"+e],inside:we.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),we.languages.html=we.languages.markup,we.languages.mathml=we.languages.markup,we.languages.svg=we.languages.markup,we.languages.xml=we.languages.extend("markup",{}),we.languages.ssml=we.languages.xml,we.languages.atom=we.languages.xml,we.languages.rss=we.languages.xml,(function(t){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?: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]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),o={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.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:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"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":o}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":o}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(we),we.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:/[{}[\];(),.:]/},we.languages.javascript=we.languages.extend("clike",{"class-name":[we.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}|\?\?=?|\?\.?|[~:]/}),we.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,we.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:we.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:we.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:we.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:we.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:we.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),we.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:we.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"}}),we.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),we.languages.markup&&(we.languages.markup.tag.addInlined("script","javascript"),we.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")),we.languages.js=we.languages.javascript,we.languages.actionscript=we.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),we.languages.actionscript["class-name"].alias="function",delete we.languages.actionscript.parameter,delete we.languages.actionscript["literal-property"],we.languages.markup&&we.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:we.languages.markup}}),(function(t){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],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"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript})(we),(function(t){var e=t.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(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(o){var l=function(h){h.inside||(h.inside={}),h.inside.rest=r},c="doc-comment";if(a=t.languages[o]){var a,u=a[c];if((u=u||(a=t.languages.insertBefore(o,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(u=a[c]={pattern:u}),Array.isArray(u))for(var d=0,p=u.length;d<p;d++)u[d]instanceof RegExp&&(u[d]={pattern:u[d]}),l(u[d]);else l(u)}})}}),e.addSupport(["java","javascript","php"],e)})(we),(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,t.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(we),(function(t){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.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":[e,{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:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=e,t.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}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.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:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})})(we),(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",o=/(?:[^\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}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(a,u){u=(u||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(d,u)}t.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 r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\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:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(l),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(we),(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(t.languages.markdown=t.languages.extend("markup",{}),t.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:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+l+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+l+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.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:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<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:n(/!?\[(?:(?!\])<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(p){d!==p&&(t.languages.markdown[d].inside.content.inside[p]=t.languages.markdown[p])})}),t.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function p(h){if(h&&typeof h!="string")for(var v=0,x=h.length;v<x;v++){var C,w=h[v];w.type!=="code"?p(w.content):(C=w.content[1],w=w.content[3],C&&w&&C.type==="code-language"&&w.type==="code-block"&&typeof C.content=="string"&&(C=C.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),C="language-"+(C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,C]:w.alias.push(C):w.alias=[C]))}})(d.tokens)}),t.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var p="",h=0,v=d.classes.length;h<v;h++){var x=d.classes[h],x=/language-(.+)/.exec(x);if(x){p=x[1];break}}var C,w=t.languages[p];w?d.content=t.highlight((function(y){return y=y.replace(c,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(S,_){var b;return(_=_.toLowerCase())[0]==="#"?(b=_[1]==="x"?parseInt(_.slice(2),16):Number(_.slice(1)),u(b)):a[_]||S})})(d.content),w,p):p&&p!=="none"&&t.plugins.autoloader&&(C="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=C,t.plugins.autoloader.loadLanguages(p,function(){var y=document.getElementById(C);y&&(y.innerHTML=t.highlight(y.textContent,t.languages[p],p))}))}}),RegExp(t.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown})(we),we.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:we.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+/},we.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var e=t.tokens.filter(function(C){return typeof C!="string"&&C.type!=="comment"&&C.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var o=[];if(h(["definition-mutation","punctuation"])&&p(1).content==="("){n+=2;var l=v(/^\($/,/^\)$/);if(l===-1)continue;for(;n<l;n++){var c=p(0);c.type==="variable"&&(x(c,"variable-input"),o.push(c.content))}n=l+1}if(h(["punctuation","property-query"])&&p(0).content==="{"&&(n++,x(p(0),"property-mutation"),0<o.length)){var a=v(/^\{$/,/^\}$/);if(a!==-1)for(var u=n;u<a;u++){var d=e[u];d.type==="variable"&&0<=o.indexOf(d.content)&&x(d,"variable-input")}}}}function p(C){return e[n+C]}function h(C,w){w=w||0;for(var y=0;y<C.length;y++){var S=p(y+w);if(!S||S.type!==C[y])return}return 1}function v(C,w){for(var y=1,S=n;S<e.length;S++){var _=e[S],b=_.content;if(_.type==="punctuation"&&typeof b=="string"){if(C.test(b))y++;else if(w.test(b)&&--y===0)return S}}return-1}function x(C,w){var y=C.alias;y?Array.isArray(y)||(C.alias=y=[y]):C.alias=y=[],y.push(w)}}),we.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(t){var e=t.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,o=r.inside["interpolation-punctuation"],l=r.pattern.source;function c(h,v){if(t.languages[h])return{pattern:RegExp("((?:"+v+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function a(h,v,x){return h={code:h,grammar:v,language:x},t.hooks.run("before-tokenize",h),h.tokens=t.tokenize(h.code,h.grammar),t.hooks.run("after-tokenize",h),h.tokens}function u(h,v,x){var y=t.tokenize(h,{interpolation:{pattern:RegExp(l),lookbehind:!0}}),C=0,w={},y=a(y.map(function(_){if(typeof _=="string")return _;for(var b,k,_=_.content;h.indexOf((k=C++,b="___"+x.toUpperCase()+"_"+k+"___"))!==-1;);return w[b]=_,b}).join(""),v,x),S=Object.keys(w);return C=0,(function _(b){for(var k=0;k<b.length;k++){if(C>=S.length)return;var T,R,M,A,j,O,z,V=b[k];typeof V=="string"||typeof V.content=="string"?(T=S[C],(z=(O=typeof V=="string"?V:V.content).indexOf(T))!==-1&&(++C,R=O.substring(0,z),j=w[T],M=void 0,(A={})["interpolation-punctuation"]=o,(A=t.tokenize(j,A)).length===3&&((M=[1,1]).push.apply(M,a(A[1],t.languages.javascript,"javascript")),A.splice.apply(A,M)),M=new t.Token("interpolation",A,r.alias,j),A=O.substring(z+T.length),j=[],R&&j.push(R),j.push(M),A&&(_(O=[A]),j.push.apply(j,O)),typeof V=="string"?(b.splice.apply(b,[k,1].concat(j)),k+=j.length-1):V.content=j)):(z=V.content,Array.isArray(z)?_(z):_([z]))}})(y),new t.Token(x,y,"language-"+x,h)}t.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),e].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(h){return typeof h=="string"?h:Array.isArray(h)?h.map(p).join(""):p(h.content)}t.hooks.add("after-tokenize",function(h){h.language in d&&(function v(x){for(var C=0,w=x.length;C<w;C++){var y,S,_,b=x[C];typeof b!="string"&&(y=b.content,Array.isArray(y)?b.type==="template-string"?(b=y[1],y.length===3&&typeof b!="string"&&b.type==="embedded-code"&&(S=p(b),b=b.alias,b=Array.isArray(b)?b[0]:b,_=t.languages[b])&&(y[1]=u(S,_,b))):v(y):typeof y!="string"&&v([y]))}})(h.tokens)})})(we),(function(t){t.languages.typescript=t.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/}),t.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 t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.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:e}}}}),t.languages.ts=t.languages.typescript})(we),(function(t){var e=t.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\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:e,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 n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:t.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:e,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)})(we),(function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.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 t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.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})})(we),we.languages.n4js=we.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/}),we.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),we.languages.n4jsd=we.languages.n4js,(function(t){function e(c,a){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.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"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.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"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\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 n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var l=n[r],o=t.languages.javascript[l],l=(o=t.util.type(o)==="RegExp"?t.languages.javascript[l]={pattern:o}:o).inside||{};(o.inside=l)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(we),(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(u,d){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(u,d)}o=l(o).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function c(u){for(var d=[],p=0;p<u.length;p++){var h=u[p],v=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===a(h.content[0].content[1])&&d.pop():h.content[h.content.length-1].content!=="/>"&&d.push({tagName:a(h.content[0].content[1]),openedBraces:0}):0<d.length&&h.type==="punctuation"&&h.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?d[d.length-1].openedBraces--:v=!0),(v||typeof h=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(v=a(h),p<u.length-1&&(typeof u[p+1]=="string"||u[p+1].type==="plain-text")&&(v+=a(u[p+1]),u.splice(p+1,1)),0<p&&(typeof u[p-1]=="string"||u[p-1].type==="plain-text")&&(v=a(u[p-1])+v,u.splice(p-1,1),p--),u[p]=new t.Token("plain-text",v,null,v)),h.content&&typeof h.content!="string"&&c(h.content)}}var a=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(a).join(""):""};t.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||c(u.tokens)})})(we),(function(t){var e=t.util.clone(t.languages.typescript),e=(t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"],t.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0})(we),we.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:/[{}[\]();,.:\\]/},we.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=we.languages.swift}),(function(t){t.languages.kotlin=t.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 t.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(we),we.languages.c=we.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|[?:~]|[-+*/%&|^!=<>]=?/}),we.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),we.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},we.languages.c.string],char:we.languages.c.char,comment:we.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:we.languages.c}}}}),we.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 we.languages.c.boolean,we.languages.objectivec=we.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 we.languages.objectivec["class-name"],we.languages.objc=we.languages.objectivec,we.languages.reason=we.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/}),we.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 we.languages.reason.function,(function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(we),we.languages.go=we.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/}),we.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete we.languages.go["class-name"],(function(t){var e=/\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/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),t.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 n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.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:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(we),we.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:/[{}[\];(),.:]/},we.languages.python["string-interpolation"].inside.interpolation.inside.rest=we.languages.python,we.languages.py=we.languages.python,we.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"}},we.languages.webmanifest=we.languages.json;var tl={};WB(tl,{dracula:()=>QB,duotoneDark:()=>JB,duotoneLight:()=>tF,github:()=>rF,gruvboxMaterialDark:()=>MF,gruvboxMaterialLight:()=>OF,jettwaveDark:()=>CF,jettwaveLight:()=>EF,nightOwl:()=>iF,nightOwlLight:()=>aF,oceanicNext:()=>cF,okaidia:()=>dF,oneDark:()=>RF,oneLight:()=>NF,palenight:()=>hF,shadesOfPurple:()=>mF,synthwave84:()=>vF,ultramin:()=>_F,vsDark:()=>SE,vsLight:()=>SF});var XB={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)"}}]},QB=XB,ZB={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"}}]},JB=ZB,eF={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"}}]},tF=eF,nF={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"}}]},rF=nF,sF={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)"}}]},iF=sF,oF={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)"}}]},aF=oF,pr={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},lF={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:pr.keyword}},{types:["attr-value"],style:{color:pr.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:pr.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:pr.primitive}},{types:["boolean"],style:{color:pr.boolean}},{types:["tag"],style:{color:pr.tag}},{types:["string"],style:{color:pr.string}},{types:["punctuation"],style:{color:pr.string}},{types:["selector","char","builtin","inserted"],style:{color:pr.char}},{types:["function"],style:{color:pr.function}},{types:["operator","entity","url","variable"],style:{color:pr.variable}},{types:["keyword"],style:{color:pr.keyword}},{types:["atrule","class-name"],style:{color:pr.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},cF=lF,uF={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"}}]},dF=uF,fF={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)"}}]},hF=fF,pF={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)"}}]},mF=pF,gF={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"}}]},vF=gF,yF={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)"}}]},_F=yF,bF={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)"}}]},SE=bF,xF={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)"}}]},SF=xF,wF={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"}}]},CF=wF,kF={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"}}]},EF=kF,AF={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%)"}}]},RF=AF,TF={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%)"}}]},NF=TF,DF={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"}}]},MF=DF,jF={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"}}]},OF=jF,LF=t=>N.useCallback(e=>{var n=e,{className:r,style:o,line:l}=n,c=xE(n,["className","style","line"]);const a=$f(ds({},c),{className:tf("token-line",r)});return typeof t=="object"&&"plain"in t&&(a.style=t.plain),typeof o=="object"&&(a.style=ds(ds({},a.style||{}),o)),a},[t]),IF=t=>{const e=N.useCallback(({types:n,empty:r})=>{if(t!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return t[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(o=>t[o]))}},[t]);return N.useCallback(n=>{var r=n,{token:o,className:l,style:c}=r,a=xE(r,["token","className","style"]);const u=$f(ds({},a),{className:tf("token",...o.types,l),children:o.content,style:e(o)});return c!=null&&(u.style=ds(ds({},u.style||{}),c)),u},[e])},PF=/\r\n|\r|\n/,Ex=t=>{t.length===0?t.push({types:["plain"],content:`
|
|
578
|
+
`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=`
|
|
579
|
+
`,t[0].empty=!0)},Ax=(t,e)=>{const n=t.length;return n>0&&t[n-1]===e?t:t.concat(e)},zF=t=>{const e=[[]],n=[t],r=[0],o=[t.length];let l=0,c=0,a=[];const u=[a];for(;c>-1;){for(;(l=r[c]++)<o[c];){let d,p=e[c];const v=n[c][l];if(typeof v=="string"?(p=c>0?p:["plain"],d=v):(p=Ax(p,v.type),v.alias&&(p=Ax(p,v.alias)),d=v.content),typeof d!="string"){c++,e.push(p),n.push(d),r.push(0),o.push(d.length);continue}const x=d.split(PF),C=x.length;a.push({types:p,content:x[0]});for(let w=1;w<C;w++)Ex(a),u.push(a=[]),a.push({types:p,content:x[w]})}c--,e.pop(),n.pop(),r.pop(),o.pop()}return Ex(a),u},Rx=zF,BF=({prism:t,code:e,grammar:n,language:r})=>N.useMemo(()=>{if(n==null)return Rx([e]);const o={code:e,grammar:n,language:r,tokens:[]};return t.hooks.run("before-tokenize",o),o.tokens=t.tokenize(e,n),t.hooks.run("after-tokenize",o),Rx(o.tokens)},[e,n,r,t]),FF=(t,e)=>{const{plain:n}=t,r=t.styles.reduce((o,l)=>{const{languages:c,style:a}=l;return c&&!c.includes(e)||l.types.forEach(u=>{const d=ds(ds({},o[u]),a);o[u]=d}),o},{});return r.root=n,r.plain=$f(ds({},n),{backgroundColor:void 0}),r},HF=FF,UF=({children:t,language:e,code:n,theme:r,prism:o})=>{const l=e.toLowerCase(),c=HF(r,l),a=LF(c),u=IF(c),d=o.languages[l],p=BF({prism:o,language:l,code:n,grammar:d});return t({tokens:p,className:`prism-code language-${l}`,style:c!=null?c.root:{},getLineProps:a,getTokenProps:u})},Vf=t=>N.createElement(UF,$f(ds({},t),{prism:t.prism||we,theme:t.theme||SE,code:t.code,language:t.language}));/*! Bundled license information:
|
|
580
|
+
|
|
581
|
+
prismjs/prism.js:
|
|
582
|
+
(**
|
|
583
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
584
|
+
*
|
|
585
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
586
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
587
|
+
* @namespace
|
|
588
|
+
* @public
|
|
589
|
+
*)
|
|
590
|
+
*/const $F=tl.oneDark,VF=tl.nightOwl,wE=N.memo(function(e){const n=fe.c(11),{children:r,className:o,inverted:l}=e,c=l===void 0?!1:l;let a;n[0]!==c?(a={code(x){const{className:C,children:w,...y}=x,S=/language-(\w+)/.exec(C||""),_=S?S[1]:"",b=!_,k=Array.isArray(w)?w.join(""):String(w);return!b&&_?m.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:m.jsx(Vf,{theme:c?VF:$F,code:k.trim(),language:_,children:qF})}):m.jsx("code",{className:Ee("px-1.5 py-0.5 rounded text-sm font-mono",c?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",C),...y,children:w})},a(x){const{href:C,children:w,...y}=x;return m.jsx("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:Ee("underline underline-offset-2 transition-colors",c?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...y,children:w})},p(x){const{children:C}=x;return m.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:C})},ul(x){const{children:C}=x;return m.jsx("ul",{className:"list-outside list-disc pl-8",children:C})},ol(x){const{children:C}=x;return m.jsx("ol",{className:"list-outside list-decimal pl-8",children:C})},li(x){const{children:C,className:w}=x,y=w==null?void 0:w.includes("nested");return m.jsx("li",{className:Ee("leading-snug",y&&"ml-8"),children:C})},h1(x){const{children:C}=x;return m.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:C})},h2(x){const{children:C}=x;return m.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:C})},h3(x){const{children:C}=x;return m.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:C})},blockquote(x){const{children:C}=x;return m.jsx("blockquote",{className:Ee("border-l-2 pl-3 my-1.5 italic",c?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:C})},strong(x){const{children:C}=x;return m.jsx("strong",{className:Ee("font-semibold",c&&"text-primary-foreground"),children:C})},em(x){const{children:C}=x;return m.jsx("em",{className:"italic",children:C})},hr(){return m.jsx("hr",{className:Ee("my-3",c?"border-primary-foreground/30":"border-border")})},table(x){const{children:C}=x;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:C})})},th(x){const{children:C}=x;return m.jsx("th",{className:Ee("border border-border px-2 py-1.5 text-left font-semibold",c?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:C})},td(x){const{children:C}=x;return m.jsx("td",{className:Ee("border px-2 py-1.5",c?"border-primary-foreground/20":"border-border"),children:C})}},n[0]=c,n[1]=a):a=n[1];const u=a;let d;n[2]!==o?(d=Ee("w-full markdown-render overflow-x-auto wrap-break-words break",o),n[2]=o,n[3]=d):d=n[3];let p;n[4]===Symbol.for("react.memo_cache_sentinel")?(p=[BB],n[4]=p):p=n[4];let h;n[5]!==r||n[6]!==u?(h=m.jsx(EP,{remarkPlugins:p,components:u,children:r}),n[5]=r,n[6]=u,n[7]=h):h=n[7];let v;return n[8]!==d||n[9]!==h?(v=m.jsx("div",{className:d,children:h}),n[8]=d,n[9]=h,n[10]=v):v=n[10],v});function qF(t){const{className:e,style:n,tokens:r,getLineProps:o,getTokenProps:l}=t;return m.jsx("pre",{className:Ee("rounded-lg text-sm p-3",e),style:n,children:r.map((c,a)=>m.jsx("div",{...o({line:c}),children:c.map((u,d)=>m.jsx("span",{...l({token:u})},d))},a))})}const WF=tl.oneDark;function Tx(t){const e=fe.c(8),{content:n,language:r,showLineNumbers:o}=t,l=o===void 0?!0:o;let c,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ee("h-full overflow-auto bg-[#282c34] chat-transcript-scrollbar"),a={WebkitOverflowScrolling:"touch"},e[0]=c,e[1]=a):(c=e[0],a=e[1]);const u=r||"plaintext";let d;e[2]!==l?(d=h=>{const{style:v,tokens:x,getLineProps:C,getTokenProps:w}=h;return m.jsx("pre",{className:"text-sm p-4 min-h-full font-mono",style:v,children:x.map((y,S)=>m.jsxs("div",{...C({line:y}),className:"table-row",children:[l&&m.jsx("span",{className:"table-cell pr-4 text-right select-none opacity-50 text-xs w-12",children:S+1}),m.jsx("span",{className:"table-cell",children:y.map((_,b)=>m.jsx("span",{...w({token:_})},b))})]},S))})},e[2]=l,e[3]=d):d=e[3];let p;return e[4]!==n||e[5]!==u||e[6]!==d?(p=m.jsx("div",{className:c,style:a,children:m.jsx(Vf,{theme:WF,code:n,language:u,children:d})}),e[4]=n,e[5]=u,e[6]=d,e[7]=p):p=e[7],p}function Fm(t){const e=fe.c(13),{icon:n,title:r,reason:o,name:l}=t;let c;e[0]!==n?(c=m.jsx(n,{className:"size-10 text-muted-foreground mb-4"}),e[0]=n,e[1]=c):c=e[1];let a;e[2]!==r?(a=m.jsx("p",{className:"text-sm font-medium mb-1",children:r}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==o?(u=m.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:o}),e[4]=o,e[5]=u):u=e[5];let d;e[6]!==l?(d=m.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[6]=l,e[7]=d):d=e[7];let p;return e[8]!==c||e[9]!==a||e[10]!==u||e[11]!==d?(p=m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[c,a,u,d]}),e[8]=c,e[9]=a,e[10]=u,e[11]=d,e[12]=p):p=e[12],p}function GF(t){const e=fe.c(20),{preview:n}=t;if(n.kind==="markdown"){let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={WebkitOverflowScrolling:"touch"},e[0]=r):r=e[0];let o;return e[1]!==n.content?(o=m.jsx("div",{className:"h-full overflow-auto p-6 chat-transcript-scrollbar",style:r,children:m.jsx(wE,{children:n.content})}),e[1]=n.content,e[2]=o):o=e[2],o}if(n.kind==="code"){let r;return e[3]!==n.content||e[4]!==n.language||e[5]!==n.path?(r=m.jsx(Tx,{content:n.content,path:n.path,language:n.language,showLineNumbers:!0}),e[3]=n.content,e[4]=n.language,e[5]=n.path,e[6]=r):r=e[6],r}if(n.kind==="text"){let r;return e[7]!==n.content||e[8]!==n.language||e[9]!==n.path?(r=m.jsx(Tx,{content:n.content,path:n.path,language:n.language,showLineNumbers:!1}),e[7]=n.content,e[8]=n.language,e[9]=n.path,e[10]=r):r=e[10],r}if(n.kind==="binary"){let r;return e[11]!==n.name||e[12]!==n.reason?(r=m.jsx(Fm,{icon:Q5,title:"Binary file",reason:n.reason,name:n.name}),e[11]=n.name,e[12]=n.reason,e[13]=r):r=e[13],r}if(n.kind==="unsupported"){let r;return e[14]!==n.name||e[15]!==n.reason?(r=m.jsx(Fm,{icon:K5,title:"Unsupported file",reason:n.reason,name:n.name}),e[14]=n.name,e[15]=n.reason,e[16]=r):r=e[16],r}if(n.kind==="too_large"){let r;return e[17]!==n.name||e[18]!==n.reason?(r=m.jsx(Fm,{icon:V5,title:"File too large",reason:n.reason,name:n.name}),e[17]=n.name,e[18]=n.reason,e[19]=r):r=e[19],r}return null}function KF({workspaceId:t,path:e,serverUrl:n,apiToken:r,enabled:o}){const{fetchWithAuth:l}=Xa(),[c,a]=N.useState(null),[u,d]=N.useState(!1),[p,h]=N.useState(null),v=N.useRef(null),x=N.useCallback(async()=>{if(!o||!t||!e||!n||!r)return;v.current&&v.current.abort();const w=new AbortController;v.current=w,d(!0),h(null);try{const y=`/api/workspaces/${t}/file-preview?path=${encodeURIComponent(e)}`,S=await l(y,{signal:w.signal},{serverUrl:n,token:r});if(!S.ok){let b="Failed to fetch file preview";try{b=(await S.json()).message||b}catch{b=S.statusText||b}h(b),a(null),d(!1);return}const _=await S.json();a(_),d(!1)}catch(y){if(y instanceof Error&&y.name==="AbortError")return;const S=y instanceof Error?y.message:"Unknown error occurred";h(S),a(null),d(!1)}},[o,t,e,n,r,l]),C=N.useCallback(()=>{x()},[x]);return N.useEffect(()=>(x(),()=>{v.current&&v.current.abort()}),[x]),{data:c,loading:u,error:p,reload:C}}function YF(t){const e=fe.c(37),{workspaceId:n,target:r,serverUrl:o,apiToken:l,open:c,onOpenChange:a}=t,u=r==null?void 0:r.path,d=c&&!!r&&!!n;let p;e[0]!==l||e[1]!==o||e[2]!==u||e[3]!==d||e[4]!==n?(p={workspaceId:n,path:u,serverUrl:o,apiToken:l,enabled:d},e[0]=l,e[1]=o,e[2]=u,e[3]=d,e[4]=n,e[5]=p):p=e[5];const{data:h,loading:v,error:x,reload:C}=KF(p);if(!r)return null;const w=XF;let y;e[6]!==r.name?(y=m.jsx(No,{className:"text-base font-semibold truncate",children:r.name}),e[6]=r.name,e[7]=y):y=e[7];let S;e[8]!==r.path?(S=m.jsx(Qa,{className:"text-xs text-muted-foreground truncate",children:r.path}),e[8]=r.path,e[9]=S):S=e[9];let _;e[10]!==h?(_=h&&m.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[m.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground capitalize",children:h.kind}),m.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"read-only"}),m.jsxs("span",{className:"text-xs text-muted-foreground",children:[w(h.size),h.language&&` · ${h.language}`]})]}),e[10]=h,e[11]=_):_=e[11];let b;e[12]!==y||e[13]!==S||e[14]!==_?(b=m.jsxs(To,{className:"px-6 pt-5 pb-3 border-b border-border shrink-0",children:[y,S,_]}),e[12]=y,e[13]=S,e[14]=_,e[15]=b):b=e[15];let k;e[16]!==v?(k=v&&m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx(nr,{className:"size-5 animate-spin text-muted-foreground"})}),e[16]=v,e[17]=k):k=e[17];let T;e[18]!==x||e[19]!==v||e[20]!==C?(T=x&&!v&&m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[m.jsx(Ea,{className:"size-8 text-muted-foreground mb-3"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:x}),m.jsxs(He,{variant:"outline",size:"sm",onClick:C,children:[m.jsx(Ai,{className:"size-3.5 mr-1.5"}),"Retry"]})]}),e[18]=x,e[19]=v,e[20]=C,e[21]=T):T=e[21];let R;e[22]!==h||e[23]!==x||e[24]!==v?(R=h&&!v&&!x&&m.jsx(GF,{preview:h}),e[22]=h,e[23]=x,e[24]=v,e[25]=R):R=e[25];let M;e[26]!==R||e[27]!==k||e[28]!==T?(M=m.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden",children:[k,T,R]}),e[26]=R,e[27]=k,e[28]=T,e[29]=M):M=e[29];let A;e[30]!==M||e[31]!==b?(A=m.jsxs(Ro,{showCloseButton:!0,className:"sm:max-w-5xl w-[min(92vw,1100px)] h-[85vh] flex flex-col p-0 gap-0",children:[b,M]}),e[30]=M,e[31]=b,e[32]=A):A=e[32];let j;return e[33]!==a||e[34]!==c||e[35]!==A?(j=m.jsx(Ao,{open:c,onOpenChange:a,children:A}),e[33]=a,e[34]=c,e[35]=A,e[36]=j):j=e[36],j}function XF(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}function QF(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function qf(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function ZF(){return!!(globalThis||window).isTauri}const JF="/assets/chat-finish-Kb8mnIhV.mp3",eH="/assets/chat-permission-BltPnMpz.mp3",tH={chatFinish:JF,chatPermission:eH};function nH(){const t=N.useRef(null),e=N.useRef({}),n=N.useRef(!1),r=N.useRef(null),o=N.useRef(0),l=N.useCallback(async()=>{let C=t.current;return(!C||C.state==="closed")&&(C=new AudioContext,t.current=C,e.current={}),C.state==="suspended"&&await C.resume(),C},[]),c=N.useCallback(async(C,w)=>{var y;if(e.current[C])return(y=e.current[C])!=null?y:null;try{const S=await fetch(tH[C]);if(!S.ok)throw new Error(`HTTP ${S.status}`);const _=await S.arrayBuffer(),b=await w.decodeAudioData(_);return e.current[C]=b,b}catch(S){return console.warn("[useNotificationSound] Failed to load",C,S),null}},[]),a=N.useCallback((C,w)=>{try{const y=w.createBufferSource();y.buffer=C,y.connect(w.destination),y.start(0)}catch(y){console.warn("[useNotificationSound] Playback error",y)}},[]),u=N.useCallback(async()=>{if(n.current)return;const C=await l();if(C.state!=="running")return;const w=r.current;if(r.current=null,w){const y=await c(w,C);y&&a(y,C)}n.current=!0},[l,c,a]),d=N.useCallback(()=>{const C=()=>{document.removeEventListener("click",C),document.removeEventListener("keydown",C),document.removeEventListener("touchstart",C),u()};document.addEventListener("click",C),document.addEventListener("keydown",C),document.addEventListener("touchstart",C)},[u]),p=N.useCallback(async C=>{if(n.current){const w=await l();if(w.state!=="running")return;const y=await c(C,w);y&&a(y,w);return}r.current=C,d()},[l,c,a,d]),h=N.useCallback(async C=>{if(ZF()){const w=Date.now();if(w>o.current)try{await qf("play_sound",{soundKey:C});return}catch(y){const S=y instanceof Error?y.message:String(y);console.warn(`[useNotificationSound] Native playback failed for ${C}, error: ${S}`),o.current=w+1e3}}else await p(C)},[p]),v=N.useCallback(()=>{h("chatFinish")},[h]),x=N.useCallback(()=>{h("chatPermission")},[h]);return N.useEffect(()=>()=>{const C=t.current;C&&C.state!=="closed"&&C.close(),t.current=null},[]),{playChatFinishSound:v,playPermissionSound:x,playSound:h}}const rH=(t,e)=>t&&e?`ws://${e}/ws?token=${t}`:null,sH=1e4,iH=3e4,oH=1e3,aH=3e4;function lH({apiToken:t,serverUrl:e,wsRef:n,serverEpochRef:r,currentSessionIdRef:o,clearPendingPermissions:l,handleLogout:c,setWs:a,setConnected:u,setAuthError:d,setConnectionTimedOut:p,setRetryCount:h,setNextRetryIn:v,setReconnectTrigger:x,reconnectTrigger:C,connected:w,connectionTimedOut:y,retryCount:S,onMessage:_}){const b=N.useRef(Date.now());N.useEffect(()=>{if(!t||!e)return;const k=rH(t,e);if(!k)return;const T=new WebSocket(k),R=r.current;return T.onopen=()=>{r.current===R&&(b.current=Date.now(),u(!0),d(null),h(0),p(!1),l(),o.current&&T.send(JSON.stringify({type:"session.resume",sessionId:o.current})),T.send(JSON.stringify({type:"permissions.sync"})))},T.onclose=M=>{r.current===R&&(u(!1),(M.code===1008||M.code===401)&&c())},T.onerror=M=>{r.current===R&&console.error("WebSocket error:",M)},T.onmessage=M=>{if(r.current!==R)return;b.current=Date.now();const A=JSON.parse(M.data);_(A)},a(T),()=>T.close()},[t,e,c,C]),N.useEffect(()=>{if(t&&e&&!w&&!y){const k=setTimeout(()=>{w||p(!0)},sH);return()=>clearTimeout(k)}},[t,e,w,y,p]),N.useEffect(()=>{const k=r.current;if(y&&!w&&t&&e){const T=Math.min(oH*Math.pow(2,S),iH);let R=Math.floor(T/1e3);v(R);const M=setInterval(()=>{R-=1,v(Math.max(0,R))},1e3),A=setTimeout(()=>{r.current===k&&(h(j=>j+1),x(j=>j+1))},T);return()=>{clearInterval(M),clearTimeout(A)}}},[y,w,t,e,S,r,x,v]),N.useEffect(()=>{const k=r.current,T=()=>{if(r.current!==k||document.visibilityState!=="visible")return;const R=n.current;if(!(!R||!t||!e))if(R.readyState===WebSocket.OPEN){if(Date.now()-b.current<aH)return;R.onclose=null,R.close(),u(!1),h(0),p(!1),x(A=>A+1)}else(R.readyState===WebSocket.CLOSED||R.readyState===WebSocket.CLOSING)&&(u(!1),h(0),p(!1),x(M=>M+1))};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[t,e,r,x,u,h,p,b]),N.useEffect(()=>{const k=r.current,T=()=>{if(r.current!==k||!t||!e)return;const R=n.current;R&&R.readyState===WebSocket.OPEN||(u(!1),h(0),p(!1),x(M=>M+1))};return window.addEventListener("online",T),()=>window.removeEventListener("online",T)},[t,e,r,x,u,h,p])}const cH=t=>t?`http://${t}/api`:null;function uH(t){const e=fe.c(38),{apiToken:n,serverUrl:r,reconnectTrigger:o,serverEpochRef:l,fetchWithAuth:c,clearSwitchingState:a,setSessions:u,setPreconfigs:d,setPrompts:p,setModels:h,setDefaultModel:v,setProviderStatuses:x,setWorkspaces:C,setActiveWorkspace:w,activeWorkspace:y,setIsLoadingServerData:S,setAuthError:_,pendingWorkspaceIdRef:b}=t,k=N.useRef(null);let T,R;e[0]!==y?(T=()=>{y&&localStorage.setItem("activeWorkspaceId",y.id)},R=[y],e[0]=y,e[1]=T,e[2]=R):(T=e[1],R=e[2]),N.useEffect(T,R);let M;e[3]!==n||e[4]!==a||e[5]!==c||e[6]!==b||e[7]!==l||e[8]!==r||e[9]!==w||e[10]!==_||e[11]!==v||e[12]!==S||e[13]!==h||e[14]!==d||e[15]!==p||e[16]!==x||e[17]!==u||e[18]!==C?(M=()=>{var V;if(!n||!r)return;(V=k.current)==null||V.abort(),k.current=new AbortController;const j=k.current.signal,O=cH(r);if(!O)return;const z=l.current;return S(!0),Promise.all([c(`${O}/sessions`,{signal:j}).then(gH),c(`${O}/preconfigs`,{signal:j}).then(mH),c(`${O}/prompts`,{signal:j}).then(pH),c(`${O}/models`,{signal:j}).then(hH),c(`${O}/workspaces`,{signal:j}).then(fH),c(`${O}/providers`,{signal:j}).then(dH)]).then(F=>{const[W,G,q,X,Y,I]=F;if(l.current!==z)return;u(W.sessions||[]),d(G.preconfigs||[]),p(q.prompts||[]),h(X.models||[]),v(X.defaultModel||"gpt-4o"),x(I.providers||[]);const L=Y.workspaces||[];if(C(L),b.current){const P=L.find(H=>H.id===b.current);P&&w(P),b.current=null}else{const P=localStorage.getItem("activeWorkspaceId"),H=L.find(B=>B.id===P);w(H||L[0])}a(),S(!1)}).catch(F=>{var W;if(F.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",F),S(!1),(W=F.message)!=null&&W.includes("Unauthorized")||_("Failed to connect to server")}),()=>{var F;(F=k.current)==null||F.abort()}},e[3]=n,e[4]=a,e[5]=c,e[6]=b,e[7]=l,e[8]=r,e[9]=w,e[10]=_,e[11]=v,e[12]=S,e[13]=h,e[14]=d,e[15]=p,e[16]=x,e[17]=u,e[18]=C,e[19]=M):M=e[19];let A;e[20]!==n||e[21]!==a||e[22]!==c||e[23]!==b||e[24]!==o||e[25]!==l||e[26]!==r||e[27]!==w||e[28]!==_||e[29]!==v||e[30]!==S||e[31]!==h||e[32]!==d||e[33]!==p||e[34]!==x||e[35]!==u||e[36]!==C?(A=[n,r,o,l,c,a,u,d,p,h,v,x,C,w,S,_,b],e[20]=n,e[21]=a,e[22]=c,e[23]=b,e[24]=o,e[25]=l,e[26]=r,e[27]=w,e[28]=_,e[29]=v,e[30]=S,e[31]=h,e[32]=d,e[33]=p,e[34]=x,e[35]=u,e[36]=C,e[37]=A):A=e[37],N.useEffect(M,A)}function dH(t){return t.json()}function fH(t){return t.json()}function hH(t){return t.json()}function pH(t){return t.json()}function mH(t){return t.json()}function gH(t){return t.json()}function vH(t){const e=fe.c(108),{ws:n,currentSession:r,sessions:o,workspaces:l,activeWorkspace:c,currentModel:a,streamingSessionIds:u,isCompacting:d,primaryPreconfigs:p,setCurrentSession:h,setActiveWorkspace:v,setCompactionSuccess:x,setCurrentModel:C,setSelectedVariant:w,removePendingPermissionByToolCallId:y,removePendingPermissionsBySessionId:S,clearStreamingSessions:_,pendingSessionCreateRef:b,partAppendRafRef:k,pendingPartAppendsRef:T,skipFinishSoundSessionIdsRef:R}=t;let M;e[0]!==n?(M=(Me,We)=>{n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:Me,...We}))},e[0]=n,e[1]=M):M=e[1];const A=M;let j;e[2]!==(c==null?void 0:c.id)||e[3]!==k||e[4]!==T||e[5]!==b||e[6]!==A||e[7]!==x?(j=(Me,We)=>{b.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear(),A("session.create",{preconfigId:Me,title:We,workspaceId:c==null?void 0:c.id}),x(!1)},e[2]=c==null?void 0:c.id,e[3]=k,e[4]=T,e[5]=b,e[6]=A,e[7]=x,e[8]=j):j=e[8];const O=j;let z;e[9]!==(c==null?void 0:c.id)||e[10]!==_||e[11]!==k||e[12]!==T||e[13]!==S||e[14]!==A||e[15]!==o||e[16]!==v||e[17]!==x||e[18]!==h||e[19]!==R||e[20]!==l?(z=Me=>{S(Me),R.current=new Set(Wm.getState().streamingSessionIds),_(),x(!1);const We=o.find(Xe=>Xe.id===Me);if(We!=null&&We.workspaceId&&We.workspaceId!==(c==null?void 0:c.id)){const Xe=l.find(vt=>vt.id===We.workspaceId);Xe&&v(Xe)}k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear(),We&&h(We),A("session.resume",{sessionId:Me})},e[9]=c==null?void 0:c.id,e[10]=_,e[11]=k,e[12]=T,e[13]=S,e[14]=A,e[15]=o,e[16]=v,e[17]=x,e[18]=h,e[19]=R,e[20]=l,e[21]=z):z=e[21];const V=z;let F;e[22]!==A?(F=Me=>{A("session.close",{sessionId:Me})},e[22]=A,e[23]=F):F=e[23];const W=F;let G;e[24]!==A?(G=(Me,We)=>{A("session.revert",{sessionId:Me,messageId:We})},e[24]=A,e[25]=G):G=e[25];const q=G;let X;e[26]!==A?(X=(Me,We)=>{A("session.fork",{sessionId:Me,messageId:We})},e[26]=A,e[27]=X):X=e[27];const Y=X;let I;e[28]!==A?(I=Me=>{A("session.compact",{sessionId:Me})},e[28]=A,e[29]=I):I=e[29];const L=I;let P;e[30]!==A?(P=Me=>{A("session.reopen",{sessionId:Me})},e[30]=A,e[31]=P):P=e[31];const H=P;let B;e[32]!==A?(B=Me=>{A("session.delete",{sessionId:Me})},e[32]=A,e[33]=B):B=e[33];const Z=B;let J;e[34]!==r||e[35]!==A?(J=Me=>{r&&A("session.update",{sessionId:r.id,preconfigId:Me})},e[34]=r,e[35]=A,e[36]=J):J=e[36];const ee=J;let K;e[37]!==r||e[38]!==A||e[39]!==C||e[40]!==w?(K=(Me,We)=>{C(Me),w(null),r&&A("session.update_model",{sessionId:r.id,modelId:Me,providerId:We})},e[37]=r,e[38]=A,e[39]=C,e[40]=w,e[41]=K):K=e[41];const $=K;let te;e[42]!==a||e[43]!==r||e[44]!==A||e[45]!==w?(te=Me=>{r&&(A("session.update_model",{sessionId:r.id,modelId:r.selectedModel||a,providerId:r.selectedProvider||"openai",variant:Me}),w(Me))},e[42]=a,e[43]=r,e[44]=A,e[45]=w,e[46]=te):te=e[46];const re=te;let ae;e[47]!==A?(ae=(Me,We)=>{A("session.rename",{sessionId:Me,title:We})},e[47]=A,e[48]=ae):ae=e[48];const se=ae;let _e;e[49]!==r||e[50]!==V?(_e=()=>{r!=null&&r.parentId&&V(r.parentId)},e[49]=r,e[50]=V,e[51]=_e):_e=e[51];const Re=_e;let je;e[52]!==A?(je=(Me,We,Xe)=>{A("queue.add",{sessionId:Me,content:We,...Xe&&Xe.length>0?{attachments:Xe}:{}})},e[52]=A,e[53]=je):je=e[53];const ze=je;let ce;e[54]!==A?(ce=Me=>{A("queue.remove",{queueId:Me})},e[54]=A,e[55]=ce):ce=e[55];const Te=ce;let ye;e[56]!==ze||e[57]!==r||e[58]!==d||e[59]!==A||e[60]!==u?(ye=(Me,We)=>{!r||d||(r.runningAt||u.has(r.id)?ze(r.id,Me,We):A("chat.message",{sessionId:r.id,content:Me,...We&&We.length>0?{attachments:We}:{}}))},e[56]=ze,e[57]=r,e[58]=d,e[59]=A,e[60]=u,e[61]=ye):ye=e[61];const Pe=ye;let Fe;e[62]!==y||e[63]!==A?(Fe=(Me,We,Xe)=>{y(Me),A("permission.response",{toolCallId:Me,allowed:We,alwaysAllow:Xe})},e[62]=y,e[63]=A,e[64]=Fe):Fe=e[64];const ve=Fe;let Ne;e[65]!==r||e[66]!==A?(Ne=()=>{r&&A("session.interrupt",{sessionId:r.id})},e[65]=r,e[66]=A,e[67]=Ne):Ne=e[67];const Ae=Ne;let Ce;e[68]!==c||e[69]!==A?(Ce=()=>{c&&A("permission.list",{workspaceId:c.id})},e[68]=c,e[69]=A,e[70]=Ce):Ce=e[70];const oe=Ce;let me;e[71]!==A?(me=Me=>{A("provider.connect",{provider:Me})},e[71]=A,e[72]=me):me=e[72];const ke=me;let De;e[73]!==A?(De=Me=>{A("provider.disconnect",{provider:Me})},e[73]=A,e[74]=De):De=e[74];const Be=De;let nt;e[75]!==k||e[76]!==T||e[77]!==b||e[78]!==p||e[79]!==A||e[80]!==v||e[81]!==x||e[82]!==l?(nt=Me=>{var Xe;v(l.find(vt=>vt.id===Me)||null),b.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear();const We=(Xe=p[0])==null?void 0:Xe.id;A("session.create",{preconfigId:We,workspaceId:Me}),x(!1)},e[75]=k,e[76]=T,e[77]=b,e[78]=p,e[79]=A,e[80]=v,e[81]=x,e[82]=l,e[83]=nt):nt=e[83];const Ye=nt;let Ue;return e[84]!==ze||e[85]!==W||e[86]!==L||e[87]!==ke||e[88]!==O||e[89]!==Ye||e[90]!==Be||e[91]!==Y||e[92]!==Ae||e[93]!==Re||e[94]!==ve||e[95]!==se||e[96]!==Z||e[97]!==oe||e[98]!==Te||e[99]!==H||e[100]!==V||e[101]!==q||e[102]!==Pe||e[103]!==A||e[104]!==$||e[105]!==ee||e[106]!==re?(Ue={sendMessage:A,createSession:O,resumeSession:V,closeSession:W,reopenSession:H,permanentlyDeleteSession:Z,handleRenameSession:se,revertSession:q,forkSession:Y,compactSession:L,addToQueue:ze,removeFromQueue:Te,sendChatMessage:Pe,handlePermissionResponse:ve,handleInterruptSession:Ae,updateSessionPreconfig:ee,updateSessionModel:$,updateSessionVariant:re,handleNavigateBack:Re,refreshPermissions:oe,connectProvider:ke,disconnectProvider:Be,createSessionInWorkspace:Ye},e[84]=ze,e[85]=W,e[86]=L,e[87]=ke,e[88]=O,e[89]=Ye,e[90]=Be,e[91]=Y,e[92]=Ae,e[93]=Re,e[94]=ve,e[95]=se,e[96]=Z,e[97]=oe,e[98]=Te,e[99]=H,e[100]=V,e[101]=q,e[102]=Pe,e[103]=A,e[104]=$,e[105]=ee,e[106]=re,e[107]=Ue):Ue=e[107],Ue}const yH=400,_H=typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window);var Xx;const bH=typeof navigator<"u"&&((Xx=navigator.platform)==null?void 0:Xx.toUpperCase().includes("MAC"))===!0;function xH(){const t=['[data-slot="dialog-overlay"][data-state="open"]','[data-slot="dialog-content"][data-state="open"]','[role="dialog"][data-state="open"]'];for(const n of t)if(document.querySelector(n))return!0;const e=document.querySelectorAll('[role="dialog"]');for(const n of e)if(n instanceof HTMLElement&&SH(n))return!0;return!1}function SH(t){if(!t.isConnected)return!1;const e=window.getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity)>0&&t.getBoundingClientRect().width>0&&t.getBoundingClientRect().height>0}function wH(){var e,n;const t=document.activeElement;return t?!!((e=t.hasAttribute)!=null&&e.call(t,"data-chat-input")||(n=t.closest)!=null&&n.call(t,'[data-chat-input="true"]')):!1}function CH(t){const e=fe.c(5),n=N.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],N.useLayoutEffect(r);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={lastEscTime:0,armed:!1},e[2]=o):o=e[2];const l=N.useRef(o);let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const u=d=>{if(d.isComposing||d.repeat||d.key==="Escape"&&xH())return;const{onCloseFocusedPanel:p,onFocusChatInput:h,onStopStreaming:v,onOpenSidebar:x,onOpenTerminal:C,onOpenFilesPanel:w,onNewWindow:y,onNewSession:S,onToggleViewMode:_,onToggleAutoFollow:b}=n.current;if(d.shiftKey&&d.key==="Escape"){d.preventDefault(),p();return}if(d.key==="Escape"&&!d.metaKey&&!d.ctrlKey){const M=wH(),A=Date.now(),{lastEscTime:j,armed:O}=l.current,z=A-j;if(M&&O&&z<yH){d.preventDefault(),l.current={lastEscTime:0,armed:!1},v();return}if(M){l.current={lastEscTime:A,armed:!0};return}d.preventDefault(),h();return}const k=d.target,T=k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable,R=d.metaKey||d.ctrlKey;if(!(T&&!R)){if(!_H||!bH){if(R&&d.code==="Digit1"){d.preventDefault(),x();return}if(R&&d.code==="KeyT"){d.preventDefault(),C();return}}if(R&&d.code==="Digit2"){d.preventDefault(),w();return}if(R&&d.shiftKey&&d.code==="KeyN"){d.preventDefault(),y();return}if(R&&d.code==="KeyN"){d.preventDefault(),S();return}if(R&&d.code==="KeyO"){d.preventDefault(),_();return}if(R&&d.shiftKey&&d.code==="KeyF"){d.preventDefault(),b();return}}};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},a=[],e[3]=c,e[4]=a):(c=e[3],a=e[4]),N.useEffect(c,a)}var Nx;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(Nx||(Nx={}));async function kH(t,e){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(t,e),await qf("plugin:event|unlisten",{event:t,eventId:e})}async function Dx(t,e,n){var r;const o=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return qf("plugin:event|listen",{event:t,target:o,handler:QF(e)}).then(l=>async()=>kH(t,l))}function EH(t){const e=fe.c(39),{sidebarRef:n,terminalPanelRef:r,filesPanelRef:o,chatInputRef:l,activeWorkspace:c,primaryPreconfigs:a,handleInterruptSession:u,handleSidebarViewModeChange:d,createSession:p,setSidebarOpen:h,onToggleAutoFollow:v}=t;let x;e[0]!==h||e[1]!==n?(x=()=>{h(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var $;($=n.current)==null||$.focusSessionPanel()})})},e[0]=h,e[1]=n,e[2]=x):x=e[2];const C=x;let w;e[3]!==r?(w=()=>{zt.getState().setShowTerminalPanel(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var $;($=r.current)==null||$.focus()})})},e[3]=r,e[4]=w):w=e[4];const y=w,S=N.useRef(C);let _;e[5]!==C?(_=()=>{S.current=C},e[5]=C,e[6]=_):_=e[6],N.useLayoutEffect(_);const b=N.useRef(y);let k;e[7]!==y?(k=()=>{b.current=y},e[7]=y,e[8]=k):k=e[8],N.useLayoutEffect(k);const T=DH;let R;e[9]!==o?(R=()=>{requestAnimationFrame(()=>{var $;($=o.current)==null||$.focus()})},e[9]=o,e[10]=R):R=e[10];const M=R,A=N.useRef(M);let j;e[11]!==M?(j=()=>{A.current=M},e[11]=M,e[12]=j):j=e[12],N.useLayoutEffect(j);let O;e[13]!==l?(O=()=>{var $;($=l.current)==null||$.focus()},e[13]=l,e[14]=O):O=e[14];const z=O;let V;e[15]!==c||e[16]!==p||e[17]!==a?(V=()=>{c&&a[0]&&p(a[0].id)},e[15]=c,e[16]=p,e[17]=a,e[18]=V):V=e[18];const F=V,W=TH;let G;e[19]!==d?(G=()=>{d(RH)},e[19]=d,e[20]=G):G=e[20];const q=G;let X;e[21]!==h?(X=()=>{const $=document.activeElement;$!=null&&$.closest("[data-terminal-panel]")?T():$!=null&&$.closest('[data-panel-id="files"]')?zt.getState().setShowFilesPanel(!1):$!=null&&$.closest('[data-sidebar="sidebar"]')&&h(!1)},e[21]=h,e[22]=X):X=e[22];const Y=X;let I;e[23]!==u?(I=()=>{u()},e[23]=u,e[24]=I):I=e[24];const L=I;let P,H,B;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>S.current(),H=()=>b.current(),B=()=>A.current(),e[25]=P,e[26]=H,e[27]=B):(P=e[25],H=e[26],B=e[27]);let Z;e[28]!==v?(Z=()=>v==null?void 0:v(),e[28]=v,e[29]=Z):Z=e[29];let J;e[30]!==z||e[31]!==Y||e[32]!==F||e[33]!==L||e[34]!==q||e[35]!==Z?(J={onOpenSidebar:P,onOpenTerminal:H,onOpenFilesPanel:B,onNewSession:F,onNewWindow:W,onToggleViewMode:q,onCloseFocusedPanel:Y,onFocusChatInput:z,onStopStreaming:L,onToggleAutoFollow:Z},e[30]=z,e[31]=Y,e[32]=F,e[33]=L,e[34]=q,e[35]=Z,e[36]=J):J=e[36],CH(J);let ee,K;e[37]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{if(!(typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)))return;let te=!1;const re=[];return(async()=>{try{const se=await Dx("jean2://accelerator/open-sidebar",()=>{S.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-sidebar accelerator listener:",se)}try{const se=await Dx("jean2://accelerator/open-terminal",()=>{b.current()});if(te){se();return}re.push(se)}catch(se){console.error("Failed to register open-terminal accelerator listener:",se)}})(),()=>{te=!0,re.forEach(AH)}},K=[],e[37]=ee,e[38]=K):(ee=e[37],K=e[38]),N.useLayoutEffect(ee,K)}function AH(t){return t()}function RH(t){return t==="overview"?"default":"overview"}function TH(){qf("create_new_window").catch(NH)}function NH(){}function DH(){zt.getState().setShowTerminalPanel(!1)}function MH(t){const e=fe.c(3),{setOpen:n}=Fc();let r;return e[0]!==t||e[1]!==n?(r={...t,setSidebarOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],EH(r),null}function Mx(t){const e=fe.c(17),{onServerSwitch:n,onSelectWorkspace:r}=t,[o,l]=N.useState(!1),c=N.useRef(!1),a=Za(),{quickConnections:u,switchServer:d,removeFromQuickConnections:p,isSwitching:h}=Ba(),v=O=>{d(O.serverId)&&(c.current=!0,n==null||n(),O.workspaceId&&r&&r(O.workspaceId))};let x,C;e[0]!==h||e[1]!==o?(x=()=>{!h&&o&&c.current&&(l(!1),c.current=!1)},C=[h,o],e[0]=h,e[1]=o,e[2]=x,e[3]=C):(x=e[2],C=e[3]),N.useEffect(x,C);let w;e[4]!==p?(w=(O,z)=>{O.stopPropagation(),p(z)},e[4]=p,e[5]=w):w=e[5];const y=w,S=()=>m.jsx(vv,{children:m.jsx(yv,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?m.jsx(bc,{heading:"Quick Switch",children:u.map(O=>m.jsxs(Ta,{onSelect:()=>v(O),className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(go,{className:"size-4 text-muted-foreground"}),m.jsxs("span",{children:[O.serverName,O.workspaceName&&m.jsxs("span",{className:"text-muted-foreground",children:[" / ",O.workspaceName]})]})]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:z=>y(z,O.id),children:m.jsx(Ua,{className:"size-3 text-destructive"})})]},O.id))}):m.jsx(_v,{className:"py-6",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[m.jsx(sm,{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"})]})})})});if(a){let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx(m8,{asChild:!0,children:m.jsx(He,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(sm,{className:"size-4"})})}),e[6]=O):O=e[6];let z;return e[7]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx(Lf,{children:m.jsx(If,{children:"Quick Switch"})}),e[7]=z):z=e[7],m.jsxs(jf,{open:o,onOpenChange:l,children:[O,m.jsxs(Of,{side:"bottom",className:"max-h-[80vh]",children:[z,m.jsx("div",{className:"mt-4",children:S()})]})]})}const _=Df;let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(bv,{asChild:!0,children:m.jsx(He,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(sm,{className:"size-4"})})}),e[8]=b):b=e[8];const k=Mf,T="w-[300px] p-0",R="start",M=S();let A;e[9]!==k||e[10]!==M?(A=m.jsx(k,{className:T,align:R,children:M}),e[9]=k,e[10]=M,e[11]=A):A=e[11];let j;return e[12]!==_||e[13]!==o||e[14]!==b||e[15]!==A?(j=m.jsxs(_,{open:o,onOpenChange:l,children:[b,A]}),e[12]=_,e[13]=o,e[14]=b,e[15]=A,e[16]=j):j=e[16],j}function jx(t){const e=fe.c(13),{viewMode:n,onViewModeChange:r}=t;let o;e[0]!==r||e[1]!==n?(o=()=>{r(n==="overview"?"default":"overview")},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o,c=n==="overview";let a;e[3]!==c?(a=c?m.jsx(pA,{className:"h-4 w-4"}):m.jsx(fA,{className:"h-4 w-4"}),e[3]=c,e[4]=a):a=e[4];let u;e[5]!==a||e[6]!==l?(u=m.jsx(Sc,{asChild:!0,children:m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:l,children:a})}),e[5]=a,e[6]=l,e[7]=u):u=e[7];const d=c?"Single workspace":"Overview";let p;e[8]!==d?(p=m.jsx(wc,{children:d}),e[8]=d,e[9]=p):p=e[9];let h;return e[10]!==u||e[11]!==p?(h=m.jsx(Fd,{children:m.jsxs(xc,{children:[u,p]})}),e[10]=u,e[11]=p,e[12]=h):h=e[12],h}function jH(t){const e=fe.c(69),{headerTitle:n,isLoggedIn:r,activeWorkspace:o,onServerSwitch:l,onSelectWorkspace:c,onSidebarViewModeChange:a}=t,u=zt(zH),d=zt(PH),p=zt(IH),h=zt(LH),v=zt(OH);let x;e[0]!==r?(x=r&&m.jsx(Ab,{}),e[0]=r,e[1]=x):x=e[1];let C;e[2]!==n?(C=m.jsx("span",{className:"font-semibold",children:n}),e[2]=n,e[3]=C):C=e[3];let w;e[4]!==x||e[5]!==C?(w=m.jsxs("div",{className:"flex items-center gap-2",children:[x,C]}),e[4]=x,e[5]=C,e[6]=w):w=e[6];let y;e[7]!==r||e[8]!==c||e[9]!==l?(y=r&&m.jsx(Mx,{onServerSwitch:l,onSelectWorkspace:c}),e[7]=r,e[8]=c,e[9]=l,e[10]=y):y=e[10];let S;e[11]!==r||e[12]!==a||e[13]!==u?(S=r&&m.jsx(jx,{viewMode:u,onViewModeChange:a}),e[11]=r,e[12]=a,e[13]=u,e[14]=S):S=e[14];let _;e[15]!==o||e[16]!==r||e[17]!==h||e[18]!==d?(_=r&&o&&m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:()=>h(!d),title:d?"Hide Files":"Show Files",children:m.jsx(Km,{className:"w-4 h-4"})}),e[15]=o,e[16]=r,e[17]=h,e[18]=d,e[19]=_):_=e[19];let b;e[20]!==o||e[21]!==r||e[22]!==v||e[23]!==p?(b=r&&o&&m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:()=>v(!p),title:p?"Hide Terminal":"Show Terminal",children:m.jsx(z_,{className:"w-4 h-4"})}),e[20]=o,e[21]=r,e[22]=v,e[23]=p,e[24]=b):b=e[24];let k;e[25]!==y||e[26]!==S||e[27]!==_||e[28]!==b?(k=m.jsxs("div",{className:"flex items-center gap-1",children:[y,S,_,b]}),e[25]=y,e[26]=S,e[27]=_,e[28]=b,e[29]=k):k=e[29];let T;e[30]!==w||e[31]!==k?(T=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:[w,k]}),e[30]=w,e[31]=k,e[32]=T):T=e[32];let R;e[33]!==r?(R=r&&m.jsx(Ab,{}),e[33]=r,e[34]=R):R=e[34];let M;e[35]!==n?(M=m.jsx("span",{className:"font-semibold",children:n}),e[35]=n,e[36]=M):M=e[36];let A;e[37]!==R||e[38]!==M?(A=m.jsxs("div",{className:"flex items-center gap-2",children:[R,M]}),e[37]=R,e[38]=M,e[39]=A):A=e[39];let j;e[40]!==r||e[41]!==c||e[42]!==l?(j=r&&m.jsx(Mx,{onServerSwitch:l,onSelectWorkspace:c}),e[40]=r,e[41]=c,e[42]=l,e[43]=j):j=e[43];let O;e[44]!==r||e[45]!==a||e[46]!==u?(O=r&&m.jsx(jx,{viewMode:u,onViewModeChange:a}),e[44]=r,e[45]=a,e[46]=u,e[47]=O):O=e[47];let z;e[48]!==o||e[49]!==r||e[50]!==h||e[51]!==d?(z=r&&o&&m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:()=>h(!d),title:d?"Hide Files":"Show Files",children:m.jsx(Km,{className:"w-4 h-4"})}),e[48]=o,e[49]=r,e[50]=h,e[51]=d,e[52]=z):z=e[52];let V;e[53]!==o||e[54]!==r||e[55]!==v||e[56]!==p?(V=r&&o&&m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:()=>v(!p),title:p?"Hide Terminal":"Show Terminal",children:m.jsx(z_,{className:"w-4 h-4"})}),e[53]=o,e[54]=r,e[55]=v,e[56]=p,e[57]=V):V=e[57];let F;e[58]!==j||e[59]!==O||e[60]!==z||e[61]!==V?(F=m.jsxs("div",{className:"flex items-center gap-2",children:[j,O,z,V]}),e[58]=j,e[59]=O,e[60]=z,e[61]=V,e[62]=F):F=e[62];let W;e[63]!==A||e[64]!==F?(W=m.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[A,F]}),e[63]=A,e[64]=F,e[65]=W):W=e[65];let G;return e[66]!==W||e[67]!==T?(G=m.jsxs(m.Fragment,{children:[T,W]}),e[66]=W,e[67]=T,e[68]=G):G=e[68],G}function OH(t){return t.setShowTerminalPanel}function LH(t){return t.setShowFilesPanel}function IH(t){return t.showTerminalPanel}function PH(t){return t.showFilesPanel}function zH(t){return t.sidebarViewMode}function BH({cachedTerminal:t}){const e=N.useRef(null);return N.useEffect(()=>{const n=e.current;if(!n)return;const{terminal:r,fitAddon:o}=t;t.isOpened?r.element&&n.appendChild(r.element):(r.open(n),t.isOpened=!0),requestAnimationFrame(()=>{try{o.fit()}catch{}if(r.cols<=1||r.rows<=1){const c=()=>{try{if(o.fit(),r.cols>1&&r.rows>1)return}catch{}requestAnimationFrame(c)};requestAnimationFrame(c)}}),r.focus();const l=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{o.fit()}catch{}})});return l.observe(n),()=>{l.disconnect(),r.element&&r.element.parentElement&&r.element.parentElement.removeChild(r.element)}},[t]),m.jsx("div",{ref:e,className:"w-full h-full",onFocus:()=>t.terminal.focus()})}var Hm={exports:{}},Ox;function FH(){return Ox||(Ox=1,(function(t,e){(function(n,r){t.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(c,a,u){var d=this&&this.__decorate||function(_,b,k,T){var R,M=arguments.length,A=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,b,k,T);else for(var j=_.length-1;j>=0;j--)(R=_[j])&&(A=(M<3?R(A):M>3?R(b,k,A):R(b,k))||A);return M>3&&A&&Object.defineProperty(b,k,A),A},p=this&&this.__param||function(_,b){return function(k,T){b(k,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const h=u(9042),v=u(9924),x=u(844),C=u(4725),w=u(2585),y=u(3656);let S=a.AccessibilityManager=class extends x.Disposable{constructor(_,b,k,T){super(),this._terminal=_,this._coreBrowserService=k,this._renderService=T,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 v.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(`
|
|
591
|
+
`)))),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,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let b=0;b<_;b++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
592
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,b){this._liveRegionDebouncer.refresh(_,b,this._terminal.rows)}_renderRows(_,b){const k=this._terminal.buffer,T=k.lines.length.toString();for(let R=_;R<=b;R++){const M=k.lines.get(k.ydisp+R),A=[],j=(M==null?void 0:M.translateToString(!0,void 0,void 0,A))||"",O=(k.ydisp+R+1).toString(),z=this._rowElements[R];z&&(j.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=j,this._rowColumns.set(z,A)),z.setAttribute("aria-posinset",O),z.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,b){const k=_.target,T=this._rowElements[b===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==T)return;let R,M;if(b===0?(R=k,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var j,O;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:_.anchorNode,offset:_.anchorOffset},k={node:_.focusNode,offset:_.focusOffset};if((b.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===k.node&&b.offset>k.offset)&&([b,k]=[k,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const T=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:T,offset:(O=(j=T.textContent)==null?void 0:j.length)!=null?O:0}),!this._rowContainer.contains(k.node))return;const R=({node:z,offset:V})=>{const F=z instanceof Text?z.parentNode:z;let W=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get(F);if(!G)return console.warn("columns is null. Race condition?"),null;let q=V<G.length?G[V]:G.slice(-1)[0]+1;return q>=this._terminal.cols&&(++W,q=0),{row:W,column:q}},M=R(b),A=R(k);if(M&&A){if(M.row>A.row||M.row===A.row&&M.column>=A.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(A.row-M.row)*this._terminal.cols-M.column+A.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=S=d([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],S)},3614:(c,a)=>{function u(v){return v.replace(/\r?\n/g,"\r")}function d(v,x){return x?"\x1B[200~"+v+"\x1B[201~":v}function p(v,x,C,w){v=d(v=u(v),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),x.value=""}function h(v,x,C){const w=C.getBoundingClientRect(),y=v.clientX-w.left-10,S=v.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${y}px`,x.style.top=`${S}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=d,a.copyHandler=function(v,x){v.clipboardData&&v.clipboardData.setData("text/plain",x.selectionText),v.preventDefault()},a.handlePasteEvent=function(v,x,C,w){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),x,C,w)},a.paste=p,a.moveTextAreaUnderMouseCursor=h,a.rightClickHandler=function(v,x,C,w,y){h(v,x,C),y&&w.rightClickSelect(v),x.value=w.selectionText,x.select()}},7239:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=u(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,h,v){this._css.set(p,h,v)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,v){this._color.set(p,h,v)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,d,p,h){u.addEventListener(d,p,h);let v=!1;return{dispose:()=>{v||(v=!0,u.removeEventListener(d,p,h))}}}},3551:function(c,a,u){var d=this&&this.__decorate||function(S,_,b,k){var T,R=arguments.length,M=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,_,b,k);else for(var A=S.length-1;A>=0;A--)(T=S[A])&&(M=(R<3?T(M):R>3?T(_,b,M):T(_,b))||M);return R>3&&M&&Object.defineProperty(_,b,M),M},p=this&&this.__param||function(S,_){return function(b,k){_(b,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const h=u(3656),v=u(8460),x=u(844),C=u(2585),w=u(4725);let y=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(S,_,b,k,T){super(),this._element=S,this._mouseService=_,this._renderService=b,this._bufferService=k,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.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,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const _=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const b=S.composedPath();for(let k=0;k<b.length;k++){const T=b[k];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,_){var k,T;this._activeProviderReplies&&_||((k=this._activeProviderReplies)==null||k.forEach((R=>{R==null||R.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let b=!1;for(const[R,M]of this._linkProviderService.linkProviders.entries())_?(T=this._activeProviderReplies)!=null&&T.get(R)&&(b=this._checkLinkProviderResult(R,S,b)):M.provideLinks(S.y,(A=>{var O,z;if(this._isMouseOut)return;const j=A==null?void 0:A.map((V=>({link:V})));(O=this._activeProviderReplies)==null||O.set(R,j),b=this._checkLinkProviderResult(R,S,b),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,_){const b=new Set;for(let k=0;k<_.size;k++){const T=_.get(k);if(T)for(let R=0;R<T.length;R++){const M=T[R],A=M.link.range.start.y<S?0:M.link.range.start.x,j=M.link.range.end.y>S?this._bufferService.cols:M.link.range.end.x;for(let O=A;O<=j;O++){if(b.has(O)){T.splice(R--,1);break}b.add(O)}}}}_checkLinkProviderResult(S,_,b){var R;if(!this._activeProviderReplies)return b;const k=this._activeProviderReplies.get(S);let T=!1;for(let M=0;M<S;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(T=!0);if(!T&&k){const M=k.find((A=>this._linkAtPosition(A.link,_)));M&&(b=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let M=0;M<this._activeProviderReplies.size;M++){const A=(R=this._activeProviderReplies.get(M))==null?void 0:R.find((j=>this._linkAtPosition(j.link,_)));if(A){b=!0,this._handleNewLink(A);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const _=this._positionFromMouseEvent(S,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,_){this._currentLink&&this._lastMouseEvent&&(!S||!_||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(S.link,_)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var b,k;return(k=(b=this._currentLink)==null?void 0:b.state)==null?void 0:k.decorations.pointerCursor},set:b=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,k;return(k=(b=this._currentLink)==null?void 0:b.state)==null?void 0:k.decorations.underline},set:b=>{var k,T,R;(k=this._currentLink)!=null&&k.state&&((R=(T=this._currentLink)==null?void 0:T.state)==null?void 0:R.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const k=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(k,T),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(S,_,b){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(b,_.text)}_fireUnderlineEvent(S,_){const b=S.range,k=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-k-1,b.end.x,b.end.y-k-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(S,_,b){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(b,_.text)}_linkAtPosition(S,_){const b=S.range.start.y*this._bufferService.cols+S.range.start.x,k=S.range.end.y*this._bufferService.cols+S.range.end.x,T=_.y*this._bufferService.cols+_.x;return b<=T&&T<=k}_positionFromMouseEvent(S,_,b){const k=b.getCoords(S,_,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,_,b,k,T){return{x1:S,y1:_,x2:b,y2:k,cols:this._bufferService.cols,fg:T}}};a.Linkifier=y=d([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],y)},9042:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,_){var b,k=arguments.length,T=k<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,S,_);else for(var R=w.length-1;R>=0;R--)(b=w[R])&&(T=(k<3?b(T):k>3?b(y,S,T):b(y,S))||T);return k>3&&T&&Object.defineProperty(y,S,T),T},p=this&&this.__param||function(w,y){return function(S,_){y(S,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const h=u(511),v=u(2585);let x=a.OscLinkProvider=class{constructor(w,y,S){this._bufferService=w,this._optionsService=y,this._oscLinkService=S}provideLinks(w,y){var j;const S=this._bufferService.buffer.lines.get(w-1);if(!S)return void y(void 0);const _=[],b=this._optionsService.rawOptions.linkHandler,k=new h.CellData,T=S.getTrimmedLength();let R=-1,M=-1,A=!1;for(let O=0;O<T;O++)if(M!==-1||S.hasContent(O)){if(S.loadCell(O,k),k.hasExtendedAttrs()&&k.extended.urlId){if(M===-1){M=O,R=k.extended.urlId;continue}A=k.extended.urlId!==R}else M!==-1&&(A=!0);if(A||M!==-1&&O===T-1){const z=(j=this._oscLinkService.getLinkData(R))==null?void 0:j.uri;if(z){const V={start:{x:M+1,y:w},end:{x:O+(A||O!==T-1?0:1),y:w}};let F=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const W=new URL(z);["http:","https:"].includes(W.protocol)||(F=!0)}catch{F=!0}F||_.push({text:z,range:V,activate:(W,G)=>b?b.activate(W,G,V):C(0,G),hover:(W,G)=>{var q;return(q=b==null?void 0:b.hover)==null?void 0:q.call(b,W,G,V)},leave:(W,G)=>{var q;return(q=b==null?void 0:b.leave)==null?void 0:q.call(b,W,G,V)}})}A=!1,k.hasExtendedAttrs()&&k.extended.urlId?(M=O,R=k.extended.urlId):(M=-1,R=-1)}}y(_)}};function C(w,y){if(confirm(`Do you want to navigate to ${y}?
|
|
593
|
+
|
|
594
|
+
WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=x=d([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],x)},6193:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,p){this._rowCount=p,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=u(3614),p=u(3656),h=u(3551),v=u(9042),x=u(3730),C=u(1680),w=u(3107),y=u(5744),S=u(2950),_=u(1296),b=u(428),k=u(4269),T=u(5114),R=u(8934),M=u(3230),A=u(9312),j=u(4725),O=u(6731),z=u(8055),V=u(8969),F=u(8460),W=u(844),G=u(6114),q=u(8437),X=u(2584),Y=u(7399),I=u(5941),L=u(9074),P=u(2585),H=u(5435),B=u(4567),Z=u(779);class J extends V.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(K={}){super(K),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,te)=>this.refresh($,te)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,W.toDisposable)((()=>{var $,te;this._customKeyEventHandler=void 0,(te=($=this.element)==null?void 0:$.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const $ of K){let te,re="";switch($.index){case 256:te="foreground",re="10";break;case 257:te="background",re="11";break;case 258:te="cursor",re="12";break;default:te="ansi",re="4;"+$.index}switch($.type){case 0:const ae=z.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${re};${(0,I.toRgbString)(ae)}${X.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((se=>se.ansi[$.index]=z.channels.toColor(...$.color)));else{const se=te;this._themeService.modifyColors((_e=>_e[se]=z.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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 K=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(K);if(!$)return;const te=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,ae=$.getWidth(te),se=this._renderService.dimensions.css.cell.width*ae,_e=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=_e+"px",this.textarea.style.width=se+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const K=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,p.addDisposableDomListener)(this.element,"paste",K)),G.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var te,re,ae;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((te=this.element)==null?void 0:te.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),G.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(T.CoreBrowserService,this.textarea,(re=K.ownerDocument.defaultView)!=null?re:window,((ae=this._document)!=null?ae:typeof window<"u")?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(B.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,$=this.element;function te(se){const _e=K._mouseService.getMouseReportCoords(se,K.screenElement);if(!_e)return!1;let Re,je;switch(se.overrideType||se.type){case"mousemove":je=32,se.buttons===void 0?(Re=3,se.button!==void 0&&(Re=se.button<3?se.button:3)):Re=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":je=0,Re=se.button<3?se.button:3;break;case"mousedown":je=1,Re=se.button<3?se.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(se)===!1||K.viewport.getLinesScrolled(se)===0)return!1;je=se.deltaY<0?0:1,Re=4;break;default:return!1}return!(je===void 0||Re===void 0||Re>4)&&K.coreMouseService.triggerMouseEvent({col:_e.col,row:_e.row,x:_e.x,y:_e.y,button:Re,action:je,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ae={mouseup:se=>(te(se),se.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(se)),wheel:se=>(te(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&te(se)},mousemove:se=>{se.buttons||te(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?re.mousemove||($.addEventListener("mousemove",ae.mousemove),re.mousemove=ae.mousemove):($.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&se?re.wheel||($.addEventListener("wheel",ae.wheel,{passive:!1}),re.wheel=ae.wheel):($.removeEventListener("wheel",re.wheel),re.wheel=null),2&se?re.mouseup||(re.mouseup=ae.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&se?re.mousedrag||(re.mousedrag=ae.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)($,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return te(se),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(se)}))),this.register((0,p.addDisposableDomListener)($,"wheel",(se=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const _e=this.viewport.getLinesScrolled(se);if(_e===0)return;const Re=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let je="";for(let ze=0;ze<Math.abs(_e);ze++)je+=Re;return this.coreService.triggerDataEvent(je,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)($,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,p.addDisposableDomListener)($,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(K,$){var te;(te=this._renderService)==null||te.refreshRows(K,$)}updateCursorStyle(K){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(K)?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(K,$,te=0){var re;te===1?(super.scrollLines(K,$,te),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(K)}paste(K){(0,d.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,$,te){this._selectionService.setSelection(K,$,te)}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 K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,$){var te;(te=this._selectionService)==null||te.selectLines(K,$)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!$&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const te=(0,Y.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),te.type===3||te.type===2){const re=this.rows-1;return this.scrollLines(te.type===2?-re:re),this.cancel(K,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(te.cancel&&this.cancel(K,!0),!te.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(te.key!==X.C0.ETX&&te.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,$){const te=K.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||K.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||K.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?te:te&&(!$.keyCode||$.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)$=K.charCode;else if(K.which===null||K.which===void 0)$=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;$=K.which}return!(!$||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=K.data;return this.coreService.triggerDataEvent($,!0),this.cancel(K),!0}return!1}resize(K,$){K!==this.cols||$!==this.rows?super.resize(K,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,$){var te,re;(te=this._charSizeService)==null||te.measure(),(re=this.viewport)==null||re.syncScrollArea(!0)}clear(){var K;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 $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var $,te;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(te=this.viewport)==null||te.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${te};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ae=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ae};${re}t`)}}cancel(K,$){if(this.options.cancelEvents||$)return K.preventDefault(),K.stopPropagation(),!1}}a.Terminal=J},9924:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,p){this._rowCount=p,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=h-this._lastRefreshMs,x=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(c,a,u){var d=this&&this.__decorate||function(S,_,b,k){var T,R=arguments.length,M=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,_,b,k);else for(var A=S.length-1;A>=0;A--)(T=S[A])&&(M=(R<3?T(M):R>3?T(_,b,M):T(_,b))||M);return R>3&&M&&Object.defineProperty(_,b,M),M},p=this&&this.__param||function(S,_){return function(b,k){_(b,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const h=u(3656),v=u(4725),x=u(8460),C=u(844),w=u(2585);let y=a.Viewport=class extends C.Disposable{constructor(S,_,b,k,T,R,M,A){super(),this._viewportElement=S,this._scrollArea=_,this._bufferService=b,this._optionsService=k,this._charSizeService=T,this._renderService=R,this._coreBrowserService=M,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.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(S){if(S)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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<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(S,_){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&b<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const _=this._getPixelsScrolled(S);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(S,_))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let _=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(S,_){var A;let b,k="";const T=[],R=_!=null?_:this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let j=S;j<R;j++){const O=M.get(j);if(!O)continue;const z=(A=M.get(j+1))==null?void 0:A.isWrapped;if(k+=O.translateToString(!z),!z||j===M.length-1){const V=document.createElement("div");V.textContent=k,T.push(V),k.length>0&&(b=V),k=""}}return{bufferElements:T,cursorElement:b}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let _=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(S,_){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&_.altKey||b==="ctrl"&&_.ctrlKey||b==="shift"&&_.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const _=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(S,_))}};a.Viewport=y=d([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],y)},3107:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,_){var b,k=arguments.length,T=k<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,S,_);else for(var R=w.length-1;R>=0;R--)(b=w[R])&&(T=(k<3?b(T):k>3?b(y,S,T):b(y,S))||T);return k>3&&T&&Object.defineProperty(y,S,T),T},p=this&&this.__param||function(w,y){return function(S,_){y(S,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const h=u(4725),v=u(844),x=u(2585);let C=a.BufferDecorationRenderer=class extends v.Disposable{constructor(w,y,S,_,b){super(),this._screenElement=w,this._bufferService=y,this._coreBrowserService=S,this._decorationService=_,this._renderService=b,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((k=>this._removeDecoration(k)))),this.register((0,v.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 _,b;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((_=w==null?void 0:w.options)==null?void 0:_.layer)==="top"),y.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=(b=w.options.x)!=null?b:0;return S&&S>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(w,y),y}_refreshStyle(w){const y=w.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let S=this._decorationElements.get(w);S||(S=this._createElement(w),w.element=S,this._decorationElements.set(w,S),this._container.appendChild(S),w.onDispose((()=>{this._decorationElements.delete(w),S.remove()}))),S.style.top=y*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(S)}}_refreshXPosition(w,y=w.element){var _;if(!y)return;const S=(_=w.options.x)!=null?_:0;(w.options.anchor||"left")==="right"?y.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var y;(y=this._decorationElements.get(w))==null||y.remove(),this._decorationElements.delete(w),w.dispose()}};a.BufferDecorationRenderer=C=d([p(1,x.IBufferService),p(2,h.ICoreBrowserService),p(3,x.IDecorationService),p(4,h.IRenderService)],C)},5871:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,p){return d>=u.startBufferLine-this._linePadding[p||"full"]&&d<=u.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(c,a,u){var d=this&&this.__decorate||function(b,k,T,R){var M,A=arguments.length,j=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,k,T,R);else for(var O=b.length-1;O>=0;O--)(M=b[O])&&(j=(A<3?M(j):A>3?M(k,T,j):M(k,T))||j);return A>3&&j&&Object.defineProperty(k,T,j),j},p=this&&this.__param||function(b,k){return function(T,R){k(T,R,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const h=u(5871),v=u(4725),x=u(844),C=u(2585),w={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let _=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,k,T,R,M,A,j){var z;super(),this._viewportElement=b,this._screenElement=k,this._bufferService=T,this._decorationService=R,this._renderService=M,this._optionsService=A,this._coreBrowserService=j,this._colorZoneStore=new h.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(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var V;(V=this._canvas)==null||V.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 b=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=b,y.center=k,y.right=b,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=y.left,S.right=y.left+y.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=k,w.center=k,w.right=k}_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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const k of b)k.position!=="full"&&this._renderColorZone(k);for(const k of b)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(S[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),y[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,k){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=_=d([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,v.IRenderService),p(5,C.IOptionsService),p(6,v.ICoreBrowserService)],_)},2950:function(c,a,u){var d=this&&this.__decorate||function(w,y,S,_){var b,k=arguments.length,T=k<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,y,S,_);else for(var R=w.length-1;R>=0;R--)(b=w[R])&&(T=(k<3?b(T):k>3?b(y,S,T):b(y,S))||T);return k>3&&T&&Object.defineProperty(y,S,T),T},p=this&&this.__param||function(w,y){return function(S,_){y(S,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const h=u(4725),v=u(2585),x=u(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,y,S,_,b,k){this._textarea=w,this._compositionView=y,this._bufferService=S,this._optionsService=_,this._coreService=b,this._renderService=k,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 y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,S=y.replace(w,"");this._dataAlreadySent=S,y.length>w.length?this._coreService.triggerDataEvent(S,!0):y.length<w.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):y.length===w.length&&y!==w&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=d([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,h.IRenderService)],C)},9806:(c,a)=>{function u(d,p,h){const v=h.getBoundingClientRect(),x=d.getComputedStyle(h),C=parseInt(x.getPropertyValue("padding-left")),w=parseInt(x.getPropertyValue("padding-top"));return[p.clientX-v.left-C,p.clientY-v.top-w]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(d,p,h,v,x,C,w,y,S){if(!C)return;const _=u(d,p,h);return _?(_[0]=Math.ceil((_[0]+(S?w/2:0))/w),_[1]=Math.ceil(_[1]/y),_[0]=Math.min(Math.max(_[0],1),v+(S?1:0)),_[1]=Math.min(Math.max(_[1],1),x),_):void 0}},9504:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=u(2584);function p(y,S,_,b){const k=y-h(y,_),T=S-h(S,_),R=Math.abs(k-T)-(function(M,A,j){let O=0;const z=M-h(M,j),V=A-h(A,j);for(let F=0;F<Math.abs(z-V);F++){const W=v(M,A)==="A"?-1:1,G=j.buffer.lines.get(z+W*F);G!=null&&G.isWrapped&&O++}return O})(y,S,_);return w(R,C(v(y,S),b))}function h(y,S){let _=0,b=S.buffer.lines.get(y),k=b==null?void 0:b.isWrapped;for(;k&&y>=0&&y<S.rows;)_++,b=S.buffer.lines.get(--y),k=b==null?void 0:b.isWrapped;return _}function v(y,S){return y>S?"A":"B"}function x(y,S,_,b,k,T){let R=y,M=S,A="";for(;R!==_||M!==b;)R+=k?1:-1,k&&R>T.cols-1?(A+=T.buffer.translateBufferLineToString(M,!1,y,R),R=0,y=0,M++):!k&&R<0&&(A+=T.buffer.translateBufferLineToString(M,!1,0,y+1),R=T.cols-1,y=R,M--);return A+T.buffer.translateBufferLineToString(M,!1,y,R)}function C(y,S){const _=S?"O":"[";return d.C0.ESC+_+y}function w(y,S){y=Math.floor(y);let _="";for(let b=0;b<y;b++)_+=S;return _}a.moveToCellSequence=function(y,S,_,b){const k=_.buffer.x,T=_.buffer.y;if(!_.buffer.hasScrollback)return(function(A,j,O,z,V,F){return p(j,z,V,F).length===0?"":w(x(A,j,A,j-h(j,V),!1,V).length,C("D",F))})(k,T,0,S,_,b)+p(T,S,_,b)+(function(A,j,O,z,V,F){let W;W=p(j,z,V,F).length>0?z-h(z,V):j;const G=z,q=(function(X,Y,I,L,P,H){let B;return B=p(I,L,P,H).length>0?L-h(L,P):Y,X<I&&B<=L||X>=I&&B<L?"C":"D"})(A,j,O,z,V,F);return w(x(A,W,O,G,q==="C",V).length,C(q,F))})(k,T,y,S,_,b);let R;if(T===S)return R=k>y?"D":"C",w(Math.abs(k-y),C(R,b));R=T>S?"D":"C";const M=Math.abs(T-S);return w((function(A,j){return j.cols-A})(T>S?y:k,_)+(M-1)*_.cols+1+((T>S?k:y)-1),C(R,b))}},1296:function(c,a,u){var d=this&&this.__decorate||function(F,W,G,q){var X,Y=arguments.length,I=Y<3?W:q===null?q=Object.getOwnPropertyDescriptor(W,G):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(F,W,G,q);else for(var L=F.length-1;L>=0;L--)(X=F[L])&&(I=(Y<3?X(I):Y>3?X(W,G,I):X(W,G))||I);return Y>3&&I&&Object.defineProperty(W,G,I),I},p=this&&this.__param||function(F,W){return function(G,q){W(G,q,F)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const h=u(3787),v=u(2550),x=u(2223),C=u(6171),w=u(6052),y=u(4725),S=u(8055),_=u(8460),b=u(844),k=u(2585),T="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",A="xterm-bg-",j="xterm-focus",O="xterm-selection";let z=1,V=a.DomRenderer=class extends b.Disposable{constructor(F,W,G,q,X,Y,I,L,P,H,B,Z,J){super(),this._terminal=F,this._document=W,this._element=G,this._screenElement=q,this._viewportElement=X,this._helperContainer=Y,this._linkifier2=I,this._charSizeService=P,this._optionsService=H,this._bufferService=B,this._coreBrowserService=Z,this._themeService=J,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.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(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.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 F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),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 G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${R} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${R} .xterm-dim { color: ${S.color.multiplyOpacity(F.foreground,.5).css};}`,W+=`${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 G=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;W+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${q} { 50% { box-shadow: none; }}`,W+=`@keyframes ${X} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,W+=`${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,I]of F.ansi.entries())W+=`${this._terminalSelector} .${M}${Y} { color: ${I.css}; }${this._terminalSelector} .${M}${Y}.xterm-dim { color: ${S.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${A}${Y} { background-color: ${I.css}; }`;W+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(F.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,W){for(let G=this._rowElements.length;G<=W;G++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,W){this._refreshRowElements(F,W),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(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,W,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,W,G),this.renderRows(0,this._bufferService.rows-1),!F||!W)return;this._selectionRenderModel.update(this._terminal,F,W,G);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(G){const P=F[0]>W[0];L.appendChild(this._createSelectionElement(Y,P?W[0]:F[0],P?F[0]:W[0],I-Y+1))}else{const P=q===Y?F[0]:0,H=Y===X?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(Y,P,H));const B=I-Y-1;if(L.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,B)),Y!==I){const Z=X===I?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,Z))}}this._selectionContainer.appendChild(L)}_createSelectionElement(F,W,G,q=1){const X=this._document.createElement("div"),Y=W*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(G-W);return Y+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Y),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=F*this.dimensions.css.cell.height+"px",X.style.left=`${Y}px`,X.style.width=`${I}px`,X}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 F of this._rowElements)F.replaceChildren()}renderRows(F,W){const G=this._bufferService.buffer,q=G.ybase+G.y,X=Math.min(G.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=F;P<=W;P++){const H=P+G.ydisp,B=this._rowElements[P],Z=G.lines.get(H);if(!B||!Z)break;B.replaceChildren(...this._rowFactory.createRow(Z,H,H===q,I,L,X,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,W,G,q,X,Y){G<0&&(F=0),q<0&&(W=0);const I=this._bufferService.rows-1;G=Math.max(Math.min(G,I),0),q=Math.max(Math.min(q,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,P=L.ybase+L.y,H=Math.min(L.x,X-1),B=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=G;ee<=q;++ee){const K=ee+L.ydisp,$=this._rowElements[ee],te=L.lines.get(K);if(!$||!te)break;$.replaceChildren(...this._rowFactory.createRow(te,K,K===P,Z,J,H,B,this.dimensions.css.cell.width,this._widthCache,Y?ee===G?F:0:-1,Y?(ee===q?W:X)-1:-1))}}};a.DomRenderer=V=d([p(7,k.IInstantiationService),p(8,y.ICharSizeService),p(9,k.IOptionsService),p(10,k.IBufferService),p(11,y.ICoreBrowserService),p(12,y.IThemeService)],V)},3787:function(c,a,u){var d=this&&this.__decorate||function(R,M,A,j){var O,z=arguments.length,V=z<3?M:j===null?j=Object.getOwnPropertyDescriptor(M,A):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(R,M,A,j);else for(var F=R.length-1;F>=0;F--)(O=R[F])&&(V=(z<3?O(V):z>3?O(M,A,V):O(M,A))||V);return z>3&&V&&Object.defineProperty(M,A,V),V},p=this&&this.__param||function(R,M){return function(A,j){M(A,j,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const h=u(2223),v=u(643),x=u(511),C=u(2585),w=u(8055),y=u(4725),S=u(4269),_=u(6171),b=u(3734);let k=a.DomRendererRowFactory=class{constructor(R,M,A,j,O,z,V){this._document=R,this._characterJoinerService=M,this._optionsService=A,this._coreBrowserService=j,this._coreService=O,this._decorationService=z,this._themeService=V,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,A){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=A}createRow(R,M,A,j,O,z,V,F,W,G,q){const X=[],Y=this._characterJoinerService.getJoinedCharacters(M),I=this._themeService.colors;let L,P=R.getNoBgTrimmedLength();A&&P<z+1&&(P=z+1);let H=0,B="",Z=0,J=0,ee=0,K=!1,$=0,te=!1,re=0;const ae=[],se=G!==-1&&q!==-1;for(let _e=0;_e<P;_e++){R.loadCell(_e,this._workCell);let Re=this._workCell.getWidth();if(Re===0)continue;let je=!1,ze=_e,ce=this._workCell;if(Y.length>0&&_e===Y[0][0]){je=!0;const Ye=Y.shift();ce=new S.JoinedCellData(this._workCell,R.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ze=Ye[1]-1,Re=ce.getWidth()}const Te=this._isCellInSelection(_e,M),ye=A&&_e===z,Pe=se&&_e>=G&&_e<=q;let Fe=!1;this._decorationService.forEachDecorationAtCell(_e,M,void 0,(Ye=>{Fe=!0}));let ve=ce.getChars()||v.WHITESPACE_CELL_CHAR;if(ve===" "&&(ce.isUnderline()||ce.isOverline())&&(ve=" "),re=Re*F-W.get(ve,ce.isBold(),ce.isItalic()),L){if(H&&(Te&&te||!Te&&!te&&ce.bg===Z)&&(Te&&te&&I.selectionForeground||ce.fg===J)&&ce.extended.ext===ee&&Pe===K&&re===$&&!ye&&!je&&!Fe){ce.isInvisible()?B+=v.WHITESPACE_CELL_CHAR:B+=ve,H++;continue}H&&(L.textContent=B),L=this._document.createElement("span"),H=0,B=""}else L=this._document.createElement("span");if(Z=ce.bg,J=ce.fg,ee=ce.extended.ext,K=Pe,$=re,te=Te,je&&z>=_e&&z<=ze&&(z=_e),!this._coreService.isCursorHidden&&ye&&this._coreService.isCursorInitialized){if(ae.push("xterm-cursor"),this._coreBrowserService.isFocused)V&&ae.push("xterm-cursor-blink"),ae.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ae.push("xterm-cursor-outline");break;case"block":ae.push("xterm-cursor-block");break;case"bar":ae.push("xterm-cursor-bar");break;case"underline":ae.push("xterm-cursor-underline")}}if(ce.isBold()&&ae.push("xterm-bold"),ce.isItalic()&&ae.push("xterm-italic"),ce.isDim()&&ae.push("xterm-dim"),B=ce.isInvisible()?v.WHITESPACE_CELL_CHAR:ce.getChars()||v.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(ae.push(`xterm-underline-${ce.extended.underlineStyle}`),B===" "&&(B=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let Ye=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&Ye<8&&(Ye+=8),L.style.textDecorationColor=I.ansi[Ye].css}ce.isOverline()&&(ae.push("xterm-overline"),B===" "&&(B=" ")),ce.isStrikethrough()&&ae.push("xterm-strikethrough"),Pe&&(L.style.textDecoration="underline");let Ne=ce.getFgColor(),Ae=ce.getFgColorMode(),Ce=ce.getBgColor(),oe=ce.getBgColorMode();const me=!!ce.isInverse();if(me){const Ye=Ne;Ne=Ce,Ce=Ye;const Ue=Ae;Ae=oe,oe=Ue}let ke,De,Be,nt=!1;switch(this._decorationService.forEachDecorationAtCell(_e,M,void 0,(Ye=>{Ye.options.layer!=="top"&&nt||(Ye.backgroundColorRGB&&(oe=50331648,Ce=Ye.backgroundColorRGB.rgba>>8&16777215,ke=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(Ae=50331648,Ne=Ye.foregroundColorRGB.rgba>>8&16777215,De=Ye.foregroundColorRGB),nt=Ye.options.layer==="top")})),!nt&&Te&&(ke=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ce=ke.rgba>>8&16777215,oe=50331648,nt=!0,I.selectionForeground&&(Ae=50331648,Ne=I.selectionForeground.rgba>>8&16777215,De=I.selectionForeground)),nt&&ae.push("xterm-decoration-top"),oe){case 16777216:case 33554432:Be=I.ansi[Ce],ae.push(`xterm-bg-${Ce}`);break;case 50331648:Be=w.channels.toColor(Ce>>16,Ce>>8&255,255&Ce),this._addStyle(L,`background-color:#${T((Ce>>>0).toString(16),"0",6)}`);break;default:me?(Be=I.foreground,ae.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Be=I.background}switch(ke||ce.isDim()&&(ke=w.color.multiplyOpacity(Be,.5)),Ae){case 16777216:case 33554432:ce.isBold()&&Ne<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ne+=8),this._applyMinimumContrast(L,Be,I.ansi[Ne],ce,ke,void 0)||ae.push(`xterm-fg-${Ne}`);break;case 50331648:const Ye=w.channels.toColor(Ne>>16&255,Ne>>8&255,255&Ne);this._applyMinimumContrast(L,Be,Ye,ce,ke,De)||this._addStyle(L,`color:#${T(Ne.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,Be,I.foreground,ce,ke,De)||me&&ae.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}ae.length&&(L.className=ae.join(" "),ae.length=0),ye||je||Fe?L.textContent=B:H++,re!==this.defaultSpacing&&(L.style.letterSpacing=`${re}px`),X.push(L),_e=ze}return L&&H&&(L.textContent=B),X}_applyMinimumContrast(R,M,A,j,O,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const V=this._getContrastCache(j);let F;if(O||z||(F=V.getColor(M.rgba,A.rgba)),F===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);F=w.color.ensureContrastRatio(O||M,z||A,W),V.setColor((O||M).rgba,(z||A).rgba,F!=null?F:null)}return!!F&&(this._addStyle(R,`color:${F.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const A=this._selectionStart,j=this._selectionEnd;return!(!A||!j)&&(this._columnSelectMode?A[0]<=j[0]?R>=A[0]&&M>=A[1]&&R<j[0]&&M<=j[1]:R<A[0]&&M>=A[1]&&R>=j[0]&&M<=j[1]:M>A[1]&&M<j[1]||A[1]===j[1]&&M===A[1]&&R>=A[0]&&R<j[0]||A[1]<j[1]&&M===j[1]&&R<j[0]||A[1]<j[1]&&M===A[1]&&R>=A[0])}};function T(R,M,A){for(;R.length<A;)R=M+R;return R}a.DomRendererRowFactory=k=d([p(1,y.ICharacterJoinerService),p(2,C.IOptionsService),p(3,y.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,y.IThemeService)],k)},2550:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 p=u.createElement("span");p.classList.add("xterm-char-measure-element");const h=u.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const v=u.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[p,h,v,x],this._container.appendChild(p),this._container.appendChild(h),this._container.appendChild(v),this._container.appendChild(x),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(u,d,p,h){u===this._font&&d===this._fontSize&&p===this._weight&&h===this._weightBold||(this._font=u,this._fontSize=d,this._weight=p,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(u,d,p){let h=0;if(!d&&!p&&u.length===1&&(h=u.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(u,0);return C>0&&(this._flat[h]=C),C}let v=u;d&&(v+="B"),p&&(v+="I");let x=this._holey.get(v);if(x===void 0){let C=0;d&&(C|=1),p&&(C|=2),x=this._measure(u,C),x>0&&this._holey.set(v,x)}return x}_measure(u,d){const p=this._measureElements[d];return p.textContent=u.repeat(32),p.offsetWidth/32}}},2223:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(c,a)=>{function u(p){return 57508<=p&&p<=57558}function d(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=d,a.allowRescaling=function(p,h,v,x){return h===1&&v>Math.ceil(1.5*x)&&p!==void 0&&p>255&&!d(p)&&!u(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return u(p)||(function(h){return 9472<=h&&h<=9631})(p)},a.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}}}},a.computeNextVariantOffset=function(p,h,v=0){return(p-(2*Math.round(h)-v))%(2*Math.round(h))}},6052:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{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(p,h,v,x=!1){if(this.selectionStart=h,this.selectionEnd=v,!h||!v||h[0]===v[0]&&h[1]===v[1])return void this.clear();const C=p.buffers.active.ydisp,w=h[1]-C,y=v[1]-C,S=Math.max(w,0),_=Math.min(y,p.rows-1);S>=p.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=y,this.viewportCappedStartRow=S,this.viewportCappedEndRow=_,this.startCol=h[0],this.endCol=v[0])}isCellSelected(p,h,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&v>=this.viewportCappedStartRow&&h<this.endCol&&v<=this.viewportCappedEndRow:h<this.startCol&&v>=this.viewportCappedStartRow&&h>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&h>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,a,u){var d=this&&this.__decorate||function(_,b,k,T){var R,M=arguments.length,A=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,b,k,T);else for(var j=_.length-1;j>=0;j--)(R=_[j])&&(A=(M<3?R(A):M>3?R(b,k,A):R(b,k))||A);return M>3&&A&&Object.defineProperty(b,k,A),A},p=this&&this.__param||function(_,b){return function(k,T){b(k,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const h=u(2585),v=u(8460),x=u(844);let C=a.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,b,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new y(_,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([p(2,h.IOptionsService)],C);class w extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,k){b!==void 0&&b>0&&k!==void 0&&k>0&&(this._result.width=b,this._result.height=k)}}class y extends w{constructor(b,k,T){super(),this._document=b,this._parentElement=k,this._optionsService=T,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 S extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(c,a,u){var d=this&&this.__decorate||function(S,_,b,k){var T,R=arguments.length,M=R<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,_,b,k);else for(var A=S.length-1;A>=0;A--)(T=S[A])&&(M=(R<3?T(M):R>3?T(_,b,M):T(_,b))||M);return R>3&&M&&Object.defineProperty(_,b,M),M},p=this&&this.__param||function(S,_){return function(b,k){_(b,k,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const h=u(3734),v=u(643),x=u(511),C=u(2585);class w extends h.AttributeData{constructor(_,b,k){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=b,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let y=a.CharacterJoinerService=class CE{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(_){const b={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(b),b.id}deregister(_){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===_)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(_);if(!b||b.length===0)return[];const k=[],T=b.translateToString(!0);let R=0,M=0,A=0,j=b.getFg(0),O=b.getBg(0);for(let z=0;z<b.getTrimmedLength();z++)if(b.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==O){if(z-R>1){const V=this._getJoinedRanges(T,A,M,b,R);for(let F=0;F<V.length;F++)k.push(V[F])}R=z,A=M,j=this._workCell.fg,O=this._workCell.bg}M+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const z=this._getJoinedRanges(T,A,M,b,R);for(let V=0;V<z.length;V++)k.push(z[V])}return k}_getJoinedRanges(_,b,k,T,R){const M=_.substring(b,k);let A=[];try{A=this._characterJoiners[0].handler(M)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const O=this._characterJoiners[j].handler(M);for(let z=0;z<O.length;z++)CE._mergeRanges(A,O[z])}catch(O){console.error(O)}return this._stringRangesToCellRanges(A,T,R),A}_stringRangesToCellRanges(_,b,k){let T=0,R=!1,M=0,A=_[T];if(A){for(let j=k;j<this._bufferService.cols;j++){const O=b.getWidth(j),z=b.getString(j).length||v.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!R&&A[0]<=M&&(A[0]=j,R=!0),A[1]<=M){if(A[1]=j,A=_[++T],!A)break;A[0]<=M?(A[0]=j,R=!0):R=!1}M+=z}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(_,b){let k=!1;for(let T=0;T<_.length;T++){const R=_[T];if(k){if(b[1]<=R[0])return _[T-1][1]=b[1],_;if(b[1]<=R[1])return _[T-1][1]=Math.max(b[1],R[1]),_.splice(T,1),_;_.splice(T,1),T--}else{if(b[1]<=R[0])return _.splice(T,0,b),_;if(b[1]<=R[1])return R[0]=Math.min(b[0],R[0]),_;b[0]<R[1]&&(R[0]=Math.min(b[0],R[0]),k=!0)}}return k?_[_.length-1][1]=b[1]:_.push(b),_}};a.CharacterJoinerService=y=d([p(0,C.IBufferService)],y)},5114:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=u(844),p=u(8460),h=u(3656);class v extends d.Disposable{constructor(w,y,S){super(),this._textarea=w,this._window=y,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,p.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}}a.CoreBrowserService=v;class x extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new p.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,h.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:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=u(844);class p extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const x=this.linkProviders.indexOf(v);x!==-1&&this.linkProviders.splice(x,1)}}}}a.LinkProviderService=p},8934:function(c,a,u){var d=this&&this.__decorate||function(C,w,y,S){var _,b=arguments.length,k=b<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,w,y,S);else for(var T=C.length-1;T>=0;T--)(_=C[T])&&(k=(b<3?_(k):b>3?_(w,y,k):_(w,y))||k);return b>3&&k&&Object.defineProperty(w,y,k),k},p=this&&this.__param||function(C,w){return function(y,S){w(y,S,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const h=u(4725),v=u(9806);let x=a.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,y,S,_){return(0,v.getCoords)(window,C,w,y,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(C,w){const y=(0,v.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};a.MouseService=x=d([p(0,h.IRenderService),p(1,h.ICharSizeService)],x)},3230:function(c,a,u){var d=this&&this.__decorate||function(_,b,k,T){var R,M=arguments.length,A=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,b,k,T);else for(var j=_.length-1;j>=0;j--)(R=_[j])&&(A=(M<3?R(A):M>3?R(b,k,A):R(b,k))||A);return M>3&&A&&Object.defineProperty(b,k,A),A},p=this&&this.__param||function(_,b){return function(k,T){b(k,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const h=u(6193),v=u(4725),x=u(8460),C=u(844),w=u(7226),y=u(2585);let S=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,b,k,T,R,M,A,j){super(),this._rowCount=_,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((O,z)=>this._renderRows(O,z)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,b),this.register(A.onWindowChange((O=>this._registerIntersectionObserver(O,b))))}_registerIntersectionObserver(_,b){if("IntersectionObserver"in _){const k=new _.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});k.observe(b),this._observerDisposable.value=(0,C.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,b,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,b,this._rowCount))}_renderRows(_,b){this._renderer.value&&(_=Math.min(_,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(_,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:b}),this._onRender.fire({start:_,end:b}),this._isNextRenderRedrawOnly=!0)}resize(_,b){this._rowCount=b,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,b;this._renderer.value&&((b=(_=this._renderer.value).clearTextureAtlas)==null||b.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(_,b)})):this._renderer.value.handleResize(_,b),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,b,k){var T;this._selectionState.start=_,this._selectionState.end=b,this._selectionState.columnSelectMode=k,(T=this._renderer.value)==null||T.handleSelectionChanged(_,b,k)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};a.RenderService=S=d([p(2,y.IOptionsService),p(3,v.ICharSizeService),p(4,y.IDecorationService),p(5,y.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],S)},9312:function(c,a,u){var d=this&&this.__decorate||function(A,j,O,z){var V,F=arguments.length,W=F<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,O):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(A,j,O,z);else for(var G=A.length-1;G>=0;G--)(V=A[G])&&(W=(F<3?V(W):F>3?V(j,O,W):V(j,O))||W);return F>3&&W&&Object.defineProperty(j,O,W),W},p=this&&this.__param||function(A,j){return function(O,z){j(O,z,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const h=u(9806),v=u(9504),x=u(456),C=u(4725),w=u(8460),y=u(844),S=u(6114),_=u(4841),b=u(511),k=u(2585),T=" ",R=new RegExp(T,"g");let M=a.SelectionService=class extends y.Disposable{constructor(A,j,O,z,V,F,W,G,q){super(),this._element=A,this._screenElement=j,this._linkifier=O,this._bufferService=z,this._coreService=V,this._mouseService=F,this._optionsService=W,this._renderService=G,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.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=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.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 A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!A||!j||A[0]===j[0]&&A[1]===j[1])}get selectionText(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!A||!j)return"";const O=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(A[0]===j[0])return"";const V=A[0]<j[0]?A[0]:j[0],F=A[0]<j[0]?j[0]:A[0];for(let W=A[1];W<=j[1];W++){const G=O.translateBufferLineToString(W,!0,V,F);z.push(G)}}else{const V=A[1]===j[1]?j[0]:void 0;z.push(O.translateBufferLineToString(A[1],!0,A[0],V));for(let F=A[1]+1;F<=j[1]-1;F++){const W=O.lines.get(F),G=O.translateBufferLineToString(F,!0);W!=null&&W.isWrapped?z[z.length-1]+=G:z.push(G)}if(A[1]!==j[1]){const F=O.lines.get(j[1]),W=O.translateBufferLineToString(j[1],!0,0,j[0]);F&&F.isWrapped?z[z.length-1]+=W:z.push(W)}}return z.map((V=>V.replace(R," "))).join(S.isWindows?`\r
|
|
595
|
+
`:`
|
|
596
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&A&&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(A){const j=this._getMouseBufferCoords(A),O=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(O&&z&&j)&&this._areCoordsInSelection(j,O,z)}isCellInSelection(A,j){const O=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!O||!z)&&this._areCoordsInSelection([A,j],O,z)}_areCoordsInSelection(A,j,O){return A[1]>j[1]&&A[1]<O[1]||j[1]===O[1]&&A[1]===j[1]&&A[0]>=j[0]&&A[0]<O[0]||j[1]<O[1]&&A[1]===O[1]&&A[0]<O[0]||j[1]<O[1]&&A[1]===j[1]&&A[0]>=j[0]}_selectWordAtCursor(A,j){var V,F;const O=(F=(V=this._linkifier.currentLink)==null?void 0:V.link)==null?void 0:F.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(A);return!!z&&(this._selectWordAt(z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,j){this._model.clearSelection(),A=Math.max(A,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const j=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(A){let j=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=O?0:(j>O&&(j-=O),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(A){return S.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const j=this._getMouseBufferCoords(A);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(A){return A.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!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(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const z=O.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[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 A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const j=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const z=(0,v.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,O=!(!A||!j||A[0]===j[0]&&A[1]===j[1]);O?A&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,j,O)):this._oldHasSelection&&this._fireOnSelectionChange(A,j,O)}_fireOnSelectionChange(A,j,O){this._oldSelectionStart=A,this._oldSelectionEnd=j,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(A,j){let O=j;for(let z=0;j>=z;z++){const V=A.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:V>1&&j!==z&&(O+=V-1)}return O}setSelection(A,j,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,j],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,j,O=!0,z=!0){if(A[0]>=this._bufferService.cols)return;const V=this._bufferService.buffer,F=V.lines.get(A[1]);if(!F)return;const W=V.translateBufferLineToString(A[1],!1);let G=this._convertViewportColToCharacterIndex(F,A[0]),q=G;const X=A[0]-G;let Y=0,I=0,L=0,P=0;if(W.charAt(G)===" "){for(;G>0&&W.charAt(G-1)===" ";)G--;for(;q<W.length&&W.charAt(q+1)===" ";)q++}else{let Z=A[0],J=A[0];F.getWidth(Z)===0&&(Y++,Z--),F.getWidth(J)===2&&(I++,J++);const ee=F.getString(J).length;for(ee>1&&(P+=ee-1,q+=ee-1);Z>0&&G>0&&!this._isCharWordSeparator(F.loadCell(Z-1,this._workCell));){F.loadCell(Z-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,Z--):K>1&&(L+=K-1,G-=K-1),G--,Z--}for(;J<F.length&&q+1<W.length&&!this._isCharWordSeparator(F.loadCell(J+1,this._workCell));){F.loadCell(J+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,J++):K>1&&(P+=K-1,q+=K-1),q++,J++}}q++;let H=G+X-Y+L,B=Math.min(this._bufferService.cols,q-G+Y+I-L-P);if(j||W.slice(G,q).trim()!==""){if(O&&H===0&&F.getCodePoint(0)!==32){const Z=V.lines.get(A[1]-1);if(Z&&F.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(J){const ee=this._bufferService.cols-J.start;H-=ee,B+=ee}}}if(z&&H+B===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const Z=V.lines.get(A[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const J=this._getWordAt([0,A[1]+1],!1,!1,!0);J&&(B+=J.length)}}return{start:H,length:B}}}_selectWordAt(A,j){const O=this._getWordAt(A,j);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[O.start,A[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(A){const j=this._getWordAt(A,!0);if(j){let O=A[1];for(;j.start<0;)j.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,O]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const j=this._bufferService.buffer.getWrappedRangeForLine(A),O={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(O,this._bufferService.cols)}};a.SelectionService=M=d([p(3,k.IBufferService),p(4,k.ICoreService),p(5,C.IMouseService),p(6,k.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],M)},4725:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=u(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(c,a,u){var d=this&&this.__decorate||function(M,A,j,O){var z,V=arguments.length,F=V<3?A:O===null?O=Object.getOwnPropertyDescriptor(A,j):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(M,A,j,O);else for(var W=M.length-1;W>=0;W--)(z=M[W])&&(F=(V<3?z(F):V>3?z(A,j,F):z(A,j))||F);return V>3&&F&&Object.defineProperty(A,j,F),F},p=this&&this.__param||function(M,A){return function(j,O){A(j,O,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const h=u(7239),v=u(8055),x=u(8460),C=u(844),w=u(2585),y=v.css.toColor("#ffffff"),S=v.css.toColor("#000000"),_=v.css.toColor("#ffffff"),b=v.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let j=0;j<216;j++){const O=A[j/36%6|0],z=A[j/6%6|0],V=A[j%6];M.push({css:v.channels.toCss(O,z,V),rgba:v.channels.toRgba(O,z,V)})}for(let j=0;j<24;j++){const O=8+10*j;M.push({css:v.channels.toCss(O,O,O),rgba:v.channels.toRgba(O,O,O)})}return M})());let T=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:S,cursor:_,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:v.color.blend(S,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:v.color.blend(S,k),ansi:a.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(M={}){const A=this._colors;if(A.foreground=R(M.foreground,y),A.background=R(M.background,S),A.cursor=R(M.cursor,_),A.cursorAccent=R(M.cursorAccent,b),A.selectionBackgroundTransparent=R(M.selectionBackground,k),A.selectionBackgroundOpaque=v.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=v.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=M.selectionForeground?R(M.selectionForeground,v.NULL_COLOR):void 0,A.selectionForeground===v.NULL_COLOR&&(A.selectionForeground=void 0),v.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=v.color.opacity(A.selectionBackgroundTransparent,.3)),v.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=v.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=a.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(M.black,a.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(M.red,a.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(M.green,a.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(M.yellow,a.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(M.blue,a.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(M.magenta,a.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(M.cyan,a.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(M.white,a.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(M.brightBlack,a.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(M.brightRed,a.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(M.brightGreen,a.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(M.brightYellow,a.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(M.brightBlue,a.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(M.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(M.brightCyan,a.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(M.brightWhite,a.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const j=Math.min(A.ansi.length-16,M.extendedAnsi.length);for(let O=0;O<j;O++)A.ansi[O+16]=R(M.extendedAnsi[O],a.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(M){M(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(M,A){if(M!==void 0)try{return v.css.toColor(M)}catch{}return A}a.ThemeService=T=d([p(0,w.IOptionsService)],T)},6349:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=u(8460),p=u(844);class h extends p.Disposable{constructor(x){super(),this._maxLength=x,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(x){if(this._maxLength===x)return;const C=new Array(x);for(let w=0;w<Math.min(x,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,C,...w){if(C){for(let y=x;y<this._length-C;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let y=this._length-1;y>=x;y--)this._array[this._getCyclicIndex(y+w.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<w.length;y++)this._array[this._getCyclicIndex(x+y)]=w[y];if(w.length&&this.onInsertEmitter.fire({index:x,amount:w.length}),this._length+w.length>this._maxLength){const y=this._length+w.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=w.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,w){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let S=C-1;S>=0;S--)this.set(x+S+w,this.get(x+S));const y=x+C+w-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<C;y++)this.set(x+y+w,this.get(x+y))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}a.CircularList=h},1439:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(d,p=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const v in d)h[v]=p<=1?d[v]:d[v]&&u(d[v],p-1);return h}},8055:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,d=0,p=0,h=0;var v,x,C,w,y;function S(b){const k=b.toString(16);return k.length<2?"0"+k:k}function _(b,k){return b<k?(k+.05)/(b+.05):(b+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(k,T,R,M){return M!==void 0?`#${S(k)}${S(T)}${S(R)}${S(M)}`:`#${S(k)}${S(T)}${S(R)}`},b.toRgba=function(k,T,R,M=255){return(k<<24|T<<16|R<<8|M)>>>0},b.toColor=function(k,T,R,M){return{css:b.toCss(k,T,R,M),rgba:b.toRgba(k,T,R,M)}}})(v||(a.channels=v={})),(function(b){function k(T,R){return h=Math.round(255*R),[u,d,p]=y.toChannels(T.rgba),{css:v.toCss(u,d,p,h),rgba:v.toRgba(u,d,p,h)}}b.blend=function(T,R){if(h=(255&R.rgba)/255,h===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,O=T.rgba>>24&255,z=T.rgba>>16&255,V=T.rgba>>8&255;return u=O+Math.round((M-O)*h),d=z+Math.round((A-z)*h),p=V+Math.round((j-V)*h),{css:v.toCss(u,d,p),rgba:v.toRgba(u,d,p)}},b.isOpaque=function(T){return(255&T.rgba)==255},b.ensureContrastRatio=function(T,R,M){const A=y.ensureContrastRatio(T.rgba,R.rgba,M);if(A)return v.toColor(A>>24&255,A>>16&255,A>>8&255)},b.opaque=function(T){const R=(255|T.rgba)>>>0;return[u,d,p]=y.toChannels(R),{css:v.toCss(u,d,p),rgba:R}},b.opacity=k,b.multiplyOpacity=function(T,R){return h=255&T.rgba,k(T,h*R/255)},b.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(x||(a.color=x={})),(function(b){let k,T;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(k=M,k.globalCompositeOperation="copy",T=k.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),v.toColor(u,d,p);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),h=parseInt(R.slice(4,5).repeat(2),16),v.toColor(u,d,p,h);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 M=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(M)return u=parseInt(M[1]),d=parseInt(M[2]),p=parseInt(M[3]),h=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),v.toColor(u,d,p,h);if(!k||!T)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=T,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,d,p,h]=k.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(u,d,p,h),css:R}}})(C||(a.css=C={})),(function(b){function k(T,R,M){const A=T/255,j=R/255,O=M/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}b.relativeLuminance=function(T){return k(T>>16&255,T>>8&255,255&T)},b.relativeLuminance2=k})(w||(a.rgb=w={})),(function(b){function k(R,M,A){const j=R>>24&255,O=R>>16&255,z=R>>8&255;let V=M>>24&255,F=M>>16&255,W=M>>8&255,G=_(w.relativeLuminance2(V,F,W),w.relativeLuminance2(j,O,z));for(;G<A&&(V>0||F>0||W>0);)V-=Math.max(0,Math.ceil(.1*V)),F-=Math.max(0,Math.ceil(.1*F)),W-=Math.max(0,Math.ceil(.1*W)),G=_(w.relativeLuminance2(V,F,W),w.relativeLuminance2(j,O,z));return(V<<24|F<<16|W<<8|255)>>>0}function T(R,M,A){const j=R>>24&255,O=R>>16&255,z=R>>8&255;let V=M>>24&255,F=M>>16&255,W=M>>8&255,G=_(w.relativeLuminance2(V,F,W),w.relativeLuminance2(j,O,z));for(;G<A&&(V<255||F<255||W<255);)V=Math.min(255,V+Math.ceil(.1*(255-V))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=Math.min(255,W+Math.ceil(.1*(255-W))),G=_(w.relativeLuminance2(V,F,W),w.relativeLuminance2(j,O,z));return(V<<24|F<<16|W<<8|255)>>>0}b.blend=function(R,M){if(h=(255&M)/255,h===1)return M;const A=M>>24&255,j=M>>16&255,O=M>>8&255,z=R>>24&255,V=R>>16&255,F=R>>8&255;return u=z+Math.round((A-z)*h),d=V+Math.round((j-V)*h),p=F+Math.round((O-F)*h),v.toRgba(u,d,p)},b.ensureContrastRatio=function(R,M,A){const j=w.relativeLuminance(R>>8),O=w.relativeLuminance(M>>8);if(_(j,O)<A){if(O<j){const F=k(R,M,A),W=_(j,w.relativeLuminance(F>>8));if(W<A){const G=T(R,M,A);return W>_(j,w.relativeLuminance(G>>8))?F:G}return F}const z=T(R,M,A),V=_(j,w.relativeLuminance(z>>8));if(V<A){const F=k(R,M,A);return V>_(j,w.relativeLuminance(F>>8))?z:F}return z}},b.reduceLuminance=k,b.increaseLuminance=T,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(y||(a.rgba=y={})),a.toPaddedHex=S,a.contrastRatio=_},8969:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=u(844),p=u(2585),h=u(4348),v=u(7866),x=u(744),C=u(7302),w=u(6975),y=u(8460),S=u(1753),_=u(1480),b=u(7994),k=u(9282),T=u(5435),R=u(5981),M=u(2660);let A=!1;class j extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{var V;(V=this._onScrollApi)==null||V.fire(z.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(z){for(const V in z)this.optionsService.options[V]=z[V]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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((V=>{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((V=>{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(((V,F)=>this._inputHandler.parse(V,F)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,V){this._writeBuffer.write(z,V)}writeSync(z,V){this._logService.logLevel<=p.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(z,V)}input(z,V=!0){this.coreService.triggerDataEvent(z,V)}resize(z,V){isNaN(z)||isNaN(V)||(z=Math.max(z,x.MINIMUM_COLS),V=Math.max(V,x.MINIMUM_ROWS),this._bufferService.resize(z,V))}scroll(z,V=!1){this._bufferService.scroll(z,V)}scrollLines(z,V,F){this._bufferService.scrollLines(z,V,F)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const V=z-this._bufferService.buffer.ydisp;V!==0&&this.scrollLines(V)}registerEscHandler(z,V){return this._inputHandler.registerEscHandler(z,V)}registerDcsHandler(z,V){return this._inputHandler.registerDcsHandler(z,V)}registerCsiHandler(z,V){return this._inputHandler.registerCsiHandler(z,V)}registerOscHandler(z,V){return this._inputHandler.registerOscHandler(z,V)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const V=this.optionsService.rawOptions.windowsPty;V&&V.buildNumber!==void 0&&V.buildNumber!==void 0?z=V.backend==="conpty"&&V.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const V of z)V.dispose()}))}}}a.CoreTerminal=j},8460:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,d){return u((p=>d.fire(p)))},a.runAndSubscribe=function(u,d){return d(void 0),u((p=>d(p)))}},5435:function(c,a,u){var d=this&&this.__decorate||function(Y,I,L,P){var H,B=arguments.length,Z=B<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,L):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(Y,I,L,P);else for(var J=Y.length-1;J>=0;J--)(H=Y[J])&&(Z=(B<3?H(Z):B>3?H(I,L,Z):H(I,L))||Z);return B>3&&Z&&Object.defineProperty(I,L,Z),Z},p=this&&this.__param||function(Y,I){return function(L,P){I(L,P,Y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const h=u(2584),v=u(7116),x=u(2015),C=u(844),w=u(482),y=u(8437),S=u(8460),_=u(643),b=u(511),k=u(3734),T=u(2585),R=u(1480),M=u(6242),A=u(6351),j=u(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function V(Y,I){if(Y>24)return I.setWinLines||!1;switch(Y){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var F;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(a.WindowsOptionsReportType=F={}));let W=0;class G extends C.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,P,H,B,Z,J,ee,K=new x.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=P,this._logService=H,this._optionsService=B,this._oscLinkService=Z,this._coreMouseService=J,this._unicodeService=ee,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:te.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,te,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:te,data:re})})),this._parser.setDcsHandlerFallback((($,te,re)=>{te==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:te,payload:re})})),this._parser.setPrintHandler((($,te,re)=>this.print($,te,re))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),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 $ in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler((($,te)=>this.requestStatusString($,te))))}_preserveStack(I,L,P,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=P,this._parseStack.position=H}_logSlowResolvingAsync(I){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let P,H=this._activeBuffer.x,B=this._activeBuffer.y,Z=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(P),P;H=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>z&&(Z=this._parseStack.position+z)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,($=>String.fromCharCode($))).join("")}"`),typeof I=="string"?I.split("").map(($=>$.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(I.length,z))),J||this._dirtyRowTracker.clearRange(),I.length>z)for(let $=Z;$<I.length;$+=z){const te=$+z<I.length?$+z:I.length,re=typeof I=="string"?this._stringDecoder.decode(I.substring($,te),this._parseBuffer):this._utf8Decoder.decode(I.subarray($,te),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,re))return this._preserveStack(H,B,re,$),this._logSlowResolvingAsync(P),P}else if(!J){const $=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,B,$,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===H&&this._activeBuffer.y===B||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(I,L,P){let H,B;const Z=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,te=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-L>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let ae=this._parser.precedingJoinState;for(let se=L;se<P;++se){if(H=I[se],H<127&&Z){const ze=Z[String.fromCharCode(H)];ze&&(H=ze.charCodeAt(0))}const _e=this._unicodeService.charProperties(H,ae);B=R.UnicodeService.extractWidth(_e);const Re=R.UnicodeService.extractShouldJoin(_e),je=Re?R.UnicodeService.extractWidth(ae):0;if(ae=_e,J&&this._onA11yChar.fire((0,w.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+B-je>ee){if(K){const ze=re;let ce=this._activeBuffer.x-je;for(this._activeBuffer.x=je,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),je>0&&re instanceof y.BufferLine&&re.copyCellsFrom(ze,ce,0,je,!1);ce<ee;)ze.setCellFromCodepoint(ce++,0,1,te)}else if(this._activeBuffer.x=ee-1,B===2)continue}if(Re&&this._activeBuffer.x){const ze=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-ze,H,B);for(let ce=B-je;--ce>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if($&&(re.insertCells(this._activeBuffer.x,B-je,this._activeBuffer.getNullCell(te)),re.getWidth(ee-1)===2&&re.setCellFromCodepoint(ee-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,te)),re.setCellFromCodepoint(this._activeBuffer.x++,H,B,te),B>0)for(;--B;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=ae,this._activeBuffer.x<ee&&P-L>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(P=>!V(P.params[0],this._optionsService.rawOptions.windowOptions)||L(P)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new A.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new M.OscHandler(L))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,P,H=!1,B=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.replaceCells(L,P,this._activeBuffer.getNullCell(this._eraseAttrData()),B),H&&(Z.isWrapped=!1)}_resetBufferLine(I,L=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,L=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);P<this._bufferService.rows;P++)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;L--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;L--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let L=I.params[0]||1;for(;L--;)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(I){let L=I.params[0]||1;for(;L--;)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(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const L=this._parser.precedingJoinState;if(!L)return!0;const P=I.params[0]||1,H=R.UnicodeService.extractWidth(L),B=this._activeBuffer.x-H,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(B),J=new Uint32Array(Z.length*P);let ee=0;for(let $=0;$<Z.length;){const te=Z.codePointAt($)||0;J[ee++]=te,$+=te>65535?2:1}let K=ee;for(let $=1;$<P;++$)J.copyWithin(K,0,ee),K+=ee;return this.print(J,0,K),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let L=0;L<I.length;L++)switch(I.params[L]){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(),I.params[L]===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(I,L){const P=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:B}=this._coreMouseService,Z=this._coreService,{buffers:J,cols:ee}=this._bufferService,{active:K,alt:$}=J,te=this._optionsService.rawOptions,re=Re=>Re?1:2,ae=I.params[0];return se=ae,_e=L?ae===2?4:ae===4?re(Z.modes.insertMode):ae===12?3:ae===20?re(te.convertEol):0:ae===1?re(P.applicationCursorKeys):ae===3?te.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ae===6?re(P.origin):ae===7?re(P.wraparound):ae===8?3:ae===9?re(H==="X10"):ae===12?re(te.cursorBlink):ae===25?re(!Z.isCursorHidden):ae===45?re(P.reverseWraparound):ae===66?re(P.applicationKeypad):ae===67?4:ae===1e3?re(H==="VT200"):ae===1002?re(H==="DRAG"):ae===1003?re(H==="ANY"):ae===1004?re(P.sendFocus):ae===1005?4:ae===1006?re(B==="SGR"):ae===1015?4:ae===1016?re(B==="SGR_PIXELS"):ae===1048?1:ae===47||ae===1047||ae===1049?re(K===$):ae===2004?re(P.bracketedPasteMode):0,Z.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${se};${_e}$y`),!0;var se,_e}_updateAttrColor(I,L,P,H,B){return L===2?(I|=50331648,I&=-16777216,I|=k.AttributeData.fromColorRGB([P,H,B])):L===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,L,P){const H=[0,0,-1,0,0,0];let B=0,Z=0;do{if(H[Z+B]=I.params[L+Z],I.hasSubParams(L+Z)){const J=I.getSubParams(L+Z);let ee=0;do H[1]===5&&(B=1),H[Z+ee+1+B]=J[ee];while(++ee<J.length&&ee+Z+1+B<H.length);break}if(H[1]===5&&Z+B>=2||H[1]===2&&Z+B>=5)break;H[1]&&(B=1)}while(++Z+L<I.length&&Z+B<H.length);for(let J=2;J<H.length;++J)H[J]===-1&&(H[J]=0);switch(H[0]){case 38:P.fg=this._updateAttrColor(P.fg,H[1],H[3],H[4],H[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,H[1],H[3],H[4],H[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,H[1],H[3],H[4],H[5])}return Z}_processUnderline(I,L){L.extended=L.extended.clone(),(!~I||I>5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=y.DEFAULT_ATTR_DATA.fg,I.bg=y.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let P;const H=this._curAttrData;for(let B=0;B<L;B++)P=I.params[B],P>=30&&P<=37?(H.fg&=-50331904,H.fg|=16777216|P-30):P>=40&&P<=47?(H.bg&=-50331904,H.bg|=16777216|P-40):P>=90&&P<=97?(H.fg&=-50331904,H.fg|=16777224|P-90):P>=100&&P<=107?(H.bg&=-50331904,H.bg|=16777224|P-100):P===0?this._processSGR0(H):P===1?H.fg|=134217728:P===3?H.bg|=67108864:P===4?(H.fg|=268435456,this._processUnderline(I.hasSubParams(B)?I.getSubParams(B)[0]:1,H)):P===5?H.fg|=536870912:P===7?H.fg|=67108864:P===8?H.fg|=1073741824:P===9?H.fg|=2147483648:P===2?H.bg|=134217728:P===21?this._processUnderline(2,H):P===22?(H.fg&=-134217729,H.bg&=-134217729):P===23?H.bg&=-67108865:P===24?(H.fg&=-268435457,this._processUnderline(0,H)):P===25?H.fg&=-536870913:P===27?H.fg&=-67108865:P===28?H.fg&=-1073741825:P===29?H.fg&=2147483647:P===39?(H.fg&=-67108864,H.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):P===49?(H.bg&=-67108864,H.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?B+=this._extractColor(I,B,H):P===53?H.bg|=1073741824:P===55?H.bg&=-1073741825:P===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):P===100?(H.fg&=-67108864,H.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.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(I){const L=I.params[0]||1;switch(L){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 P=L%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const L=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!V(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],P=I.split(";");for(;P.length>1;){const H=P.shift(),B=P.shift();if(/^\d+$/.exec(H)){const Z=parseInt(H);if(X(Z))if(B==="?")L.push({type:0,index:Z});else{const J=(0,j.parseColor)(B);J&&L.push({type:1,index:Z,color:J})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let H;const B=P.findIndex((Z=>Z.startsWith("id=")));return B!==-1&&(H=P[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const P=I.split(";");for(let H=0;H<P.length&&!(L>=this._specialColors.length);++H,++L)if(P[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const B=(0,j.parseColor)(P[H]);B&&this._onColor.fire([{type:1,index:this._specialColors[L],color:B}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],P=I.split(";");for(let H=0;H<P.length;++H)if(/^\d+$/.exec(P[H])){const B=parseInt(P[H]);X(B)&&L.push({type:2,index:B})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,v.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(O[I[0]],v.CHARSETS[I[1]]||v.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new b.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const P=this._activeBuffer.ybase+this._activeBuffer.y+L,H=this._activeBuffer.lines.get(P);H&&(H.fill(I),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,L){const P=this._bufferService.buffer,H=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${B}${h.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}a.InputHandler=G;let q=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,I){Y>I&&(W=Y,Y=I,I=W),Y<this.start&&(this.start=Y),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(Y){return 0<=Y&&Y<256}q=d([p(0,T.IBufferService)],q)},844:(c,a)=>{function u(d){for(const p of d)p.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.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 p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var p;this._isDisposed||d===this._value||((p=this._value)==null||p.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}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=u,a.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(p,h,v){this._data[p]||(this._data[p]={}),this._data[p][h]=v}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(d,p,h,v,x){this._data.get(d,p)||this._data.set(d,p,new u),this._data.get(d,p).set(h,v,x)}get(d,p,h,v){var x;return(x=this._data.get(d,p))==null?void 0:x.get(h,v)}clear(){this._data.clear()}}},6114:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=u.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(u=this._search(p),u===-1)||this._getKey(this._array[u])!==p)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,p){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do p(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let p=0,h=this._array.length-1;for(;h>=p;){let v=p+h>>1;const x=this._getKey(this._array[v]);if(x>d)h=v-1;else{if(!(x<d)){for(;v>0&&this._getKey(this._array[v-1])===d;)v--;return v}p=v+1}}return p}}},7226:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=u(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let C=0,w=0,y=x.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),S=x.timeRemaining(),1.5*w>S)return y-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-C))}ms`),void this._start();y=S}this.clear()}}class h extends p{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=h,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:h,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=u(643);a.updateWindowsModeWrappedState=function(p){const h=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=h==null?void 0:h.get(p.cols-1),x=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);x&&v&&(x.isWrapped=v[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&v[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new u;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}a.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,v=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=u(6349),p=u(7226),h=u(3734),v=u(8437),x=u(4634),C=u(511),w=u(643),y=u(4863),S=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(_,b,k){this._hasScrollback=_,this._optionsService=b,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,b){return new v.BufferLine(this._bufferService.cols,this.getNullCell(_),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const b=_+this._optionsService.rawOptions.scrollback;return b>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:b}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=v.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(_))}}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(_,b){const k=this.getNullCell(v.DEFAULT_ATTR_DATA);let T=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<_)for(let A=0;A<this.lines.length;A++)T+=+this.lines.get(A).resize(_,k);let M=0;if(this._rows<b)for(let A=this._rows;A<b;A++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(_,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(_,k)));else for(let A=this._rows;A>b;A--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(_,b),this._cols>_))for(let M=0;M<this.lines.length;M++)T+=+this.lines.get(M).resize(_,k);this._cols=_,this._rows=b,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,b){this._cols!==_&&(_>this._cols?this._reflowLarger(_,b):this._reflowSmaller(_,b))}_reflowLarger(_,b){const k=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(k.length>0){const T=(0,x.reflowLargerCreateNewLayout)(this.lines,k);(0,x.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(_,b,T.countRemoved)}}_reflowLargerAdjustViewport(_,b,k){const T=this.getNullCell(v.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new v.BufferLine(_,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(_,b){const k=this.getNullCell(v.DEFAULT_ATTR_DATA),T=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let A=this.lines.get(M);if(!A||!A.isWrapped&&A.getTrimmedLength()<=_)continue;const j=[A];for(;A.isWrapped&&M>0;)A=this.lines.get(--M),j.unshift(A);const O=this.ybase+this.y;if(O>=M&&O<M+j.length)continue;const z=j[j.length-1].getTrimmedLength(),V=(0,x.reflowSmallerGetNewLineLengths)(j,this._cols,_),F=V.length-j.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const G=[];for(let P=0;P<F;P++){const H=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);G.push(H)}G.length>0&&(T.push({start:M+j.length+R,newLines:G}),R+=G.length),j.push(...G);let q=V.length-1,X=V[q];X===0&&(q--,X=V[q]);let Y=j.length-F-1,I=z;for(;Y>=0;){const P=Math.min(I,X);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[Y],I-P,X-P,P,!0),X-=P,X===0&&(q--,X=V[q]),I-=P,I===0){Y--;const H=Math.max(Y,0);I=(0,x.getWrappedLineTrimmedLength)(j,H,this._cols)}}for(let P=0;P<j.length;P++)V[P]<_&&j[P].setCell(V[P],k);let L=F-W;for(;L-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+b-1)}if(T.length>0){const M=[],A=[];for(let q=0;q<this.lines.length;q++)A.push(this.lines.get(q));const j=this.lines.length;let O=j-1,z=0,V=T[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let F=0;for(let q=Math.min(this.lines.maxLength-1,j+R-1);q>=0;q--)if(V&&V.start>O+F){for(let X=V.newLines.length-1;X>=0;X--)this.lines.set(q--,V.newLines[X]);q++,M.push({index:O+1,amount:V.newLines.length}),F+=V.newLines.length,V=T[++z]}else this.lines.set(q,A[O--]);let W=0;for(let q=M.length-1;q>=0;q--)M[q].index+=W,this.lines.onInsertEmitter.fire(M[q]),W+=M[q].amount;const G=Math.max(0,j+R-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(_,b,k=0,T){const R=this.lines.get(_);return R?R.translateToString(b,k,T):""}getWrappedRangeForLine(_){let b=_,k=_;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:b,last:k}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===_&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const b=new y.Marker(_);return this.markers.push(b),b.register(this.lines.onTrim((k=>{b.line-=k,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((k=>{b.line>=k.index&&(b.line+=k.amount)}))),b.register(this.lines.onDelete((k=>{b.line>=k.index&&b.line<k.index+k.amount&&b.dispose(),b.line>k.index&&(b.line-=k.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=u(3734),p=u(511),h=u(643),v=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let x=0;class C{constructor(y,S,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const b=S||p.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let k=0;k<y;++k)this.setCell(k,b);this.length=y}get(y){const S=this._data[3*y+0],_=2097151&S;return[this._data[3*y+1],2097152&S?this._combined[y]:_?(0,v.stringFromCodePoint)(_):"",S>>22,2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):_]}set(y,S){this._data[3*y+1]=S[h.CHAR_DATA_ATTR_INDEX],S[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=S[1],this._data[3*y+0]=2097152|y|S[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=S[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&S}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y]:2097151&S?(0,v.stringFromCodePoint)(2097151&S):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,S){return x=3*y,S.content=this._data[x+0],S.fg=this._data[x+1],S.bg=this._data[x+2],2097152&S.content&&(S.combinedData=this._combined[y]),268435456&S.bg&&(S.extended=this._extendedAttrs[y]),S}setCell(y,S){2097152&S.content&&(this._combined[y]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=S.content,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}setCellFromCodepoint(y,S,_,b){268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=S|_<<22,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}addCodepointToCell(y,S,_){let b=this._data[3*y+0];2097152&b?this._combined[y]+=(0,v.stringFromCodePoint)(S):2097151&b?(this._combined[y]=(0,v.stringFromCodePoint)(2097151&b)+(0,v.stringFromCodePoint)(S),b&=-2097152,b|=2097152):b=S|4194304,_&&(b&=-12582913,b|=_<<22),this._data[3*y+0]=b}insertCells(y,S,_){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length-y){const b=new p.CellData;for(let k=this.length-y-S-1;k>=0;--k)this.setCell(y+S+k,this.loadCell(y+k,b));for(let k=0;k<S;++k)this.setCell(y+k,_)}else for(let b=y;b<this.length;++b)this.setCell(b,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(y,S,_){if(y%=this.length,S<this.length-y){const b=new p.CellData;for(let k=0;k<this.length-y-S;++k)this.setCell(y+k,this.loadCell(y+S+k,b));for(let k=this.length-S;k<this.length;++k)this.setCell(k,_)}else for(let b=y;b<this.length;++b)this.setCell(b,_);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,_)}replaceCells(y,S,_,b=!1){if(b)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,_);y<S&&y<this.length;)this.isProtected(y)||this.setCell(y,_),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,_),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,_);y<S&&y<this.length;)this.setCell(y++,_)}resize(y,S){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const b=new Uint32Array(_);b.set(this._data),this._data=b}for(let b=this.length;b<y;++b)this.setCell(b,S)}else{this._data=this._data.subarray(0,_);const b=Object.keys(this._combined);for(let T=0;T<b.length;T++){const R=parseInt(b[T],10);R>=y&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let T=0;T<k.length;T++){const R=parseInt(k[T],10);R>=y&&delete this._extendedAttrs[R]}}return this.length=y,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,S=!1){if(S)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,y);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const S in y._combined)this._combined[S]=y._combined[S];this._extendedAttrs={};for(const S in y._extendedAttrs)this._extendedAttrs[S]=y._extendedAttrs[S];this.isWrapped=y.isWrapped}clone(){const y=new C(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const S in this._combined)y._combined[S]=this._combined[S];for(const S in this._extendedAttrs)y._extendedAttrs[S]=this._extendedAttrs[S];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,S,_,b,k){const T=y._data;if(k)for(let M=b-1;M>=0;M--){for(let A=0;A<3;A++)this._data[3*(_+M)+A]=T[3*(S+M)+A];268435456&T[3*(S+M)+2]&&(this._extendedAttrs[_+M]=y._extendedAttrs[S+M])}else for(let M=0;M<b;M++){for(let A=0;A<3;A++)this._data[3*(_+M)+A]=T[3*(S+M)+A];268435456&T[3*(S+M)+2]&&(this._extendedAttrs[_+M]=y._extendedAttrs[S+M])}const R=Object.keys(y._combined);for(let M=0;M<R.length;M++){const A=parseInt(R[M],10);A>=S&&(this._combined[A-S+_]=y._combined[A])}}translateToString(y,S,_,b){S=S!=null?S:0,_=_!=null?_:this.length,y&&(_=Math.min(_,this.getTrimmedLength())),b&&(b.length=0);let k="";for(;S<_;){const T=this._data[3*S+0],R=2097151&T,M=2097152&T?this._combined[S]:R?(0,v.stringFromCodePoint)(R):h.WHITESPACE_CELL_CHAR;if(k+=M,b)for(let A=0;A<M.length;++A)b.push(S);S+=T>>22||1}return b&&b.push(S),k}}a.BufferLine=C},4841:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(c,a)=>{function u(d,p,h){if(p===d.length-1)return d[p].getTrimmedLength();const v=!d[p].hasContent(h-1)&&d[p].getWidth(h-1)===1,x=d[p+1].getWidth(0)===2;return v&&x?h-1:h}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,p,h,v,x){const C=[];for(let w=0;w<d.length-1;w++){let y=w,S=d.get(++y);if(!S.isWrapped)continue;const _=[d.get(w)];for(;y<d.length&&S.isWrapped;)_.push(S),S=d.get(++y);if(v>=w&&v<y){w+=_.length-1;continue}let b=0,k=u(_,b,p),T=1,R=0;for(;T<_.length;){const A=u(_,T,p),j=A-R,O=h-k,z=Math.min(j,O);_[b].copyCellsFrom(_[T],R,k,z,!1),k+=z,k===h&&(b++,k=0),R+=z,R===A&&(T++,R=0),k===0&&b!==0&&_[b-1].getWidth(h-1)===2&&(_[b].copyCellsFrom(_[b-1],h-1,k++,1,!1),_[b-1].setCell(h-1,x))}_[b].replaceCells(k,h,x);let M=0;for(let A=_.length-1;A>0&&(A>b||_[A].getTrimmedLength()===0);A--)M++;M>0&&(C.push(w+_.length-M),C.push(M)),w+=_.length-1}return C},a.reflowLargerCreateNewLayout=function(d,p){const h=[];let v=0,x=p[v],C=0;for(let w=0;w<d.length;w++)if(x===w){const y=p[++v];d.onDeleteEmitter.fire({index:w-C,amount:y}),w+=y-1,C+=y,x=p[++v]}else h.push(w);return{layout:h,countRemoved:C}},a.reflowLargerApplyNewLayout=function(d,p){const h=[];for(let v=0;v<p.length;v++)h.push(d.get(p[v]));for(let v=0;v<h.length;v++)d.set(v,h[v]);d.length=p.length},a.reflowSmallerGetNewLineLengths=function(d,p,h){const v=[],x=d.map(((S,_)=>u(d,_,p))).reduce(((S,_)=>S+_));let C=0,w=0,y=0;for(;y<x;){if(x-y<h){v.push(x-y);break}C+=h;const S=u(d,w,p);C>S&&(C-=S,w++);const _=d[w].getWidth(C-1)===2;_&&C--;const b=_?h-1:h;v.push(b),y+=b}return v},a.getWrappedLineTrimmedLength=u},5295:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=u(8460),p=u(844),h=u(9092);class v extends p.Disposable{constructor(C,w){super(),this._optionsService=C,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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=v},511:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=u(482),p=u(643),h=u(3734);class v extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new v;return w.setFromCharData(C),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(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const S=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(y-55296)+S-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=v},643:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=u(8460),p=u(844);class h{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=h._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,p.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}a.Marker=h,h._nextId=1},7116:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,a)=>{var u,d,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
597
|
+
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(u||(a.C0=u={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(d||(a.C1=d={})),(function(h){h.ST=`${u.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=u(2584),p={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:["'",'"']};a.evaluateKeyboardEvent=function(h,v,x,C){const w={type:0,cancel:!1,key:void 0},y=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?w.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?w.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?w.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(w.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(h.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,h.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(h.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(x?"b":"[1;5D"))):w.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(x?"f":"[1;5C"))):w.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"A",x||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;y?(w.key=d.C0.ESC+"[1;"+(y+1)+"B",x||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=y?d.C0.ESC+"[3;"+(y+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=y?d.C0.ESC+"[1;"+(y+1)+"H":v?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=y?d.C0.ESC+"[1;"+(y+1)+"F":v?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?w.type=2:h.ctrlKey?w.key=d.C0.ESC+"[5;"+(y+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?w.type=3:h.ctrlKey?w.key=d.C0.ESC+"[6;"+(y+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=y?d.C0.ESC+"[1;"+(y+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=y?d.C0.ESC+"[1;"+(y+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=y?d.C0.ESC+"[1;"+(y+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=y?d.C0.ESC+"[1;"+(y+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=y?d.C0.ESC+"[15;"+(y+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=y?d.C0.ESC+"[17;"+(y+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=y?d.C0.ESC+"[18;"+(y+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=y?d.C0.ESC+"[19;"+(y+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=y?d.C0.ESC+"[20;"+(y+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=y?d.C0.ESC+"[21;"+(y+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=y?d.C0.ESC+"[23;"+(y+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=y?d.C0.ESC+"[24;"+(y+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(x&&!C||!h.altKey||h.metaKey)!x||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?w.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(w.key=d.C0.US),h.key==="@"&&(w.key=d.C0.NUL)):h.keyCode===65&&(w.type=1);else{const S=p[h.keyCode],_=S==null?void 0:S[h.shiftKey?1:0];if(_)w.key=d.C0.ESC+_;else if(h.keyCode>=65&&h.keyCode<=90){const b=h.ctrlKey?h.keyCode-64:h.keyCode+32;let k=String.fromCharCode(b);h.shiftKey&&(k=k.toUpperCase()),w.key=d.C0.ESC+k}else if(h.keyCode===32)w.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let b=h.code.slice(3,4);h.shiftKey||(b=b.toLowerCase()),w.key=d.C0.ESC+b,w.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?w.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?w.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?w.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?w.key=d.C0.DEL:h.keyCode===219?w.key=d.C0.ESC:h.keyCode===220?w.key=d.C0.FS:h.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,d=0,p=u.length){let h="";for(let v=d;v<p;++v){let x=u[v];x>65535?(x-=65536,h+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):h+=String.fromCharCode(x)}return h},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const p=u.length;if(!p)return 0;let h=0,v=0;if(this._interim){const x=u.charCodeAt(v++);56320<=x&&x<=57343?d[h++]=1024*(this._interim-55296)+x-56320+65536:(d[h++]=this._interim,d[h++]=x),this._interim=0}for(let x=v;x<p;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=p)return this._interim=C,h;const w=u.charCodeAt(x);56320<=w&&w<=57343?d[h++]=1024*(C-55296)+w-56320+65536:(d[h++]=C,d[h++]=w)}else C!==65279&&(d[h++]=C)}return h}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const p=u.length;if(!p)return 0;let h,v,x,C,w=0,y=0,S=0;if(this.interim[0]){let k=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)T<<=6,T|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-M;for(;S<j;){if(S>=p)return 0;if(R=u[S++],(192&R)!=128){S--,k=!0;break}this.interim[M++]=R,T<<=6,T|=63&R}k||(A===2?T<128?S--:d[w++]=T:A===3?T<2048||T>=55296&&T<=57343||T===65279||(d[w++]=T):T<65536||T>1114111||(d[w++]=T)),this.interim.fill(0)}const _=p-4;let b=S;for(;b<p;){for(;!(!(b<_)||128&(h=u[b])||128&(v=u[b+1])||128&(x=u[b+2])||128&(C=u[b+3]));)d[w++]=h,d[w++]=v,d[w++]=x,d[w++]=C,b+=4;if(h=u[b++],h<128)d[w++]=h;else if((224&h)==192){if(b>=p)return this.interim[0]=h,w;if(v=u[b++],(192&v)!=128){b--;continue}if(y=(31&h)<<6|63&v,y<128){b--;continue}d[w++]=y}else if((240&h)==224){if(b>=p)return this.interim[0]=h,w;if(v=u[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=v,w;if(x=u[b++],(192&x)!=128){b--;continue}if(y=(15&h)<<12|(63&v)<<6|63&x,y<2048||y>=55296&&y<=57343||y===65279)continue;d[w++]=y}else if((248&h)==240){if(b>=p)return this.interim[0]=h,w;if(v=u[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=v,w;if(x=u[b++],(192&x)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=v,this.interim[2]=x,w;if(C=u[b++],(192&C)!=128){b--;continue}if(y=(7&h)<<18|(63&v)<<12|(63&x)<<6|63&C,y<65536||y>1114111)continue;d[w++]=y}}return w}}},225:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=u(1480),p=[[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]],h=[[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 v;a.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let x=0;x<p.length;++x)v.fill(0,p[x][0],p[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?v[x]:(function(C,w){let y,S=0,_=w.length-1;if(C<w[0][0]||C>w[_][1])return!1;for(;_>=S;)if(y=S+_>>1,C>w[y][1])S=y+1;else{if(!(C<w[y][0]))return!0;_=y-1}return!1})(x,h)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let w=this.wcwidth(x),y=w===0&&C!==0;if(y){const S=d.UnicodeService.extractWidth(C);S===0?y=!1:S>w&&(w=S)}return d.UnicodeService.createPropertyValue(0,w,y)}}},5981:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=u(8460),p=u(844);class h extends p.Disposable{constructor(x){super(),this._action=x,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(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){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+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,C);if(S){const b=k=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(w,k);return void S.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(b)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=y.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()}}a.WriteBuffer=h},5941:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\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 p(h,v){const x=h.toString(16),C=x.length<2?"0"+x:x;switch(v){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(h){if(!h)return;let v=h.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const x=u.exec(v);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const x=v.length/3,C=[0,0,0];for(let w=0;w<3;++w){const y=parseInt(v.slice(x*w,x*w+x),16);C[w]=x===1?y<<4:x===2?y:x===3?y>>4:y>>8}return C}},a.toRgbString=function(h,v=16){const[x,C,w]=h;return`rgb:${p(x,v)}/${p(C,v)}/${p(w,v)}`}},5770:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=u(482),p=u(8742),h=u(5770),v=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const y=this._handlers[C];return y.push(w),{dispose:()=>{const S=y.indexOf(w);S!==-1&&y.splice(S,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(C,w,y);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,w,y))}unhook(C,w=!0){if(this._active.length){let y=!1,S=this._active.length-1,_=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=w,_=this._stack.fallThrough,this._stack.paused=!1),!_&&y===!1){for(;S>=0&&(y=this._active[S].unhook(C),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const x=new p.Params;x.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,w,y){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,w,y),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((y=>(this._params=x,this._data="",this._hitLimit=!1,y)));return this._params=x,this._data="",this._hitLimit=!1,w}}},2015:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=u(844),p=u(8742),h=u(6242),v=u(6351);class x{constructor(S){this.table=new Uint8Array(S)}setDefault(S,_){this.table.fill(S<<4|_)}add(S,_,b,k){this.table[_<<8|S]=b<<4|k}addMany(S,_,b,k){for(let T=0;T<S.length;T++)this.table[_<<8|S[T]]=b<<4|k}}a.TransitionTable=x;const C=160;a.VT500_TRANSITION_TABLE=(function(){const y=new x(4095),S=Array.apply(null,Array(256)).map(((M,A)=>A)),_=(M,A)=>S.slice(M,A),b=_(32,127),k=_(0,24);k.push(25),k.push.apply(k,_(28,32));const T=_(0,14);let R;for(R in y.setDefault(1,0),y.addMany(b,0,2,0),T)y.addMany([24,26,153,154],R,3,0),y.addMany(_(128,144),R,3,0),y.addMany(_(144,152),R,3,0),y.add(156,R,0,0),y.add(27,R,11,1),y.add(157,R,4,8),y.addMany([152,158,159],R,0,7),y.add(155,R,11,3),y.add(144,R,11,9);return y.addMany(k,0,3,0),y.addMany(k,1,3,1),y.add(127,1,0,1),y.addMany(k,8,0,8),y.addMany(k,3,3,3),y.add(127,3,0,3),y.addMany(k,4,3,4),y.add(127,4,0,4),y.addMany(k,6,3,6),y.addMany(k,5,3,5),y.add(127,5,0,5),y.addMany(k,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(b,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(_(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(b,7,0,7),y.addMany(k,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(_(64,127),3,7,0),y.addMany(_(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(_(48,60),4,8,4),y.addMany(_(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(_(32,64),6,0,6),y.add(127,6,0,6),y.addMany(_(64,127),6,0,0),y.addMany(_(32,48),3,9,5),y.addMany(_(32,48),5,9,5),y.addMany(_(48,64),5,0,6),y.addMany(_(64,127),5,7,0),y.addMany(_(32,48),4,9,5),y.addMany(_(32,48),1,9,2),y.addMany(_(32,48),2,9,2),y.addMany(_(48,127),2,10,0),y.addMany(_(48,80),1,10,0),y.addMany(_(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(_(96,127),1,10,0),y.add(80,1,11,9),y.addMany(k,9,0,9),y.add(127,9,0,9),y.addMany(_(28,32),9,0,9),y.addMany(_(32,48),9,9,12),y.addMany(_(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(k,11,0,11),y.addMany(_(32,128),11,0,11),y.addMany(_(28,32),11,0,11),y.addMany(k,10,0,10),y.add(127,10,0,10),y.addMany(_(28,32),10,0,10),y.addMany(_(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(_(32,48),10,9,12),y.addMany(k,12,0,12),y.add(127,12,0,12),y.addMany(_(28,32),12,0,12),y.addMany(_(32,48),12,9,12),y.addMany(_(48,64),12,0,11),y.addMany(_(64,127),12,12,13),y.addMany(_(64,127),10,12,13),y.addMany(_(64,127),9,12,13),y.addMany(k,13,13,13),y.addMany(b,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(C,0,2,0),y.add(C,8,5,8),y.add(C,6,0,6),y.add(C,11,0,11),y.add(C,13,13,13),y})();class w extends d.Disposable{constructor(S=a.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,b,k)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,b)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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 h.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,_=[64,126]){let b=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=S.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<S.intermediates.length;++T){const R=S.intermediates.charCodeAt(T);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(S.final.length!==1)throw new Error("final must be a single byte");const k=S.final.charCodeAt(0);if(_[0]>k||k>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return b<<=8,b|=k,b}identToString(S){const _=[];for(;S;)_.push(String.fromCharCode(255&S)),S>>=8;return _.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,_){const b=this._identifier(S,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const k=this._escHandlers[b];return k.push(_),{dispose:()=>{const T=k.indexOf(_);T!==-1&&k.splice(T,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,_){this._executeHandlers[S.charCodeAt(0)]=_}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,_){const b=this._identifier(S);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const k=this._csiHandlers[b];return k.push(_),{dispose:()=>{const T=k.indexOf(_);T!==-1&&k.splice(T,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,_){return this._dcsParser.registerHandler(this._identifier(S),_)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,_){return this._oscParser.registerHandler(S,_)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}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(S,_,b,k,T){this._parseStack.state=S,this._parseStack.handlers=_,this._parseStack.handlerPos=b,this._parseStack.transition=k,this._parseStack.chunkPos=T}parse(S,_,b){let k,T=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&j>-1){for(;j>=0&&(k=A[j](this._params),k!==!0);j--)if(k instanceof Promise)return this._parseStack.handlerPos=j,k}this._parseStack.handlers=[];break;case 4:if(b===!1&&j>-1){for(;j>=0&&(k=A[j](),k!==!0);j--)if(k instanceof Promise)return this._parseStack.handlerPos=j,k}this._parseStack.handlers=[];break;case 6:if(T=S[this._parseStack.chunkPos],k=this._dcsParser.unhook(T!==24&&T!==26,b),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=S[this._parseStack.chunkPos],k=this._oscParser.end(T!==24&&T!==26,b),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=M;A<_;++A){switch(T=S[A],R=this._transitions.table[this.currentState<<8|(T<160?T:C)],R>>4){case 2:for(let F=A+1;;++F){if(F>=_||(T=S[F])<32||T>126&&T<C){this._printHandler(S,A,F),A=F-1;break}if(++F>=_||(T=S[F])<32||T>126&&T<C){this._printHandler(S,A,F),A=F-1;break}if(++F>=_||(T=S[F])<32||T>126&&T<C){this._printHandler(S,A,F),A=F-1;break}if(++F>=_||(T=S[F])<32||T>126&&T<C){this._printHandler(S,A,F),A=F-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|T];let O=j?j.length-1:-1;for(;O>=0&&(k=j[O](this._params),k!==!0);O--)if(k instanceof Promise)return this._preserveStack(3,j,O,R,A),k;O<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++A<_&&(T=S[A])>47&&T<60);A--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const z=this._escHandlers[this._collect<<8|T];let V=z?z.length-1:-1;for(;V>=0&&(k=z[V](),k!==!0);V--)if(k instanceof Promise)return this._preserveStack(4,z,V,R,A),k;V<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let F=A+1;;++F)if(F>=_||(T=S[F])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(S,A,F),A=F-1;break}break;case 14:if(k=this._dcsParser.unhook(T!==24&&T!==26),k)return this._preserveStack(6,[],0,R,A),k;T===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 F=A+1;;F++)if(F>=_||(T=S[F])<32||T>127&&T<C){this._oscParser.put(S,A,F),A=F-1;break}break;case 6:if(k=this._oscParser.end(T!==24&&T!==26),k)return this._preserveStack(5,[],0,R,A),k;T===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=w},6242:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=u(5770),p=u(482),h=[];a.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,x){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(x),{dispose:()=>{const w=C.indexOf(x);w!==-1&&C.splice(w,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,x,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(v,x,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,x,C))}start(){this.reset(),this._state=1}put(v,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const w=v[x++];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&&C-x>0&&this._put(v,x,C)}}end(v,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,y=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=x,y=this._stack.fallThrough,this._stack.paused=!1),!y&&C===!1){for(;w>=0&&(C=this._active[w].end(v),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=h,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,x,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,x,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let x=!1;if(this._hitLimit)x=!1;else if(v&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class d{static fromArray(h){const v=new d;if(!h.length)return v;for(let x=Array.isArray(h[0])?1:0;x<h.length;++x){const C=h[x];if(Array.isArray(C))for(let w=0;w<C.length;++w)v.addSubParam(C[w]);else v.addParam(C)}return v}constructor(h=32,v=32){if(this.maxLength=h,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let v=0;v<this.length;++v){h.push(this.params[v]);const x=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-x>0&&h.push(Array.prototype.slice.call(this._subParams,x,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>u?u:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>u?u:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const v=this._subParamsIdx[h]>>8,x=255&this._subParamsIdx[h];return x-v>0?this._subParams.subarray(v,x):null}getSubParamsAll(){const h={};for(let v=0;v<this.length;++v){const x=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-x>0&&(h[v]=this._subParams.slice(x,C))}return h}addDigit(h){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[v-1];x[v-1]=~C?Math.min(10*C+h,u):h}}a.Params=d},5741:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===u){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=u(3785),p=u(511);a.BufferApiView=class{constructor(h,v){this._buffer=h,this.type=v}init(h){return this._buffer=h,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(h){const v=this._buffer.lines.get(h);if(v)return new d.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=u(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,h){if(!(p<0||p>=this._line.length))return h?(this._line.loadCell(p,h),h):this._line.loadCell(p,new d.CellData)}translateToString(p,h,v){return this._line.translateToString(p,h,v)}}},8285:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=u(8771),p=u(8460),h=u(844);class v extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.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)}}a.BufferNamespaceApi=v},7975:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(p=>d(p.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((p,h)=>d(p,h.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(c,a,u){var d=this&&this.__decorate||function(y,S,_,b){var k,T=arguments.length,R=T<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,S,_,b);else for(var M=y.length-1;M>=0;M--)(k=y[M])&&(R=(T<3?k(R):T>3?k(S,_,R):k(S,_))||R);return T>3&&R&&Object.defineProperty(S,_,R),R},p=this&&this.__param||function(y,S){return function(_,b){S(_,b,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const h=u(8460),v=u(844),x=u(5295),C=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const _=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===y.fg&&b.getBg(0)===y.bg||(b=_.getBlankLine(y,S),this._cachedBlankLine=b),b.isWrapped=S;const k=_.ybase+_.scrollTop,T=_.ybase+_.scrollBottom;if(_.scrollTop===0){const R=_.lines.isFull;T===_.lines.length-1?R?_.lines.recycle().copyFrom(b):_.lines.push(b.clone()):_.lines.splice(T+1,0,b.clone()),R?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const R=T-k+1;_.lines.shiftElements(k+1,R-1,-1),_.lines.set(T,b.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(y,S,_){const b=this.buffer;if(y<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else y+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const k=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+y,b.ybase),0),k!==b.ydisp&&(S||this._onScroll.fire(b.ydisp))}};a.BufferService=w=d([p(0,C.IOptionsService)],w)},7994:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(c,a,u){var d=this&&this.__decorate||function(b,k,T,R){var M,A=arguments.length,j=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,k,T,R);else for(var O=b.length-1;O>=0;O--)(M=b[O])&&(j=(A<3?M(j):A>3?M(k,T,j):M(k,T))||j);return A>3&&j&&Object.defineProperty(k,T,j),j},p=this&&this.__param||function(b,k){return function(T,R){k(T,R,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const h=u(2585),v=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,k){let T=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(T|=64,T|=b.action):(T|=3&b.button,4&b.button&&(T|=64),8&b.button&&(T|=128),b.action===32?T|=32:b.action!==0||k||(T|=3)),T}const y=String.fromCharCode,S={DEFAULT:b=>{const k=[w(b,!1)+32,b.col+32,b.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${y(k[0])}${y(k[1])}${y(k[2])}`},SGR:b=>{const k=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${k}`},SGR_PIXELS:b=>{const k=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${k}`}};let _=a.CoreMouseService=class extends x.Disposable{constructor(b,k){super(),this._bufferService=b,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(S))this.addEncoding(T,S[T]);this.reset()}addProtocol(b,k){this._protocols[b]=k}addEncoding(b,k){this._encodings[b]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const k=this._encodings[this._activeEncoding](b);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,k,T){if(T){if(b.x!==k.x||b.y!==k.y)return!1}else if(b.col!==k.col||b.row!==k.row)return!1;return b.button===k.button&&b.action===k.action&&b.ctrl===k.ctrl&&b.alt===k.alt&&b.shift===k.shift}};a.CoreMouseService=_=d([p(0,h.IBufferService),p(1,h.ICoreService)],_)},6975:function(c,a,u){var d=this&&this.__decorate||function(_,b,k,T){var R,M=arguments.length,A=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,b,k,T);else for(var j=_.length-1;j>=0;j--)(R=_[j])&&(A=(M<3?R(A):M>3?R(b,k,A):R(b,k))||A);return M>3&&A&&Object.defineProperty(b,k,A),A},p=this&&this.__param||function(_,b){return function(k,T){b(k,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const h=u(1439),v=u(8460),x=u(844),C=u(2585),w=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=a.CoreService=class extends x.Disposable{constructor(_,b,k){super(),this._bufferService=_,this._logService=b,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(w),this.decPrivateModes=(0,h.clone)(y)}reset(){this.modes=(0,h.clone)(w),this.decPrivateModes=(0,h.clone)(y)}triggerDataEvent(_,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(_))}};a.CoreService=S=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],S)},9074:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=u(8055),p=u(8460),h=u(844),v=u(6106);let x=0,C=0;class w extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const b=new y(_);if(b){const k=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),k.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,b,k){var M,A,j;let T=0,R=0;for(const O of this._decorations.getKeyIterator(b))T=(M=O.options.x)!=null?M:0,R=T+((A=O.options.width)!=null?A:1),_>=T&&_<R&&(!k||((j=O.options.layer)!=null?j:"bottom")===k)&&(yield O)}forEachDecorationAtCell(_,b,k,T){this._decorations.forEachByKey(b,(R=>{var M,A,j;x=(M=R.options.x)!=null?M:0,C=x+((A=R.options.width)!=null?A:1),_>=x&&_<C&&(!k||((j=R.options.layer)!=null?j:"bottom")===k)&&T(R)}))}}a.DecorationService=w;class y extends h.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(_){super(),this.options=_,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=u(2585),p=u(8343);class h{constructor(...x){this._entries=new Map;for(const[C,w]of x)this.set(C,w)}set(x,C){const w=this._entries.get(x);return this._entries.set(x,C),w}forEach(x){for(const[C,w]of this._entries.entries())x(C,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=h,a.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(v,x){this._services.set(v,x)}getService(v){return this._services.get(v)}createInstance(v,...x){const C=(0,p.getServiceDependencies)(v).sort(((S,_)=>S.index-_.index)),w=[];for(const S of C){const _=this._services.get(S.id);if(!_)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${S.id}.`);w.push(_)}const y=C.length>0?C[0].index:x.length;if(x.length!==y)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${y+1} conflicts with ${x.length} static arguments`);return new v(...x,...w)}}},7866:function(c,a,u){var d=this&&this.__decorate||function(y,S,_,b){var k,T=arguments.length,R=T<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,S,_,b);else for(var M=y.length-1;M>=0;M--)(k=y[M])&&(R=(T<3?k(R):T>3?k(S,_,R):k(S,_))||R);return T>3&&R&&Object.defineProperty(S,_,R),R},p=this&&this.__param||function(y,S){return function(_,b){S(_,b,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const h=u(844),v=u(2585),x={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,w=a.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,_){this._evalLazyOptionalParams(_),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,..._)}trace(y,...S){var _,b;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((b=(_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))!=null?b:console.log,y,S)}debug(y,...S){var _,b;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((b=(_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))!=null?b:console.log,y,S)}info(y,...S){var _,b;this._logLevel<=v.LogLevelEnum.INFO&&this._log((b=(_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))!=null?b:console.info,y,S)}warn(y,...S){var _,b;this._logLevel<=v.LogLevelEnum.WARN&&this._log((b=(_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))!=null?b:console.warn,y,S)}error(y,...S){var _,b;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((b=(_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))!=null?b:console.error,y,S)}};a.LogService=w=d([p(0,v.IOptionsService)],w),a.setTraceLogger=function(y){C=y},a.traceCall=function(y,S,_){if(typeof _.value!="function")throw new Error("not supported");const b=_.value;_.value=function(...k){if(C.logLevel!==v.LogLevelEnum.TRACE)return b.apply(this,k);C.trace(`GlyphRenderer#${b.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const T=b.apply(this,k);return C.trace(`GlyphRenderer#${b.name} return`,T),T}}},7302:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=u(8460),p=u(844),h=u(6114);a.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const S in w)if(S in y)try{const _=w[S];y[S]=this._sanitizeAndValidateOption(S,_)}catch(_){console.error(_)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,y){return this.onOptionChange((S=>{S===w&&y(this.rawOptions[w])}))}onMultipleOptionChange(w,y){return this.onOptionChange((S=>{w.indexOf(S)!==-1&&y()}))}_setupOptions(){const w=S=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,_)=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);_=this._sanitizeAndValidateOption(S,_),this.rawOptions[S]!==_&&(this.rawOptions[S]=_,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const _={get:w.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,_)}}_sanitizeAndValidateOption(w,y){switch(w){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[w]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${w}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=v.includes(y)?y:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${w} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${w} must be numeric, value: ${y}`);break;case"windowsPty":y=y!=null?y:{}}return y}}a.OptionsService=x},2660:function(c,a,u){var d=this&&this.__decorate||function(x,C,w,y){var S,_=arguments.length,b=_<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,C,w,y);else for(var k=x.length-1;k>=0;k--)(S=x[k])&&(b=(_<3?S(b):_>3?S(C,w,b):S(C,w))||b);return _>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(x,C){return function(w,y){C(w,y,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const h=u(2585);let v=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const k=C.addMarker(C.ybase+C.y),T={data:x,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(T,k))),this._dataByLinkId.set(T.id,T),T.id}const w=x,y=this._getEntryIdKey(w),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,C.ybase+C.y),S.id;const _=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(b,_))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(x,C){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((y=>y.line!==C))){const y=this._bufferService.buffer.addMarker(C);w.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(w,y)))}}getLinkData(x){var C;return(C=this._dataByLinkId.get(x))==null?void 0:C.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const w=x.lines.indexOf(C);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};a.OscLinkService=v=d([p(0,h.IBufferService)],v)},8343:(c,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[d]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const h=function(v,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,y,S){y[u]===y?y[d].push({id:w,index:S}):(y[d]=[{id:w,index:S}],y[u]=y)})(h,v,C)};return h.toString=()=>p,a.serviceRegistry.set(p,h),h}},2585:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=u(8343);var p;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(c,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=u(8460),p=u(225);class h{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,w=!1){return(16777215&x)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new p.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,w=0;const y=x.length;for(let S=0;S<y;++S){let _=x.charCodeAt(S);if(55296<=_&&_<=56319){if(++S>=y)return C+this.wcwidth(_);const T=x.charCodeAt(S);56320<=T&&T<=57343?_=1024*(_-55296)+T-56320+65536:C+=this.wcwidth(T)}const b=this.charProperties(_,w);let k=h.extractWidth(b);h.extractShouldJoin(b)&&(k-=h.extractWidth(w)),C+=k,w=b}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}a.UnicodeService=h}},r={};function o(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c].call(u.exports,u,u.exports,o),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const a=o(9042),u=o(3236),d=o(844),p=o(5741),h=o(8285),v=o(7975),x=o(7090),C=["cols","rows"];class w extends d.Disposable{constructor(S){super(),this._core=this.register(new u.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const _=k=>this._core.options[k],b=(k,T)=>{this._checkReadonlyOptions(k),this._core.options[k]=T};for(const k in this._core.options){const T={get:_.bind(this,k),set:b.bind(this,k)};Object.defineProperty(this._publicOptions,k,T)}}_checkReadonlyOptions(S){if(C.includes(S))throw new Error(`Option "${S}" 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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const _ in S)this._publicOptions[_]=S[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,_=!0){this._core.input(S,_)}resize(S,_){this._verifyIntegers(S,_),this._core.resize(S,_)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){var _,b,k;return this._checkProposedApi(),this._verifyPositiveIntegers((_=S.x)!=null?_:0,(b=S.width)!=null?b:0,(k=S.height)!=null?k:0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,_,b){this._verifyIntegers(S,_,b),this._core.select(S,_,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,_){this._verifyIntegers(S,_),this._core.selectLines(S,_)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,_){this._core.write(S,_)}writeln(S,_){this._core.write(S),this._core.write(`\r
|
|
598
|
+
`,_)}paste(S){this._core.paste(S)}refresh(S,_){this._verifyIntegers(S,_),this._core.refresh(S,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return a}_verifyIntegers(...S){for(const _ of S)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const _ of S)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}c.Terminal=w})(),l})()))})(Hm)),Hm.exports}var HH=FH(),Um={exports:{}},Lx;function UH(){return Lx||(Lx=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const l=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(l._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,l=o._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),h=u-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(v/l.css.cell.width)),rows:Math.max(1,Math.floor(h/l.css.cell.height))}}}})(),n})()))})(Um)),Um.exports}var $H=UH(),$m={exports:{}},Ix;function VH(){return Ix||(Ix=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={6:(c,a)=>{function u(p){try{const h=new URL(p),v=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return p.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,h,v,x={}){this._terminal=p,this._regex=h,this._handler=v,this._options=x}provideLinks(p,h){const v=d.computeLink(p,this._regex,this._terminal,this._handler);h(this._addCallbacks(v))}_addCallbacks(p){return p.map((h=>(h.leave=this._options.leave,h.hover=(v,x)=>{if(this._options.hover){const{range:C}=h;this._options.hover(v,x,C)}},h)))}};class d{static computeLink(h,v,x,C){const w=new RegExp(v.source,(v.flags||"")+"g"),[y,S]=d._getWindowedLineStrings(h-1,x),_=y.join("");let b;const k=[];for(;b=w.exec(_);){const T=b[0];if(!u(T))continue;const[R,M]=d._mapStrIdx(x,S,0,b.index),[A,j]=d._mapStrIdx(x,R,M,T.length);if(R===-1||M===-1||A===-1||j===-1)continue;const O={start:{x:M+1,y:R+1},end:{x:j,y:A+1}};k.push({range:O,text:T,activate:C})}return k}static _getWindowedLineStrings(h,v){let x,C=h,w=h,y=0,S="";const _=[];if(x=v.buffer.active.getLine(h)){const b=x.translateToString(!0);if(x.isWrapped&&b[0]!==" "){for(y=0;(x=v.buffer.active.getLine(--C))&&y<2048&&(S=x.translateToString(!0),y+=S.length,_.push(S),x.isWrapped&&S.indexOf(" ")===-1););_.reverse()}for(_.push(b),y=0;(x=v.buffer.active.getLine(++w))&&x.isWrapped&&y<2048&&(S=x.translateToString(!0),y+=S.length,_.push(S),S.indexOf(" ")===-1););}return[_,C]}static _mapStrIdx(h,v,x,C){const w=h.buffer.active,y=w.getNullCell();let S=x;for(;C;){const _=w.getLine(v);if(!_)return[-1,-1];for(let b=S;b<_.length;++b){_.getCell(b,y);const k=y.getChars();if(y.getWidth()&&(C-=k.length||1,b===_.length-1&&k==="")){const T=w.getLine(v+1);T&&T.isWrapped&&(T.getCell(0,y),y.getWidth()===2&&(C+=1))}if(C<0)return[v,b]}v++,S=0}return[v,S]}}a.LinkComputer=d}},r={};function o(c){var a=r[c];if(a!==void 0)return a.exports;var u=r[c]={exports:{}};return n[c](u,u.exports,o),u.exports}var l={};return(()=>{var c=l;Object.defineProperty(c,"__esModule",{value:!0}),c.WebLinksAddon=void 0;const a=o(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(p,h){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}c.WebLinksAddon=class{constructor(p=d,h={}){this._handler=p,this._options=h}activate(p){this._terminal=p;const h=this._options,v=h.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,v,this._handler,h))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),l})()))})($m)),$m.exports}var qH=VH();const Ci={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function Vm(t,e){const n=new Uint8Array(1+e.length);return n[0]=t,n.set(e,1),n}function WH(){const t=new Map;return{get(e){return t.get(e)},set(e,n){t.set(e,n)},delete(e){t.delete(e)},has(e){return t.has(e)},clear(){t.clear()},dispose(e){const n=t.get(e);n&&(n.terminal.dispose(),t.delete(e))},disposeAll(){for(const e of t.values())e.terminal.dispose();t.clear()}}}function GH(t){const e=new HH.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)"}}),n=new $H.FitAddon,r=new qH.WebLinksAddon;return e.loadAddon(n),e.loadAddon(r),{terminal:e,fitAddon:n}}function KH(t,e){const n=fe.c(21),{serverUrl:r,apiToken:o,cwd:l}=e,c=N.useRef(null),a=N.useRef("disconnected"),u=N.useRef(!1),d=N.useRef(0),p=N.useRef(e.onOutput),h=N.useRef(e.onStatusChange),v=N.useRef(e.onExit),x=N.useRef(e.onSessionInit),C=N.useRef(e.onTitleChange),w=N.useRef(r),y=N.useRef(o),S=N.useRef(l),_=N.useRef(e.serverSessionId),b=N.useRef(e.terminal);let k;n[0]!==e.onExit||n[1]!==e.onOutput||n[2]!==e.onSessionInit||n[3]!==e.onStatusChange||n[4]!==e.onTitleChange?(k=()=>{p.current=e.onOutput,h.current=e.onStatusChange,v.current=e.onExit,x.current=e.onSessionInit,C.current=e.onTitleChange},n[0]=e.onExit,n[1]=e.onOutput,n[2]=e.onSessionInit,n[3]=e.onStatusChange,n[4]=e.onTitleChange,n[5]=k):k=n[5],N.useEffect(k);let T,R;n[6]!==o||n[7]!==l||n[8]!==e.serverSessionId||n[9]!==e.terminal||n[10]!==r?(T=()=>{w.current=r,y.current=o,S.current=l,_.current=e.serverSessionId,b.current=e.terminal},R=[r,o,l,e.serverSessionId,e.terminal],n[6]=o,n[7]=l,n[8]=e.serverSessionId,n[9]=e.terminal,n[10]=r,n[11]=T,n[12]=R):(T=n[11],R=n[12]),N.useEffect(T,R);let M;n[13]===Symbol.for("react.memo_cache_sentinel")?(M=Y=>{var I;a.current=Y,(I=h.current)==null||I.call(h,Y)},n[13]=M):M=n[13];const A=M;let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j=Y=>{const I=d.current=d.current+1,L=c.current;L&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.onerror=null,L.close(),c.current=null),Y&&b.current&&b.current.clear(),A("connecting");const P=Y?`ws://${w.current}/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}&sessionId=${Y}`:`ws://${w.current}/ws/terminal?token=${y.current}&cwd=${encodeURIComponent(S.current)}`,H=new WebSocket(P);H.binaryType="arraybuffer",H.onopen=()=>{if(d.current!==I){H.close();return}c.current=H},H.onmessage=B=>{var K,$,te,re,ae,se;if(d.current!==I||!(B.data instanceof ArrayBuffer))return;const Z=new Uint8Array(B.data);if(Z.length<1)return;const J=Z[0],ee=Z.slice(1);e:switch(J){case Ci.OUTPUT:{(K=p.current)==null||K.call(p,new TextDecoder().decode(ee));break e}case Ci.EXIT:{const{exitCode:_e}=JSON.parse(new TextDecoder().decode(ee));A("exited"),($=v.current)==null||$.call(v,_e),H.close();break e}case Ci.ERROR:{const{message:_e}=JSON.parse(new TextDecoder().decode(ee));console.error("[useTerminal] Server error:",_e),A("disconnected");break e}case Ci.INIT_ACK:{const _e=JSON.parse(new TextDecoder().decode(ee));(te=x.current)==null||te.call(x,_e),_e.isReconnect&&_e.status==="exited"?(A("exited"),(re=v.current)==null||re.call(v,_e.exitCode)):_e.isReconnect&&_e.inAlternateScreen?(A("connected"),(ae=p.current)==null||ae.call(p,`\r
|
|
599
|
+
\x1B[33m[Reconnected — a full-screen application is running. Press Ctrl+C to exit it.]\x1B[0m\r
|
|
600
|
+
`)):A("connected");break e}case Ci.TITLE:{const{title:_e}=JSON.parse(new TextDecoder().decode(ee));(se=C.current)==null||se.call(C,_e)}}},H.onclose=()=>{d.current===I&&(c.current=null,(a.current==="connecting"||a.current==="connected")&&A("disconnected"))},H.onerror=YH},n[14]=j):j=n[14];const O=j;let z,V;n[15]!==t?(z=()=>{if(!t)return;u.current=!1;const Y=t.onData(L=>{const P=c.current;if(!P||P.readyState!==WebSocket.OPEN)return;const H=new TextEncoder().encode(L);P.send(Vm(Ci.INPUT,H))}),I=t.onResize(L=>{const{cols:P,rows:H}=L,B=c.current;if(!B||B.readyState!==WebSocket.OPEN)return;const Z=new TextEncoder().encode(JSON.stringify({cols:P,rows:H}));B.send(Vm(Ci.RESIZE,Z))});return()=>{Y.dispose(),I.dispose(),u.current=!0;const L=c.current;L&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.onerror=null,L.close(),c.current=null)}},V=[t],n[15]=t,n[16]=z,n[17]=V):(z=n[16],V=n[17]),N.useEffect(z,V);let F;n[18]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{const Y=c.current;Y&&(Y.onopen=null,Y.onclose=null,Y.onmessage=null,Y.onerror=null,Y.close(),c.current=null)},n[18]=F):F=n[18];const W=F;let G;n[19]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{const Y=c.current;if(Y){try{Y.send(Vm(Ci.CLOSE,new Uint8Array(0)))}catch{}Y.close(),c.current=null}u.current=!0},n[19]=G):G=n[19];const q=G;let X;return n[20]===Symbol.for("react.memo_cache_sentinel")?(X={connect:O,disconnect:W,destroy:q},n[20]=X):X=n[20],X}function YH(){}function XH(){const t=fe.c(2),[e,n]=N.useState(QH);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=window.visualViewport;if(!l)return;const c=()=>{n({height:l.height,offsetTop:l.offsetTop,scale:l.scale})};return c(),l.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{l.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),e}function QH(){return{height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}}const ZH=300,JH=200,eU=.7,tU=N.forwardRef(function({workspaceId:e,workspacePath:n,workspaceName:r,serverUrl:o,apiToken:l,isOpen:c,onClose:a},u){var Re,je,ze;const d=Za(),p=XH(),[h,v]=N.useState([]),[x,C]=N.useState(null),[w,y]=N.useState(ZH),S=N.useRef(!1),_=N.useRef(0),b=N.useRef(0),k=N.useRef(WH()),T=N.useRef(null),R=N.useRef(null),M=N.useRef([]),A=N.useRef(()=>{}),j=N.useRef(!1),O=N.useRef(void 0),z=N.useRef(new Set),V=N.useRef(()=>{});N.useEffect(()=>{M.current=h},[h]);const F=N.useCallback(ce=>{switch(ce.type){case"snapshot":{const Te=z.current;if(v(ce.sessions.map(ye=>({serverSessionId:ye.id,title:ye.title,status:ye.status==="exited"?"exited":"disconnected",cwd:ye.cwd,shell:ye.shell}))),ce.sessions.length>0?C(ye=>ye&&ce.sessions.some(Pe=>Pe.id===ye)?ye:ce.sessions[0].id):(C(null),j.current||(j.current=!0,V.current())),Te.size>0){const ye=new Set(ce.sessions.map(Fe=>Fe.id)),Pe=[...Te].filter(Fe=>!ye.has(Fe));for(const Fe of Pe)V.current()}break}case"created":{v(Te=>Te.some(ye=>ye.serverSessionId===ce.session.id)?Te:[...Te,{serverSessionId:ce.session.id,title:ce.session.title,status:"disconnected",cwd:ce.session.cwd,shell:ce.session.shell}]),C(ce.session.id);break}case"destroyed":{v(Te=>Te.filter(ye=>ye.serverSessionId!==ce.sessionId)),k.current.dispose(ce.sessionId),C(Te=>{if(Te!==ce.sessionId)return Te;const ye=M.current.filter(Pe=>Pe.serverSessionId!==ce.sessionId);return ye.length>0?ye[0].serverSessionId:null});break}case"exited":{v(Te=>Te.map(ye=>ye.serverSessionId===ce.sessionId?{...ye,status:"exited"}:ye));break}case"title_changed":{v(Te=>Te.map(ye=>ye.serverSessionId===ce.sessionId?{...ye,title:ce.title}:ye));break}case"status_changed":{v(Te=>Te.map(ye=>ye.serverSessionId===ce.sessionId?{...ye,status:ce.status==="exited"?"exited":"connected"}:ye));break}}},[]);N.useEffect(()=>{A.current=F},[F]),N.useEffect(()=>{if(!e||!c||!o||!l){v([]),C(null),z.current=new Set,j.current=!1,T.current&&(T.current.disconnect(),T.current=null),I(null),k.current.disposeAll();const ye=R.current;ye&&(ye.onopen=null,ye.onclose=null,ye.onmessage=null,ye.onerror=null,ye.close(),R.current=null);return}T.current&&(T.current.disconnect(),T.current=null),I(null),k.current.disposeAll(),z.current=new Set(M.current.map(ye=>ye.serverSessionId));const ce=`ws://${o}/ws/terminal/events?token=${l}&workspaceId=${encodeURIComponent(e)}`,Te=new WebSocket(ce);return R.current=Te,Te.onmessage=ye=>{try{const Pe=JSON.parse(ye.data);A.current(Pe)}catch(Pe){console.error("[TerminalPanel] Failed to parse event:",Pe)}},()=>{const ye=R.current;ye&&(ye.onopen=null,ye.onclose=null,ye.onmessage=null,ye.onerror=null,ye.close(),R.current=null)}},[e,c,o,l]);const W=N.useCallback(ce=>Te=>{const ye=k.current.get(ce);ye==null||ye.terminal.write(Te)},[]),G=N.useCallback(ce=>Te=>{v(ye=>ye.map(Pe=>Pe.serverSessionId===ce?{...Pe,status:Te}:Pe))},[]),q=N.useCallback(ce=>Te=>{const ye=k.current.get(ce);ye&&(ye.serverSessionId=Te.sessionId),v(Pe=>Pe.map(Fe=>Fe.serverSessionId===ce?{...Fe,title:Te.title||Fe.title}:Fe))},[]),X=N.useCallback(ce=>Te=>{v(ye=>ye.map(Pe=>Pe.serverSessionId===ce?{...Pe,title:Te}:Pe))},[]),[Y,I]=N.useState(null),{connect:L,disconnect:P,destroy:H}=KH((Re=Y==null?void 0:Y.terminal)!=null?Re:null,Y&&o&&l&&n&&Y.serverSessionId?{terminal:Y.terminal,serverUrl:o,apiToken:l,cwd:(ze=(je=h.find(ce=>ce.serverSessionId===Y.serverSessionId))==null?void 0:je.cwd)!=null?ze:n,serverSessionId:Y.serverSessionId,onOutput:W(Y.serverSessionId),onStatusChange:G(Y.serverSessionId),onSessionInit:q(Y.serverSessionId),onTitleChange:X(Y.serverSessionId)}:{terminal:null,serverUrl:"",apiToken:"",cwd:"",onOutput:()=>{},onStatusChange:()=>{}});N.useEffect(()=>{Y&&Y.serverSessionId&&(T.current={serverSessionId:Y.serverSessionId,disconnect:P,destroy:H},L(Y.serverSessionId))},[Y,L,P,H]);const B=N.useCallback(()=>{if(!x||!o||!l||!n)return;const ce=k.current.get(x);let Te;if(ce)Te=ce;else{const{terminal:ye,fitAddon:Pe}=GH();Te={terminal:ye,fitAddon:Pe,serverSessionId:x,status:"connecting",isOpened:!1},k.current.set(x,Te)}T.current&&(T.current.disconnect(),T.current=null),I(Te)},[x,o,l,n]);N.useEffect(()=>{!c||!x||B()},[c,x,B]);const Z=N.useCallback(async()=>{if(!(!e||!n||!o||!l))try{const ce=await fetch(`http://${o}/api/workspaces/${e}/terminals`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify({cwd:n})});ce.ok||console.error("[TerminalPanel] Failed to create terminal:",ce.statusText)}catch(ce){console.error("[TerminalPanel] Failed to create terminal:",ce)}},[e,n,o,l]);N.useEffect(()=>{V.current=Z},[Z]);const J=N.useCallback(async ce=>{var Te;if(!(!e||!o||!l)){((Te=T.current)==null?void 0:Te.serverSessionId)===ce&&(T.current.destroy(),T.current=null,I(null)),k.current.dispose(ce);try{await fetch(`http://${o}/api/workspaces/${e}/terminals/${ce}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}})}catch(ye){console.error("[TerminalPanel] Failed to destroy terminal:",ye)}}},[e,o,l]);N.useEffect(()=>{O.current!==e&&(O.current=e,j.current=!1)},[e]),N.useEffect(()=>{z.current=new Set},[e]),N.useEffect(()=>()=>{k.current.disposeAll()},[]);const ee=N.useCallback(()=>{if(x){const ce=k.current.get(x);ce==null||ce.terminal.focus()}},[x]);N.useImperativeHandle(u,()=>({focus:ee}),[ee]),N.useEffect(()=>{if(!c||!x)return;const ce=setTimeout(ee,300);return()=>clearTimeout(ce)},[c,x,ee]);const K=N.useCallback(ce=>{ce.preventDefault(),S.current=!0;const Te="touches"in ce?ce.touches[0].clientY:ce.clientY;_.current=Te,b.current=w;const ye=Fe=>{if(!S.current)return;const ve="touches"in Fe?Fe.touches[0].clientY:Fe.clientY,Ne=_.current-ve,Ae=window.innerHeight*eU,Ce=Math.min(Math.max(b.current+Ne,JH),Ae);y(Ce)},Pe=()=>{S.current=!1,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Pe),document.removeEventListener("touchmove",ye),document.removeEventListener("touchend",Pe)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Pe),document.addEventListener("touchmove",ye,{passive:!1}),document.addEventListener("touchend",Pe)},[w]);if(!e||!n||!o||!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 $=r||n.split("/").pop()||"ws",te=h.find(ce=>ce.serverSessionId===x),re=x?k.current.get(x):null,ae=ce=>{switch(ce){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},se=()=>m.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[h.map(ce=>m.jsxs("div",{className:Ee("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",ce.serverSessionId===x?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>C(ce.serverSessionId),children:[m.jsx("span",{className:Ee("w-1.5 h-1.5 rounded-full shrink-0",ae(ce.status))}),m.jsxs("span",{children:[$," ",ce.title]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:Te=>{Te.stopPropagation(),J(ce.serverSessionId)},children:m.jsx(Bs,{className:"w-3 h-3"})})]},ce.serverSessionId)),m.jsx(He,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:Z,title:"New terminal tab",children:m.jsx(Ha,{className:"w-3.5 h-3.5"})})]}),_e=()=>m.jsx("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:re&&te?m.jsx(BH,{cachedTerminal:re},x):m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})});if(d){const Te=p.height<window.innerHeight*.85?`calc(${p.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,p.height);return c?m.jsx(jf,{open:c,onOpenChange:ye=>!ye&&a(),children:m.jsxs(Of,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:Te},children:[m.jsx(Lf,{className:"sr-only",children:m.jsx(If,{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(F_,{className:"w-4 h-4"}),m.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:a,children:m.jsx(Bs,{className:"w-4 h-4"})})]}),se(),_e()]})}):null}return c?m.jsxs("div",{"data-terminal-panel":"",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:K,onTouchStart:K,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:w},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(F_,{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(He,{variant:"ghost",size:"icon-sm",onClick:a,children:m.jsx(Bs,{className:"w-3.5 h-3.5"})})]}),se(),_e()]})]}):null});function nU(t){const e=fe.c(11),{workspaceId:n,workspacePath:r,workspaceName:o,serverUrl:l,apiToken:c,terminalPanelRef:a}=t,u=zt(sU),d=zt(rU);let p;e[0]!==d?(p=()=>d(!1),e[0]=d,e[1]=p):p=e[1];let h;return e[2]!==c||e[3]!==l||e[4]!==u||e[5]!==p||e[6]!==a||e[7]!==n||e[8]!==o||e[9]!==r?(h=m.jsx(tU,{ref:a,workspaceId:n,workspacePath:r,workspaceName:o,serverUrl:l,apiToken:c,isOpen:u,onClose:p}),e[2]=c,e[3]=l,e[4]=u,e[5]=p,e[6]=a,e[7]=n,e[8]=o,e[9]=r,e[10]=h):h=e[10],h}function rU(t){return t.setShowTerminalPanel}function sU(t){return t.showTerminalPanel}function Px(t){const e=fe.c(3),{message:n}=t,r=n===void 0?"Connecting to server...":n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(nr,{className:"size-8 animate-spin"}),e[0]=o):o=e[0];let l;return e[1]!==r?(l=m.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[o,m.jsx("p",{className:"text-sm",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const iU=t=>{const e=fe.c(26),{serverUrl:n,authError:r,retryCount:o,nextRetryIn:l,onRetry:c,onLogout:a}=t;let u,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(yS,{className:"size-12 text-destructive mb-4"}),d=m.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),e[0]=u,e[1]=d):(u=e[0],d=e[1]);const p=r||"Please check that the server is running.";let h;e[2]!==p?(h=m.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:p}),e[2]=p,e[3]=h):h=e[3];let v;e[4]!==n?(v=n&&m.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:n}),e[4]=n,e[5]=v):v=e[5];let x;e[6]!==l?(x=m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",l,"s..."]}),e[6]=l,e[7]=x):x=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(Ai,{className:"size-4 mr-2","data-icon":"inline-start"}),e[8]=C):C=e[8];let w;e[9]!==c?(w=m.jsxs(He,{onClick:c,variant:"default",children:[C,"Retry Now"]}),e[9]=c,e[10]=w):w=e[10];let y;e[11]!==a?(y=m.jsx(He,{onClick:a,variant:"ghost",children:"Change Server"}),e[11]=a,e[12]=y):y=e[12];let S;e[13]!==w||e[14]!==y?(S=m.jsxs("div",{className:"flex items-center gap-2",children:[w,y]}),e[13]=w,e[14]=y,e[15]=S):S=e[15];let _;e[16]!==o?(_=o>0&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",o]}),e[16]=o,e[17]=_):_=e[17];let b;e[18]!==S||e[19]!==_||e[20]!==x?(b=m.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,S,_]}),e[18]=S,e[19]=_,e[20]=x,e[21]=b):b=e[21];let k;return e[22]!==b||e[23]!==h||e[24]!==v?(k=m.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[u,d,h,v,b]}),e[22]=b,e[23]=h,e[24]=v,e[25]=k):k=e[25],k};function zx(t){const e=fe.c(40),{onServerAdded:n,error:r}=t,[o,l]=N.useState(""),[c,a]=N.useState("localhost:8742"),[u,d]=N.useState(""),[p,h]=N.useState(!1),[v,x]=N.useState(null);let C;e[0]!==o||e[1]!==n||e[2]!==u||e[3]!==c?(C=I=>{I.preventDefault();const L=o.trim(),P=c.trim(),H=u.trim();if(!L){x("Please enter a server name");return}if(!P){x("Please enter a server URL");return}if(!H){x("Please enter an API token");return}if(!sS(H)){x("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const B=Ad(P),Z={id:crypto.randomUUID(),name:L,url:B,token:H,createdAt:new Date().toISOString()};n(Z)},e[0]=o,e[1]=n,e[2]=u,e[3]=c,e[4]=C):C=e[4];const w=C;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=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"})]}),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),e[6]=S):S=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=I=>{l(I.target.value),x(null)},e[7]=_):_=e[7];let b;e[8]!==o?(b=m.jsxs("div",{className:"space-y-2",children:[S,m.jsx("input",{id:"serverName",type:"text",value:o,onChange:_,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"})]}),e[8]=o,e[9]=b):b=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),e[10]=k):k=e[10];let T;e[11]===Symbol.for("react.memo_cache_sentinel")?(T=I=>{a(I.target.value),x(null)},e[11]=T):T=e[11];let R;e[12]!==c?(R=m.jsxs("div",{className:"space-y-2",children:[k,m.jsx("input",{id:"serverUrl",type:"text",value:c,onChange:T,placeholder:"localhost:8742",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"})]}),e[12]=c,e[13]=R):R=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),e[14]=M):M=e[14];const A=p?"text":"password";let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{d(I.target.value),x(null)},e[15]=j):j=e[15];let O;e[16]!==A||e[17]!==u?(O=m.jsx("input",{id:"token",type:A,value:u,onChange:j,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"}),e[16]=A,e[17]=u,e[18]=O):O=e[18];let z;e[19]!==p?(z=()=>h(!p),e[19]=p,e[20]=z):z=e[20];const V=p?"Hide token":"Show token";let F;e[21]!==p?(F=p?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"})]}),e[21]=p,e[22]=F):F=e[22];let W;e[23]!==z||e[24]!==V||e[25]!==F?(W=m.jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":V,children:F}),e[23]=z,e[24]=V,e[25]=F,e[26]=W):W=e[26];let G;e[27]!==O||e[28]!==W?(G=m.jsxs("div",{className:"space-y-2",children:[M,m.jsxs("div",{className:"relative",children:[O,W]})]}),e[27]=O,e[28]=W,e[29]=G):G=e[29];let q;e[30]!==r||e[31]!==v?(q=(v||r)&&m.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:v||r}),e[30]=r,e[31]=v,e[32]=q):q=e[32];let X;e[33]===Symbol.for("react.memo_cache_sentinel")?(X=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"}),e[33]=X):X=e[33];let Y;return e[34]!==w||e[35]!==G||e[36]!==q||e[37]!==b||e[38]!==R?(Y=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:[y,m.jsxs("form",{onSubmit:w,className:"p-6 space-y-4",children:[b,R,G,q,X]})]})})}),e[34]=w,e[35]=G,e[36]=q,e[37]=b,e[38]=R,e[39]=Y):Y=e[39],Y}function oU(t){const e=fe.c(12);let n,r,o;e[0]!==t?({className:n,value:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n?(l=Ee("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",n),e[4]=n,e[5]=l):l=e[5];const c=`translateX(-${100-(o||0)}%)`;let a;e[6]!==c?(a=m.jsx(dM,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:c}}),e[6]=c,e[7]=a):a=e[7];let u;return e[8]!==r||e[9]!==l||e[10]!==a?(u=m.jsx(uM,{"data-slot":"progress",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}function yd(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":t.toString()}function aU(t){return t>=60?"critical":t>=40?"warning":"normal"}function lU(t){const e=fe.c(41),{totalTokens:n,contextWindow:r,modelName:o,compact:l}=t,c=n===void 0?0:n,a=r===void 0?0:r,u=l===void 0?!1:l,d=c===0?0:a;let p;e[0]!==d||e[1]!==c?(p=d===0?0:Math.min(100,Math.round(c/d*100)),e[0]=d,e[1]=c,e[2]=p):p=e[2];const h=p;let v;e[3]!==h?(v=aU(h),e[3]=h,e[4]=v):v=e[4];const x=v;if(u){let O;e[5]!==c?(O=yd(c),e[5]=c,e[6]=O):O=e[6];let z;e[7]!==d?(z=yd(d),e[7]=d,e[8]=z):z=e[8];let V;e[9]!==O||e[10]!==z?(V=m.jsxs("span",{className:"text-xs font-mono",children:[O,"/",z]}),e[9]=O,e[10]=z,e[11]=V):V=e[11];let F;e[12]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsx(Sc,{asChild:!0,children:m.jsx(lA,{className:"size-3 text-muted-foreground cursor-help"})}),e[12]=F):F=e[12];let W;e[13]!==h?(W=m.jsx(Fd,{children:m.jsxs(xc,{children:[F,m.jsx(wc,{side:"bottom",children:m.jsxs("p",{className:"text-xs",children:[h,"% of context window used"]})})]})}),e[13]=h,e[14]=W):W=e[14];let G;return e[15]!==W||e[16]!==V?(G=m.jsxs("div",{className:"flex items-center gap-1.5",children:[V,W]}),e[15]=W,e[16]=V,e[17]=G):G=e[17],G}let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),e[18]=C):C=e[18];let w;e[19]!==c?(w=yd(c),e[19]=c,e[20]=w):w=e[20];let y;e[21]!==d?(y=yd(d),e[21]=d,e[22]=y):y=e[22];let S;e[23]!==w||e[24]!==y?(S=m.jsxs("div",{className:"flex items-center gap-2",children:[C,m.jsxs("span",{className:"text-xs font-mono",children:[w,"/",y]})]}),e[23]=w,e[24]=y,e[25]=S):S=e[25];const _=x==="critical"&&"[&>div]:bg-destructive",b=x==="warning"&&"[&>div]:bg-warning",k=x==="normal"&&"[&>div]:bg-primary";let T;e[26]!==_||e[27]!==b||e[28]!==k?(T=Ee("h-1 w-20",_,b,k),e[26]=_,e[27]=b,e[28]=k,e[29]=T):T=e[29];let R;e[30]!==h||e[31]!==T?(R=m.jsx(oU,{value:h,className:T}),e[30]=h,e[31]=T,e[32]=R):R=e[32];let M;e[33]!==h?(M=m.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",h,"%)"]}),e[33]=h,e[34]=M):M=e[34];let A;e[35]!==R||e[36]!==M?(A=m.jsxs("div",{className:"flex items-center gap-2",children:[R,M]}),e[35]=R,e[36]=M,e[37]=A):A=e[37];let j;return e[38]!==S||e[39]!==A?(j=m.jsx("div",{className:"flex items-center gap-3",children:m.jsxs("div",{className:"flex flex-col gap-1",children:[S,A]})}),e[38]=S,e[39]=A,e[40]=j):j=e[40],j}function Fv(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(GM,{"data-slot":"select",...n}),e[2]=n,e[3]=r):r=e[3],r}function cU(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("scroll-my-1 p-1",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(ej,{"data-slot":"select-group",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Pa(t){const e=fe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(YM,{"data-slot":"select-value",...n}),e[2]=n,e[3]=r):r=e[3],r}function Hv(t){const e=fe.c(13);let n,r,o,l;e[0]!==t?({className:r,size:l,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const c=l===void 0?"default":l;let a;e[5]!==r?(a=Ee("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",r),e[5]=r,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(XM,{asChild:!0,children:m.jsx(Fa,{className:"pointer-events-none size-4 text-muted-foreground"})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==o||e[10]!==c||e[11]!==a?(d=m.jsxs(KM,{"data-slot":"select-trigger","data-size":c,className:a,...o,children:[n,u]}),e[8]=n,e[9]=o,e[10]=c,e[11]=a,e[12]=d):d=e[12],d}function Uv(t){const e=fe.c(24);let n,r,o,l,c;e[0]!==t?({className:r,children:n,position:l,align:c,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l,e[5]=c):(n=e[1],r=e[2],o=e[3],l=e[4],c=e[5]);const a=l===void 0?"item-aligned":l,u=c===void 0?"center":c,d=a==="item-aligned",p=a==="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";let h;e[6]!==r||e[7]!==p?(h=Ee("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",p,r),e[6]=r,e[7]=p,e[8]=h):h=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(dU,{}),e[9]=v):v=e[9];const x=a==="popper"&&"";let C;e[10]!==x?(C=Ee("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",x),e[10]=x,e[11]=C):C=e[11];let w;e[12]!==n||e[13]!==a||e[14]!==C?(w=m.jsx(JM,{"data-position":a,className:C,children:n}),e[12]=n,e[13]=a,e[14]=C,e[15]=w):w=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=m.jsx(fU,{}),e[16]=y):y=e[16];let S;return e[17]!==u||e[18]!==a||e[19]!==o||e[20]!==d||e[21]!==h||e[22]!==w?(S=m.jsx(QM,{children:m.jsxs(ZM,{"data-slot":"select-content","data-align-trigger":d,className:h,position:a,align:u,...o,children:[v,w,y]})}),e[17]=u,e[18]=a,e[19]=o,e[20]=d,e[21]=h,e[22]=w,e[23]=S):S=e[23],S}function uU(t){const e=fe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("px-1.5 py-1 text-xs text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=m.jsx(tj,{"data-slot":"select-label",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function Wf(t){const e=fe.c(13);let n,r,o;e[0]!==t?({className:r,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==r?(l=Ee("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",r),e[4]=r,e[5]=l):l=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:m.jsx(sj,{children:m.jsx(Fs,{className:"pointer-events-none"})})}),e[6]=c):c=e[6];let a;e[7]!==n?(a=m.jsx(rj,{children:n}),e[7]=n,e[8]=a):a=e[8];let u;return e[9]!==o||e[10]!==l||e[11]!==a?(u=m.jsxs(nj,{"data-slot":"select-item",className:l,...o,children:[c,a]}),e[9]=o,e[10]=l,e[11]=a,e[12]=u):u=e[12],u}function dU(t){const e=fe.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(S5,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==o?(c=m.jsx(ij,{"data-slot":"select-scroll-up-button",className:o,...r,children:l}),e[6]=r,e[7]=o,e[8]=c):c=e[8],c}function fU(t){const e=fe.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=Ee("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Fa,{}),e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==o?(c=m.jsx(oj,{"data-slot":"select-scroll-down-button",className:o,...r,children:l}),e[6]=r,e[7]=o,e[8]=c):c=e[8],c}function hU(t){switch(t){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function pU(t){const e=fe.c(45),{models:n,selectedModelId:r,onChangeModel:o,disabled:l,compact:c,iconOnly:a,connectedProviderIds:u,connectableProviderIds:d}=t,p=c===void 0?!1:c,h=a===void 0?!1:a;let v,x,C,w,y,S,_,b,k;if(e[0]!==p||e[1]!==d||e[2]!==u||e[3]!==l||e[4]!==h||e[5]!==n||e[6]!==o||e[7]!==r){const A=n.reduce(mU,{});let j;e[17]!==n||e[18]!==o?(j=G=>{const q=n.find(X=>X.id===G);q&&o(G,q.providerId)},e[17]=n,e[18]=o,e[19]=j):j=e[19];const O=j,z=p&&!h;b="flex items-center gap-2",e[20]!==h||e[21]!==z?(k=!h&&m.jsx(Ir,{className:"text-xs text-muted-foreground",children:z?m.jsx(P_,{className:"size-3.5"}):"Model:"}),e[20]=h,e[21]=z,e[22]=k):k=e[22],x=Fv,w=r||"",y=O,S=l;const V=h?"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";let F;e[23]!==h?(F=h&&m.jsxs(m.Fragment,{children:[m.jsx(P_,{className:"size-4"}),m.jsx(Pa,{className:"sr-only"})]}),e[23]=h,e[24]=F):F=e[24];let W;e[25]!==h?(W=!h&&m.jsx(Pa,{placeholder:"Select model"}),e[25]=h,e[26]=W):W=e[26],e[27]!==V||e[28]!==F||e[29]!==W?(_=m.jsxs(Hv,{className:V,children:[F,W]}),e[27]=V,e[28]=F,e[29]=W,e[30]=_):_=e[30],v=Uv,C=Object.entries(A).map(G=>{const[q,X]=G;return m.jsxs(cU,{children:[m.jsx(uU,{children:q}),X.map(Y=>m.jsx(Wf,{value:Y.id,disabled:(d==null?void 0:d.has(Y.providerId))&&!(u!=null&&u.has(Y.providerId)),children:m.jsxs("span",{className:"flex items-center gap-2",children:[Y.name,m.jsx("span",{className:"text-muted-foreground text-xs",children:hU(Y.tier)}),(d==null?void 0:d.has(Y.providerId))&&(u==null?void 0:u.has(Y.providerId))&&m.jsx(Un,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"Sub"}),(d==null?void 0:d.has(Y.providerId))&&!(u!=null&&u.has(Y.providerId))&&m.jsx(Un,{variant:"outline",className:"text-[10px] px-1 py-0 h-4",children:"OAuth"})]})},Y.id))]},q)}),e[0]=p,e[1]=d,e[2]=u,e[3]=l,e[4]=h,e[5]=n,e[6]=o,e[7]=r,e[8]=v,e[9]=x,e[10]=C,e[11]=w,e[12]=y,e[13]=S,e[14]=_,e[15]=b,e[16]=k}else v=e[8],x=e[9],C=e[10],w=e[11],y=e[12],S=e[13],_=e[14],b=e[15],k=e[16];let T;e[31]!==v||e[32]!==C?(T=m.jsx(v,{children:C}),e[31]=v,e[32]=C,e[33]=T):T=e[33];let R;e[34]!==x||e[35]!==T||e[36]!==w||e[37]!==y||e[38]!==S||e[39]!==_?(R=m.jsxs(x,{value:w,onValueChange:y,disabled:S,children:[_,T]}),e[34]=x,e[35]=T,e[36]=w,e[37]=y,e[38]=S,e[39]=_,e[40]=R):R=e[40];let M;return e[41]!==R||e[42]!==b||e[43]!==k?(M=m.jsxs("div",{className:b,children:[k,R]}),e[41]=R,e[42]=b,e[43]=k,e[44]=M):M=e[44],M}function mU(t,e){return t[e.providerName]||(t[e.providerName]=[]),t[e.providerName].push(e),t}const gU={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function vU(t){return gU[t]||t.charAt(0).toUpperCase()+t.slice(1)}function yU(t){const e=fe.c(45),{variants:n,selectedVariant:r,onChangeVariant:o,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,p=u&&!d;if(!n||Object.keys(n).length===0)return null;let h,v,x,C,w,y,S,_,b,k;if(e[0]!==l||e[1]!==d||e[2]!==o||e[3]!==r||e[4]!==p||e[5]!==n){const A=Object.keys(n);let j;e[16]!==o?(j=W=>{o(W==="__none__"?null:W)},e[16]=o,e[17]=j):j=e[17];const O=j;k="flex items-center gap-2",e[18]!==d||e[19]!==p?(x=!d&&m.jsx(Ir,{className:"text-xs text-muted-foreground",children:p?m.jsx(I_,{className:"size-3.5"}):"Thinking:"}),e[18]=d,e[19]=p,e[20]=x):x=e[20],v=Fv,y=r||"__none__",S=O,_=l;const z=d?"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";let V;e[21]!==d?(V=d&&m.jsxs(m.Fragment,{children:[m.jsx(I_,{className:"size-4"}),m.jsx(Pa,{className:"sr-only"})]}),e[21]=d,e[22]=V):V=e[22];let F;e[23]!==d?(F=!d&&m.jsx(Pa,{placeholder:"Default"}),e[23]=d,e[24]=F):F=e[24],e[25]!==z||e[26]!==V||e[27]!==F?(b=m.jsxs(Hv,{className:z,children:[V,F]}),e[25]=z,e[26]=V,e[27]=F,e[28]=b):b=e[28],h=Uv,e[29]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(Wf,{value:"__none__",children:"Default"}),e[29]=C):C=e[29],w=A.map(_U),e[0]=l,e[1]=d,e[2]=o,e[3]=r,e[4]=p,e[5]=n,e[6]=h,e[7]=v,e[8]=x,e[9]=C,e[10]=w,e[11]=y,e[12]=S,e[13]=_,e[14]=b,e[15]=k}else h=e[6],v=e[7],x=e[8],C=e[9],w=e[10],y=e[11],S=e[12],_=e[13],b=e[14],k=e[15];let T;e[30]!==h||e[31]!==C||e[32]!==w?(T=m.jsxs(h,{children:[C,w]}),e[30]=h,e[31]=C,e[32]=w,e[33]=T):T=e[33];let R;e[34]!==v||e[35]!==T||e[36]!==y||e[37]!==S||e[38]!==_||e[39]!==b?(R=m.jsxs(v,{value:y,onValueChange:S,disabled:_,children:[b,T]}),e[34]=v,e[35]=T,e[36]=y,e[37]=S,e[38]=_,e[39]=b,e[40]=R):R=e[40];let M;return e[41]!==x||e[42]!==R||e[43]!==k?(M=m.jsxs("div",{className:k,children:[x,R]}),e[41]=x,e[42]=R,e[43]=k,e[44]=M):M=e[44],M}function _U(t){return m.jsx(Wf,{value:t,children:vU(t)},t)}function bU(t){const e=fe.c(24),{preconfigs:n,selectedPreconfigId:r,onChangePreconfig:o,disabled:l,compact:c,iconOnly:a}=t,u=c===void 0?!1:c,d=a===void 0?!1:a,p=u&&!d;let h;e[0]!==d||e[1]!==p?(h=!d&&m.jsx(Ir,{className:"text-xs text-muted-foreground",children:p?m.jsx(j5,{className:"size-3.5"}):"Config:"}),e[0]=d,e[1]=p,e[2]=h):h=e[2];const v=r||"",x=d?"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";let C;e[3]!==d?(C=d&&m.jsxs(m.Fragment,{children:[m.jsx(pS,{className:"size-4"}),m.jsx(Pa,{className:"sr-only"})]}),e[3]=d,e[4]=C):C=e[4];let w;e[5]!==d?(w=!d&&m.jsx(Pa,{placeholder:"Select config"}),e[5]=d,e[6]=w):w=e[6];let y;e[7]!==x||e[8]!==C||e[9]!==w?(y=m.jsxs(Hv,{className:x,children:[C,w]}),e[7]=x,e[8]=C,e[9]=w,e[10]=y):y=e[10];let S;e[11]!==n?(S=n.map(xU),e[11]=n,e[12]=S):S=e[12];let _;e[13]!==S?(_=m.jsx(Uv,{children:S}),e[13]=S,e[14]=_):_=e[14];let b;e[15]!==l||e[16]!==o||e[17]!==_||e[18]!==v||e[19]!==y?(b=m.jsxs(Fv,{value:v,onValueChange:o,disabled:l,children:[y,_]}),e[15]=l,e[16]=o,e[17]=_,e[18]=v,e[19]=y,e[20]=b):b=e[20];let k;return e[21]!==b||e[22]!==h?(k=m.jsxs("div",{className:"flex items-center gap-2",children:[h,b]}),e[21]=b,e[22]=h,e[23]=k):k=e[23],k}function xU(t){return m.jsxs(Wf,{value:t.id,children:[t.name,t.isDefault&&m.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},t.id)}function SU(t){var Ye;const e=fe.c(104),{session:n,preconfigs:r,models:o,usage:l,modelName:c,onChangePreconfig:a,onChangeModel:u,onChangeVariant:d,onRename:p,onNavigateBack:h,isStreaming:v,onInterrupt:x,onCompact:C,isCompacting:w,canCompact:y,connectedProviderIds:S,connectableProviderIds:_,selectedVariant:b,variants:k}=t,[T,R]=N.useState(!1),[M,A]=N.useState(n.title||""),j=N.useRef(null),O=Za(),z=p8();let V,F;e[0]!==T?(V=()=>{T&&j.current&&(j.current.focus(),j.current.select())},F=[T],e[0]=T,e[1]=V,e[2]=F):(V=e[1],F=e[2]),N.useEffect(V,F);let W;e[3]!==n.title?(W=()=>{A(n.title||""),R(!0)},e[3]=n.title,e[4]=W):W=e[4];const G=W;let q;e[5]!==M||e[6]!==p||e[7]!==n.id||e[8]!==n.title?(q=()=>{const Ue=M.trim();Ue&&Ue!==n.title&&p(n.id,Ue),R(!1)},e[5]=M,e[6]=p,e[7]=n.id,e[8]=n.title,e[9]=q):q=e[9];const X=q;let Y;e[10]!==X||e[11]!==n.title?(Y=Ue=>{Ue.key==="Enter"?X():Ue.key==="Escape"&&(A(n.title||""),R(!1))},e[10]=X,e[11]=n.title,e[12]=Y):Y=e[12];const I=Y;let L;e[13]!==c||e[14]!==r||e[15]!==n.preconfigId||e[16]!==n.selectedModel?(L=n.selectedModel||((Ye=r.find(Ue=>Ue.id===n.preconfigId))==null?void 0:Ye.model)||c,e[13]=c,e[14]=r,e[15]=n.preconfigId,e[16]=n.selectedModel,e[17]=L):L=e[17];const P=L;let H;if(e[18]!==o||e[19]!==P){let Ue;e[21]!==P?(Ue=Me=>Me.id===P,e[21]=P,e[22]=Ue):Ue=e[22],H=o.find(Ue),e[18]=o,e[19]=P,e[20]=H}else H=e[20];const B=H,Z=B==null?void 0:B.contextWindow;let J;e[23]!==h||e[24]!==n.parentId?(J=n.parentId&&h&&m.jsxs(He,{variant:"ghost",size:"sm",onClick:h,className:"h-7",children:[m.jsx(d5,{className:"size-4","data-icon":"inline-start"}),"Back"]}),e[23]=h,e[24]=n.parentId,e[25]=J):J=e[25];let ee;e[26]!==M||e[27]!==I||e[28]!==G||e[29]!==X||e[30]!==T||e[31]!==n.title?(ee=T?m.jsx("input",{ref:j,type:"text",value:M,onChange:Ue=>A(Ue.target.value),onBlur:X,onKeyDown:I,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 truncate min-w-0",onDoubleClick:G,children:n.title||"Untitled Session"}),e[26]=M,e[27]=I,e[28]=G,e[29]=X,e[30]=T,e[31]=n.title,e[32]=ee):ee=e[32];let K;e[33]!==n.id?(K=n.id.slice(0,8),e[33]=n.id,e[34]=K):K=e[34];let $;e[35]!==K?($=m.jsx(Un,{variant:"outline",className:"font-mono text-xs",children:K}),e[35]=K,e[36]=$):$=e[36];let te;e[37]!==n.status?(te=n.status==="closed"&&m.jsxs(Un,{variant:"secondary",children:[m.jsx(a5,{className:"size-3","data-icon":"inline-start"}),"Archived"]}),e[37]=n.status,e[38]=te):te=e[38];let re;e[39]!==$||e[40]!==te||e[41]!==J||e[42]!==ee?(re=m.jsx("div",{className:"flex items-center justify-start px-4 py-2 overflow-hidden",children:m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[J,ee,$,te]})}),e[39]=$,e[40]=te,e[41]=J,e[42]=ee,e[43]=re):re=e[43];let ae;e[44]===Symbol.for("react.memo_cache_sentinel")?(ae=m.jsx(cs,{}),e[44]=ae):ae=e[44];let se;e[45]!==Z||e[46]!==O||e[47]!==c||e[48]!==l.completionTokens||e[49]!==l.promptTokens||e[50]!==l.totalTokens?(se=m.jsx(lU,{promptTokens:l.promptTokens,completionTokens:l.completionTokens,totalTokens:l.totalTokens,contextWindow:Z,modelName:c,compact:O}),e[45]=Z,e[46]=O,e[47]=c,e[48]=l.completionTokens,e[49]=l.promptTokens,e[50]=l.totalTokens,e[51]=se):se=e[51];let _e;e[52]===Symbol.for("react.memo_cache_sentinel")?(_e=m.jsx(cs,{orientation:"vertical",className:"hidden sm:block"}),e[52]=_e):_e=e[52];const Re=n.status==="closed"||!!n.parentId;let je;e[53]!==_||e[54]!==S||e[55]!==z||e[56]!==O||e[57]!==o||e[58]!==u||e[59]!==P||e[60]!==Re?(je=m.jsx(pU,{models:o,selectedModelId:P,onChangeModel:u,disabled:Re,compact:z,iconOnly:O,connectedProviderIds:S,connectableProviderIds:_}),e[53]=_,e[54]=S,e[55]=z,e[56]=O,e[57]=o,e[58]=u,e[59]=P,e[60]=Re,e[61]=je):je=e[61];const ze=n.status==="closed"||!!n.parentId;let ce;e[62]!==z||e[63]!==O||e[64]!==d||e[65]!==b||e[66]!==ze||e[67]!==k?(ce=m.jsx(yU,{variants:k,selectedVariant:b,onChangeVariant:d,disabled:ze,compact:z,iconOnly:O}),e[62]=z,e[63]=O,e[64]=d,e[65]=b,e[66]=ze,e[67]=k,e[68]=ce):ce=e[68];const Te=n.status==="closed"||!!n.parentId;let ye;e[69]!==z||e[70]!==O||e[71]!==a||e[72]!==r||e[73]!==n.preconfigId||e[74]!==Te?(ye=m.jsx(bU,{preconfigs:r,selectedPreconfigId:n.preconfigId,onChangePreconfig:a,disabled:Te,compact:z,iconOnly:O}),e[69]=z,e[70]=O,e[71]=a,e[72]=r,e[73]=n.preconfigId,e[74]=Te,e[75]=ye):ye=e[75];let Pe;e[76]===Symbol.for("react.memo_cache_sentinel")?(Pe=m.jsx(cs,{orientation:"vertical",className:"hidden sm:block"}),e[76]=Pe):Pe=e[76];let Fe;e[77]!==y||e[78]!==z||e[79]!==w||e[80]!==v||e[81]!==C?(Fe=C&&m.jsxs(m.Fragment,{children:[m.jsxs(He,{variant:"outline",size:z?"icon":"sm",onClick:C,disabled:v||w||!y,title:w?"Compacting...":"Compact older messages",children:[m.jsx(dS,{className:"size-4"}),!z&&m.jsx("span",{className:"ml-1",children:w?"Compacting...":"Compact"})]}),m.jsx(cs,{orientation:"vertical",className:"hidden sm:block"})]}),e[77]=y,e[78]=z,e[79]=w,e[80]=v,e[81]=C,e[82]=Fe):Fe=e[82];const ve=v?"destructive":"outline",Ne=z?"icon":"sm",Ae=!x,Ce=v?"":"opacity-60 hover:opacity-100",oe=v?"Interrupt operation":"Interrupt (no active operation)";let me;e[83]===Symbol.for("react.memo_cache_sentinel")?(me=m.jsx(gS,{className:"size-4"}),e[83]=me):me=e[83];let ke;e[84]!==z?(ke=!z&&m.jsx("span",{className:"ml-1",children:"Stop"}),e[84]=z,e[85]=ke):ke=e[85];let De;e[86]!==x||e[87]!==ve||e[88]!==Ne||e[89]!==Ae||e[90]!==Ce||e[91]!==oe||e[92]!==ke?(De=m.jsxs(He,{variant:ve,size:Ne,onClick:x,disabled:Ae,className:Ce,title:oe,children:[me,ke]}),e[86]=x,e[87]=ve,e[88]=Ne,e[89]=Ae,e[90]=Ce,e[91]=oe,e[92]=ke,e[93]=De):De=e[93];let Be;e[94]!==se||e[95]!==je||e[96]!==ce||e[97]!==ye||e[98]!==Fe||e[99]!==De?(Be=m.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[se,_e,je,ce,ye,Pe,Fe,De]}),e[94]=se,e[95]=je,e[96]=ce,e[97]=ye,e[98]=Fe,e[99]=De,e[100]=Be):Be=e[100];let nt;return e[101]!==re||e[102]!==Be?(nt=m.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[re,ae,Be]}),e[101]=re,e[102]=Be,e[103]=nt):nt=e[103],nt}function wU(t){const e=fe.c(33),{workspaceId:n,searchQuery:r,selectedIndex:o,onSelect:l,onFilesChange:c,showHidden:a,serverUrl:u,apiToken:d}=t,p=a===void 0?!0:a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[v,x]=N.useState(h),[C,w]=N.useState(!1),[y,S]=N.useState(r),{fetchWithAuth:_}=Xa(),b=N.useRef(0);let k,T;e[1]!==r?(k=()=>{const G=setTimeout(()=>{S(r)},300);return()=>clearTimeout(G)},T=[r],e[1]=r,e[2]=k,e[3]=T):(k=e[2],T=e[3]),N.useEffect(k,T);let R,M;if(e[4]!==d||e[5]!==y||e[6]!==_||e[7]!==c||e[8]!==u||e[9]!==p||e[10]!==n?(R=()=>{if(!y||y.length<2){x([]),c([]);return}const G=b.current=b.current+1;w(!0);const q=new AbortController;return _(`/api/workspaces/${n}/files?search=${encodeURIComponent(y)}&showHidden=${p}`,{signal:q.signal},{serverUrl:u,token:d}).then(kU).then(X=>{if(G!==b.current)return;const Y=X.files||[];x(Y),c(Y)}).catch(CU).finally(()=>{G===b.current&&w(!1)}),()=>q.abort()},M=[n,y,c,p,_,u,d],e[4]=d,e[5]=y,e[6]=_,e[7]=c,e[8]=u,e[9]=p,e[10]=n,e[11]=R,e[12]=M):(R=e[11],M=e[12]),N.useEffect(R,M),!r||r.length<2){let G;return e[13]===Symbol.for("react.memo_cache_sentinel")?(G=m.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=G):G=e[13],G}if(C){let G;return e[14]===Symbol.for("react.memo_cache_sentinel")?(G=m.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[m.jsx(nr,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=G):G=e[14],G}if(v.length===0){let G;return e[15]!==r?(G=m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',r,'"']}),e[15]=r,e[16]=G):G=e[16],G}let A;if(e[17]!==v||e[18]!==l||e[19]!==o){let G;e[21]!==l||e[22]!==o?(G=(q,X)=>m.jsxs("button",{onClick:()=>l(q),className:Ee("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",X===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[q.type==="directory"?m.jsx(zs,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):m.jsx(Or,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:q.path}),q.extension&&m.jsx("span",{className:"text-xs text-muted-foreground",children:q.extension})]},q.path),e[21]=l,e[22]=o,e[23]=G):G=e[23],A=v.map(G),e[17]=v,e[18]=l,e[19]=o,e[20]=A}else A=e[20];const j=v.length!==1?"s":"";let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=z):z=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=V):V=e[26];let F;e[27]!==v.length||e[28]!==j?(F=m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[v.length," result",j," •",O," navigate",z," select",V," close"]}),e[27]=v.length,e[28]=j,e[29]=F):F=e[29];let W;return e[30]!==F||e[31]!==A?(W=m.jsxs("div",{className:"p-1",children:[A,F]}),e[30]=F,e[31]=A,e[32]=W):W=e[32],W}function CU(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function kU(t){return t.json()}function EU(t){const e=fe.c(25),{prompts:n,query:r,selectedIndex:o,onSelect:l}=t;let c,a,u,d;if(e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==o){d=Symbol.for("react.early_return_sentinel");e:{let y;if(e[8]!==r?(y=_=>_.name.toLowerCase().includes(r.toLowerCase()),e[8]=r,e[9]=y):y=e[9],c=n.filter(y),c.length===0){let _;e[10]!==r?(_=m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',r,'"']}),e[10]=r,e[11]=_):_=e[11],d=_;break e}a="p-1";let S;e[12]!==l||e[13]!==o?(S=(_,b)=>m.jsxs("button",{onClick:()=>l(_),className:Ee("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",b===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(xA,{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:["/",_.name]}),m.jsx("div",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.name),e[12]=l,e[13]=o,e[14]=S):S=e[14],u=c.map(S)}e[0]=l,e[1]=n,e[2]=r,e[3]=o,e[4]=c,e[5]=a,e[6]=u,e[7]=d}else c=e[4],a=e[5],u=e[6],d=e[7];if(d!==Symbol.for("react.early_return_sentinel"))return d;const p=c.length!==1?"s":"";let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[15]=h):h=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[16]=v):v=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[17]=x):x=e[17];let C;e[18]!==c.length||e[19]!==p?(C=m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," prompt",p," •",h," navigate",v," select",x," close"]}),e[18]=c.length,e[19]=p,e[20]=C):C=e[20];let w;return e[21]!==a||e[22]!==u||e[23]!==C?(w=m.jsxs("div",{className:a,children:[u,C]}),e[21]=a,e[22]=u,e[23]=C,e[24]=w):w=e[24],w}function AU(t){const e=fe.c(26),{id:n,kind:r,filename:o,size:l,previewUrl:c,isUploading:a,onRemove:u}=t,d=a&&"opacity-50";let p;e[0]!==d?(p=Ee("flex items-center gap-2 px-2 py-1.5 bg-muted rounded-lg border border-border max-w-[180px]",d),e[0]=d,e[1]=p):p=e[1];let h;e[2]!==o||e[3]!==r||e[4]!==c?(h=r==="image"&&c?m.jsx("img",{src:c,alt:o,className:"size-8 rounded object-cover shrink-0"}):r==="image"?m.jsx(oA,{className:"size-4 text-muted-foreground shrink-0"}):m.jsx(Or,{className:"size-4 text-muted-foreground shrink-0"}),e[2]=o,e[3]=r,e[4]=c,e[5]=h):h=e[5];let v;e[6]!==o?(v=m.jsx("div",{className:"text-xs truncate",children:o}),e[6]=o,e[7]=v):v=e[7];let x;e[8]!==l?(x=RU(l),e[8]=l,e[9]=x):x=e[9];let C;e[10]!==x?(C=m.jsx("div",{className:"text-[10px] text-muted-foreground",children:x}),e[10]=x,e[11]=C):C=e[11];let w;e[12]!==v||e[13]!==C?(w=m.jsxs("div",{className:"min-w-0 flex-1",children:[v,C]}),e[12]=v,e[13]=C,e[14]=w):w=e[14];let y;e[15]!==n||e[16]!==u?(y=()=>u(n),e[15]=n,e[16]=u,e[17]=y):y=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx(Bs,{className:"size-3 text-muted-foreground"}),e[18]=S):S=e[18];let _;e[19]!==y?(_=m.jsx("button",{type:"button",onClick:y,className:"shrink-0 p-0.5 hover:bg-accent rounded",children:S}),e[19]=y,e[20]=_):_=e[20];let b;return e[21]!==_||e[22]!==p||e[23]!==h||e[24]!==w?(b=m.jsxs("div",{className:p,children:[h,w,_]}),e[21]=_,e[22]=p,e[23]=h,e[24]=w,e[25]=b):b=e[25],b}function RU(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function TU(t){const e=fe.c(9),[n,r]=N.useState(""),[o,l]=N.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,u]=N.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=w=>{const y={type:"file",path:w.path,display:w.name};return u(S=>[...S,y]),l(!1),r(""),y},e[1]=d):d=e[1];const p=d,h=NU;let v;e[2]!==a?(v=w=>{const y=/@([^\s@]+)/g,S=[];let _;for(;(_=y.exec(w))!==null;){const b=_[1];a.some(k=>k.path===b)&&!S.some(k=>k.path===b)&&S.push({type:"file",path:b,display:b.split("/").pop()||b})}return S},e[2]=a,e[3]=v):v=e[3];const x=v;let C;return e[4]!==x||e[5]!==a||e[6]!==n||e[7]!==o?(C={query:n,setQuery:r,showAutocomplete:o,setShowAutocomplete:l,mentions:a,handleFileSelect:p,insertMention:h,extractMentions:x},e[4]=x,e[5]=a,e[6]=n,e[7]=o,e[8]=C):C=e[8],C}function NU(t,e,n){const r=t.lastIndexOf("@",e);if(r===-1)return{text:t,cursorPos:e};const o=t.slice(0,r)+`@${n.path}`+t.slice(e),l=r+n.path.length+1;return{text:o,cursorPos:l}}function DU(t,e){return e?t.content.includes("ARG")?t.content.replace("ARG",e):`${t.content}
|
|
601
|
+
${e}`:t.content}function MU(t){const e=t.trimStart();if(!e.startsWith("/"))return null;const n=e.indexOf(" ");return n===-1?{command:e.slice(1),rest:""}:{command:e.slice(1,n),rest:e.slice(n+1).trim()}}const jU=N.forwardRef(function({onSendMessage:e,disabled:n,isStreaming:r,onStopStreaming:o,placeholder:l="Type a message...",workspaceId:c,serverUrl:a,apiToken:u,prompts:d=[],sessionId:p,modelSupportsImage:h},v){const[x,C]=N.useState(""),[w,y]=N.useState(0),[S,_]=N.useState([]),[b,k]=N.useState(0),[T,R]=N.useState("none"),[M,A]=N.useState(""),[j,O]=N.useState([]),[z,V]=N.useState(!1),F=N.useRef(null),W=N.useRef(null);N.useImperativeHandle(v,()=>({focus:()=>{var ve;return(ve=F.current)==null?void 0:ve.focus()}}),[]);const{query:G,setQuery:q,showAutocomplete:X,setShowAutocomplete:Y,handleFileSelect:I,insertMention:L}=TU();N.useEffect(()=>{k(0)},[S,M,d]),N.useEffect(()=>{const ve=F.current;ve&&(ve.style.height="auto",ve.style.height=`${Math.min(ve.scrollHeight,150)}px`)},[x]);const P=d.filter(ve=>ve.name.toLowerCase().includes(M.toLowerCase())),H=T==="prompts"&&d.length>0,B=T==="files"&&X&&!!c,Z=N.useCallback(ve=>{const Ne=ve.target.value,Ae=ve.target.selectionStart||0;C(Ne),y(Ae);const Ce=Ne.lastIndexOf("/",Ae);if(Ce!==-1){const me=Ce>0?Ne[Ce-1]:`
|
|
602
|
+
`,ke=Ne.slice(Ce+1,Ae);if((me===`
|
|
603
|
+
`||me===" "||me==="")&&!ke.includes(" ")){A(ke),R("prompts");return}}const oe=Ne.lastIndexOf("@",Ae);if(oe!==-1){const me=Ne.slice(oe+1,Ae);if(!me.includes(" ")){q(me),Y(!0),R("files");return}}R("none"),Y(!1)},[q,Y]),J=N.useCallback(ve=>{const Ne=I(ve),Ae=L(x,w,Ne);C(Ae.text),R("none"),Y(!1),_([]),setTimeout(()=>{F.current&&(F.current.focus(),F.current.setSelectionRange(Ae.cursorPos,Ae.cursorPos))},0)},[x,w,I,L,Y]),ee=N.useCallback(ve=>{const Ne=x.lastIndexOf("/",w),Ae=x.slice(0,Ne),Ce=x.slice(Ne+1),oe=Ce.indexOf(" "),me=oe!==-1?Ce.slice(oe):"",ke=`${Ae}/${ve.name}${me}`,De=Ne+1+ve.name.length+0;C(ke),R("none"),setTimeout(()=>{F.current&&(F.current.focus(),F.current.setSelectionRange(De,De))},0)},[x,w]),K=N.useCallback(()=>{for(const ve of j)ve.previewUrl&&URL.revokeObjectURL(ve.previewUrl);O([]),C("")},[j]),$=N.useCallback(async ve=>{if(!a||!u||!p)return null;try{const Ne=new FormData;Ne.append("file",ve);const Ae=await fetch(`http://${a}/api/sessions/${p}/attachments`,{method:"POST",headers:{Authorization:`Bearer ${u}`},body:Ne});if(!Ae.ok){const oe=await Ae.json().catch(()=>({message:"Upload failed"}));return console.error("Upload failed:",oe.message),null}const Ce=await Ae.json();return{id:crypto.randomUUID(),kind:Ce.kind,filename:Ce.filename,size:Ce.size,previewUrl:ve.type.startsWith("image/")?URL.createObjectURL(ve):void 0,uploadedId:Ce.id,uploadedKind:Ce.kind}}catch(Ne){return console.error("Upload error:",Ne),null}},[a,u,p]),te=N.useCallback(ve=>{O(Ne=>{const Ae=Ne.find(Ce=>Ce.id===ve);return Ae!=null&&Ae.previewUrl&&URL.revokeObjectURL(Ae.previewUrl),Ne.filter(Ce=>Ce.id!==ve)})},[]),re=N.useCallback(async ve=>{const Ne=Array.from(ve);for(const Ae of Ne){if(Ae.size>20*1024*1024)continue;const Ce=Ae.type.startsWith("image/")?"image":Ae.type.startsWith("video/")?"video":"file",oe={id:crypto.randomUUID(),kind:Ce,filename:Ae.name,size:Ae.size,previewUrl:Ae.type.startsWith("image/")?URL.createObjectURL(Ae):void 0,isUploading:!0};O(ke=>[...ke,oe]);const me=await $(Ae);O(me?ke=>ke.map(De=>De.id===oe.id?(De.previewUrl&&De.previewUrl!==me.previewUrl&&URL.revokeObjectURL(De.previewUrl),{...me,isUploading:!1}):De):ke=>ke.filter(De=>De.id!==oe.id))}},[$]),ae=N.useCallback(ve=>{var Ae;const Ne=(Ae=ve.clipboardData)==null?void 0:Ae.files;Ne&&Ne.length>0&&(ve.preventDefault(),re(Ne))},[re]),se=N.useCallback(ve=>{ve.preventDefault(),ve.stopPropagation(),V(!0)},[]),_e=N.useCallback(ve=>{ve.preventDefault(),ve.stopPropagation(),V(!1)},[]),Re=N.useCallback(ve=>{var Ae;ve.preventDefault(),ve.stopPropagation(),V(!1);const Ne=(Ae=ve.dataTransfer)==null?void 0:Ae.files;Ne&&Ne.length>0&&re(Ne)},[re]),je=async ve=>{ve==null||ve.preventDefault();const Ne=x.trim();if(!Ne&&j.length===0||n)return;const Ae=MU(x);if(Ae){const oe=d.find(me=>me.name===Ae.command);if(oe){const me=DU(oe,Ae.rest),ke=j.filter(De=>De.uploadedId).map(De=>({id:De.uploadedId,kind:De.uploadedKind}));e(me,ke.length>0?ke:void 0),K();return}}const Ce=j.filter(oe=>oe.uploadedId).map(oe=>({id:oe.uploadedId,kind:oe.uploadedKind}));e(Ne||"",Ce.length>0?Ce:void 0),K()},ze=ve=>{if(!ve.nativeEvent.isComposing){if(H&&P.length>0)switch(ve.key){case"ArrowDown":ve.preventDefault(),k(Ne=>Math.min(Ne+1,P.length-1));return;case"ArrowUp":ve.preventDefault(),k(Ne=>Math.max(Ne-1,0));return;case"Enter":if(ve.shiftKey)return;ve.preventDefault(),P[b]&&ee(P[b]);return;case"Tab":ve.preventDefault(),P[b]&&ee(P[b]);return;case"Escape":ve.preventDefault(),R("none");return}if(B&&S.length>0)switch(ve.key){case"ArrowDown":ve.preventDefault(),k(Ne=>Math.min(Ne+1,S.length-1));return;case"ArrowUp":ve.preventDefault(),k(Ne=>Math.max(Ne-1,0));return;case"Enter":ve.preventDefault(),S[b]&&J(S[b]);return;case"Escape":ve.preventDefault(),Y(!1),R("none");return;case"Tab":ve.preventDefault(),S[b]&&J(S[b]);return}ve.key==="Enter"&&!ve.shiftKey&&(ve.preventDefault(),je())}},ce=N.useCallback(ve=>{_(ve)},[]);if(r&&o)return 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(He,{variant:"outline",size:"sm",onClick:o,children:[m.jsx(gS,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})});const Te=x.trim(),ye=j.some(ve=>ve.isUploading),Fe=!(Te||j.length>0)||n||ye;return m.jsxs("form",{onSubmit:je,onDragOver:se,onDragLeave:_e,onDrop:Re,className:Ee("p-4 border-t border-border bg-card",z&&"ring-2 ring-primary"),children:[(j.length>0||!r)&&m.jsx("div",{className:"flex gap-2 flex-wrap mb-2",children:j.map(ve=>m.jsx(AU,{id:ve.id,kind:ve.kind,filename:ve.filename,size:ve.size,previewUrl:ve.previewUrl,isUploading:ve.isUploading,onRemove:te},ve.id))}),j.length>0&&h===!1&&m.jsxs("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-amber-600 dark:text-amber-400",children:[m.jsx(Da,{className:"size-3 shrink-0"}),m.jsx("span",{children:"This model will not inspect images directly. They will be sent as file paths instead."})]}),m.jsxs("div",{className:"flex gap-3 items-end",children:[m.jsx("div",{className:"flex-1 relative",children:m.jsxs(Df,{open:H||B,onOpenChange:ve=>{ve||(R("none"),Y(!1))},children:[m.jsx(u8,{asChild:!0,children:m.jsx(i8,{ref:F,value:x,onChange:Z,onKeyDown:ze,onPaste:ae,placeholder:l,disabled:n,className:Ee("min-h-[44px] max-h-[150px] resize-none pr-12 chat-input-scrollbar","focus-visible:ring-1"),rows:1,"data-chat-input":"true"})}),m.jsx(Mf,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:ve=>ve.preventDefault(),onCloseAutoFocus:ve=>ve.preventDefault(),children:B?m.jsx(wU,{workspaceId:c||"",searchQuery:G,selectedIndex:b,onSelect:J,onFilesChange:ce,serverUrl:a,apiToken:u}):m.jsx(EU,{prompts:d,query:M,selectedIndex:b,onSelect:ee})})]})}),m.jsx("button",{type:"button",className:"flex items-center justify-center size-11 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50 disabled:pointer-events-none",onClick:()=>{var ve;return(ve=W.current)==null?void 0:ve.click()},disabled:n,children:m.jsx(MA,{className:"size-4"})}),m.jsx("input",{ref:W,type:"file",accept:"image/*,video/*,.pdf,.doc,.docx,.txt,.csv,.json,.xml,.md",multiple:!0,className:"hidden",onChange:ve=>{ve.target.files&&re(ve.target.files),ve.target.value=""}}),m.jsx(He,{type:"submit",disabled:Fe,size:"default",className:"h-11",children:m.jsx(qA,{className:"size-4"})})]}),m.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center hidden sm: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:"@"}),m.jsx("span",{children:"files"}),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 OU(t){const e=fe.c(3),n=N.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],N.useLayoutEffect(r);let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=(...c)=>{const a=c;return n.current(...a)},e[2]=o):o=e[2],o}function Sa(t,e,n){var a;let r=(a=n.initialDeps)!=null?a:[],o,l=!0;function c(){var u,d,p;let h;n.key&&((u=n.debug)!=null&&u.call(n))&&(h=Date.now());const v=t();if(!(v.length!==r.length||v.some((w,y)=>r[y]!==w)))return o;r=v;let C;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(C=Date.now()),o=e(...v),n.key&&((p=n.debug)!=null&&p.call(n))){const w=Math.round((Date.now()-h)*100)/100,y=Math.round((Date.now()-C)*100)/100,S=y/16,_=(b,k)=>{for(b=String(b);b.length<k;)b=" "+b;return b};console.info(`%c⏱ ${_(y,5)} /${_(w,5)} ms`,`
|
|
604
|
+
font-size: .6rem;
|
|
605
|
+
font-weight: bold;
|
|
606
|
+
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(o),l=!1,o}return c.updateDeps=u=>{r=u},c}function Bx(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const LU=(t,e)=>Math.abs(t-e)<1.01,IU=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},Fx=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},PU=t=>t,zU=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},BU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=c=>{const{width:a,height:u}=c;e({width:Math.round(a),height:Math.round(u)})};if(o(Fx(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(c=>{const a=()=>{const u=c[0];if(u!=null&&u.borderBoxSize){const d=u.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Fx(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Hx={passive:!0},Ux=typeof window>"u"?!0:"onscrollend"in window,FU=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const l=t.options.useScrollendEvent&&Ux?()=>{}:IU(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),c=p=>()=>{const{horizontal:h,isRtl:v}=t.options;o=h?n.scrollLeft*(v&&-1||1):n.scrollTop,l(),e(o,p)},a=c(!0),u=c(!1);n.addEventListener("scroll",a,Hx);const d=t.options.useScrollendEvent&&Ux;return d&&n.addEventListener("scrollend",u,Hx),()=>{n.removeEventListener("scroll",a),d&&n.removeEventListener("scrollend",u)}},HU=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},UU=(t,{adjustments:e=0,behavior:n},r)=>{var o,l;const c=t+e;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:c,behavior:n})};class $U{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var l;var n,r,o;return(l=(o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))!=null?l:Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const c=()=>{const a=l.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:PU,rangeExtractor:zU,onChange:()=>{},measureElement:HU,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Sa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var o;var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(o=(n=this.scrollElement)==null?void 0:n.window)!=null?o:null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,c)=>{this.scrollAdjustments=0,this.scrollDirection=c?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=c,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>{var n;return this.options.enabled?(this.scrollRect=(n=this.scrollRect)!=null?n:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var n;return this.options.enabled?(this.scrollOffset=(n=this.scrollOffset)!=null?n:typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(n,r)=>{const o=new Map,l=new Map;for(let c=r-1;c>=0;c--){const a=n[c];if(o.has(a.lane))continue;const u=l.get(a.lane);if(u==null||a.end>u.end?l.set(a.lane,a):a.end<u.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,a)=>c.end===a.end?c.index-a.index:c.end-a.end)[0]:void 0},this.getMeasurementOptions=Sa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,l,c,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:c,lanes:a}),{key:!1}),this.getMeasurements=Sa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:c,lanes:a},u)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,d),h=new Array(a).fill(void 0);for(let v=0;v<d;v++){const x=p[v];x&&(h[x.lane]=v)}for(let v=d;v<n;v++){const x=l(v),C=this.laneAssignments.get(v);let w,y;if(C!==void 0&&this.options.lanes>1){w=C;const k=h[w],T=k!==void 0?p[k]:void 0;y=T?T.end+this.options.gap:r+o}else{const k=this.options.lanes===1?p[v-1]:this.getFurthestMeasurement(p,v);y=k?k.end+this.options.gap:r+o,w=k?k.lane:v%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(v,w)}const S=u.get(x),_=typeof S=="number"?S:this.options.estimateSize(v),b=y+_;p[v]={index:v,start:y,size:_,end:b,key:x,lane:w},h[w]=v}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Sa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,l)=>this.range=n.length>0&&r>0?VU({measurements:n,outerSize:r,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Sa(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,l,c)=>l===null||c===null?[]:n({startIndex:l,endIndex:c,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var l;var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=(l=this.scrollState.index)!=null?l:(r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index;if(o!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-c),u=Math.min(this.options.count-1,o+c);return n>=a&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,a)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),l=this.elementsCache.get(o);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var u;var o;const l=this.measurementsCache[n];if(!l)return;const c=(u=this.itemSizeCache.get(l.key))!=null?u:l.size,a=r-c;a!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,a,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=Sa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let l=0,c=n.length;l<c;l++){const a=n[l],u=r[a];o.push(u)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Bx(r[kE(0,r.length-1,o=>Bx(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+l?"end":"start"),r==="center"?n+=(o-l)/2:r==="end"&&(n-=l);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=l+o-this.options.scrollPaddingEnd)r="end";else if(c.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:c,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[c,a]=l,u=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:u,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var l;var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=(l=(n=r[r.length-1])==null?void 0:n.end)!=null?l:0;else{const c=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&c.some(u=>u===null);){const u=r[a];c[u.lane]===null&&(c[u.lane]=u.end),a--}o=Math.max(...c.filter(u=>u!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,l=1,c=o!==this.scrollState.lastTargetOffset;if(!c&&LU(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,c&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const kE=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,l=n(o);if(l<r)t=o+1;else if(l>r)e=o-1;else return o}return t>0?t-1:0};function VU({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1,l=u=>t[u].start;if(t.length<=r)return{startIndex:0,endIndex:o};let c=kE(0,o,l,n),a=c;if(r===1)for(;a<o&&t[a].end<n+e;)a++;else if(r>1){const u=Array(r).fill(0);for(;a<o&&u.some(p=>p<n+e);){const p=t[a];u[p.lane]=p.end,a++}const d=Array(r).fill(n+e);for(;c>=0&&d.some(p=>p>=n);){const p=t[c];d[p.lane]=p.start,c--}c=Math.max(0,c-c%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:c,endIndex:a}}const $x=typeof document<"u"?N.useLayoutEffect:N.useEffect;function qU({useFlushSync:t=!0,...e}){const n=N.useReducer(()=>({}),{})[1],r={...e,onChange:(l,c)=>{var a;t&&c?Va.flushSync(n):n(),(a=e.onChange)==null||a.call(e,l,c)}},[o]=N.useState(()=>new $U(r));return o.setOptions(r),$x(()=>o._didMount(),[]),$x(()=>o._willUpdate()),o}function WU(t){return qU({observeElementRect:BU,observeElementOffset:FU,scrollToFn:UU,...t})}function GU(t){const e=fe.c(47),{message:n,textContent:r,children:o,isQueued:l,onRemove:c,onRevert:a,canRevert:u,onFork:d,canFork:p}=t,h=l===void 0?!1:l,v=u===void 0?!1:u,x=p===void 0?!1:p,[C,w]=N.useState(!1),[y,S]=N.useState(!1),[_,b]=N.useState(!1),k=n.role==="user";let T;e[0]!==r?(T=async()=>{const Z=r||"";await navigator.clipboard.writeText(Z),w(!0),setTimeout(()=>w(!1),2e3)},e[0]=r,e[1]=T):T=e[1];const R=T,M=k?"items-end":"items-start";let A;e[2]!==M?(A=Ee("flex flex-col gap-1 animate-slide-up min-w-0",M),e[2]=M,e[3]=A):A=e[3];const j=k?"mr-3":"ml-3";let O;e[4]!==j?(O=Ee("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",j),e[4]=j,e[5]=O):O=e[5];let z;e[6]!==x||e[7]!==v||e[8]!==C||e[9]!==R||e[10]!==h||e[11]!==k||e[12]!==n.role||e[13]!==d||e[14]!==a?(z=k?m.jsxs(m.Fragment,{children:[!h&&m.jsxs(m.Fragment,{children:[v&&a&&m.jsx(He,{variant:"ghost",size:"icon",onClick:()=>S(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:m.jsx(sR,{className:"size-3"})}),x&&d&&m.jsx(He,{variant:"ghost",size:"icon",onClick:()=>b(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:m.jsx(nA,{className:"size-3"})}),m.jsx(He,{variant:"ghost",size:"icon",onClick:R,className:"size-5 text-muted-foreground hover:text-foreground",children:C?m.jsx(Fs,{className:"size-3"}):m.jsx(pc,{className:"size-3"})})]}),m.jsx(vS,{className:"size-3"}),n.role]}):m.jsxs(m.Fragment,{children:[m.jsx(h5,{className:"size-3"}),n.role,m.jsx(He,{variant:"ghost",size:"icon",onClick:R,className:"size-5 text-muted-foreground hover:text-foreground",children:C?m.jsx(Fs,{className:"size-3"}):m.jsx(pc,{className:"size-3"})})]}),e[6]=x,e[7]=v,e[8]=C,e[9]=R,e[10]=h,e[11]=k,e[12]=n.role,e[13]=d,e[14]=a,e[15]=z):z=e[15];let V;e[16]!==O||e[17]!==z?(V=m.jsx("div",{className:O,children:z}),e[16]=O,e[17]=z,e[18]=V):V=e[18];const F=k?"max-w-[90%]":"max-w-full",W=h?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":k?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md";let G;e[19]!==F||e[20]!==W?(G=Ee("rounded-2xl px-4 py-3 relative group min-w-0 overflow-hidden",F,W),e[19]=F,e[20]=W,e[21]=G):G=e[21];let q;e[22]!==h||e[23]!==c?(q=h&&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(lS,{className:"size-3 animate-pulse"}),m.jsx("span",{children:"Pending"})]}),c&&m.jsx(He,{variant:"ghost",size:"icon",onClick:c,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:m.jsx(Bs,{className:"size-3"})})]}),e[22]=h,e[23]=c,e[24]=q):q=e[24];let X;e[25]!==o?(X=m.jsx("div",{className:"min-w-0",children:o}),e[25]=o,e[26]=X):X=e[26];let Y;e[27]!==G||e[28]!==q||e[29]!==X?(Y=m.jsxs("div",{className:G,children:[q,X]}),e[27]=G,e[28]=q,e[29]=X,e[30]=Y):Y=e[30];let I;e[31]!==a?(I=()=>{a==null||a()},e[31]=a,e[32]=I):I=e[32];let L;e[33]!==y||e[34]!==I?(L=m.jsx(dg,{open:y,onOpenChange:S,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:I,variant:"destructive"}),e[33]=y,e[34]=I,e[35]=L):L=e[35];let P;e[36]!==d?(P=()=>{d==null||d()},e[36]=d,e[37]=P):P=e[37];let H;e[38]!==_||e[39]!==P?(H=m.jsx(dg,{open:_,onOpenChange:b,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:P}),e[38]=_,e[39]=P,e[40]=H):H=e[40];let B;return e[41]!==V||e[42]!==Y||e[43]!==L||e[44]!==H||e[45]!==A?(B=m.jsxs("div",{className:A,children:[V,Y,L,H]}),e[41]=V,e[42]=Y,e[43]=L,e[44]=H,e[45]=A,e[46]=B):B=e[46],B}const KU=tl.oneDark;function YU(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.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"}[e||""]||e||"text"}const XU=N.memo(function(e){const n=fe.c(28),{type:r,content:o,lineNumber:l,newLineNumber:c,language:a}=e,u=r==="added"&&"bg-green-500/20",d=r==="removed"&&"bg-red-500/20",p=r==="context"&&"bg-muted/30";let h;n[0]!==u||n[1]!==d||n[2]!==p?(h=Ee("flex font-mono text-xs",u,d,p),n[0]=u,n[1]=d,n[2]=p,n[3]=h):h=n[3];const v=h,x=r==="added"&&"text-green-400",C=r==="removed"&&"text-red-400",w=r==="context"&&"text-muted-foreground/50";let y;n[4]!==x||n[5]!==C||n[6]!==w?(y=Ee("font-bold w-4 select-none",x,C,w),n[4]=x,n[5]=C,n[6]=w,n[7]=y):y=n[7];const S=y,_=l!=null?l:"";let b;n[8]!==_?(b=m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:_}),n[8]=_,n[9]=b):b=n[9];const k=c!=null?c:"";let T;n[10]!==k?(T=m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:k}),n[10]=k,n[11]=T):T=n[11];const R=r==="added"&&"+",M=r==="removed"&&"-",A=r==="context"&&" ";let j;n[12]!==S||n[13]!==R||n[14]!==M||n[15]!==A?(j=m.jsxs("span",{className:S,children:[R,M,A]}),n[12]=S,n[13]=R,n[14]=M,n[15]=A,n[16]=j):j=n[16];let O;n[17]!==o||n[18]!==a?(O=m.jsx(Vf,{theme:KU,code:o,language:a,children:QU}),n[17]=o,n[18]=a,n[19]=O):O=n[19];let z;n[20]!==j||n[21]!==O?(z=m.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[j,O]}),n[20]=j,n[21]=O,n[22]=z):z=n[22];let V;return n[23]!==b||n[24]!==T||n[25]!==z||n[26]!==v?(V=m.jsxs("div",{className:v,children:[b,T,z]}),n[23]=b,n[24]=T,n[25]=z,n[26]=v,n[27]=V):V=n[27],V}),EE=N.memo(function(e){const n=fe.c(33),{hunks:r,path:o,language:l,additions:c,deletions:a}=e,[u,d]=N.useState(!0);let p;n[0]!==o||n[1]!==l?(p=l||YU(o),n[0]=o,n[1]=l,n[2]=p):p=n[2];const h=p,v=zt(ZU),x=Tg(JU);let C;n[3]!==x||n[4]!==v||n[5]!==o?(C=()=>{x&&v({workspaceId:x.id,path:o,name:o.split("/").pop()||o})},n[3]=x,n[4]=v,n[5]=o,n[6]=C):C=n[6];const w=C;let y;n[7]!==u?(y=()=>d(!u),n[7]=u,n[8]=y):y=n[8];let S;n[9]!==u?(S=u?m.jsx(Fa,{className:"size-3"}):m.jsx(Xr,{className:"size-3"}),n[9]=u,n[10]=S):S=n[10];let _;n[11]!==y||n[12]!==S?(_=m.jsx("button",{onClick:y,className:"px-1 py-1 hover:bg-muted rounded",children:S}),n[11]=y,n[12]=S,n[13]=_):_=n[13];let b;n[14]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(Ng,{className:"size-3"}),n[14]=b):b=n[14];let k;n[15]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(mc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),n[15]=k):k=n[15];let T;n[16]!==w||n[17]!==o?(T=m.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[o,k]}),n[16]=w,n[17]=o,n[18]=T):T=n[18];let R;n[19]!==c||n[20]!==a?(R=c!==void 0&&a!==void 0&&m.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",c," -",a]}),n[19]=c,n[20]=a,n[21]=R):R=n[21];let M;n[22]!==_||n[23]!==T||n[24]!==R?(M=m.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[_,b,T,R]}),n[22]=_,n[23]=T,n[24]=R,n[25]=M):M=n[25];let A;n[26]!==u||n[27]!==r||n[28]!==h?(A=u&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:r.map((O,z)=>m.jsx("div",{className:"divide-y divide-white/5",children:O.changes.map((V,F)=>m.jsx(XU,{...V,language:h},F))},z))}),n[26]=u,n[27]=r,n[28]=h,n[29]=A):A=n[29];let j;return n[30]!==M||n[31]!==A?(j=m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[M,A]})}),n[30]=M,n[31]=A,n[32]=j):j=n[32],j});function QU(t){const{tokens:e,getTokenProps:n}=t;return m.jsx(m.Fragment,{children:e.map((r,o)=>m.jsx("span",{children:r.map((l,c)=>m.jsx("span",{...n({token:l})},c))},o))})}function ZU(t){return t.openFilePreview}function JU(t){return t.activeWorkspace}const e$=tl.oneDark,t$=20;function n$(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.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"}[e||""]||e||"text"}const r$=N.memo(t=>{const e=fe.c(46),{content:n,path:r,language:o,created:l,highlightLines:c}=t;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const u=a,[d,p]=N.useState(!1),h=zt(s$),v=Tg(i$);let x;e[2]!==v||e[3]!==h||e[4]!==r?(x=()=>{v&&h({workspaceId:v.id,path:r,name:r.split("/").pop()||r})},e[2]=v,e[3]=h,e[4]=r,e[5]=x):x=e[5];const C=x;let w;e[6]!==o||e[7]!==r?(w=o||n$(r),e[6]=o,e[7]=r,e[8]=w):w=e[8];const y=w;let S;e[9]!==u?(S=new Set(u),e[9]=u,e[10]=S):S=e[10];const _=S;let b;e[11]!==n?(b=n.split(`
|
|
607
|
+
`),e[11]=n,e[12]=b):b=e[12];const k=b.length;let T;e[13]!==d?(T=()=>p(!d),e[13]=d,e[14]=T):T=e[14];let R;e[15]!==d?(R=d?m.jsx(Fa,{className:"size-3"}):m.jsx(Xr,{className:"size-3"}),e[15]=d,e[16]=R):R=e[16];let M;e[17]!==T||e[18]!==R?(M=m.jsx("button",{onClick:T,className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:R}),e[17]=T,e[18]=R,e[19]=M):M=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsx(Ng,{className:"size-3"}),e[20]=A):A=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx(mc,{className:"size-2.5 opacity-0 group-hover/path:opacity-100 transition-opacity"}),e[21]=j):j=e[21];let O;e[22]!==C||e[23]!==r?(O=m.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1 font-mono pr-2 hover:text-foreground transition-colors cursor-pointer rounded px-1 py-0.5 -mx-1 hover:bg-muted",title:"Open file preview",children:[r,j]}),e[22]=C,e[23]=r,e[24]=O):O=e[24];let z;e[25]!==d||e[26]!==k?(z=!d&&m.jsxs("span",{className:"text-xs text-muted-foreground/70",children:[k," lines"]}),e[25]=d,e[26]=k,e[27]=z):z=e[27];let V;e[28]!==l?(V=l===!1?m.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[m.jsx(Ea,{className:"size-3"}),"Overwrote"]}):m.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[m.jsx(Fs,{className:"size-3"}),"Created"]}),e[28]=l,e[29]=V):V=e[29];let F;e[30]!==O||e[31]!==z||e[32]!==V||e[33]!==M?(F=m.jsxs("div",{className:"group/path flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[M,A,O,z,V]}),e[30]=O,e[31]=z,e[32]=V,e[33]=M,e[34]=F):F=e[34];let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W={backgroundColor:"#282c34"},e[35]=W):W=e[35];let G;e[36]!==d||e[37]!==_?(G=Y=>{const{tokens:I,getTokenProps:L}=Y,P=d?I:I.slice(0,t$);return m.jsx(m.Fragment,{children:P.map((H,B)=>m.jsxs("div",{className:`flex font-mono text-xs ${_.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:H.map((Z,J)=>m.jsx("span",{...L({token:Z})},J))})]},B))})},e[36]=d,e[37]=_,e[38]=G):G=e[38];let q;e[39]!==n||e[40]!==y||e[41]!==G?(q=m.jsx("div",{style:W,children:m.jsx(Vf,{theme:e$,code:n,language:y,children:G})}),e[39]=n,e[40]=y,e[41]=G,e[42]=q):q=e[42];let X;return e[43]!==F||e[44]!==q?(X=m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[F,q]})}),e[43]=F,e[44]=q,e[45]=X):X=e[45],X});function s$(t){return t.openFilePreview}function i$(t){return t.activeWorkspace}function o$(t){const e=fe.c(3),{message:n}=t,r=n===void 0?"Success":n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(Ec,{className:"size-4"}),e[0]=o):o=e[0];let l;return e[1]!==r?(l=m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o,m.jsx("span",{className:"break-all",children:r})]}),e[1]=r,e[2]=l):l=e[2],l}const a$={edit:W5,plus:Ha,trash:Ua,search:Dg};function l$(t){const e=fe.c(7),{text:n}=t,[r,o]=N.useState(!1);let l;e[0]!==n?(l=async()=>{await navigator.clipboard.writeText(n),o(!0),setTimeout(()=>o(!1),1500)},e[0]=n,e[1]=l):l=e[1];const c=l;let a;e[2]!==r?(a=r?m.jsx("span",{className:"text-success text-xs",children:"Copied!"}):m.jsx(pc,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];let u;return e[4]!==c||e[5]!==a?(u=m.jsx("button",{onClick:c,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:a}),e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function c$(t){const e=fe.c(16),{title:n,groups:r,files:o,total:l}=t;let c;e[0]!==o?(c=o||[],e[0]=o,e[1]=c):c=e[1];let a;e[2]!==c?(a={label:"Files",files:c,icon:void 0},e[2]=c,e[3]=a):a=e[3];const u=a;let d;e[4]!==u||e[5]!==o||e[6]!==r?(d=r||(o?[u]:[]),e[4]=u,e[5]=o,e[6]=r,e[7]=d):d=e[7];const p=d;if(p.length===0)return null;let h;e[8]!==n||e[9]!==l?(h=n&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n,l!==void 0&&m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",l," files)"]})]}),e[8]=n,e[9]=l,e[10]=h):h=e[10];let v;e[11]!==p?(v=p.map(u$),e[11]=p,e[12]=v):v=e[12];let x;return e[13]!==h||e[14]!==v?(x=m.jsxs("div",{className:"flex flex-col gap-3",children:[h,v]}),e[13]=h,e[14]=v,e[15]=x):x=e[15],x}function u$(t,e){return 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:[t.icon&&m.jsx("span",{className:"flex items-center",children:(()=>{const n=a$[t.icon];return m.jsx(n,{className:"size-3"})})()}),m.jsx("span",{children:t.label}),m.jsxs("span",{className:"text-muted-foreground/50",children:["(",t.files.length,")"]})]}),m.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:t.files.map(d$)})]},e)}function d$(t,e){return m.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[m.jsx(Ng,{className:"size-3 text-muted-foreground shrink-0"}),m.jsx("span",{className:"font-mono text-foreground/80 truncate",children:t.path}),t.line!==void 0&&m.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",t.line]}),t.action&&m.jsx("span",{className:Ee("text-xs px-1 rounded shrink-0",t.action==="created"&&"bg-success/20 text-success",t.action==="modified"&&"bg-warning/20 text-warning",t.action==="deleted"&&"bg-destructive/20 text-destructive"),children:t.action}),m.jsx(l$,{text:t.path})]},e)}function f$(t){const e=fe.c(15),{command:n,stdout:r,stderr:o,exitCode:l}=t,c=l===0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"text-muted-foreground",children:"$ "}),e[0]=a):a=e[0];let u;e[1]!==n?(u=m.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[a,m.jsx("span",{className:"text-foreground",children:n})]}),e[1]=n,e[2]=u):u=e[2];const d=`text-xs font-mono px-2 py-0.5 rounded ${c?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`;let p;e[3]!==l||e[4]!==d?(p=m.jsxs("span",{className:d,children:["[",l,"]"]}),e[3]=l,e[4]=d,e[5]=p):p=e[5];let h;e[6]!==u||e[7]!==p?(h=m.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[u,p]}),e[6]=u,e[7]=p,e[8]=h):h=e[8];let v;e[9]!==o||e[10]!==r?(v=(r||o)&&m.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[r&&m.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:r}),o&&m.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:o})]}),e[9]=o,e[10]=r,e[11]=v):v=e[11];let x;return e[12]!==h||e[13]!==v?(x=m.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14],x}const h$={pending:{icon:N5,color:"text-muted-foreground"},in_progress:{icon:nr,color:"text-warning",animate:!0},completed:{icon:Ec,color:"text-success"},cancelled:{icon:ef,color:"text-destructive"}},p$={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function m$(t){const e=fe.c(13),{title:n,items:r}=t;if(r.length===0)return null;let o;e[0]!==r?(o=r.filter(_$),e[0]=r,e[1]=o):o=e[1];const l=o.length;r.filter(y$),r.filter(v$);let c;e[2]!==l||e[3]!==r.length||e[4]!==n?(c=(n||r.length>0)&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n||"Todo List",m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",r.length,")"]}),l>0&&m.jsxs("span",{className:"ml-2 text-success text-xs",children:[l," completed"]})]}),e[2]=l,e[3]=r.length,e[4]=n,e[5]=c):c=e[5];let a;e[6]!==r?(a=r.map(g$),e[6]=r,e[7]=a):a=e[7];let u;e[8]!==a?(u=m.jsx("div",{className:"flex flex-col gap-1 w-full",children:a}),e[8]=a,e[9]=u):u=e[9];let d;return e[10]!==c||e[11]!==u?(d=m.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function g$(t,e){const n=h$[t.status],r=n.icon,o=p$[t.priority];return m.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[m.jsx(r,{className:Ee("size-4 shrink-0",n.color,n.animate&&"animate-spin")}),m.jsx("span",{className:Ee("flex-1 break-all",t.status==="completed"&&"line-through text-muted-foreground",t.status==="cancelled"&&"text-muted-foreground"),children:t.content}),o.label&&t.priority==="high"&&m.jsx("span",{className:Ee("text-xs px-1.5 py-0.5 rounded shrink-0",o.className),children:o.label}),t.priority==="low"&&t.status!=="completed"&&t.status!=="cancelled"&&m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o.label})]},e)}function v$(t){return t.status==="pending"}function y$(t){return t.status==="in_progress"}function _$(t){return t.status==="completed"}const b$=N.memo(function(e){const n=fe.c(38),{visualization:r}=e;if(!r)return null;switch(r.type){case"diff":{let o;return n[0]!==r.additions||n[1]!==r.deletions||n[2]!==r.hunks||n[3]!==r.language||n[4]!==r.matchInfo||n[5]!==r.path?(o=m.jsx(EE,{path:r.path,hunks:r.hunks,language:r.language,additions:r.additions,deletions:r.deletions,matchInfo:r.matchInfo}),n[0]=r.additions,n[1]=r.deletions,n[2]=r.hunks,n[3]=r.language,n[4]=r.matchInfo,n[5]=r.path,n[6]=o):o=n[6],o}case"diffs":{let o;n[7]!==r.items?(o=r.items.map(x$),n[7]=r.items,n[8]=o):o=n[8];let l;return n[9]!==o?(l=m.jsx("div",{className:"space-y-3",children:o}),n[9]=o,n[10]=l):l=n[10],l}case"code":{let o;return n[11]!==r.content||n[12]!==r.created||n[13]!==r.highlightLines||n[14]!==r.language||n[15]!==r.path?(o=m.jsx(r$,{path:r.path,content:r.content,language:r.language,created:r.created,highlightLines:r.highlightLines}),n[11]=r.content,n[12]=r.created,n[13]=r.highlightLines,n[14]=r.language,n[15]=r.path,n[16]=o):o=n[16],o}case"file-list":{let o;return n[17]!==r.files||n[18]!==r.groups||n[19]!==r.title||n[20]!==r.total?(o=m.jsx(c$,{title:r.title,groups:r.groups,files:r.files,total:r.total}),n[17]=r.files,n[18]=r.groups,n[19]=r.title,n[20]=r.total,n[21]=o):o=n[21],o}case"table":{let o;n[22]!==r.rows?(o=JSON.stringify(r.rows,null,2),n[22]=r.rows,n[23]=o):o=n[23];let l;return n[24]!==o?(l=m.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:o}),n[24]=o,n[25]=l):l=n[25],l}case"markdown":{let o;return n[26]!==r.content?(o=m.jsx("div",{className:"prose prose-sm dark:prose-invert",children:r.content}),n[26]=r.content,n[27]=o):o=n[27],o}case"none":{let o;return n[28]!==r.message?(o=m.jsx(o$,{message:r.message}),n[28]=r.message,n[29]=o):o=n[29],o}case"shell-output":{let o;return n[30]!==r.command||n[31]!==r.exitCode||n[32]!==r.stderr||n[33]!==r.stdout?(o=m.jsx(f$,{command:r.command,stdout:r.stdout,stderr:r.stderr,exitCode:r.exitCode}),n[30]=r.command,n[31]=r.exitCode,n[32]=r.stderr,n[33]=r.stdout,n[34]=o):o=n[34],o}case"todo-list":{let o;return n[35]!==r.items||n[36]!==r.title?(o=m.jsx(m$,{title:r.title,items:r.items}),n[35]=r.items,n[36]=r.title,n[37]=o):o=n[37],o}default:return null}});function x$(t,e){return m.jsx(EE,{path:t.path,hunks:t.hunks,language:t.language,additions:t.additions,deletions:t.deletions,matchInfo:t.matchInfo},`${t.path}-${e}`)}const Vx=1536,qx=N.memo(function(e){const n=fe.c(16),{content:r,className:o}=e,[l,c]=N.useState(!1);let a;n[0]!==r?(a=new Blob([r]),n[0]=r,n[1]=a):a=n[1];const u=a.size,d=u>Vx,p=d?r.slice(0,Vx)+`
|
|
608
|
+
...`:null;if(!d){let b;return n[2]!==o||n[3]!==r?(b=m.jsx("pre",{className:o,children:r}),n[2]=o,n[3]=r,n[4]=b):b=n[4],b}let h;n[5]!==u?(h=u>1048576?`${(u/1048576).toFixed(1)} MB`:u>1024?`${(u/1024).toFixed(1)} KB`:`${u} bytes`,n[5]=u,n[6]=h):h=n[6];const v=h,x=l?r:p;let C;n[7]!==o||n[8]!==x?(C=m.jsx("pre",{className:o,children:x}),n[7]=o,n[8]=x,n[9]=C):C=n[9];let w;n[10]===Symbol.for("react.memo_cache_sentinel")?(w=()=>c(E$),n[10]=w):w=n[10];const y=l?"Show less":`Show full output (${v})`;let S;n[11]!==y?(S=m.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors cursor-pointer",onClick:w,children:y}),n[11]=y,n[12]=S):S=n[12];let _;return n[13]!==C||n[14]!==S?(_=m.jsxs("div",{children:[C,S]}),n[13]=C,n[14]=S,n[15]=_):_=n[15],_});function S$(t){switch(t){case"pending":return m.jsx(lS,{className:"size-3 text-warning"});case"running":return m.jsx(nr,{className:"size-3 text-warning animate-spin"});case"completed":return m.jsx(Ec,{className:"size-3 text-success"});case"error":return m.jsx(ef,{className:"size-3 text-destructive"});case"interrupted":return m.jsx(fS,{className:"size-3 text-warning"});default:return null}}function w$(t){if(t&&typeof t=="object"&&"_visualization"in t)return t._visualization}const C$=(t,e)=>{if(t.part!==e.part||t.onNavigateToSubagent!==e.onNavigateToSubagent)return!1;if(t.part.state.status!=="pending")return!0;const r=t.pendingPermissions.find(l=>l.toolCallId===t.part.callId),o=e.pendingPermissions.find(l=>l.toolCallId===e.part.callId);return r===o},k$=N.memo(function({part:e,pendingPermissions:n,onPermissionResponse:r,onNavigateToSubagent:o}){var b;const[l,c]=N.useState(!1),[a,u]=N.useState(!1),d=e.state,p=d.status,h=N.useMemo(()=>{if(!l)return"";try{return JSON.stringify(d.input,null,2)}catch{return String(d.input)}},[d.input,l]),v=N.useMemo(()=>!l||p!=="completed"||!("output"in d)?null:typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2),[p,d,l]),x=p==="completed"&&"output"in d?w$(d.output):void 0,C=p==="pending"?n.find(k=>k.toolCallId===e.callId):void 0,w=C?typeof((b=C.args)==null?void 0:b.command)=="string"?C.args.command:JSON.stringify(C.args,null,2):null;let y=null;if(e.name==="task"){if("childSessionId"in d&&d.childSessionId)y=d.childSessionId;else if(p==="completed"&&"output"in d){const T=(typeof d.output=="string"?d.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);T&&(y=T[1])}}const S=async()=>{if("output"in d){const k=typeof d.output=="string"?d.output:JSON.stringify(d.output,null,2);await navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),2e3)}},_=(()=>{try{const k=JSON.stringify(d.input);return k.length>50?k.slice(0,47)+"...":k}catch{return String(d.input)}})();return m.jsxs("div",{className:"my-1",children:[m.jsxs(Mi,{open:l,onOpenChange:c,children:[m.jsx(ji,{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(Fa,{className:"size-4 text-muted-foreground"}):m.jsx(Xr,{className:"size-4 text-muted-foreground"}),m.jsx(gR,{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:_}),m.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[S$(p),y&&o&&m.jsxs(He,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:k=>{k.stopPropagation(),o(y)},title:"View session",children:[m.jsx(mc,{className:"size-3"}),m.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),l&&m.jsx(Oi,{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(qx,{content:h,className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),(p==="running"||p==="completed")&&y&&o&&m.jsxs(He,{variant:"outline",className:"w-full",size:"sm",onClick:()=>o(y),children:[m.jsx(mc,{className:"size-4","data-icon":"inline-start"}),p==="running"?"Watch Subagent":"View Session"]}),p==="completed"&&v!==null&&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(He,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:a?m.jsx(Fs,{className:"size-3 text-success"}):m.jsx(pc,{className:"size-3"})})]}),m.jsx(qx,{content:v,className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),p==="error"&&"error"in d&&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:d.error})]})]})})]}),p==="pending"&&C&&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(Da,{className:"size-4 text-warning"}),m.jsx("span",{className:"text-sm font-medium",children:"Permission Required"})]}),C.message&&m.jsx("p",{className:"text-sm",children:C.message}),C.dangerous&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[m.jsx(Da,{className:"size-4"}),"This operation is marked as dangerous"]}),w&&m.jsxs(Mi,{children:[m.jsx(ji,{asChild:!0,children:m.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[m.jsx(Xr,{className:"size-3"}),m.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),m.jsx(Oi,{children:m.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words overflow-wrap-break",children:w})})]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(He,{variant:"outline",size:"sm",onClick:()=>r(e.callId,!1,!1),children:"Deny"}),m.jsx(He,{variant:"secondary",size:"sm",onClick:()=>r(e.callId,!0,!1),children:"Approve"}),m.jsx(He,{size:"sm",onClick:()=>r(e.callId,!0,!0),children:"Always Allow"})]})]}),p==="completed"&&x&&m.jsx("div",{className:"mt-2",children:m.jsx(b$,{visualization:x})})]})},C$);function E$(t){return!t}const qm=60,Wx=300,po=16;function Gx(t){if(t.length===0)return!1;const e=t[t.length-1];return Rg(e.message)&&e.message.status==="streaming"}function Kx(t){return t.filter(e=>e.type==="text").map(e=>e.text).join("")}function A$(t,e){const n=e.findIndex(r=>r.message.id===t);if(n<=0)return null;for(let r=n-1;r>=0;r--){const o=e[r];if(o.message.role==="assistant"&&o.message.status!=="streaming")return o.message.id}return null}function R$(){const t=fe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground bg-muted rounded-lg px-3 py-2 border border-border shadow-sm",children:[m.jsx(dS,{className:"size-4 animate-pulse"}),m.jsx("span",{children:"Compacting conversation..."})]}),t[0]=e):e=t[0],e}function T$(){const t=fe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-400 bg-green-500/15 rounded-lg px-3 py-2 border border-green-500/30 shadow-sm",children:[m.jsx(A5,{className:"size-4"}),m.jsx("span",{children:"Compaction complete"})]}),t[0]=e):e=t[0],e}function N$(t){const e=fe.c(8),{message:n,textContent:r,onRetry:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsxs("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-destructive ml-3",children:[m.jsx(Da,{className:"size-3"}),"Compaction Failed"]}),e[0]=l):l=e[0];const c=r||n.error||"Compaction failed. The conversation could not be summarized.";let a;e[1]!==c?(a=m.jsx("p",{className:"text-sm text-destructive/90",children:c}),e[1]=c,e[2]=a):a=e[2];let u;e[3]!==o?(u=o&&m.jsxs(He,{variant:"outline",size:"sm",onClick:o,className:"mt-2 h-7 text-xs gap-1.5",children:[m.jsx(hS,{className:"size-3"}),"Retry"]}),e[3]=o,e[4]=u):u=e[4];let d;return e[5]!==a||e[6]!==u?(d=m.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[l,m.jsxs("div",{className:"rounded-2xl px-4 py-3 max-w-full bg-destructive/10 border border-destructive/30 rounded-bl-md",children:[a,u]})]}),e[5]=a,e[6]=u,e[7]=d):d=e[7],d}function D$(t,e){var r;return(t==null?void 0:t.split("/").pop())||((r=e==null?void 0:e.split(".").pop())==null?void 0:r.toLowerCase())||""}function M$(t){const e=fe.c(15),{part:n}=t,[r,o]=N.useState(!1),l=n.overflow?"overflow":n.auto?"auto":"manual";let c;e[0]!==r?(c=()=>o(!r),e[0]=r,e[1]=c):c=e[1];let a;e[2]!==r?(a=r?m.jsx(Fa,{className:"size-3"}):m.jsx(Xr,{className:"size-3"}),e[2]=r,e[3]=a):a=e[3];const u=l==="overflow"?"Context overflow":l==="auto"?"Auto":"Manual";let d;e[4]!==u?(d=m.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[u," compaction"]}),e[4]=u,e[5]=d):d=e[5];let p;e[6]!==c||e[7]!==a||e[8]!==d?(p=m.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=p):p=e[9];let h;e[10]!==r?(h=r&&m.jsx("div",{className:"mt-2 text-xs text-muted-foreground italic",children:"Summary available in the assistant message below"}),e[10]=r,e[11]=h):h=e[11];let v;return e[12]!==p||e[13]!==h?(v=m.jsxs("div",{className:"flex flex-col items-center py-3",children:[p,h]}),e[12]=p,e[13]=h,e[14]=v):v=e[14],v}const j$=N.memo(function(e){const n=fe.c(15),{parts:r,pendingPermissions:o,onPermissionResponse:l,onNavigateToSubagent:c,inverted:a,serverUrl:u}=e,d=a===void 0?!1:a;let p;if(n[0]!==d||n[1]!==c||n[2]!==l||n[3]!==r||n[4]!==o||n[5]!==u){const v=[...r].sort(I$);let x;n[7]!==d||n[8]!==c||n[9]!==l||n[10]!==o||n[11]!==u?(x=C=>{switch(C.type){case"text":return m.jsx("div",{className:"min-w-0",children:m.jsx(wE,{inverted:d,children:C.text||"..."})},C.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:C.text},C.id);case"tool":return m.jsx(k$,{part:C,pendingPermissions:o,onPermissionResponse:l,onNavigateToSubagent:c},C.id);case"image":{const w=u?`http://${u}${C.url}`:C.url;return m.jsx("img",{src:w,alt:"",className:Ee("max-w-full max-h-64 rounded-xl mt-2 object-contain",d&&"ring-2 ring-white/20")},C.id)}case"file":{const w=u?`http://${u}${C.url}`:C.url,y=D$(C.mimeType,C.filename),S=C.filename||"",_=S.length>30?S.slice(0,27)+"...":S||"unnamed";return m.jsxs("a",{href:w,className:Ee("mt-2 p-2 rounded-lg text-sm flex items-center gap-2 transition-colors",d?"bg-white/15 hover:bg-white/25 text-primary-foreground":"bg-muted hover:bg-accent"),target:"_blank",rel:"noopener noreferrer",children:[m.jsx(Or,{className:"size-4 shrink-0"}),m.jsx("span",{className:"truncate",children:_}),y&&m.jsx("span",{className:Ee("px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide ml-auto shrink-0",d?"bg-white/25 text-primary-foreground":"bg-secondary text-secondary-foreground"),children:y}),m.jsx(P5,{className:"size-3.5 shrink-0 opacity-60"})]},C.id)}default:return null}},n[7]=d,n[8]=c,n[9]=l,n[10]=o,n[11]=u,n[12]=x):x=n[12],p=v.map(x),n[0]=d,n[1]=c,n[2]=l,n[3]=r,n[4]=o,n[5]=u,n[6]=p}else p=n[6];let h;return n[13]!==p?(h=m.jsx(m.Fragment,{children:p}),n[13]=p,n[14]=h):h=n[14],h},(t,e)=>{if(t.parts!==e.parts||t.inverted!==e.inverted||t.onPermissionResponse!==e.onPermissionResponse||t.onNavigateToSubagent!==e.onNavigateToSubagent||t.serverUrl!==e.serverUrl)return!1;if(!t.parts.some(c=>c.type==="tool"&&c.state.status==="pending"))return!0;const r=new Set(t.parts.filter(c=>c.type==="tool").map(c=>c.callId)),o=t.pendingPermissions.filter(c=>r.has(c.toolCallId)),l=e.pendingPermissions.filter(c=>r.has(c.toolCallId));if(o.length!==l.length)return!1;for(let c=0;c<o.length;c++)if(o[c].toolCallId!==l[c].toolCallId)return!1;return!0}),O$=N.memo(function(e){const n=fe.c(46),{item:r,messagesWithParts:o,sessionId:l,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,onRemoveFromQueue:d,onRevert:p,onFork:h,isMainActiveSession:v,isCompacting:x,onCompact:C,serverUrl:w}=e,y=v===void 0?!1:v,S=x===void 0?!1:x;let _;n[0]!==r.parts?(_=r.parts.find(P$),n[0]=r.parts,n[1]=_):_=n[1];const b=_;if(Rg(r.message)&&r.message.mode==="compact_failed"){const X=r.message;let Y;n[2]!==r.parts?(Y=Kx(r.parts),n[2]=r.parts,n[3]=Y):Y=n[3];const I=y&&!S?C:void 0;let L;return n[4]!==X||n[5]!==Y||n[6]!==I?(L=m.jsx(N$,{message:X,textContent:Y,onRetry:I}),n[4]=X,n[5]=Y,n[6]=I,n[7]=L):L=n[7],L}if(b){let X;return n[8]!==b?(X=m.jsx(M$,{part:b}),n[8]=b,n[9]=X):X=n[9],X}const T=!r.isQueued&&r.message.role==="user";let R;n[10]!==T||n[11]!==r.message||n[12]!==o?(R=T?A$(r.message.id,o):null,n[10]=T,n[11]=r.message,n[12]=o,n[13]=R):R=n[13];const M=R,A=r.message;let j;n[14]!==r.parts?(j=Kx(r.parts),n[14]=r.parts,n[15]=j):j=n[15];let O;n[16]!==r.isQueued||n[17]!==r.queueId||n[18]!==d?(O=r.isQueued?()=>d(r.queueId):void 0,n[16]=r.isQueued,n[17]=r.queueId,n[18]=d,n[19]=O):O=n[19];const z=T&&M!==null;let V;n[20]!==p||n[21]!==M||n[22]!==l?(V=M?()=>p==null?void 0:p(l,M):void 0,n[20]=p,n[21]=M,n[22]=l,n[23]=V):V=n[23];const F=T&&M!==null;let W;n[24]!==r.message||n[25]!==h||n[26]!==M||n[27]!==l?(W=M?()=>h==null?void 0:h(l,r.message.id):void 0,n[24]=r.message,n[25]=h,n[26]=M,n[27]=l,n[28]=W):W=n[28];let G;n[29]!==r.message||n[30]!==r.parts||n[31]!==u||n[32]!==a||n[33]!==c||n[34]!==w?(G=r.parts.length===0?m.jsx("span",{className:"opacity-50",children:"..."}):m.jsx(j$,{parts:r.parts,pendingPermissions:c,onPermissionResponse:a,onNavigateToSubagent:u,inverted:r.message.role==="user",serverUrl:w}),n[29]=r.message,n[30]=r.parts,n[31]=u,n[32]=a,n[33]=c,n[34]=w,n[35]=G):G=n[35];let q;return n[36]!==r.isQueued||n[37]!==r.message||n[38]!==F||n[39]!==W||n[40]!==G||n[41]!==j||n[42]!==O||n[43]!==z||n[44]!==V?(q=m.jsx(GU,{message:A,textContent:j,isQueued:r.isQueued,onRemove:O,canRevert:z,onRevert:V,canFork:F,onFork:W,children:G}),n[36]=r.isQueued,n[37]=r.message,n[38]=F,n[39]=W,n[40]=G,n[41]=j,n[42]=O,n[43]=z,n[44]=V,n[45]=q):q=n[45],q});function L$({displayItems:t,messagesWithParts:e,sessionId:n,sessionStatus:r,pendingPermissions:o,isCompacting:l=!1,compactionSuccess:c=!1,onClearCompactionSuccess:a,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:p,onRevert:h,onFork:v,onCompact:x,isMainActiveSession:C=!1,autoFollow:w=!0,onAutoScrollChange:y,scrollToBottomRef:S,serverUrl:_}){var B,Z;const b=N.useRef(null),[k,T]=N.useState(!1),R=N.useRef(w),M=N.useRef(t.length),A=N.useRef(0),j=N.useRef(!1),O=N.useRef(!1),z=N.useRef(""),V=N.useCallback(J=>{if(J.length===0)return"";const ee=J[J.length-1],$=ee.parts.filter(ae=>ae.type==="text").reduce((ae,se)=>ae+se.text.length,0),te=ee.message.id,re=Rg(ee.message)?ee.message.status:"n/a";return`${te}:${re}:${ee.parts.length}:${$}`},[]),F=N.useRef(null),W=N.useRef(null),G=N.useRef(new Map),q=N.useRef(t);q.current=t;const X=N.useCallback(J=>{const ee=q.current[J];if(!ee)return qm+po;if(ee.message.role==="assistant"){let $=100;return ee.parts.some(ae=>{var se,_e;return ae.type==="text"&&((se=ae.text)==null?void 0:se.includes("```"))||ae.type==="tool"&&((_e=ae.state.input)==null?void 0:_e.command)})&&($=180),ee.parts.some(ae=>ae.type==="tool")&&($=Math.max($,150)),ee.parts.some(ae=>ae.type==="compaction")&&($=60),ee.message.mode==="compact_failed"&&($=100),Math.min(Math.max($+po,qm+po),Wx+po)}const K=ee.parts.length>1?80:60;return Math.min(Math.max(K+po,qm+po),Wx+po)},[]);N.useLayoutEffect(()=>{const J=b.current;if(!J)return;const ee=requestAnimationFrame(()=>{J.querySelectorAll("[data-index]").forEach($=>{const te=$.getAttribute("data-index");if(te===null)return;const re=parseInt(te,10);G.current.set(re,$.offsetHeight)})});return()=>cancelAnimationFrame(ee)},[t.length]);const Y=N.useRef(null);N.useLayoutEffect(()=>{const J=b.current;if(!J)return;Y.current&&Y.current.disconnect();const ee=new ResizeObserver($=>{$.forEach(te=>{const re=te.target,ae=re.getAttribute("data-index");if(ae===null)return;const se=parseInt(ae,10),_e=re.offsetHeight;G.current.set(se,_e)})});return Y.current=ee,J.querySelectorAll("[data-index]").forEach($=>ee.observe($)),()=>ee.disconnect()},[t.length]);const I=WU({count:t.length,getScrollElement:()=>b.current,estimateSize:X,overscan:5,getItemKey:J=>{var K,$;const ee=t[J];return($=(K=ee==null?void 0:ee.message)==null?void 0:K.id)!=null?$:`fallback-${J}`}});N.useLayoutEffect(()=>{R.current=w,M.current=t.length,A.current=0,j.current=!1,z.current="",t.length!==0&&(I.scrollToIndex(t.length-1,{align:"end"}),j.current=!0)},[n]),N.useEffect(()=>{const J=b.current;if(!J)return;const ee=K=>{R.current&&K.deltaY<0&&(R.current=!1,y==null||y(!1))};return J.addEventListener("wheel",ee,{passive:!1}),()=>J.removeEventListener("wheel",ee)},[y]);const L=OU(()=>{if(O.current)return;const J=b.current;if(J)if(R.current){const{scrollTop:ee,scrollHeight:K,clientHeight:$}=J;K-ee-$>0&&(O.current=!0,J.scrollTop=K,requestAnimationFrame(()=>{O.current=!1}))}else{const{scrollTop:ee,scrollHeight:K,clientHeight:$}=J;K-ee-$<=5&&(R.current=!0,y==null||y(!0))}});N.useLayoutEffect(()=>{T(l)},[l]);const P=V(t);N.useLayoutEffect(()=>{var Re;const J=t.length,ee=M.current,K=J!==ee,$=P,te=$!==z.current;z.current=$;const re=J-1;let ae=0;re>=0&&(ae=(Re=G.current.get(re))!=null?Re:0);const se=A.current,_e=re>=0&&ae>se&&se>0;if(M.current=J,A.current=ae,!(J===0||!K&&!te&&!_e)){if(ee===0&&J>0&&se===0&&!j.current){I.scrollToIndex(J-1,{align:"end"}),j.current=!0;return}R.current&&(b.current.scrollTop=b.current.scrollHeight)}},[t.length,P,I]),N.useEffect(()=>{var te;const J=I.getVirtualItems(),ee=J.length-1;if(ee<0)return;const K=J[ee],$=(te=b.current)==null?void 0:te.querySelector(`[data-index="${K.index}"]`);if(F.current&&F.current.disconnect(),!!$&&(W.current=$,!(!Gx(t)||!R.current)))return F.current=new ResizeObserver(re=>{R.current&&Gx(t)&&requestAnimationFrame(()=>{R.current&&(b.current.scrollTop=b.current.scrollHeight)})}),F.current.observe($),()=>{F.current&&(F.current.disconnect(),F.current=null)}},[t,I]),N.useEffect(()=>{if(c){const J=setTimeout(()=>{a==null||a()},3e3);return()=>clearTimeout(J)}},[c,a]),N.useLayoutEffect(()=>{S&&(S.current=()=>{R.current=!0,O.current=!0,b.current.scrollTop=b.current.scrollHeight,requestAnimationFrame(()=>{O.current=!1})})},[S]),N.useLayoutEffect(()=>{R.current=w},[w]);const H=I.getVirtualItems();return m.jsxs("div",{ref:b,className:"flex-1 min-h-0 overflow-y-auto relative chat-transcript-scrollbar",style:{WebkitOverflowScrolling:"touch"},onScroll:L,children:[k&&m.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:m.jsx(R$,{})}),c&&m.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4 pb-1 bg-gradient-to-b from-background via-background/95 to-transparent",children:m.jsx(T$,{})}),r==="closed"&&m.jsx(wd,{className:"mx-4 mt-4",children:m.jsx(Cd,{children:"This session is archived. You can reopen it from the sidebar."})}),m.jsx("div",{className:"relative w-full",style:{height:`${I.getTotalSize()}px`},children:t.length===0?m.jsxs("div",{className:"text-center py-16 text-muted-foreground px-4",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."})]}):m.jsx("div",{className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${(Z=(B=H[0])==null?void 0:B.start)!=null?Z:0}px)`},children:H.map(J=>{const ee=t[J.index];return m.jsx("div",{"data-index":J.index,ref:I.measureElement,className:"px-4 py-4",children:m.jsx(O$,{item:ee,messagesWithParts:e,sessionId:n,pendingPermissions:o,onPermissionResponse:u,onNavigateToSubagent:d,onRemoveFromQueue:p,onRevert:h,onFork:v,isMainActiveSession:C,isCompacting:l,onCompact:x,serverUrl:_})},ee.message.id)})})})]})}function I$(t,e){return t.createdAt-e.createdAt}function P$(t){return t.type==="compaction"}function z$(t,e){const n=t.map(c=>({message:c.message,parts:c.parts,isQueued:!1})),r=e.map(c=>{const a=(c.attachments||[]).map(u=>{const d=`/api/sessions/${c.sessionId}/attachments/${u.id}/content?key=${u.accessKey}`;return u.kind==="image"?{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"image",url:d,mimeType:u.mimeType}:{id:`${c.id}-att-${u.id}`,messageId:c.id,createdAt:c.createdAt,type:"file",url:d,mimeType:u.mimeType||"",filename:u.filename}});return{message:{id:c.id,role:"user",sessionId:c.sessionId,createdAt:c.createdAt},parts:[...a,...c.content.trim()?[{id:`${c.id}-part`,messageId:c.id,createdAt:c.createdAt,type:"text",text:c.content}]:[]],isQueued:!0,queueId:c.id}}),o=[...n].sort((c,a)=>c.message.createdAt-a.message.createdAt),l=[...r].sort((c,a)=>c.message.createdAt-a.message.createdAt);return[...o,...l]}function B$(t){const e=fe.c(8),{permissions:n,onPermissionResponse:r}=t;if(n.length===0)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide font-medium",children:"Pending Requests"}),e[0]=o):o=e[0];let l;if(e[1]!==r||e[2]!==n){let a;e[4]!==r?(a=u=>{var p;const d=typeof((p=u.args)==null?void 0:p.command)=="string"?u.args.command:JSON.stringify(u.args,null,2);return m.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg flex flex-col gap-2",children:[m.jsx("div",{className:"flex items-center gap-2",children:m.jsx("span",{className:"text-sm font-medium",children:u.toolName})}),m.jsx("p",{className:"text-sm",children:u.message}),m.jsxs(Mi,{children:[m.jsx(ji,{asChild:!0,children:m.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[m.jsx(Xr,{className:"size-3"}),m.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),m.jsx(Oi,{children:m.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words",children:d})})]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(He,{variant:"outline",size:"sm",onClick:()=>r(u.toolCallId,!1,!1),children:"Deny"}),m.jsx(He,{variant:"secondary",size:"sm",onClick:()=>r(u.toolCallId,!0,!1),children:"Approve"}),m.jsx(He,{size:"sm",onClick:()=>r(u.toolCallId,!0,!0),children:"Always Allow"})]})]},u.toolCallId)},e[4]=r,e[5]=a):a=e[5],l=n.map(a),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;return e[6]!==l?(c=m.jsxs("div",{className:"border-t border-border bg-muted/30 flex flex-col gap-2 p-4",children:[o,l]}),e[6]=l,e[7]=c):c=e[7],c}function F$(t){const e=fe.c(88),{session:n,messagesWithParts:r,queuedMessages:o,preconfigs:l,prompts:c,models:a,connectedProviderIds:u,connectableProviderIds:d,defaultModel:p,onSendMessage:h,onRemoveFromQueue:v,onChangePreconfig:x,onChangeModel:C,onChangeVariant:w,pendingPermissions:y,onPermissionResponse:S,onRename:_,usage:b,modelName:k,modelSupportsImage:T,onNavigateToSubagent:R,onNavigateBack:M,isStreaming:A,onInterrupt:j,onRevert:O,onFork:z,onCompact:V,isCompacting:F,compactionSuccess:W,onClearCompactionSuccess:G,serverUrl:q,apiToken:X,selectedVariant:Y,variants:I,inputRef:L,scrollToBottomRef:P,autoFollowToggleRef:H}=t,Z=!n.parentId&&n.status==="active",[J,ee]=N.useState(!0);let K;e[0]!==P?(K=()=>{ee(oe=>{var ke;const me=!oe;return me&&((ke=P==null?void 0:P.current)==null||ke.call(P)),me})},e[0]=P,e[1]=K):K=e[1];const $=K;let te,re;e[2]!==H||e[3]!==$?(te=()=>{H&&(H.current={toggle:()=>{$()}})},re=[H,$],e[2]=H,e[3]=$,e[4]=te,e[5]=re):(te=e[4],re=e[5]),N.useEffect(te,re);let ae;e[6]!==r||e[7]!==o?(ae=z$(r,o),e[6]=r,e[7]=o,e[8]=ae):ae=e[8];const se=ae;let _e;if(e[9]!==r||e[10]!==y||e[11]!==n.id){let oe;e[13]!==r||e[14]!==n.id?(oe=me=>me.sessionId!==n.id?!1:!r.some(ke=>ke.parts.some(De=>De.type==="tool"&&De.callId===me.toolCallId)),e[13]=r,e[14]=n.id,e[15]=oe):oe=e[15],_e=y.filter(oe),e[9]=r,e[10]=y,e[11]=n.id,e[12]=_e}else _e=e[12];const Re=_e,je=r.length>=4;let ze;e[16]!==d||e[17]!==u||e[18]!==p||e[19]!==F||e[20]!==A||e[21]!==k||e[22]!==a||e[23]!==C||e[24]!==x||e[25]!==w||e[26]!==V||e[27]!==j||e[28]!==M||e[29]!==_||e[30]!==l||e[31]!==Y||e[32]!==n||e[33]!==je||e[34]!==b||e[35]!==I?(ze=m.jsx(SU,{session:n,preconfigs:l,models:a,defaultModel:p,usage:b,modelName:k,onChangePreconfig:x,onChangeModel:C,onChangeVariant:w,onRename:_,onNavigateBack:M,isStreaming:A,onInterrupt:j,onCompact:V,isCompacting:F,canCompact:je,connectedProviderIds:u,connectableProviderIds:d,selectedVariant:Y,variants:I}),e[16]=d,e[17]=u,e[18]=p,e[19]=F,e[20]=A,e[21]=k,e[22]=a,e[23]=C,e[24]=x,e[25]=w,e[26]=V,e[27]=j,e[28]=M,e[29]=_,e[30]=l,e[31]=Y,e[32]=n,e[33]=je,e[34]=b,e[35]=I,e[36]=ze):ze=e[36];let ce;e[37]!==z||e[38]!==O||e[39]!==J||e[40]!==W||e[41]!==se||e[42]!==F||e[43]!==Z||e[44]!==r||e[45]!==G||e[46]!==V||e[47]!==R||e[48]!==S||e[49]!==v||e[50]!==y||e[51]!==P||e[52]!==q||e[53]!==n.id||e[54]!==n.status?(ce=m.jsx(L$,{displayItems:se,messagesWithParts:r,sessionId:n.id,sessionStatus:n.status,pendingPermissions:y,isCompacting:F,compactionSuccess:W,onClearCompactionSuccess:G,onPermissionResponse:S,onNavigateToSubagent:R,onRemoveFromQueue:v,onRevert:O,onFork:z,onCompact:V,isMainActiveSession:Z,autoFollow:J,onAutoScrollChange:ee,scrollToBottomRef:P,serverUrl:q}),e[37]=z,e[38]=O,e[39]=J,e[40]=W,e[41]=se,e[42]=F,e[43]=Z,e[44]=r,e[45]=G,e[46]=V,e[47]=R,e[48]=S,e[49]=v,e[50]=y,e[51]=P,e[52]=q,e[53]=n.id,e[54]=n.status,e[55]=ce):ce=e[55];const Te=J?"Auto-follow enabled (Cmd+Shift+F)":"Auto-follow disabled (Cmd+Shift+F)";let ye;e[56]!==J?(ye=J?m.jsxs(m.Fragment,{children:[m.jsx(c5,{className:"size-3"}),m.jsx("span",{children:"Follow"})]}):m.jsxs(m.Fragment,{children:[m.jsx(uS,{className:"size-3"}),m.jsx("span",{children:"Free"})]}),e[56]=J,e[57]=ye):ye=e[57];let Pe;e[58]!==$||e[59]!==ye||e[60]!==Te?(Pe=m.jsx("button",{onClick:$,className:"absolute bottom-4 right-4 z-50 flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-full transition-colors cursor-pointer bg-background/80 backdrop-blur-sm hover:bg-background border border-border/50 shadow-sm pointer-events-auto",title:Te,children:ye}),e[58]=$,e[59]=ye,e[60]=Te,e[61]=Pe):Pe=e[61];let Fe;e[62]!==Pe||e[63]!==ce?(Fe=m.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[ce,Pe]}),e[62]=Pe,e[63]=ce,e[64]=Fe):Fe=e[64];let ve;e[65]!==S||e[66]!==Re?(ve=Re.length>0&&m.jsx(B$,{permissions:Re,onPermissionResponse:S}),e[65]=S,e[66]=Re,e[67]=ve):ve=e[67];let Ne;e[68]!==X||e[69]!==L||e[70]!==F||e[71]!==T||e[72]!==h||e[73]!==c||e[74]!==q||e[75]!==n.id||e[76]!==n.parentId||e[77]!==n.status||e[78]!==n.workspaceId?(Ne=n.status==="active"&&!n.parentId&&m.jsx(jU,{ref:L,onSendMessage:h,disabled:F,workspaceId:n.workspaceId,serverUrl:q,apiToken:X,prompts:c,sessionId:n.id,modelSupportsImage:T}),e[68]=X,e[69]=L,e[70]=F,e[71]=T,e[72]=h,e[73]=c,e[74]=q,e[75]=n.id,e[76]=n.parentId,e[77]=n.status,e[78]=n.workspaceId,e[79]=Ne):Ne=e[79];let Ae;e[80]!==n.parentId?(Ae=n.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(_A,{className:"size-4"}),"This is a subagent session (read-only)"]}),e[80]=n.parentId,e[81]=Ae):Ae=e[81];let Ce;return e[82]!==Fe||e[83]!==ve||e[84]!==Ne||e[85]!==Ae||e[86]!==ze?(Ce=m.jsxs("div",{className:"flex flex-col flex-1 min-h-0 relative",children:[ze,Fe,ve,Ne,Ae]}),e[82]=Fe,e[83]=ve,e[84]=Ne,e[85]=Ae,e[86]=ze,e[87]=Ce):Ce=e[87],Ce}function H$(t){var Lt,Rn,Ut;const e=fe.c(85),{servers:n,activeServer:r,isSwitching:o,connected:l,authError:c,connectionTimedOut:a,retryCount:u,nextRetryIn:d,serverUrl:p,currentSession:h,messagesWithParts:v,queuedMessages:x,preconfigs:C,primaryPreconfigs:w,prompts:y,models:S,providerStatuses:_,defaultModel:b,selectedVariant:k,pendingPermissions:T,sessionUsage:R,currentModel:M,streamingSessionIds:A,isCompacting:j,compactionSuccess:O,isPrimarySession:z,inputRef:V,apiToken:F,onFirstServerAdded:W,onRetry:G,onLogout:q,onSendMessage:X,onRemoveFromQueue:Y,onChangePreconfig:I,onChangeModel:L,onChangeVariant:P,onPermissionResponse:H,onRename:B,onNavigateToSubagent:Z,onNavigateBack:J,onInterrupt:ee,onRevert:K,onFork:$,onCompact:te,onClearCompactionSuccess:re,scrollToBottomRef:ae,autoFollowToggleRef:se}=t;let _e;e[0]!==_?(_e=new Set(_.filter(W$).map(q$)),e[0]=_,e[1]=_e):_e=e[1];const Re=_e;let je;e[2]!==_?(je=new Set(_.filter(V$).map($$)),e[2]=_,e[3]=je):je=e[3];const ze=je,ce=!!r;let Te;e[4]!==I?(Te=et=>{I(et)},e[4]=I,e[5]=Te):Te=e[5];const ye=Te;let Pe;e[6]!==P?(Pe=et=>{P(et)},e[6]=P,e[7]=Pe):Pe=e[7];const Fe=Pe;let ve;e[8]!==ee?(ve=()=>{ee()},e[8]=ee,e[9]=ve):ve=e[9];const Ne=ve;if(n.length===0){const et=c||void 0;let at;return e[10]!==W||e[11]!==et?(at=m.jsx(zx,{onServerAdded:W,error:et}),e[10]=W,e[11]=et,e[12]=at):at=e[12],at}if(!ce){const et=c||void 0;let at;return e[13]!==W||e[14]!==et?(at=m.jsx(zx,{onServerAdded:W,error:et}),e[13]=W,e[14]=et,e[15]=at):at=e[15],at}if(o){const et=`Connecting to ${(r==null?void 0:r.name)||"server"}...`;let at;return e[16]!==et?(at=m.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:m.jsx(Px,{message:et})}),e[16]=et,e[17]=at):at=e[17],at}if(!l&&n.length>0){if(a){let Gt;return e[18]!==c||e[19]!==d||e[20]!==q||e[21]!==G||e[22]!==u||e[23]!==p?(Gt=m.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:m.jsx(iU,{serverUrl:p,authError:c,retryCount:u,nextRetryIn:d,onRetry:G,onLogout:q})}),e[18]=c,e[19]=d,e[20]=q,e[21]=G,e[22]=u,e[23]=p,e[24]=Gt):Gt=e[24],Gt}let et;e[25]===Symbol.for("react.memo_cache_sentinel")?(et=m.jsx(Px,{}),e[25]=et):et=e[25];let at;return e[26]!==q?(at=m.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[et,m.jsx(He,{variant:"ghost",size:"sm",onClick:q,className:"text-muted-foreground",children:"Change Server"})]}),e[26]=q,e[27]=at):at=e[27],at}if(!h){let et;return e[28]===Symbol.for("react.memo_cache_sentinel")?(et=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."})]}),e[28]=et):et=e[28],et}let Ae;e[29]!==v?(Ae=v.filter(U$),e[29]=v,e[30]=Ae):Ae=e[30];const oe=Ae.length>=4;let me;if(e[31]!==M||e[32]!==S){let et;e[34]!==M?(et=at=>at.id===M,e[34]=M,e[35]=et):et=e[35],me=S.find(et),e[31]=M,e[32]=S,e[33]=me}else me=e[33];const ke=me;let De;e[36]!==h.id||e[37]!==x?(De=x[h.id]||[],e[36]=h.id,e[37]=x,e[38]=De):De=e[38];const Be=z?w:C,nt=ke==null?void 0:ke.variants,Ye=(Ut=(Rn=(Lt=ke==null?void 0:ke.capabilities)==null?void 0:Lt.input)==null?void 0:Rn.image)!=null?Ut:!1;let Ue;e[39]!==h.id||e[40]!==h.runningAt||e[41]!==A?(Ue=A.has(h.id)||!!h.runningAt,e[39]=h.id,e[40]=h.runningAt,e[41]=A,e[42]=Ue):Ue=e[42];let Me;e[43]!==oe||e[44]!==h.id||e[45]!==te?(Me=oe?()=>te(h.id):void 0,e[43]=oe,e[44]=h.id,e[45]=te,e[46]=Me):Me=e[46];const We=p!=null?p:void 0,Xe=F!=null?F:void 0;let vt;return e[47]!==se||e[48]!==O||e[49]!==ze||e[50]!==Re||e[51]!==M||e[52]!==h||e[53]!==b||e[54]!==ye||e[55]!==Fe||e[56]!==Ne||e[57]!==V||e[58]!==j||e[59]!==v||e[60]!==S||e[61]!==L||e[62]!==re||e[63]!==$||e[64]!==J||e[65]!==Z||e[66]!==H||e[67]!==Y||e[68]!==B||e[69]!==K||e[70]!==X||e[71]!==T||e[72]!==y||e[73]!==ae||e[74]!==k||e[75]!==R||e[76]!==nt||e[77]!==Ye||e[78]!==Ue||e[79]!==Me||e[80]!==We||e[81]!==Xe||e[82]!==De||e[83]!==Be?(vt=m.jsx(F$,{inputRef:V,session:h,messagesWithParts:v,queuedMessages:De,preconfigs:Be,prompts:y,models:S,connectedProviderIds:Re,connectableProviderIds:ze,defaultModel:b,onSendMessage:X,onRemoveFromQueue:Y,onChangePreconfig:ye,onChangeModel:L,onChangeVariant:Fe,selectedVariant:k,variants:nt,pendingPermissions:T,onPermissionResponse:H,onRename:B,usage:R,modelName:M,modelSupportsImage:Ye,onNavigateToSubagent:Z,onNavigateBack:J,isStreaming:Ue,onInterrupt:Ne,onRevert:K,onFork:$,onCompact:Me,isCompacting:j,compactionSuccess:O,onClearCompactionSuccess:re,serverUrl:We,apiToken:Xe,scrollToBottomRef:ae,autoFollowToggleRef:se}),e[47]=se,e[48]=O,e[49]=ze,e[50]=Re,e[51]=M,e[52]=h,e[53]=b,e[54]=ye,e[55]=Fe,e[56]=Ne,e[57]=V,e[58]=j,e[59]=v,e[60]=S,e[61]=L,e[62]=re,e[63]=$,e[64]=J,e[65]=Z,e[66]=H,e[67]=Y,e[68]=B,e[69]=K,e[70]=X,e[71]=T,e[72]=y,e[73]=ae,e[74]=k,e[75]=R,e[76]=nt,e[77]=Ye,e[78]=Ue,e[79]=Me,e[80]=We,e[81]=Xe,e[82]=De,e[83]=Be,e[84]=vt):vt=e[84],vt}function U$(t){return t.message.role!=="system"}function $$(t){return t.provider}function V$(t){return t.connectable}function q$(t){return t.provider}function W$(t){return t.connected}const G$={".ts":{icon:Or,color:"text-blue-500"},".tsx":{icon:Or,color:"text-blue-500"},".js":{icon:Or,color:"text-yellow-500"},".jsx":{icon:Or,color:"text-yellow-500"},".json":{icon:Or,color:"text-yellow-600"},".md":{icon:Or,color:"text-gray-500"},".css":{icon:Or,color:"text-purple-500"},".html":{icon:Or,color:"text-orange-500"}};function AE({entry:t,workspaceId:e,parentPath:n,depth:r,onFileSelect:o,showHidden:l=!0,serverUrl:c,apiToken:a}){const{fetchWithAuth:u}=Xa(),[d,p]=N.useState(!1),[h,v]=N.useState([]),[x,C]=N.useState(!1),[w,y]=N.useState(!1),S=n?`${n}/${t.path}`:t.path,_=t.type==="directory",b=async()=>{if(!(w||x)){C(!0);try{const z=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(S)}&showHidden=${l}`,{},{serverUrl:c,token:a})).json();v(z.files||[]),y(!0)}catch(O){console.error("Failed to load children:",O)}finally{C(!1)}}},k=O=>{var z;(z=document.activeElement)==null||z.focus(),p(O),O&&_&&b()},T=O=>{O.currentTarget.focus(),!_&&o&&o({...t,path:S})},R=O=>{O.key==="Enter"&&(O.preventDefault(),T(O))},M=t.extension?G$[t.extension]:null,A=_?d?Km:zs:(M==null?void 0:M.icon)||Or,j=_?"text-amber-500":(M==null?void 0:M.color)||"text-muted-foreground";return _?m.jsxs(Mi,{open:d,onOpenChange:k,children:[m.jsx(ji,{asChild:!0,children:m.jsxs("button",{"data-file-node":!0,"data-file-type":"directory","data-file-is-open":d||void 0,className:Ee("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[x?m.jsx(nr,{className:"w-3 h-3 animate-spin shrink-0"}):m.jsx(Xr,{className:Ee("w-3 h-3 shrink-0 transition-transform",d&&"rotate-90")}),m.jsx(A,{className:j}),m.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}),m.jsx(Oi,{children:h.map(O=>m.jsx(AE,{entry:O,workspaceId:e,parentPath:S,depth:r+1,onFileSelect:o,showHidden:l,serverUrl:c,apiToken:a},`${S}/${O.path}`))})]}):m.jsxs("button",{"data-file-node":!0,"data-file-type":"file",onClick:T,onKeyDown:R,className:Ee("flex items-center gap-2 w-full min-w-0 overflow-hidden rounded-md p-2 text-left text-sm","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus:ring-1 focus:ring-inset ring-sidebar-ring outline-hidden","[&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate"),style:{paddingLeft:`${r*12+8}px`},children:[m.jsx(A,{className:j}),m.jsx("div",{className:"flex-1 min-w-0 truncate",children:t.name})]})}const Eg=N.forwardRef(({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:r,showHidden:o=!0,width:l},c)=>{const[a,u]=N.useState([]),[d,p]=N.useState(""),[h,v]=N.useState(!0),[x,C]=N.useState(null),{fetchWithAuth:w}=Xa(),y=N.useRef(null),S=N.useCallback(async()=>{v(!0),C(null);try{const b=await w(`/api/workspaces/${t}/files?showHidden=${o}`,{},{serverUrl:e,token:n}),k=await b.json();if(!b.ok)throw new Error(k.message||"Failed to load files");u(k.files),p(k.currentPath)}catch(b){C(b instanceof Error?b.message:"Failed to load files")}finally{v(!1)}},[t,o,w,e,n]);N.useEffect(()=>{S()},[S]),N.useImperativeHandle(c,()=>({refresh:S,focus:()=>{const b=y.current;if(!b)return;const k=b.querySelector("[data-file-node]");k?k.focus():b.focus()}}),[S]);const _=N.useCallback(b=>{var M,A,j,O,z,V,F;const k=y.current;if(!k)return;const T=Array.from(k.querySelectorAll("[data-file-node]"));if(T.length===0)return;const R=T.indexOf(document.activeElement);switch(b.key){case"ArrowDown":{b.preventDefault();const W=R<T.length-1?R+1:0;(M=T[W])==null||M.focus();break}case"ArrowUp":{b.preventDefault();const W=R>0?R-1:T.length-1;(A=T[W])==null||A.focus();break}case"ArrowRight":{b.preventDefault();const W=document.activeElement;if(!W)break;if(W.getAttribute("data-file-type")==="directory")if(W.getAttribute("data-file-is-open")!=="true")W.click();else{const X=R<T.length-1?R+1:-1;X>=0&&((j=T[X])==null||j.focus())}else{const q=R<T.length-1?R+1:-1;q>=0&&((O=T[q])==null||O.focus())}break}case"ArrowLeft":{b.preventDefault();const W=document.activeElement;if(!W)break;if(W.getAttribute("data-file-type")==="directory")if(W.getAttribute("data-file-is-open")==="true")W.click();else{const X=R>0?R-1:-1;X>=0&&((z=T[X])==null||z.focus())}else{const q=R>0?R-1:-1;q>=0&&((V=T[q])==null||V.focus())}break}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break}case"Escape":{b.preventDefault(),(F=document.activeElement)==null||F.blur();break}}},[]);return h?m.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[m.jsx(nr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):x?m.jsxs("div",{className:"p-4 text-sm text-destructive",children:[x,m.jsx(He,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:m.jsx(Ai,{className:"w-3 h-3"})})]}):a.length===0?m.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",m.jsx(He,{variant:"ghost",size:"sm",onClick:S,className:"ml-2",children:m.jsx(Ai,{className:"w-3 h-3"})})]}):m.jsx("div",{ref:y,tabIndex:-1,onKeyDown:_,className:"flex-1 min-h-0 min-w-0 w-full outline-none",children:m.jsx(zc,{className:"h-full",children:m.jsx("div",{className:"px-2 pb-2 w-full min-w-0",style:l?{width:`${l-8}px`}:void 0,children:m.jsx("div",{className:"space-y-0.5 min-w-0",children:a.map(b=>m.jsx(AE,{entry:b,workspaceId:t,parentPath:d,depth:0,onFileSelect:r,showHidden:o,serverUrl:e,apiToken:n},b.path))})})})})});Eg.displayName="FileTree";const RE=N.forwardRef((t,e)=>{const n=fe.c(43),{workspaceId:r,serverUrl:o,apiToken:l,isOpen:c,onClose:a}=t,u=Za(),d=N.useRef(null),p=zt(K$),h=zt(Y$);let v;n[0]!==h?(v=()=>{h(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var z;(z=d.current)==null||z.focus()})})},n[0]=h,n[1]=v):v=n[1];const x=v;let C,w;n[2]!==x?(C=()=>({focus:x}),w=[x],n[2]=x,n[3]=C,n[4]=w):(C=n[3],w=n[4]),N.useImperativeHandle(e,C,w);const y=zt(X$);let S;n[5]!==y||n[6]!==r?(S=z=>{z.type==="file"&&r&&y({workspaceId:r,path:z.path,name:z.name})},n[5]=y,n[6]=r,n[7]=S):S=n[7];const _=S;if(!r)return null;if(u){let z;n[8]!==a?(z=I=>!I&&a(),n[8]=a,n[9]=z):z=n[9];let V;n[10]===Symbol.for("react.memo_cache_sentinel")?(V=m.jsx(Lf,{className:"sr-only",children:m.jsx(If,{children:"Files"})}),n[10]=V):V=n[10];let F;n[11]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsx("span",{className:"font-semibold text-sm text-sidebar-foreground",children:"Files"}),n[11]=F):F=n[11];let W;n[12]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Bs,{className:"size-4"}),n[12]=W):W=n[12];let G;n[13]!==a?(G=m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[F,m.jsx(He,{variant:"ghost",size:"icon-sm",onClick:a,children:W})]}),n[13]=a,n[14]=G):G=n[14];let q;n[15]!==l||n[16]!==_||n[17]!==o||n[18]!==r?(q=m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:m.jsx(Eg,{ref:d,workspaceId:r,serverUrl:o,apiToken:l,showHidden:!0,onFileSelect:_},r)}),n[15]=l,n[16]=_,n[17]=o,n[18]=r,n[19]=q):q=n[19];let X;n[20]!==q||n[21]!==G?(X=m.jsxs(Of,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[V,G,q]}),n[20]=q,n[21]=G,n[22]=X):X=n[22];let Y;return n[23]!==c||n[24]!==X||n[25]!==z?(Y=m.jsx(jf,{open:c,onOpenChange:z,children:X}),n[23]=c,n[24]=X,n[25]=z,n[26]=Y):Y=n[26],Y}const b=`${p}px`;let k;n[27]!==b?(k={"--sidebar-width":b},n[27]=b,n[28]=k):k=n[28];const T=k;let R;n[29]===Symbol.for("react.memo_cache_sentinel")?(R=m.jsx(ck,{side:"right",panelId:"files"}),n[29]=R):R=n[29];let M;n[30]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(ak,{children:m.jsx(mo,{children:m.jsx(Ei,{children:m.jsxs(vo,{className:"w-full justify-between",onClick:()=>{var z;return(z=d.current)==null?void 0:z.refresh()},children:[m.jsx("span",{className:"text-sm font-semibold",children:"Files"}),m.jsx(Ai,{className:"size-4"})]})})})}),n[30]=M):M=n[30];let A;n[31]!==l||n[32]!==p||n[33]!==_||n[34]!==o||n[35]!==r?(A=m.jsx(lk,{className:"overflow-hidden",children:m.jsx(Eg,{ref:d,workspaceId:r,serverUrl:o,apiToken:l,showHidden:!0,width:p,onFileSelect:_},r)}),n[31]=l,n[32]=p,n[33]=_,n[34]=o,n[35]=r,n[36]=A):A=n[36];let j;n[37]!==c||n[38]!==A?(j=m.jsxs(ok,{side:"right",isOpen:c,children:[R,M,A]}),n[37]=c,n[38]=A,n[39]=j):j=n[39];let O;return n[40]!==j||n[41]!==T?(O=m.jsx(ik,{panelId:"files",defaultOpen:!0,className:"w-0 shrink-0",style:T,children:j}),n[40]=j,n[41]=T,n[42]=O):O=n[42],O});RE.displayName="FilesPanel";function K$(t){return t.filesPanelWidth}function Y$(t){return t.setShowFilesPanel}function X$(t){return t.openFilePreview}function Q$(t,e){var C;const{session:n}=t,{setSessions:r,setCurrentSession:o,setMessagesBySession:l,setPartsBySession:c,setSessionUsage:a,setCurrentModel:u,setSelectedVariant:d,pendingSessionCreateRef:p,sessionAccessTimesRef:h,partIdIndexRef:v,defaultModel:x}=e;r(w=>[n,...w]),p.current&&(o(n),l({[n.id]:[]}),c({[n.id]:{}}),v.current.clear(),a({promptTokens:0,completionTokens:0,totalTokens:0}),u(n.selectedModel||x),d((C=n.selectedVariant)!=null?C:null),p.current=!1),h.current.set(n.id,Date.now())}function Z$(t,e){var M;const{session:n,messages:r,usage:o,isRunning:l}=t,{setCurrentSession:c,removeInterruptedSession:a,addStreamingSession:u,removeStreamingSession:d,skipFinishSoundSessionIdsRef:p,setMessagesBySession:h,setPartsBySession:v,setSessionUsage:x,setCurrentModel:C,setSelectedVariant:w,sessionAccessTimesRef:y,partIdIndexRef:S,models:_,defaultModel:b,clearCompletion:k}=e;if(c(n),a(n.id),k(n.id),l?u(n.id):(d(n.id),p.current.add(n.id)),r){h({[n.id]:r.map(A=>A.message)}),v(()=>{const A={};A[n.id]={};for(const j of r)A[n.id][j.message.id]=j.parts;return A}),S.current.clear();for(const A of r)for(let j=0;j<A.parts.length;j++)S.current.set(A.parts[j].id,{sessionId:n.id,messageId:A.message.id,index:j})}x(o!=null?o:{promptTokens:0,completionTokens:0,totalTokens:0}),C(n.selectedModel||b),w(n.selectedVariant||null);const T=n.selectedModel||b,R=(M=_.find(A=>A.id===T))==null?void 0:M.variants;n.selectedVariant&&R&&!R[n.selectedVariant]&&w(null),y.current.set(n.id,Date.now())}function J$(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:o,setPartsBySession:l,setCurrentSession:c,partIdIndexRef:a,partAppendRafRef:u,pendingPartAppendsRef:d,sessionAccessTimesRef:p,currentSessionIdRef:h,clearCompletion:v}=e;r(x=>x.map(C=>C.id===n?{...C,status:"closed"}:C)),v(n),h.current===n&&(u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current.clear()),o(x=>{const C={...x};return delete C[n],C}),l(x=>{const C={...x};return delete C[n],C});for(const[x,C]of a.current)C.sessionId===n&&a.current.delete(x);p.current.delete(n),h.current===n&&c(null)}function eV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&o(n)}function tV(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:o,setPartsBySession:l,removeInterruptedSession:c,partIdIndexRef:a,sessionAccessTimesRef:u,setCurrentSession:d,currentSessionIdRef:p,clearCompletion:h}=e;r(v=>v.filter(x=>x.id!==n)),h(n),o(v=>{const x={...v};return delete x[n],x}),l(v=>{const x={...v};return delete x[n],x}),c(n);for(const[v,x]of a.current)x.sessionId===n&&a.current.delete(v);u.current.delete(n),p.current===n&&d(null)}function nV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,setSelectedVariant:l,setCurrentModel:c,currentSessionIdRef:a}=e;r(u=>u.map(d=>d.id===n.id?n:d)),a.current===n.id&&(o(n),n.selectedVariant!==void 0&&l(n.selectedVariant),n.selectedModel&&c(n.selectedModel))}function rV(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,currentSessionIdRef:l}=e;r(c=>c.map(a=>a.id===n.id?n:a)),l.current===n.id&&o(n)}function sV(t,e){const{sessionId:n,result:r}=t,{addInterruptedSession:o,skipFinishSoundSessionIdsRef:l,removeStreamingSession:c}=e;o(n),l.current.add(n),c(n),r.cascadedTo.length>0&&console.log(`Session ${n} interrupted. Cascaded to:`,r.cascadedTo)}function iV(t,e){const{sessionId:n,revertedTo:r,removed:o}=t;console.log(`Session ${n} reverted to message ${r.messageId}, removed ${o.messageIds.length} messages`)}function oV(t,e){const{forkedSession:n,messages:r}=t,{setSessions:o,setCurrentSession:l,setMessagesBySession:c,setPartsBySession:a,setSessionUsage:u,sessionAccessTimesRef:d,partIdIndexRef:p,clearCompletion:h}=e;o(v=>[n,...v]),c({[n.id]:r.map(v=>v.message)}),a(()=>{const v={};v[n.id]={};for(const x of r)v[n.id][x.message.id]=x.parts;return v}),p.current.clear();for(const v of r)for(let x=0;x<v.parts.length;x++)p.current.set(v.parts[x].id,{sessionId:n.id,messageId:v.message.id,index:x});l(n),u({promptTokens:0,completionTokens:0,totalTokens:0}),d.current.set(n.id,Date.now()),h(n.id)}function aV(t,e){const{sessionId:n,messages:r}=t,{setMessagesBySession:o,setPartsBySession:l,partIdIndexRef:c,partAppendRafRef:a,skipFinishSoundSessionIdsRef:u,removeStreamingSession:d,sessionAccessTimesRef:p,flushPendingPartAppends:h,currentSessionIdRef:v,clearCompletion:x}=e;if(v.current===n&&(a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),h()),v.current===n){o({[n]:r.map(C=>C.message)}),l(()=>{const C={};C[n]={};for(const w of r)C[n][w.message.id]=w.parts;return C}),c.current.clear();for(const C of r)for(let w=0;w<C.parts.length;w++)c.current.set(C.parts[w].id,{sessionId:n,messageId:C.message.id,index:w})}u.current.add(n),d(n),p.current.set(n,Date.now()),x(n)}const lV={"session.created":Q$,"session.resumed":Z$,"session.closed":J$,"session.reopened":eV,"session.deleted":tV,"session.updated":nV,"session.renamed":rV,"session.interrupted":sV,"session.reverted":iV,"session.forked":oV,"session.state":aV};function cV(t,e){const{message:n}=t,{setMessagesBySession:r,setPartsBySession:o,addStreamingSession:l,removeInterruptedSession:c,currentSessionIdRef:a,clearCompletion:u}=e;u(n.sessionId),n.sessionId===a.current&&(r(d=>({...d,[n.sessionId]:[...d[n.sessionId]||[],n]})),o(d=>({...d,[n.sessionId]:{...d[n.sessionId],[n.id]:[]}}))),n.sessionId===a.current&&"status"in n&&n.status==="streaming"&&(l(n.sessionId),c(n.sessionId))}function uV(t,e){const{message:n}=t,{setMessagesBySession:r,removeStreamingSession:o,partAppendRafRef:l,partAppendTimeoutRef:c,flushPendingPartAppends:a,currentSessionIdRef:u,sessionsRef:d,setCompletion:p,chatFinishSoundEnabledRef:h,playChatFinishSound:v}=e;if(n.sessionId===u.current&&("status"in n&&n.status!=="streaming"&&(l.current!==null&&(cancelAnimationFrame(l.current),l.current=null),c.current!==null&&(clearTimeout(c.current),c.current=null),a()),r(x=>({...x,[n.sessionId]:(x[n.sessionId]||[]).map(C=>C.id===n.id?n:C)}))),"status"in n&&n.status!=="streaming"){o(n.sessionId);const x=d.current.find(w=>w.id===n.sessionId);if(x&&x.parentId===null){const w=Date.now();p(n.sessionId,{type:"flash-only",flashStartedAt:w}),h.current&&v()}}}function dV(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:o,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){o(d=>{const p=d[n]||{},h=p[r.messageId]||[];return{...d,[n]:{...p,[r.messageId]:[...h,r]}}});let u=0;for(const d of l.current.values())d.sessionId===n&&d.messageId===r.messageId&&(u=Math.max(u,d.index+1));l.current.set(r.id,{sessionId:n,messageId:r.messageId,index:u})}}function fV(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:o,partIdIndexRef:l,currentSessionIdRef:c,clearCompletion:a}=e;if(a(n),n===c.current){const u=l.current.get(r.id);o(u?d=>{const p=d[u.sessionId];if(!p)return d;const h=p[u.messageId];if(!h)return d;const v=[...h];return v[u.index]=r,{...d,[u.sessionId]:{...p,[u.messageId]:v}}}:d=>{const p=d[n]||{},h=p[r.messageId]||[];return{...d,[n]:{...p,[r.messageId]:h.map(v=>v.id===r.id?r:v)}}})}}function hV(t,e){const{sessionId:n,partId:r,delta:o}=t,{addStreamingSession:l,pendingPartAppendsRef:c,partAppendRafRef:a,lastPartAppendFlushAtRef:u,partAppendTimeoutRef:d,interruptedSessions:p,currentSessionIdRef:h,flushPendingPartAppends:v,clearCompletion:x}=e;if(x(n),n===h.current&&!p.has(n)&&l(n),n===h.current){const C=c.current.get(r);c.current.set(r,(C||"")+o);const y=Date.now()-u.current,S=50;if(y<S){if(d.current===null){const _=S-y;d.current=setTimeout(()=>{d.current=null,a.current===null&&(a.current=requestAnimationFrame(()=>{v()}))},_)}}else a.current===null&&(a.current=requestAnimationFrame(()=>{v()}))}}function pV(t,e){const{sessionId:n,usage:r,model:o}=t,{setSessionUsage:l,setCurrentModel:c,currentSessionIdRef:a}=e;n===a.current&&(l({promptTokens:r.promptTokens,completionTokens:r.completionTokens,totalTokens:r.totalTokens}),c(o))}function mV(t,e){const{sessionId:n}=t,{setCompactionSuccess:r,currentSessionIdRef:o}=e;n===o.current&&r(!0)}function gV(t,e){const{code:n,message:r}=t;console.error("Server error:",n,r)}const vV={"message.created":cV,"message.updated":uV,"part.created":dV,"part.updated":fV,"part.append":hV,"chat.usage":pV,"compaction.complete":mV,error:gV};function yV(t,e){const{permissions:n}=t,{setPermissions:r}=e;r(n)}function _V(t,e){const{approvals:n}=t,{mergePendingPermissions:r}=e;r(n.map(o=>({toolCallId:o.toolCallId,sessionId:o.sessionId,toolName:o.toolName,args:o.args,permissionType:o.permissionType,permissionKey:o.permissionKey,message:o.message,details:o.details,dangerous:o.dangerous,childSessionId:o.childSessionId,subagentName:o.subagentName})))}function bV(t,e){const{permissionId:n}=t,{setPermissions:r}=e;r(o=>o.map(l=>l.id===n?{...l,revokedAt:new Date().toISOString()}:l))}function xV(t,e){const{setPermissions:n}=e;n(r=>{const o=new Date().toISOString();return r.map(l=>({...l,revokedAt:o}))})}function SV(t,e){const{sessionId:n,toolCallId:r,toolName:o,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:p,childSessionId:h,subagentName:v}=t,{addPendingPermission:x,sessionsRef:C,notifiedToolCallIdsRef:w,permissionSoundEnabledRef:y,playPermissionSound:S}=e;x({toolCallId:r,sessionId:n,toolName:o,args:l,permissionType:c,permissionKey:a,message:u,details:d,dangerous:p,childSessionId:h,subagentName:v});const b=C.current.find(k=>k.id===n);(b==null?void 0:b.parentId)===null&&y.current&&!w.current.has(r)&&(S(),w.current.add(r))}function wV(t,e){const{toolCallId:n}=t,{removePendingPermissionByToolCallId:r}=e;r(n)}function CV(t,e){const{sessionId:n,messages:r}=t,{setQueuedMessagesForSession:o}=e;o(n,r)}function kV(t,e){const{sessionId:n,message:r}=t,{addQueuedMessage:o}=e;o(n,r)}function EV(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:o}=e;o(n,r)}function AV(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:o}=e;o(n,r)}const RV={"permission.list":yV,"permissions.sync":_V,"permission.revoked":bV,"permission.all_revoked":xV,"permission.request":SV,"permission.granted":wV,"queue.list":CV,"queue.added":kV,"queue.removed":EV,"queue.sending":AV};function TV(t,e){const{provider:n,connected:r,authorizationUrl:o,error:l}=t,{setProviderStatuses:c}=e;c(a=>a.find(d=>d.provider===n)?a.map(d=>d.provider===n?{...d,connected:r,authorizationUrl:o,error:l}:d):[...a,{provider:n,connected:r,authorizationUrl:o,error:l}])}function NV(t,e){const{provider:n,connected:r,connectedAt:o,accountId:l}=t,{setProviderStatuses:c}=e;c(a=>a.map(u=>u.provider===n?{...u,connected:r,connectedAt:o,accountId:l}:u))}const DV={"provider.status":TV,"provider.connected":NV},Yx=t=>t?`http://${t}/api`:null;function MV(){var Zc,dl,Jc,eu,tu;const{servers:t,activeServer:e,addServer:n,removeServer:r,isSwitching:o,clearSwitchingState:l,quickConnections:c,isAddingServerRef:a,prepareForServerAdd:u,removeFromQuickConnectionsByWorkspace:d}=Ba(),{sessions:p,currentSession:h,setSessions:v,setCurrentSession:x,clearSessionState:C}=V4(co(he=>({sessions:he.sessions,currentSession:he.currentSession,setSessions:he.setSessions,setCurrentSession:he.setCurrentSession,clearSessionState:he.clearSessionState}))),[w,y]=N.useState([]),[S,_]=N.useState([]),{setMessagesBySession:b,setPartsBySession:k}=Zl(co(he=>({setMessagesBySession:he.setMessagesBySession,setPartsBySession:he.setPartsBySession}))),T=h==null?void 0:h.id,R=Zl(co(he=>T?he.messagesBySession[T]||[]:[])),M=Zl(co(he=>T?he.partsBySession[T]||{}:{})),A=N.useRef({});N.useLayoutEffect(()=>{A.current=Zl.getState().messagesBySession});const j=1,O=N.useRef(new Map),z=N.useRef(0),[V,F]=N.useState(null),W=N.useRef(null),G=N.useRef(null),q=N.useRef(null),X=N.useRef(null),Y=N.useRef(null),I=N.useRef(null),L=N.useRef(null),P=N.useRef(null),[H,B]=N.useState(!1),Z=N.useRef([]),{streamingSessionIds:J,interruptedSessions:ee,clearStreamingSessions:K,clearInterruptedSessions:$,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se}=Wm(co(he=>({streamingSessionIds:he.streamingSessionIds,interruptedSessions:he.interruptedSessions,clearStreamingSessions:he.clearStreamingSessions,clearInterruptedSessions:he.clearInterruptedSessions,addStreamingSession:he.addStreamingSession,removeStreamingSession:he.removeStreamingSession,addInterruptedSession:he.addInterruptedSession,removeInterruptedSession:he.removeInterruptedSession}))),[_e,Re]=N.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[je,ze]=N.useState("gpt-4o"),[ce,Te]=N.useState(null),[ye,Pe]=N.useState([]),[Fe,ve]=N.useState("gpt-4o");N.useEffect(()=>{var _t;const he=(_t=ye.find(Bt=>Bt.id===je))==null?void 0:_t.variants;ce&&he&&!he[ce]&&Te(null)},[je,ce,ye]);const[Ne,Ae]=N.useState([]),[Ce,oe]=N.useState(null),me=Tg(he=>he.setActiveWorkspace);N.useLayoutEffect(()=>{me(Ce)},[Ce,me]);const{showSettings:ke,showMCPDialog:De,showAddServer:Be,editServerData:nt,showFilesPanel:Ye,setShowFilesPanel:Ue,filesPanelWidth:Me,setShowSettings:We,setShowMCPDialog:Xe,setShowAddServer:vt,setEditServerData:Lt,setCompletion:Rn,clearCompletion:Ut,clearAllCompletions:et,filePreviewTarget:at,closeFilePreview:Gt}=zt(co(he=>({showSettings:he.showSettings,showMCPDialog:he.showMCPDialog,showAddServer:he.showAddServer,editServerData:he.editServerData,showFilesPanel:he.showFilesPanel,setShowFilesPanel:he.setShowFilesPanel,filesPanelWidth:he.filesPanelWidth,setShowSettings:he.setShowSettings,setShowMCPDialog:he.setShowMCPDialog,setShowAddServer:he.setShowAddServer,setEditServerData:he.setEditServerData,setCompletion:he.setCompletion,clearCompletion:he.clearCompletion,clearAllCompletions:he.clearAllCompletions,filePreviewTarget:he.filePreviewTarget,closeFilePreview:he.closeFilePreview}))),[Qe,yt]=N.useState(()=>{const he=localStorage.getItem("jean2_sound_chat_finish_enabled");return he!==null?he==="true":!0}),[It,$t]=N.useState(()=>{const he=localStorage.getItem("jean2_sound_permission_enabled");return he!==null?he==="true":!0}),Qt=N.useRef(It);N.useLayoutEffect(()=>{Qt.current=It},[It]);const[In,xr]=N.useState([]),[Pn,qn]=N.useState([]),{pendingPermissions:zn,queuedMessages:Zt,clearPendingPermissions:Jt,clearQueuedMessages:fn,mergePendingPermissions:Sr,addPendingPermission:Bn,removePendingPermissionByToolCallId:Rt,removePendingPermissionsBySessionId:en,setQueuedMessagesForSession:Tn,addQueuedMessage:sr,removeQueuedMessageById:ms}=$4(co(he=>({pendingPermissions:he.pendingPermissions,queuedMessages:he.queuedMessages,clearPendingPermissions:he.clearPendingPermissions,clearQueuedMessages:he.clearQueuedMessages,mergePendingPermissions:he.mergePendingPermissions,addPendingPermission:he.addPendingPermission,removePendingPermissionByToolCallId:he.removePendingPermissionByToolCallId,removePendingPermissionsBySessionId:he.removePendingPermissionsBySessionId,setQueuedMessagesForSession:he.setQueuedMessagesForSession,addQueuedMessage:he.addQueuedMessage,removeQueuedMessageById:he.removeQueuedMessageById}))),[Gs,Br]=N.useState(null),[Fn,wr]=N.useState(!1),[ir,gn]=N.useState(0),[Wn,Nn]=N.useState(0),[Tt,gs]=N.useState(0),vs=(Zc=h==null?void 0:h.compacting)!=null?Zc:!1,[Dn,vn]=N.useState(!1),or=N.useRef(new Set),Fr=N.useRef(0),Mn=N.useRef(new Map),Gn=N.useRef(new Map),tn=N.useRef(null),Kn=N.useRef(0),qt=N.useRef(null),Kt=N.useCallback(()=>{if(tn.current!==null&&(cancelAnimationFrame(tn.current),tn.current=null),qt.current!==null&&(clearTimeout(qt.current),qt.current=null),Gn.current.size===0)return;const he=new Map(Gn.current);Gn.current.clear(),Kn.current=Date.now(),k(_t=>{const Bt={..._t};let bt=!1;for(const[rn,xt]of he){const Ct=Mn.current.get(rn);if(!Ct)continue;const Wi=Bt[Ct.sessionId];if(!Wi)continue;const fl=Wi[Ct.messageId];if(!fl)continue;const Gi=fl[Ct.index];if(!Gi||Gi.type!=="text"&&Gi.type!=="reasoning")continue;bt=!0;const nu=[...fl];nu[Ct.index]={...Gi,text:Gi.text+xt},Bt[Ct.sessionId]={...Wi,[Ct.messageId]:nu}}return bt?Bt:_t})},[k]),{playChatFinishSound:ys,playPermissionSound:es}=nH(),Ks=N.useRef(new Set),nl=N.useRef(null),Ys=N.useRef(Qe);N.useLayoutEffect(()=>{Ys.current=Qe},[Qe]),N.useEffect(()=>{localStorage.setItem("jean2_sound_chat_finish_enabled",String(Qe))},[Qe]),N.useEffect(()=>{localStorage.setItem("jean2_sound_permission_enabled",String(It))},[It]),N.useLayoutEffect(()=>{const he=Zl.getState().getMessagesBySessionKeysCount();if(he<=z.current){z.current=he;return}if(z.current=he,he<=j)return;const _t=A.current,Bt=Object.keys(_t);for(;Bt.length>j;){let bt=null,rn=1/0;for(const xt of Bt){if(xt===(h==null?void 0:h.id))continue;const Ct=O.current.get(xt);Ct!==void 0&&Ct<rn&&(rn=Ct,bt=xt)}if(!bt)break;O.current.delete(bt);for(const[xt,Ct]of Mn.current)Ct.sessionId===bt&&Mn.current.delete(xt);Bt.splice(Bt.indexOf(bt),1),b(xt=>{if(!(bt in xt))return xt;const Ct={...xt};return delete Ct[bt],Ct}),k(xt=>{if(!(bt in xt))return xt;const Ct={...xt};return delete Ct[bt],Ct})}},[h,b,k]);const Vc=N.useRef(null),[,Yn]=N.useState(!1),Wt=(dl=e==null?void 0:e.token)!=null?dl:null,nn=(Jc=e==null?void 0:e.url)!=null?Jc:null;N.useEffect(()=>{W.current=V},[V]),N.useEffect(()=>{var he;G.current=(he=h==null?void 0:h.id)!=null?he:null},[h]),N.useEffect(()=>{or.current.clear()},[h==null?void 0:h.id]),N.useLayoutEffect(()=>{Z.current=p},[p]);const Xs=N.useRef(null),ts=N.useRef(!1),qc=N.useCallback(he=>{var _t;(_t=Xs.current)==null||_t.call(Xs,he)},[]),Wc=N.useCallback(he=>{u(),n(he.name,he.url,he.token)},[n,u]),Cr=N.useCallback(()=>{e&&r(e.id),W.current&&W.current.close(),F(null),B(!1),wr(!1),gn(0),Nn(0)},[e,r]),Gf=N.useCallback(()=>{gn(he=>he+1),wr(!1),Nn(0)},[]),Hi=N.useCallback(()=>{Fr.current+=1,W.current&&W.current.close(),F(null),B(!1),wr(!1),gn(0),Nn(0),C(),y([]),b({}),k({}),O.current.clear(),z.current=0,Ks.current=new Set(Wm.getState().streamingSessionIds),or.current.clear(),K(),$(),Re({promptTokens:0,completionTokens:0,totalTokens:0}),ze("gpt-4o"),Pe([]),Ae([]),oe(null),xr([]),Jt(),fn(),et(),Mn.current.clear(),tn.current!==null&&(cancelAnimationFrame(tn.current),tn.current=null),qt.current!==null&&(clearTimeout(qt.current),qt.current=null),Gn.current.clear(),Kn.current=0,gs(he=>he+1)},[]);N.useEffect(()=>{var he;(e==null?void 0:e.id)!==Vc.current&&a.current&&(a.current=!1,Vc.current=(he=e==null?void 0:e.id)!=null?he:null,Hi())},[e,Hi,a]);const jo=N.useCallback(async(he,_t={})=>{if(!Wt)throw new Error("No API token available");const Bt=new Headers(_t.headers||{});Bt.set("Authorization",`Bearer ${Wt}`);const bt=await fetch(he,{..._t,signal:_t.signal,headers:Bt});if(bt.status===401)throw Br("Authentication failed. Your token may have been regenerated."),Cr(),new Error("Unauthorized");return bt},[Wt,Cr]),rl=N.useCallback(he=>he!==T?[]:R.map(_t=>({message:_t,parts:(M[_t.id]||[]).sort((Bt,bt)=>Bt.createdAt-bt.createdAt)})),[T,R,M]);lH({apiToken:Wt,serverUrl:nn,wsRef:W,serverEpochRef:Fr,currentSessionIdRef:G,clearPendingPermissions:Jt,handleLogout:Cr,setWs:F,setConnected:B,setAuthError:Br,setConnectionTimedOut:wr,setRetryCount:gn,setNextRetryIn:Nn,setReconnectTrigger:gs,reconnectTrigger:Tt,connected:H,connectionTimedOut:Fn,retryCount:ir,onMessage:qc}),uH({apiToken:Wt,serverUrl:nn,reconnectTrigger:Tt,serverEpochRef:Fr,fetchWithAuth:jo,clearSwitchingState:l,setSessions:v,setPreconfigs:y,setPrompts:_,setModels:Pe,setDefaultModel:ve,setProviderStatuses:qn,setWorkspaces:Ae,setActiveWorkspace:oe,activeWorkspace:Ce,setIsLoadingServerData:Yn,setAuthError:Br,pendingWorkspaceIdRef:nl});const Gc=async(he,_t,Bt)=>{const bt=Yx(nn);if(!bt)return;const Ct=(await(await jo(`${bt}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:he,path:_t,isVirtual:Bt})})).json()).workspace;return Ae(Wi=>[...Wi,Ct]),oe(Ct),x(null),Ct},Kf=he=>{oe(he),x(null)},Oo=he=>{nl.current=he},Hr=async he=>{const _t=Yx(nn);if(!_t)return;const Bt=await jo(`${_t}/workspaces/${he}`,{method:"DELETE"});if(!Bt.ok){const rn=await Bt.json().catch(()=>({message:"Failed to delete workspace"}));console.error("Failed to delete workspace:",rn.message);return}const{deletedSessions:bt}=await Bt.json();d(he),h&&(h.workspaceId===he||bt.includes(h.id))&&x(null),v(rn=>rn.filter(xt=>!bt.includes(xt.id))),b(rn=>{const xt={...rn};return bt.forEach(Ct=>delete xt[Ct]),xt}),k(rn=>{const xt={...rn};return bt.forEach(Ct=>delete xt[Ct]),xt}),bt.forEach(rn=>O.current.delete(rn));for(const[rn,xt]of Mn.current)bt.includes(xt.sessionId)&&Mn.current.delete(rn);Ae(rn=>{const xt=rn.filter(Ct=>Ct.id!==he);return(Ce==null?void 0:Ce.id)===he&&oe(xt[0]||null),xt})},sl=async()=>{const he=`Workspace ${Ne.length+1}`,_t=`~/.jean2/workspaces/${crypto.randomUUID()}`;await Gc(he,_t,!0)},il=async he=>{const _t=he.split("/").pop()||he.split("\\").pop()||"Workspace";await Gc(_t,he,!1)},kr=N.useMemo(()=>({setSessions:v,setCurrentSession:x,setMessagesBySession:b,setPartsBySession:k,setSessionUsage:Re,setCurrentModel:ze,setSelectedVariant:Te,addStreamingSession:te,removeStreamingSession:re,addInterruptedSession:ae,removeInterruptedSession:se,setQueuedMessagesForSession:Tn,addQueuedMessage:sr,removeQueuedMessageById:ms,clearPendingPermissions:Jt,clearQueuedMessages:fn,setCompactionSuccess:vn,setCompletion:Rn,clearCompletion:Ut,clearAllCompletions:et,pendingSessionCreateRef:ts,sessionAccessTimesRef:O,partIdIndexRef:Mn,partAppendRafRef:tn,pendingPartAppendsRef:Gn,lastPartAppendFlushAtRef:Kn,partAppendTimeoutRef:qt,skipFinishSoundSessionIdsRef:Ks,currentSessionIdRef:G,models:ye,defaultModel:Fe,interruptedSessions:ee,sessionsRef:Z,flushPendingPartAppends:Kt,setProviderStatuses:qn,setPermissions:xr,mergePendingPermissions:Sr,addPendingPermission:Bn,removePendingPermissionByToolCallId:Rt,notifiedToolCallIdsRef:or,permissionSoundEnabledRef:Qt,playPermissionSound:es,chatFinishSoundEnabledRef:Ys,playChatFinishSound:ys}),[v,x,b,k,Re,ze,Te,te,re,ae,se,Tn,sr,ms,Jt,fn,vn,ts,O,Mn,tn,Gn,Kn,qt,Ks,G,ye,Fe,ee,Z,Kt,qn,xr,Sr,Bn,Rt,or,Qt,es,Rn,Ut,et,Ys,ys]),_s=N.useCallback(he=>{switch(he.type){case"session.created":case"session.resumed":case"session.closed":case"session.reopened":case"session.deleted":case"session.updated":case"session.renamed":case"session.interrupted":case"session.reverted":case"session.forked":case"session.state":lV[he.type](he,kr);break;case"message.created":case"message.updated":case"part.created":case"part.updated":case"part.append":case"chat.usage":case"compaction.complete":case"error":vV[he.type](he,kr);break;case"permission.list":case"permissions.sync":case"permission.revoked":case"permission.all_revoked":case"permission.request":case"permission.granted":case"queue.list":case"queue.added":case"queue.removed":case"queue.sending":RV[he.type](he,kr);break;case"provider.status":case"provider.connected":DV[he.type](he,kr);break;default:{console.warn(`[handleServerMessage] Unknown message type: ${he.type}`);break}}},[kr]);N.useEffect(()=>{Xs.current=_s},[_s]);const Ui=w.filter(he=>he.mode!=="subagent"),{sendMessage:Lo,createSession:ol,resumeSession:Qs,closeSession:Ur,reopenSession:al,permanentlyDeleteSession:$i,handleRenameSession:$r,revertSession:ll,forkSession:Io,compactSession:Kc,removeFromQueue:Po,sendChatMessage:zo,handlePermissionResponse:Yc,handleInterruptSession:xn,updateSessionPreconfig:bs,updateSessionModel:Bo,updateSessionVariant:Vi,handleNavigateBack:Yf,refreshPermissions:cl,connectProvider:ul,disconnectProvider:qi,createSessionInWorkspace:Fo}=vH({ws:V,currentSession:h,sessions:p,workspaces:Ne,activeWorkspace:Ce,currentModel:je,streamingSessionIds:J,isCompacting:vs,primaryPreconfigs:Ui,setCurrentSession:x,setActiveWorkspace:oe,setCompactionSuccess:vn,setCurrentModel:ze,setSelectedVariant:Te,removePendingPermissionByToolCallId:Rt,removePendingPermissionsBySessionId:en,clearStreamingSessions:K,pendingSessionCreateRef:ts,partAppendRafRef:tn,pendingPartAppendsRef:Gn,skipFinishSoundSessionIdsRef:Ks}),Xc=p.filter(he=>he.workspaceId===(Ce==null?void 0:Ce.id)),Xf=c.filter(he=>he.serverId===(e==null?void 0:e.id)&&he.workspaceId).map(he=>he.workspaceId),Qf=h?rl(h.id):[],Zf=h&&(eu=Ce==null?void 0:Ce.name)!=null?eu:"Jean2",Ho=zt(he=>he.setSidebarViewMode),Jf=zt(he=>he.sessionsPanelWidth),Qc=N.useCallback(he=>{const _t=zt.getState().sidebarViewMode,Bt=typeof he=="function"?he(_t):he;Ho(Bt),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var bt;(bt=I.current)==null||bt.focusSessionPanel()})})},[I,Ho]),eh=!(h!=null&&h.parentId),Zs=!!e;return m.jsxs(ik,{panelId:"sessions",defaultOpen:!0,style:{"--sidebar-width":`${Jf}px`},children:[m.jsx(MH,{sidebarRef:I,terminalPanelRef:X,filesPanelRef:Y,chatInputRef:q,activeWorkspace:Ce,primaryPreconfigs:Ui,handleInterruptSession:xn,handleSidebarViewModeChange:Qc,createSession:ol,onToggleAutoFollow:()=>{var he;return(he=P.current)==null?void 0:he.toggle()}}),Zs&&m.jsx(H8,{ref:I,allSessions:p,favoritedWorkspaceIds:Xf,sessions:Xc,currentSession:h,currentSessionId:(tu=h==null?void 0:h.id)!=null?tu:null,streamingSessionIds:J,connected:H,workspaces:Ne,activeWorkspace:Ce,onCreateSession:()=>{var he;return ol((he=Ui[0])==null?void 0:he.id)},onResumeSession:Qs,onCloseSession:Ur,onReopenSession:al,onDeleteSession:$i,onRenameSession:$r,onSelectWorkspace:Kf,onCreateVirtualWorkspace:sl,onCreatePhysicalWorkspace:il,onDeleteWorkspace:Hr,onOpenSettings:()=>We(!0),onOpenMCP:()=>Xe(!0),onOpenAddServer:()=>vt(!0),onServerSwitch:Hi,onEscape:()=>{var he;h&&((he=q.current)==null||he.focus())},onCreateSessionInWorkspace:Fo,pendingPermissions:zn}),Zs&&m.jsx(RE,{ref:Y,workspaceId:Ce==null?void 0:Ce.id,serverUrl:nn!=null?nn:void 0,apiToken:Wt!=null?Wt:void 0,isOpen:Ye,onClose:()=>Ue(!1)}),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.jsx(jH,{headerTitle:Zf,isLoggedIn:Zs,activeWorkspace:Ce,onServerSwitch:Hi,onSelectWorkspace:Oo,onSidebarViewModeChange:Qc}),m.jsx(H$,{servers:t,activeServer:e,isSwitching:o,connected:H,authError:Gs,connectionTimedOut:Fn,retryCount:ir,nextRetryIn:Wn,serverUrl:nn,currentSession:h,messagesWithParts:Qf,queuedMessages:Zt,preconfigs:w,primaryPreconfigs:Ui,prompts:S,models:ye,providerStatuses:Pn,defaultModel:Fe,selectedVariant:ce,pendingPermissions:zn,sessionUsage:_e,currentModel:je,streamingSessionIds:J,isCompacting:vs,compactionSuccess:Dn,isPrimarySession:eh,inputRef:q,apiToken:Wt,onFirstServerAdded:Wc,onRetry:Gf,onLogout:Cr,onSendMessage:zo,onRemoveFromQueue:Po,onChangePreconfig:bs,onChangeModel:Bo,onChangeVariant:Vi,onPermissionResponse:Yc,onRename:$r,onNavigateToSubagent:Qs,onNavigateBack:Yf,onInterrupt:xn,onRevert:ll,onFork:Io,onCompact:Kc,onClearCompactionSuccess:()=>vn(!1),scrollToBottomRef:L,autoFollowToggleRef:P}),m.jsx(nU,{workspaceId:Ce==null?void 0:Ce.id,workspacePath:Ce==null?void 0:Ce.path,workspaceName:Ce==null?void 0:Ce.name,serverUrl:nn!=null?nn:void 0,apiToken:Wt!=null?Wt:void 0,terminalPanelRef:X})]}),Zs&&m.jsx("div",{"data-panel-gap":"files",className:`relative bg-transparent transition-[width] duration-200 ease-linear shrink-0 ${Ye?"":"w-0"}`,style:{width:Ye?Me:0}}),Zs&&m.jsxs(m.Fragment,{children:[m.jsx(lL,{open:ke,onOpenChange:We,permissions:In,onRefreshPermissions:cl,onRevokePermission:he=>{Lo("permission.revoke",{permissionId:he})},onRevokeAllPermissions:()=>{Lo("permission.revoke_all",{workspaceId:Ce==null?void 0:Ce.id})},apiToken:Wt,onLogout:Cr,providerStatuses:Pn,onConnectProvider:ul,onDisconnectProvider:qi,chatFinishSoundEnabled:Qe,onChatFinishSoundEnabledChange:yt,permissionSoundEnabled:It,onPermissionSoundEnabledChange:$t,serverUrl:nn}),m.jsx(pL,{open:De,onOpenChange:Xe,workspaceId:Ce==null?void 0:Ce.id,workspacePath:Ce==null?void 0:Ce.path,serverUrl:nn!=null?nn:void 0,apiToken:Wt!=null?Wt:void 0})]}),m.jsx(mL,{open:Be,onOpenChange:he=>{vt(he),he||Lt(null)},editServer:nt}),Zs&&m.jsx(YF,{workspaceId:Ce==null?void 0:Ce.id,target:at,serverUrl:nn!=null?nn:void 0,apiToken:Wt!=null?Wt:void 0,open:at!==null,onOpenChange:he=>{he||Gt()}})]})}function jV(){const t=fe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(e5,{children:m.jsx(MV,{})}),t[0]=e):e=t[0],e}document.addEventListener("dragover",t=>t.preventDefault());document.addEventListener("drop",t=>t.preventDefault());_4.createRoot(document.getElementById("root")).render(m.jsx(N.StrictMode,{children:m.jsx(w4,{defaultMode:"system",defaultScheme:"neutral",children:m.jsx(jV,{})})}));
|