kanna-code 0.6.0 → 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,498 @@
1
+ var HN=Object.defineProperty;var bS=e=>{throw TypeError(e)};var FN=(e,t,n)=>t in e?HN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qt=(e,t,n)=>FN(e,typeof t!="symbol"?t+"":t,n),xS=(e,t,n)=>t.has(e)||bS("Cannot "+n);var hc=(e,t,n)=>(xS(e,t,"read from private field"),n?n.call(e):t.get(e)),SS=(e,t,n)=>t.has(e)?bS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wS=(e,t,n,r)=>(xS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function UN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lg={exports:{}},dc={};/**
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 CS;function $N(){if(CS)return dc;CS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return dc.Fragment=t,dc.jsx=n,dc.jsxs=n,dc}var kS;function WN(){return kS||(kS=1,lg.exports=$N()),lg.exports}var v=WN(),cg={exports:{}},ze={};/**
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 ES;function qN(){if(ES)return ze;ES=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=_&&B[_]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(B,Y,M){this.props=B,this.context=Y,this.refs=C,this.updater=M||S}k.prototype.isReactComponent={},k.prototype.setState=function(B,Y){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,Y,"setState")},k.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(B,Y,M){this.props=B,this.context=Y,this.refs=C,this.updater=M||S}var D=R.prototype=new T;D.constructor=R,w(D,k.prototype),D.isPureReactComponent=!0;var z=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function Z(B,Y,M){var X=M.ref;return{$$typeof:e,type:B,key:Y,ref:X!==void 0?X:null,props:M}}function P(B,Y){return Z(B.type,Y,B.props)}function W(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function H(B){var Y={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(M){return Y[M]})}var F=/\/+/g;function V(B,Y){return typeof B=="object"&&B!==null&&B.key!=null?H(""+B.key):Y.toString(36)}function U(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(L,L):(B.status="pending",B.then(function(Y){B.status==="pending"&&(B.status="fulfilled",B.value=Y)},function(Y){B.status==="pending"&&(B.status="rejected",B.reason=Y)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function O(B,Y,M,X,se){var re=typeof B;(re==="undefined"||re==="boolean")&&(B=null);var me=!1;if(B===null)me=!0;else switch(re){case"bigint":case"string":case"number":me=!0;break;case"object":switch(B.$$typeof){case e:case t:me=!0;break;case p:return me=B._init,O(me(B._payload),Y,M,X,se)}}if(me)return se=se(B),me=X===""?"."+V(B,0):X,z(se)?(M="",me!=null&&(M=me.replace(F,"$&/")+"/"),O(se,Y,M,"",function(ke){return ke})):se!=null&&(W(se)&&(se=P(se,M+(se.key==null||B&&B.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+me)),Y.push(se)),1;me=0;var Ce=X===""?".":X+":";if(z(B))for(var pe=0;pe<B.length;pe++)X=B[pe],re=Ce+V(X,pe),me+=O(X,Y,M,re,se);else if(pe=b(B),typeof pe=="function")for(B=pe.call(B),pe=0;!(X=B.next()).done;)X=X.value,re=Ce+V(X,pe++),me+=O(X,Y,M,re,se);else if(re==="object"){if(typeof B.then=="function")return O(U(B),Y,M,X,se);throw Y=String(B),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return me}function K(B,Y,M){if(B==null)return B;var X=[],se=0;return O(B,X,"","",function(re){return Y.call(M,re,se++)}),X}function $(B){if(B._status===-1){var Y=B._result;Y=Y(),Y.then(function(M){(B._status===0||B._status===-1)&&(B._status=1,B._result=M)},function(M){(B._status===0||B._status===-1)&&(B._status=2,B._result=M)}),B._status===-1&&(B._status=0,B._result=Y)}if(B._status===1)return B._result.default;throw B._result}var J=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},A={map:K,forEach:function(B,Y,M){K(B,function(){Y.apply(this,arguments)},M)},count:function(B){var Y=0;return K(B,function(){Y++}),Y},toArray:function(B){return K(B,function(Y){return Y})||[]},only:function(B){if(!W(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return ze.Activity=m,ze.Children=A,ze.Component=k,ze.Fragment=n,ze.Profiler=s,ze.PureComponent=R,ze.StrictMode=r,ze.Suspense=d,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,ze.__COMPILER_RUNTIME={__proto__:null,c:function(B){return j.H.useMemoCache(B)}},ze.cache=function(B){return function(){return B.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(B,Y,M){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var X=w({},B.props),se=B.key;if(Y!=null)for(re in Y.key!==void 0&&(se=""+Y.key),Y)!I.call(Y,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&Y.ref===void 0||(X[re]=Y[re]);var re=arguments.length-2;if(re===1)X.children=M;else if(1<re){for(var me=Array(re),Ce=0;Ce<re;Ce++)me[Ce]=arguments[Ce+2];X.children=me}return Z(B.type,se,X)},ze.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:a,_context:B},B},ze.createElement=function(B,Y,M){var X,se={},re=null;if(Y!=null)for(X in Y.key!==void 0&&(re=""+Y.key),Y)I.call(Y,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(se[X]=Y[X]);var me=arguments.length-2;if(me===1)se.children=M;else if(1<me){for(var Ce=Array(me),pe=0;pe<me;pe++)Ce[pe]=arguments[pe+2];se.children=Ce}if(B&&B.defaultProps)for(X in me=B.defaultProps,me)se[X]===void 0&&(se[X]=me[X]);return Z(B,re,se)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(B){return{$$typeof:u,render:B}},ze.isValidElement=W,ze.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:$}},ze.memo=function(B,Y){return{$$typeof:h,type:B,compare:Y===void 0?null:Y}},ze.startTransition=function(B){var Y=j.T,M={};j.T=M;try{var X=B(),se=j.S;se!==null&&se(M,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,J)}catch(re){J(re)}finally{Y!==null&&M.types!==null&&(Y.types=M.types),j.T=Y}},ze.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},ze.use=function(B){return j.H.use(B)},ze.useActionState=function(B,Y,M){return j.H.useActionState(B,Y,M)},ze.useCallback=function(B,Y){return j.H.useCallback(B,Y)},ze.useContext=function(B){return j.H.useContext(B)},ze.useDebugValue=function(){},ze.useDeferredValue=function(B,Y){return j.H.useDeferredValue(B,Y)},ze.useEffect=function(B,Y){return j.H.useEffect(B,Y)},ze.useEffectEvent=function(B){return j.H.useEffectEvent(B)},ze.useId=function(){return j.H.useId()},ze.useImperativeHandle=function(B,Y,M){return j.H.useImperativeHandle(B,Y,M)},ze.useInsertionEffect=function(B,Y){return j.H.useInsertionEffect(B,Y)},ze.useLayoutEffect=function(B,Y){return j.H.useLayoutEffect(B,Y)},ze.useMemo=function(B,Y){return j.H.useMemo(B,Y)},ze.useOptimistic=function(B,Y){return j.H.useOptimistic(B,Y)},ze.useReducer=function(B,Y,M){return j.H.useReducer(B,Y,M)},ze.useRef=function(B){return j.H.useRef(B)},ze.useState=function(B){return j.H.useState(B)},ze.useSyncExternalStore=function(B,Y,M){return j.H.useSyncExternalStore(B,Y,M)},ze.useTransition=function(){return j.H.useTransition()},ze.version="19.2.1",ze}var RS;function q_(){return RS||(RS=1,cg.exports=qN()),cg.exports}var x=q_();const vt=mf(x),pk=UN({__proto__:null,default:vt},[x]);var ug={exports:{}},fc={},hg={exports:{}},dg={};/**
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 MS;function VN(){return MS||(MS=1,(function(e){function t(O,K){var $=O.length;O.push(K);e:for(;0<$;){var J=$-1>>>1,A=O[J];if(0<s(A,K))O[J]=K,O[$]=A,$=J;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var K=O[0],$=O.pop();if($!==K){O[0]=$;e:for(var J=0,A=O.length,B=A>>>1;J<B;){var Y=2*(J+1)-1,M=O[Y],X=Y+1,se=O[X];if(0>s(M,$))X<A&&0>s(se,M)?(O[J]=se,O[X]=$,J=X):(O[J]=M,O[Y]=$,J=Y);else if(X<A&&0>s(se,$))O[J]=se,O[X]=$,J=X;else break e}}return K}function s(O,K){var $=O.sortIndex-K.sortIndex;return $!==0?$:O.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],p=1,m=null,_=3,b=!1,S=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(O){for(var K=n(h);K!==null;){if(K.callback===null)r(h);else if(K.startTime<=O)r(h),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(h)}}function z(O){if(w=!1,D(O),!S)if(n(d)!==null)S=!0,L||(L=!0,H());else{var K=n(h);K!==null&&U(z,K.startTime-O)}}var L=!1,j=-1,I=5,Z=-1;function P(){return C?!0:!(e.unstable_now()-Z<I)}function W(){if(C=!1,L){var O=e.unstable_now();Z=O;var K=!0;try{e:{S=!1,w&&(w=!1,T(j),j=-1),b=!0;var $=_;try{t:{for(D(O),m=n(d);m!==null&&!(m.expirationTime>O&&P());){var J=m.callback;if(typeof J=="function"){m.callback=null,_=m.priorityLevel;var A=J(m.expirationTime<=O);if(O=e.unstable_now(),typeof A=="function"){m.callback=A,D(O),K=!0;break t}m===n(d)&&r(d),D(O)}else r(d);m=n(d)}if(m!==null)K=!0;else{var B=n(h);B!==null&&U(z,B.startTime-O),K=!1}}break e}finally{m=null,_=$,b=!1}K=void 0}}finally{K?H():L=!1}}}var H;if(typeof R=="function")H=function(){R(W)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,V=F.port2;F.port1.onmessage=W,H=function(){V.postMessage(null)}}else H=function(){k(W,0)};function U(O,K){j=k(function(){O(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(O){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var $=_;_=K;try{return O()}finally{_=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,K){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=_;_=O;try{return K()}finally{_=$}},e.unstable_scheduleCallback=function(O,K,$){var J=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?J+$:J):$=J,O){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=$+A,O={id:p++,callback:K,priorityLevel:O,startTime:$,expirationTime:A,sortIndex:-1},$>J?(O.sortIndex=$,t(h,O),n(d)===null&&O===n(h)&&(w?(T(j),j=-1):w=!0,U(z,$-J))):(O.sortIndex=A,t(d,O),S||b||(S=!0,L||(L=!0,H()))),O},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(O){var K=_;return function(){var $=_;_=K;try{return O.apply(this,arguments)}finally{_=$}}}})(dg)),dg}var TS;function KN(){return TS||(TS=1,hg.exports=VN()),hg.exports}var fg={exports:{}},Rn={};/**
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 AS;function GN(){if(AS)return Rn;AS=1;var e=q_();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+h+" 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(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(d,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rn.createPortal=function(d,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,p)},Rn.flushSync=function(d){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=h,r.p=p,r.d.f()}},Rn.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},Rn.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Rn.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:b}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:_,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rn.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},Rn.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=u(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rn.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},Rn.requestFormReset=function(d){r.d.r(d)},Rn.unstable_batchedUpdates=function(d,h){return d(h)},Rn.useFormState=function(d,h,p){return l.H.useFormState(d,h,p)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.1",Rn}var DS;function mk(){if(DS)return fg.exports;DS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fg.exports=GN(),fg.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 NS;function YN(){if(NS)return fc;NS=1;var e=KN(),t=q_(),n=mk();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var g=c.return;if(g===null)break;var y=g.alternate;if(y===null){if(f=g.return,f!==null){c=f;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===c)return d(g),i;if(y===f)return d(g),o;y=y.sibling}throw Error(r(188))}if(c.return!==f.return)c=g,f=y;else{for(var E=!1,N=g.child;N;){if(N===c){E=!0,c=g,f=y;break}if(N===f){E=!0,f=g,c=y;break}N=N.sibling}if(!E){for(N=y.child;N;){if(N===c){E=!0,c=y,f=g;break}if(N===f){E=!0,f=y,c=g;break}N=N.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function H(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var F=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===F?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case R:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case D:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return o=i.displayName||null,o!==null?o:V(i.type)||"Memo";case I:o=i._payload,i=i._init;try{return V(i(o))}catch{}}return null}var U=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},J=[],A=-1;function B(i){return{current:i}}function Y(i){0>A||(i.current=J[A],J[A]=null,A--)}function M(i,o){A++,J[A]=i.current,i.current=o}var X=B(null),se=B(null),re=B(null),me=B(null);function Ce(i,o){switch(M(re,o),M(se,i),M(X,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?$1(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=$1(o),i=W1(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(X),M(X,i)}function pe(){Y(X),Y(se),Y(re)}function ke(i){i.memoizedState!==null&&M(me,i);var o=X.current,c=W1(o,i.type);o!==c&&(M(se,i),M(X,c))}function Je(i){se.current===i&&(Y(X),Y(se)),me.current===i&&(Y(me),ac._currentValue=$)}var qe,Me;function Ve(i){if(qe===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);qe=o&&o[1]||"",Me=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+qe+i+Me}var Nt=!1;function It(i,o){if(!i||Nt)return"";Nt=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ie){var ne=ie}Reflect.construct(i,[],ce)}else{try{ce.call()}catch(ie){ne=ie}i.call(ce.prototype)}}else{try{throw Error()}catch(ie){ne=ie}(ce=i())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ie){if(ie&&ne&&typeof ie.stack=="string")return[ie.stack,ne.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),E=y[0],N=y[1];if(E&&N){var q=E.split(`
44
+ `),te=N.split(`
45
+ `);for(g=f=0;f<q.length&&!q[f].includes("DetermineComponentFrameRoot");)f++;for(;g<te.length&&!te[g].includes("DetermineComponentFrameRoot");)g++;if(f===q.length||g===te.length)for(f=q.length-1,g=te.length-1;1<=f&&0<=g&&q[f]!==te[g];)g--;for(;1<=f&&0<=g;f--,g--)if(q[f]!==te[g]){if(f!==1||g!==1)do if(f--,g--,0>g||q[f]!==te[g]){var oe=`
46
+ `+q[f].replace(" at new "," at ");return i.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",i.displayName)),oe}while(1<=f&&0<=g);break}}}finally{Nt=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Ve(c):""}function ir(i,o){switch(i.tag){case 26:case 27:case 5:return Ve(i.type);case 16:return Ve("Lazy");case 13:return i.child!==o&&o!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return It(i.type,!1);case 11:return It(i.type.render,!1);case 1:return It(i.type,!0);case 31:return Ve("Activity");default:return""}}function Fn(i){try{var o="",c=null;do o+=ir(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
47
+ Error generating stack: `+f.message+`
48
+ `+f.stack}}var Ht=Object.prototype.hasOwnProperty,vn=e.unstable_scheduleCallback,yr=e.unstable_cancelCallback,ri=e.unstable_shouldYield,Mi=e.unstable_requestPaint,Ft=e.unstable_now,ro=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Le=e.unstable_LowPriority,he=e.unstable_IdlePriority,ge=e.log,je=e.unstable_setDisableYieldValue,Be=null,Fe=null;function Yt(i){if(typeof ge=="function"&&je(i),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(Be,i)}catch{}}var ot=Math.clz32?Math.clz32:Qf,ii=Math.log,Un=Math.LN2;function Qf(i){return i>>>=0,i===0?32:31-(ii(i)/Un|0)|0}var Xo=256,Zo=262144,Ot=4194304;function Lt(i){var o=i&42;if(o!==0)return o;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function sn(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var g=0,y=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var N=f&134217727;return N!==0?(f=N&~y,f!==0?g=Lt(f):(E&=N,E!==0?g=Lt(E):c||(c=N&~i,c!==0&&(g=Lt(c))))):(N=f&~y,N!==0?g=Lt(N):E!==0?g=Lt(E):c||(c=f&~i,c!==0&&(g=Lt(c)))),g===0?0:o!==0&&o!==g&&(o&y)===0&&(y=g&-g,c=o&-o,y>=c||y===32&&(c&4194048)!==0)?o:g}function $n(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Wn(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 En(){var i=Ot;return Ot<<=1,(Ot&62914560)===0&&(Ot=4194304),i}function qn(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function br(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Xt(i,o,c,f,g,y){var E=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,te=i.hiddenUpdates;for(c=E&~c;0<c;){var oe=31-ot(c),ce=1<<oe;N[oe]=0,q[oe]=-1;var ne=te[oe];if(ne!==null)for(te[oe]=null,oe=0;oe<ne.length;oe++){var ie=ne[oe];ie!==null&&(ie.lane&=-536870913)}c&=~ce}f!==0&&$r(i,f,0),y!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=y&~(E&~o))}function $r(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-ot(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function sr(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-ot(c),g=1<<f;g&o|i[f]&o&&(i[f]|=o),c&=~g}}function xr(i,o){var c=o&-o;return c=(c&42)!==0?1:Ti(c),(c&(i.suspendedLanes|o))!==0?0:c}function Ti(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ai(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Wr(){var i=K.p;return i!==0?i:(i=window.event,i===void 0?32:fS(i.type))}function cs(i,o){var c=K.p;try{return K.p=i,o()}finally{K.p=c}}var Sr=Math.random().toString(36).slice(2),_n="__reactFiber$"+Sr,Vn="__reactProps$"+Sr,Qo="__reactContainer$"+Sr,Jf="__reactEvents$"+Sr,T5="__reactListeners$"+Sr,A5="__reactHandles$"+Sr,Ab="__reactResources$"+Sr,Sl="__reactMarker$"+Sr;function ep(i){delete i[_n],delete i[Vn],delete i[Jf],delete i[T5],delete i[A5]}function Jo(i){var o=i[_n];if(o)return o;for(var c=i.parentNode;c;){if(o=c[Qo]||c[_n]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=Z1(i);i!==null;){if(c=i[_n])return c;i=Z1(i)}return o}i=c,c=i.parentNode}return null}function ea(i){if(i=i[_n]||i[Qo]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function wl(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function ta(i){var o=i[Ab];return o||(o=i[Ab]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function on(i){i[Sl]=!0}var Db=new Set,Nb={};function io(i,o){na(i,o),na(i+"Capture",o)}function na(i,o){for(Nb[i]=o,i=0;i<o.length;i++)Db.add(o[i])}var D5=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]*$"),Ob={},Lb={};function N5(i){return Ht.call(Lb,i)?!0:Ht.call(Ob,i)?!1:D5.test(i)?Lb[i]=!0:(Ob[i]=!0,!1)}function Nu(i,o,c){if(N5(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function Ou(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Di(i,o,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+f)}}function wr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function zb(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function O5(i,o,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,y=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(E){c=""+E,y.call(this,E)}}),Object.defineProperty(i,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function tp(i){if(!i._valueTracker){var o=zb(i)?"checked":"value";i._valueTracker=O5(i,o,""+i[o])}}function jb(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=zb(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function Lu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var L5=/[\n"\\]/g;function Cr(i){return i.replace(L5,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function np(i,o,c,f,g,y,E,N){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),o!=null?E==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+wr(o)):i.value!==""+wr(o)&&(i.value=""+wr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?rp(i,E,wr(o)):c!=null?rp(i,E,wr(c)):f!=null&&i.removeAttribute("value"),g==null&&y!=null&&(i.defaultChecked=!!y),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+wr(N):i.removeAttribute("name")}function Bb(i,o,c,f,g,y,E,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null)){tp(i);return}c=c!=null?""+wr(c):"",o=o!=null?""+wr(o):c,N||o===i.value||(i.value=o),i.defaultValue=o}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=N?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),tp(i)}function rp(i,o,c){o==="number"&&Lu(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function ra(i,o,c,f){if(i=i.options,o){o={};for(var g=0;g<c.length;g++)o["$"+c[g]]=!0;for(c=0;c<i.length;c++)g=o.hasOwnProperty("$"+i[c].value),i[c].selected!==g&&(i[c].selected=g),g&&f&&(i[c].defaultSelected=!0)}else{for(c=""+wr(c),o=null,g=0;g<i.length;g++){if(i[g].value===c){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function Pb(i,o,c){if(o!=null&&(o=""+wr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+wr(c):""}function Ib(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(U(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=wr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),tp(i)}function ia(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var z5=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 Hb(i,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":f?i.setProperty(o,c):typeof c!="number"||c===0||z5.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function Fb(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var g in o)f=o[g],o.hasOwnProperty(g)&&c[g]!==f&&Hb(i,g,f)}else for(var y in o)o.hasOwnProperty(y)&&Hb(i,y,o[y])}function ip(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var j5=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"]]),B5=/^[\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 zu(i){return B5.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ni(){}var sp=null;function op(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var sa=null,oa=null;function Ub(i){var o=ea(i);if(o&&(i=o.stateNode)){var c=i[Vn]||null;e:switch(i=o.stateNode,o.type){case"input":if(np(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var g=f[Vn]||null;if(!g)throw Error(r(90));np(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&jb(f)}break e;case"textarea":Pb(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&ra(i,!!c.multiple,o,!1)}}}var ap=!1;function $b(i,o,c){if(ap)return i(o,c);ap=!0;try{var f=i(o);return f}finally{if(ap=!1,(sa!==null||oa!==null)&&(Sh(),sa&&(o=sa,i=oa,oa=sa=null,Ub(o),i)))for(o=0;o<i.length;o++)Ub(i[o])}}function Cl(i,o){var c=i.stateNode;if(c===null)return null;var f=c[Vn]||null;if(f===null)return null;c=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lp=!1;if(Oi)try{var kl={};Object.defineProperty(kl,"passive",{get:function(){lp=!0}}),window.addEventListener("test",kl,kl),window.removeEventListener("test",kl,kl)}catch{lp=!1}var us=null,cp=null,ju=null;function Wb(){if(ju)return ju;var i,o=cp,c=o.length,f,g="value"in us?us.value:us.textContent,y=g.length;for(i=0;i<c&&o[i]===g[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===g[y-f];f++);return ju=g.slice(i,1<f?1-f:void 0)}function Bu(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Pu(){return!0}function qb(){return!1}function Kn(i){function o(c,f,g,y,E){this._reactName=c,this._targetInst=g,this.type=f,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(c=i[N],this[N]=c?c(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Pu:qb,this.isPropagationStopped=qb,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Pu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Pu)},persist:function(){},isPersistent:Pu}),o}var so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Iu=Kn(so),El=m({},so,{view:0,detail:0}),P5=Kn(El),up,hp,Rl,Hu=m({},El,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fp,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Rl&&(Rl&&i.type==="mousemove"?(up=i.screenX-Rl.screenX,hp=i.screenY-Rl.screenY):hp=up=0,Rl=i),up)},movementY:function(i){return"movementY"in i?i.movementY:hp}}),Vb=Kn(Hu),I5=m({},Hu,{dataTransfer:0}),H5=Kn(I5),F5=m({},El,{relatedTarget:0}),dp=Kn(F5),U5=m({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),$5=Kn(U5),W5=m({},so,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),q5=Kn(W5),V5=m({},so,{data:0}),Kb=Kn(V5),K5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G5={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"},Y5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function X5(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Y5[i])?!!o[i]:!1}function fp(){return X5}var Z5=m({},El,{key:function(i){if(i.key){var o=K5[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Bu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?G5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fp,charCode:function(i){return i.type==="keypress"?Bu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Bu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Q5=Kn(Z5),J5=m({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gb=Kn(J5),eD=m({},El,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fp}),tD=Kn(eD),nD=m({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),rD=Kn(nD),iD=m({},Hu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),sD=Kn(iD),oD=m({},so,{newState:0,oldState:0}),aD=Kn(oD),lD=[9,13,27,32],pp=Oi&&"CompositionEvent"in window,Ml=null;Oi&&"documentMode"in document&&(Ml=document.documentMode);var cD=Oi&&"TextEvent"in window&&!Ml,Yb=Oi&&(!pp||Ml&&8<Ml&&11>=Ml),Xb=" ",Zb=!1;function Qb(i,o){switch(i){case"keyup":return lD.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jb(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var aa=!1;function uD(i,o){switch(i){case"compositionend":return Jb(o);case"keypress":return o.which!==32?null:(Zb=!0,Xb);case"textInput":return i=o.data,i===Xb&&Zb?null:i;default:return null}}function hD(i,o){if(aa)return i==="compositionend"||!pp&&Qb(i,o)?(i=Wb(),ju=cp=us=null,aa=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Yb&&o.locale!=="ko"?null:o.data;default:return null}}var dD={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 e0(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!dD[i.type]:o==="textarea"}function t0(i,o,c,f){sa?oa?oa.push(f):oa=[f]:sa=f,o=Th(o,"onChange"),0<o.length&&(c=new Iu("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var Tl=null,Al=null;function fD(i){B1(i,0)}function Fu(i){var o=wl(i);if(jb(o))return i}function n0(i,o){if(i==="change")return o}var r0=!1;if(Oi){var mp;if(Oi){var gp="oninput"in document;if(!gp){var i0=document.createElement("div");i0.setAttribute("oninput","return;"),gp=typeof i0.oninput=="function"}mp=gp}else mp=!1;r0=mp&&(!document.documentMode||9<document.documentMode)}function s0(){Tl&&(Tl.detachEvent("onpropertychange",o0),Al=Tl=null)}function o0(i){if(i.propertyName==="value"&&Fu(Al)){var o=[];t0(o,Al,i,op(i)),$b(fD,o)}}function pD(i,o,c){i==="focusin"?(s0(),Tl=o,Al=c,Tl.attachEvent("onpropertychange",o0)):i==="focusout"&&s0()}function mD(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Fu(Al)}function gD(i,o){if(i==="click")return Fu(o)}function vD(i,o){if(i==="input"||i==="change")return Fu(o)}function _D(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var or=typeof Object.is=="function"?Object.is:_D;function Dl(i,o){if(or(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var g=c[f];if(!Ht.call(o,g)||!or(i[g],o[g]))return!1}return!0}function a0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function l0(i,o){var c=a0(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=o&&f>=o)return{node:c,offset:o-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=a0(c)}}function c0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?c0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function u0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Lu(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=Lu(i.document)}return o}function vp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var yD=Oi&&"documentMode"in document&&11>=document.documentMode,la=null,_p=null,Nl=null,yp=!1;function h0(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;yp||la==null||la!==Lu(f)||(f=la,"selectionStart"in f&&vp(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Nl&&Dl(Nl,f)||(Nl=f,f=Th(_p,"onSelect"),0<f.length&&(o=new Iu("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=la)))}function oo(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var ca={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionrun:oo("Transition","TransitionRun"),transitionstart:oo("Transition","TransitionStart"),transitioncancel:oo("Transition","TransitionCancel"),transitionend:oo("Transition","TransitionEnd")},bp={},d0={};Oi&&(d0=document.createElement("div").style,"AnimationEvent"in window||(delete ca.animationend.animation,delete ca.animationiteration.animation,delete ca.animationstart.animation),"TransitionEvent"in window||delete ca.transitionend.transition);function ao(i){if(bp[i])return bp[i];if(!ca[i])return i;var o=ca[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in d0)return bp[i]=o[c];return i}var f0=ao("animationend"),p0=ao("animationiteration"),m0=ao("animationstart"),bD=ao("transitionrun"),xD=ao("transitionstart"),SD=ao("transitioncancel"),g0=ao("transitionend"),v0=new Map,xp="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(" ");xp.push("scrollEnd");function qr(i,o){v0.set(i,o),io(o,[i])}var Uu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},kr=[],ua=0,Sp=0;function $u(){for(var i=ua,o=Sp=ua=0;o<i;){var c=kr[o];kr[o++]=null;var f=kr[o];kr[o++]=null;var g=kr[o];kr[o++]=null;var y=kr[o];if(kr[o++]=null,f!==null&&g!==null){var E=f.pending;E===null?g.next=g:(g.next=E.next,E.next=g),f.pending=g}y!==0&&_0(c,g,y)}}function Wu(i,o,c,f){kr[ua++]=i,kr[ua++]=o,kr[ua++]=c,kr[ua++]=f,Sp|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function wp(i,o,c,f){return Wu(i,o,c,f),qu(i)}function lo(i,o){return Wu(i,null,null,o),qu(i)}function _0(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var g=!1,y=i.return;y!==null;)y.childLanes|=c,f=y.alternate,f!==null&&(f.childLanes|=c),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(g=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,g&&o!==null&&(g=31-ot(c),i=y.hiddenUpdates,f=i[g],f===null?i[g]=[o]:f.push(o),o.lane=c|536870912),y):null}function qu(i){if(50<ec)throw ec=0,Nm=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var ha={};function wD(i,o,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(i,o,c,f){return new wD(i,o,c,f)}function Cp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Li(i,o){var c=i.alternate;return c===null?(c=ar(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function y0(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Vu(i,o,c,f,g,y){var E=0;if(f=i,typeof i=="function")Cp(i)&&(E=1);else if(typeof i=="string")E=MN(i,c,X.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=ar(31,c,o,g),i.elementType=Z,i.lanes=y,i;case w:return co(c.children,g,y,o);case C:E=8,g|=24;break;case k:return i=ar(12,c,o,g|2),i.elementType=k,i.lanes=y,i;case z:return i=ar(13,c,o,g),i.elementType=z,i.lanes=y,i;case L:return i=ar(19,c,o,g),i.elementType=L,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case T:E=9;break e;case D:E=11;break e;case j:E=14;break e;case I:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=ar(E,c,o,g),o.elementType=i,o.type=f,o.lanes=y,o}function co(i,o,c,f){return i=ar(7,i,f,o),i.lanes=c,i}function kp(i,o,c){return i=ar(6,i,null,o),i.lanes=c,i}function b0(i){var o=ar(18,null,null,0);return o.stateNode=i,o}function Ep(i,o,c){return o=ar(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var x0=new WeakMap;function Er(i,o){if(typeof i=="object"&&i!==null){var c=x0.get(i);return c!==void 0?c:(o={value:i,source:o,stack:Fn(o)},x0.set(i,o),o)}return{value:i,source:o,stack:Fn(o)}}var da=[],fa=0,Ku=null,Ol=0,Rr=[],Mr=0,hs=null,si=1,oi="";function zi(i,o){da[fa++]=Ol,da[fa++]=Ku,Ku=i,Ol=o}function S0(i,o,c){Rr[Mr++]=si,Rr[Mr++]=oi,Rr[Mr++]=hs,hs=i;var f=si;i=oi;var g=32-ot(f)-1;f&=~(1<<g),c+=1;var y=32-ot(o)+g;if(30<y){var E=g-g%5;y=(f&(1<<E)-1).toString(32),f>>=E,g-=E,si=1<<32-ot(o)+g|c<<g|f,oi=y+i}else si=1<<y|c<<g|f,oi=i}function Rp(i){i.return!==null&&(zi(i,1),S0(i,1,0))}function Mp(i){for(;i===Ku;)Ku=da[--fa],da[fa]=null,Ol=da[--fa],da[fa]=null;for(;i===hs;)hs=Rr[--Mr],Rr[Mr]=null,oi=Rr[--Mr],Rr[Mr]=null,si=Rr[--Mr],Rr[Mr]=null}function w0(i,o){Rr[Mr++]=si,Rr[Mr++]=oi,Rr[Mr++]=hs,si=o.id,oi=o.overflow,hs=i}var yn=null,_t=null,Qe=!1,ds=null,Tr=!1,Tp=Error(r(519));function fs(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ll(Er(o,i)),Tp}function C0(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[_n]=i,o[Vn]=f,c){case"dialog":Ge("cancel",o),Ge("close",o);break;case"iframe":case"object":case"embed":Ge("load",o);break;case"video":case"audio":for(c=0;c<nc.length;c++)Ge(nc[c],o);break;case"source":Ge("error",o);break;case"img":case"image":case"link":Ge("error",o),Ge("load",o);break;case"details":Ge("toggle",o);break;case"input":Ge("invalid",o),Bb(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ge("invalid",o);break;case"textarea":Ge("invalid",o),Ib(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||F1(o.textContent,c)?(f.popover!=null&&(Ge("beforetoggle",o),Ge("toggle",o)),f.onScroll!=null&&Ge("scroll",o),f.onScrollEnd!=null&&Ge("scrollend",o),f.onClick!=null&&(o.onclick=Ni),o=!0):o=!1,o||fs(i,!0)}function k0(i){for(yn=i.return;yn;)switch(yn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:yn=yn.return}}function pa(i){if(i!==yn)return!1;if(!Qe)return k0(i),Qe=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Km(i.type,i.memoizedProps)),c=!c),c&&_t&&fs(i),k0(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));_t=X1(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));_t=X1(i)}else o===27?(o=_t,Rs(i.type)?(i=Qm,Qm=null,_t=i):_t=o):_t=yn?Dr(i.stateNode.nextSibling):null;return!0}function uo(){_t=yn=null,Qe=!1}function Ap(){var i=ds;return i!==null&&(Zn===null?Zn=i:Zn.push.apply(Zn,i),ds=null),i}function Ll(i){ds===null?ds=[i]:ds.push(i)}var Dp=B(null),ho=null,ji=null;function ps(i,o,c){M(Dp,o._currentValue),o._currentValue=c}function Bi(i){i._currentValue=Dp.current,Y(Dp)}function Np(i,o,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===c)break;i=i.return}}function Op(i,o,c,f){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var y=g.dependencies;if(y!==null){var E=g.child;y=y.firstContext;e:for(;y!==null;){var N=y;y=g;for(var q=0;q<o.length;q++)if(N.context===o[q]){y.lanes|=c,N=y.alternate,N!==null&&(N.lanes|=c),Np(y.return,c,i),f||(E=null);break e}y=N.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=c,y=E.alternate,y!==null&&(y.lanes|=c),Np(E,c,i),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===i){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function ma(i,o,c,f){i=null;for(var g=o,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var N=g.type;or(g.pendingProps.value,E.value)||(i!==null?i.push(N):i=[N])}}else if(g===me.current){if(E=g.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(ac):i=[ac])}g=g.return}i!==null&&Op(o,i,c,f),o.flags|=262144}function Gu(i){for(i=i.firstContext;i!==null;){if(!or(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function fo(i){ho=i,ji=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function bn(i){return E0(ho,i)}function Yu(i,o){return ho===null&&fo(i),E0(i,o)}function E0(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},ji===null){if(i===null)throw Error(r(308));ji=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ji=ji.next=o;return c}var CD=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},kD=e.unstable_scheduleCallback,ED=e.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lp(){return{controller:new CD,data:new Map,refCount:0}}function zl(i){i.refCount--,i.refCount===0&&kD(ED,function(){i.controller.abort()})}var jl=null,zp=0,ga=0,va=null;function RD(i,o){if(jl===null){var c=jl=[];zp=0,ga=Pm(),va={status:"pending",value:void 0,then:function(f){c.push(f)}}}return zp++,o.then(R0,R0),o}function R0(){if(--zp===0&&jl!==null){va!==null&&(va.status="fulfilled");var i=jl;jl=null,ga=0,va=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function MD(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var g=0;g<c.length;g++)(0,c[g])(o)},function(g){for(f.status="rejected",f.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),f}var M0=O.S;O.S=function(i,o){h1=Ft(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&RD(i,o),M0!==null&&M0(i,o)};var po=B(null);function jp(){var i=po.current;return i!==null?i:pt.pooledCache}function Xu(i,o){o===null?M(po,po.current):M(po,o.pool)}function T0(){var i=jp();return i===null?null:{parent:Ut._currentValue,pool:i}}var _a=Error(r(460)),Bp=Error(r(474)),Zu=Error(r(542)),Qu={then:function(){}};function A0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function D0(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Ni,Ni),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,O0(i),i;default:if(typeof o.status=="string")o.then(Ni,Ni);else{if(i=pt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=f}},function(f){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,O0(i),i}throw go=o,_a}}function mo(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(go=c,_a):c}}var go=null;function N0(){if(go===null)throw Error(r(459));var i=go;return go=null,i}function O0(i){if(i===_a||i===Zu)throw Error(r(483))}var ya=null,Bl=0;function Ju(i){var o=Bl;return Bl+=1,ya===null&&(ya=[]),D0(ya,i,o)}function Pl(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function eh(i,o){throw o.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function L0(i){function o(Q,G){if(i){var ee=Q.deletions;ee===null?(Q.deletions=[G],Q.flags|=16):ee.push(G)}}function c(Q,G){if(!i)return null;for(;G!==null;)o(Q,G),G=G.sibling;return null}function f(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function g(Q,G){return Q=Li(Q,G),Q.index=0,Q.sibling=null,Q}function y(Q,G,ee){return Q.index=ee,i?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<G?(Q.flags|=67108866,G):ee):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function E(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,G,ee,le){return G===null||G.tag!==6?(G=kp(ee,Q.mode,le),G.return=Q,G):(G=g(G,ee),G.return=Q,G)}function q(Q,G,ee,le){var Te=ee.type;return Te===w?oe(Q,G,ee.props.children,le,ee.key):G!==null&&(G.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===I&&mo(Te)===G.type)?(G=g(G,ee.props),Pl(G,ee),G.return=Q,G):(G=Vu(ee.type,ee.key,ee.props,null,Q.mode,le),Pl(G,ee),G.return=Q,G)}function te(Q,G,ee,le){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=Ep(ee,Q.mode,le),G.return=Q,G):(G=g(G,ee.children||[]),G.return=Q,G)}function oe(Q,G,ee,le,Te){return G===null||G.tag!==7?(G=co(ee,Q.mode,le,Te),G.return=Q,G):(G=g(G,ee),G.return=Q,G)}function ce(Q,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=kp(""+G,Q.mode,ee),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return ee=Vu(G.type,G.key,G.props,null,Q.mode,ee),Pl(ee,G),ee.return=Q,ee;case S:return G=Ep(G,Q.mode,ee),G.return=Q,G;case I:return G=mo(G),ce(Q,G,ee)}if(U(G)||H(G))return G=co(G,Q.mode,ee,null),G.return=Q,G;if(typeof G.then=="function")return ce(Q,Ju(G),ee);if(G.$$typeof===R)return ce(Q,Yu(Q,G),ee);eh(Q,G)}return null}function ne(Q,G,ee,le){var Te=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Te!==null?null:N(Q,G,""+ee,le);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Te?q(Q,G,ee,le):null;case S:return ee.key===Te?te(Q,G,ee,le):null;case I:return ee=mo(ee),ne(Q,G,ee,le)}if(U(ee)||H(ee))return Te!==null?null:oe(Q,G,ee,le,null);if(typeof ee.then=="function")return ne(Q,G,Ju(ee),le);if(ee.$$typeof===R)return ne(Q,G,Yu(Q,ee),le);eh(Q,ee)}return null}function ie(Q,G,ee,le,Te){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Q=Q.get(ee)||null,N(G,Q,""+le,Te);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return Q=Q.get(le.key===null?ee:le.key)||null,q(G,Q,le,Te);case S:return Q=Q.get(le.key===null?ee:le.key)||null,te(G,Q,le,Te);case I:return le=mo(le),ie(Q,G,ee,le,Te)}if(U(le)||H(le))return Q=Q.get(ee)||null,oe(G,Q,le,Te,null);if(typeof le.then=="function")return ie(Q,G,ee,Ju(le),Te);if(le.$$typeof===R)return ie(Q,G,ee,Yu(G,le),Te);eh(G,le)}return null}function be(Q,G,ee,le){for(var Te=null,nt=null,we=G,Ie=G=0,Ze=null;we!==null&&Ie<ee.length;Ie++){we.index>Ie?(Ze=we,we=null):Ze=we.sibling;var rt=ne(Q,we,ee[Ie],le);if(rt===null){we===null&&(we=Ze);break}i&&we&&rt.alternate===null&&o(Q,we),G=y(rt,G,Ie),nt===null?Te=rt:nt.sibling=rt,nt=rt,we=Ze}if(Ie===ee.length)return c(Q,we),Qe&&zi(Q,Ie),Te;if(we===null){for(;Ie<ee.length;Ie++)we=ce(Q,ee[Ie],le),we!==null&&(G=y(we,G,Ie),nt===null?Te=we:nt.sibling=we,nt=we);return Qe&&zi(Q,Ie),Te}for(we=f(we);Ie<ee.length;Ie++)Ze=ie(we,Q,Ie,ee[Ie],le),Ze!==null&&(i&&Ze.alternate!==null&&we.delete(Ze.key===null?Ie:Ze.key),G=y(Ze,G,Ie),nt===null?Te=Ze:nt.sibling=Ze,nt=Ze);return i&&we.forEach(function(Ns){return o(Q,Ns)}),Qe&&zi(Q,Ie),Te}function De(Q,G,ee,le){if(ee==null)throw Error(r(151));for(var Te=null,nt=null,we=G,Ie=G=0,Ze=null,rt=ee.next();we!==null&&!rt.done;Ie++,rt=ee.next()){we.index>Ie?(Ze=we,we=null):Ze=we.sibling;var Ns=ne(Q,we,rt.value,le);if(Ns===null){we===null&&(we=Ze);break}i&&we&&Ns.alternate===null&&o(Q,we),G=y(Ns,G,Ie),nt===null?Te=Ns:nt.sibling=Ns,nt=Ns,we=Ze}if(rt.done)return c(Q,we),Qe&&zi(Q,Ie),Te;if(we===null){for(;!rt.done;Ie++,rt=ee.next())rt=ce(Q,rt.value,le),rt!==null&&(G=y(rt,G,Ie),nt===null?Te=rt:nt.sibling=rt,nt=rt);return Qe&&zi(Q,Ie),Te}for(we=f(we);!rt.done;Ie++,rt=ee.next())rt=ie(we,Q,Ie,rt.value,le),rt!==null&&(i&&rt.alternate!==null&&we.delete(rt.key===null?Ie:rt.key),G=y(rt,G,Ie),nt===null?Te=rt:nt.sibling=rt,nt=rt);return i&&we.forEach(function(IN){return o(Q,IN)}),Qe&&zi(Q,Ie),Te}function ht(Q,G,ee,le){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Te=ee.key;G!==null;){if(G.key===Te){if(Te=ee.type,Te===w){if(G.tag===7){c(Q,G.sibling),le=g(G,ee.props.children),le.return=Q,Q=le;break e}}else if(G.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===I&&mo(Te)===G.type){c(Q,G.sibling),le=g(G,ee.props),Pl(le,ee),le.return=Q,Q=le;break e}c(Q,G);break}else o(Q,G);G=G.sibling}ee.type===w?(le=co(ee.props.children,Q.mode,le,ee.key),le.return=Q,Q=le):(le=Vu(ee.type,ee.key,ee.props,null,Q.mode,le),Pl(le,ee),le.return=Q,Q=le)}return E(Q);case S:e:{for(Te=ee.key;G!==null;){if(G.key===Te)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){c(Q,G.sibling),le=g(G,ee.children||[]),le.return=Q,Q=le;break e}else{c(Q,G);break}else o(Q,G);G=G.sibling}le=Ep(ee,Q.mode,le),le.return=Q,Q=le}return E(Q);case I:return ee=mo(ee),ht(Q,G,ee,le)}if(U(ee))return be(Q,G,ee,le);if(H(ee)){if(Te=H(ee),typeof Te!="function")throw Error(r(150));return ee=Te.call(ee),De(Q,G,ee,le)}if(typeof ee.then=="function")return ht(Q,G,Ju(ee),le);if(ee.$$typeof===R)return ht(Q,G,Yu(Q,ee),le);eh(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(c(Q,G.sibling),le=g(G,ee),le.return=Q,Q=le):(c(Q,G),le=kp(ee,Q.mode,le),le.return=Q,Q=le),E(Q)):c(Q,G)}return function(Q,G,ee,le){try{Bl=0;var Te=ht(Q,G,ee,le);return ya=null,Te}catch(we){if(we===_a||we===Zu)throw we;var nt=ar(29,we,null,Q.mode);return nt.lanes=le,nt.return=Q,nt}finally{}}}var vo=L0(!0),z0=L0(!1),ms=!1;function Pp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ip(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function gs(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function vs(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(it&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,o=qu(i),_0(i,null,c),o}return Wu(i,f,o,c),qu(i)}function Il(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,sr(i,c)}}function Hp(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var g=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?g=y=E:y=y.next=E,c=c.next}while(c!==null);y===null?g=y=o:y=y.next=o}else g=y=o;c={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var Fp=!1;function Hl(){if(Fp){var i=va;if(i!==null)throw i}}function Fl(i,o,c,f){Fp=!1;var g=i.updateQueue;ms=!1;var y=g.firstBaseUpdate,E=g.lastBaseUpdate,N=g.shared.pending;if(N!==null){g.shared.pending=null;var q=N,te=q.next;q.next=null,E===null?y=te:E.next=te,E=q;var oe=i.alternate;oe!==null&&(oe=oe.updateQueue,N=oe.lastBaseUpdate,N!==E&&(N===null?oe.firstBaseUpdate=te:N.next=te,oe.lastBaseUpdate=q))}if(y!==null){var ce=g.baseState;E=0,oe=te=q=null,N=y;do{var ne=N.lane&-536870913,ie=ne!==N.lane;if(ie?(Xe&ne)===ne:(f&ne)===ne){ne!==0&&ne===ga&&(Fp=!0),oe!==null&&(oe=oe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var be=i,De=N;ne=o;var ht=c;switch(De.tag){case 1:if(be=De.payload,typeof be=="function"){ce=be.call(ht,ce,ne);break e}ce=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=De.payload,ne=typeof be=="function"?be.call(ht,ce,ne):be,ne==null)break e;ce=m({},ce,ne);break e;case 2:ms=!0}}ne=N.callback,ne!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=g.callbacks,ie===null?g.callbacks=[ne]:ie.push(ne))}else ie={lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},oe===null?(te=oe=ie,q=ce):oe=oe.next=ie,E|=ne;if(N=N.next,N===null){if(N=g.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,g.lastBaseUpdate=ie,g.shared.pending=null}}while(!0);oe===null&&(q=ce),g.baseState=q,g.firstBaseUpdate=te,g.lastBaseUpdate=oe,y===null&&(g.shared.lanes=0),Ss|=E,i.lanes=E,i.memoizedState=ce}}function j0(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function B0(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)j0(c[i],o)}var ba=B(null),th=B(0);function P0(i,o){i=Vi,M(th,i),M(ba,o),Vi=i|o.baseLanes}function Up(){M(th,Vi),M(ba,ba.current)}function $p(){Vi=th.current,Y(ba),Y(th)}var lr=B(null),Ar=null;function _s(i){var o=i.alternate;M(zt,zt.current&1),M(lr,i),Ar===null&&(o===null||ba.current!==null||o.memoizedState!==null)&&(Ar=i)}function Wp(i){M(zt,zt.current),M(lr,i),Ar===null&&(Ar=i)}function I0(i){i.tag===22?(M(zt,zt.current),M(lr,i),Ar===null&&(Ar=i)):ys()}function ys(){M(zt,zt.current),M(lr,lr.current)}function cr(i){Y(lr),Ar===i&&(Ar=null),Y(zt)}var zt=B(0);function nh(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Xm(c)||Zm(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Pi=0,Pe=null,ct=null,$t=null,rh=!1,xa=!1,_o=!1,ih=0,Ul=0,Sa=null,TD=0;function Rt(){throw Error(r(321))}function qp(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!or(i[c],o[c]))return!1;return!0}function Vp(i,o,c,f,g,y){return Pi=y,Pe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,O.H=i===null||i.memoizedState===null?Sx:am,_o=!1,y=c(f,g),_o=!1,xa&&(y=F0(o,c,f,g)),H0(i),y}function H0(i){O.H=ql;var o=ct!==null&&ct.next!==null;if(Pi=0,$t=ct=Pe=null,rh=!1,Ul=0,Sa=null,o)throw Error(r(300));i===null||Wt||(i=i.dependencies,i!==null&&Gu(i)&&(Wt=!0))}function F0(i,o,c,f){Pe=i;var g=0;do{if(xa&&(Sa=null),Ul=0,xa=!1,25<=g)throw Error(r(301));if(g+=1,$t=ct=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}O.H=wx,y=o(c,f)}while(xa);return y}function AD(){var i=O.H,o=i.useState()[0];return o=typeof o.then=="function"?$l(o):o,i=i.useState()[0],(ct!==null?ct.memoizedState:null)!==i&&(Pe.flags|=1024),o}function Kp(){var i=ih!==0;return ih=0,i}function Gp(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Yp(i){if(rh){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}rh=!1}Pi=0,$t=ct=Pe=null,xa=!1,Ul=ih=0,Sa=null}function Nn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Pe.memoizedState=$t=i:$t=$t.next=i,$t}function jt(){if(ct===null){var i=Pe.alternate;i=i!==null?i.memoizedState:null}else i=ct.next;var o=$t===null?Pe.memoizedState:$t.next;if(o!==null)$t=o,ct=i;else{if(i===null)throw Pe.alternate===null?Error(r(467)):Error(r(310));ct=i,i={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},$t===null?Pe.memoizedState=$t=i:$t=$t.next=i}return $t}function sh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $l(i){var o=Ul;return Ul+=1,Sa===null&&(Sa=[]),i=D0(Sa,i,o),o=Pe,($t===null?o.memoizedState:$t.next)===null&&(o=o.alternate,O.H=o===null||o.memoizedState===null?Sx:am),i}function oh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return $l(i);if(i.$$typeof===R)return bn(i)}throw Error(r(438,String(i)))}function Xp(i){var o=null,c=Pe.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=Pe.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=sh(),Pe.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=P;return o.index++,c}function Ii(i,o){return typeof o=="function"?o(i):o}function ah(i){var o=jt();return Zp(o,ct,i)}function Zp(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var g=i.baseQueue,y=f.pending;if(y!==null){if(g!==null){var E=g.next;g.next=y.next,y.next=E}o.baseQueue=g=y,f.pending=null}if(y=i.baseState,g===null)i.memoizedState=y;else{o=g.next;var N=E=null,q=null,te=o,oe=!1;do{var ce=te.lane&-536870913;if(ce!==te.lane?(Xe&ce)===ce:(Pi&ce)===ce){var ne=te.revertLane;if(ne===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ce===ga&&(oe=!0);else if((Pi&ne)===ne){te=te.next,ne===ga&&(oe=!0);continue}else ce={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(N=q=ce,E=y):q=q.next=ce,Pe.lanes|=ne,Ss|=ne;ce=te.action,_o&&c(y,ce),y=te.hasEagerState?te.eagerState:c(y,ce)}else ne={lane:ce,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},q===null?(N=q=ne,E=y):q=q.next=ne,Pe.lanes|=ce,Ss|=ce;te=te.next}while(te!==null&&te!==o);if(q===null?E=y:q.next=N,!or(y,i.memoizedState)&&(Wt=!0,oe&&(c=va,c!==null)))throw c;i.memoizedState=y,i.baseState=E,i.baseQueue=q,f.lastRenderedState=y}return g===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Qp(i){var o=jt(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,g=c.pending,y=o.memoizedState;if(g!==null){c.pending=null;var E=g=g.next;do y=i(y,E.action),E=E.next;while(E!==g);or(y,o.memoizedState)||(Wt=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),c.lastRenderedState=y}return[y,f]}function U0(i,o,c){var f=Pe,g=jt(),y=Qe;if(y){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!or((ct||g).memoizedState,c);if(E&&(g.memoizedState=c,Wt=!0),g=g.queue,tm(q0.bind(null,f,g,i),[i]),g.getSnapshot!==o||E||$t!==null&&$t.memoizedState.tag&1){if(f.flags|=2048,wa(9,{destroy:void 0},W0.bind(null,f,g,c,o),null),pt===null)throw Error(r(349));y||(Pi&127)!==0||$0(f,o,c)}return c}function $0(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=Pe.updateQueue,o===null?(o=sh(),Pe.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function W0(i,o,c,f){o.value=c,o.getSnapshot=f,V0(o)&&K0(i)}function q0(i,o,c){return c(function(){V0(o)&&K0(i)})}function V0(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!or(i,c)}catch{return!0}}function K0(i){var o=lo(i,2);o!==null&&Qn(o,i,2)}function Jp(i){var o=Nn();if(typeof i=="function"){var c=i;if(i=c(),_o){Yt(!0);try{c()}finally{Yt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:i},o}function G0(i,o,c,f){return i.baseState=c,Zp(i,ct,typeof f=="function"?f:Ii)}function DD(i,o,c,f,g){if(uh(i))throw Error(r(485));if(i=o.action,i!==null){var y={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};O.T!==null?c(!0):y.isTransition=!1,f(y),c=o.pending,c===null?(y.next=o.pending=y,Y0(o,y)):(y.next=c.next,o.pending=c.next=y)}}function Y0(i,o){var c=o.action,f=o.payload,g=i.state;if(o.isTransition){var y=O.T,E={};O.T=E;try{var N=c(g,f),q=O.S;q!==null&&q(E,N),X0(i,o,N)}catch(te){em(i,o,te)}finally{y!==null&&E.types!==null&&(y.types=E.types),O.T=y}}else try{y=c(g,f),X0(i,o,y)}catch(te){em(i,o,te)}}function X0(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){Z0(i,o,f)},function(f){return em(i,o,f)}):Z0(i,o,c)}function Z0(i,o,c){o.status="fulfilled",o.value=c,Q0(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,Y0(i,c)))}function em(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,Q0(o),o=o.next;while(o!==f)}i.action=null}function Q0(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function J0(i,o){return o}function ex(i,o){if(Qe){var c=pt.formState;if(c!==null){e:{var f=Pe;if(Qe){if(_t){t:{for(var g=_t,y=Tr;g.nodeType!==8;){if(!y){g=null;break t}if(g=Dr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){_t=Dr(g.nextSibling),f=g.data==="F!";break e}}fs(f)}f=!1}f&&(o=c[0])}}return c=Nn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:J0,lastRenderedState:o},c.queue=f,c=yx.bind(null,Pe,f),f.dispatch=c,f=Jp(!1),y=om.bind(null,Pe,!1,f.queue),f=Nn(),g={state:o,dispatch:null,action:i,pending:null},f.queue=g,c=DD.bind(null,Pe,g,y,c),g.dispatch=c,f.memoizedState=i,[o,c,!1]}function tx(i){var o=jt();return nx(o,ct,i)}function nx(i,o,c){if(o=Zp(i,o,J0)[0],i=ah(Ii)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=$l(o)}catch(E){throw E===_a?Zu:E}else f=o;o=jt();var g=o.queue,y=g.dispatch;return c!==o.memoizedState&&(Pe.flags|=2048,wa(9,{destroy:void 0},ND.bind(null,g,c),null)),[f,y,i]}function ND(i,o){i.action=o}function rx(i){var o=jt(),c=ct;if(c!==null)return nx(o,c,i);jt(),o=o.memoizedState,c=jt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function wa(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=Pe.updateQueue,o===null&&(o=sh(),Pe.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,o.lastEffect=i),i}function ix(){return jt().memoizedState}function lh(i,o,c,f){var g=Nn();Pe.flags|=i,g.memoizedState=wa(1|o,{destroy:void 0},c,f===void 0?null:f)}function ch(i,o,c,f){var g=jt();f=f===void 0?null:f;var y=g.memoizedState.inst;ct!==null&&f!==null&&qp(f,ct.memoizedState.deps)?g.memoizedState=wa(o,y,c,f):(Pe.flags|=i,g.memoizedState=wa(1|o,y,c,f))}function sx(i,o){lh(8390656,8,i,o)}function tm(i,o){ch(2048,8,i,o)}function OD(i){Pe.flags|=4;var o=Pe.updateQueue;if(o===null)o=sh(),Pe.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function ox(i){var o=jt().memoizedState;return OD({ref:o,nextImpl:i}),function(){if((it&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function ax(i,o){return ch(4,2,i,o)}function lx(i,o){return ch(4,4,i,o)}function cx(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function ux(i,o,c){c=c!=null?c.concat([i]):null,ch(4,4,cx.bind(null,o,i),c)}function nm(){}function hx(i,o){var c=jt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&qp(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function dx(i,o){var c=jt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&qp(o,f[1]))return f[0];if(f=i(),_o){Yt(!0);try{i()}finally{Yt(!1)}}return c.memoizedState=[f,o],f}function rm(i,o,c){return c===void 0||(Pi&1073741824)!==0&&(Xe&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=f1(),Pe.lanes|=i,Ss|=i,c)}function fx(i,o,c,f){return or(c,o)?c:ba.current!==null?(i=rm(i,c,f),or(i,o)||(Wt=!0),i):(Pi&42)===0||(Pi&1073741824)!==0&&(Xe&261930)===0?(Wt=!0,i.memoizedState=c):(i=f1(),Pe.lanes|=i,Ss|=i,o)}function px(i,o,c,f,g){var y=K.p;K.p=y!==0&&8>y?y:8;var E=O.T,N={};O.T=N,om(i,!1,o,c);try{var q=g(),te=O.S;if(te!==null&&te(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=MD(q,f);Wl(i,o,oe,dr(i))}else Wl(i,o,f,dr(i))}catch(ce){Wl(i,o,{then:function(){},status:"rejected",reason:ce},dr())}finally{K.p=y,E!==null&&N.types!==null&&(E.types=N.types),O.T=E}}function LD(){}function im(i,o,c,f){if(i.tag!==5)throw Error(r(476));var g=mx(i).queue;px(i,g,o,$,c===null?LD:function(){return gx(i),c(f)})}function mx(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:$},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function gx(i){var o=mx(i);o.next===null&&(o=i.alternate.memoizedState),Wl(i,o.next.queue,{},dr())}function sm(){return bn(ac)}function vx(){return jt().memoizedState}function _x(){return jt().memoizedState}function zD(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=dr();i=gs(c);var f=vs(o,i,c);f!==null&&(Qn(f,o,c),Il(f,o,c)),o={cache:Lp()},i.payload=o;return}o=o.return}}function jD(i,o,c){var f=dr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},uh(i)?bx(o,c):(c=wp(i,o,c,f),c!==null&&(Qn(c,i,f),xx(c,o,f)))}function yx(i,o,c){var f=dr();Wl(i,o,c,f)}function Wl(i,o,c,f){var g={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(uh(i))bx(o,g);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var E=o.lastRenderedState,N=y(E,c);if(g.hasEagerState=!0,g.eagerState=N,or(N,E))return Wu(i,o,g,0),pt===null&&$u(),!1}catch{}finally{}if(c=wp(i,o,g,f),c!==null)return Qn(c,i,f),xx(c,o,f),!0}return!1}function om(i,o,c,f){if(f={lane:2,revertLane:Pm(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},uh(i)){if(o)throw Error(r(479))}else o=wp(i,c,f,2),o!==null&&Qn(o,i,2)}function uh(i){var o=i.alternate;return i===Pe||o!==null&&o===Pe}function bx(i,o){xa=rh=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function xx(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,sr(i,c)}}var ql={readContext:bn,use:oh,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};ql.useEffectEvent=Rt;var Sx={readContext:bn,use:oh,useCallback:function(i,o){return Nn().memoizedState=[i,o===void 0?null:o],i},useContext:bn,useEffect:sx,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,lh(4194308,4,cx.bind(null,o,i),c)},useLayoutEffect:function(i,o){return lh(4194308,4,i,o)},useInsertionEffect:function(i,o){lh(4,2,i,o)},useMemo:function(i,o){var c=Nn();o=o===void 0?null:o;var f=i();if(_o){Yt(!0);try{i()}finally{Yt(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Nn();if(c!==void 0){var g=c(o);if(_o){Yt(!0);try{c(o)}finally{Yt(!1)}}}else g=o;return f.memoizedState=f.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},f.queue=i,i=i.dispatch=jD.bind(null,Pe,i),[f.memoizedState,i]},useRef:function(i){var o=Nn();return i={current:i},o.memoizedState=i},useState:function(i){i=Jp(i);var o=i.queue,c=yx.bind(null,Pe,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:nm,useDeferredValue:function(i,o){var c=Nn();return rm(c,i,o)},useTransition:function(){var i=Jp(!1);return i=px.bind(null,Pe,i.queue,!0,!1),Nn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=Pe,g=Nn();if(Qe){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),pt===null)throw Error(r(349));(Xe&127)!==0||$0(f,o,c)}g.memoizedState=c;var y={value:c,getSnapshot:o};return g.queue=y,sx(q0.bind(null,f,y,i),[i]),f.flags|=2048,wa(9,{destroy:void 0},W0.bind(null,f,y,c,o),null),c},useId:function(){var i=Nn(),o=pt.identifierPrefix;if(Qe){var c=oi,f=si;c=(f&~(1<<32-ot(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=ih++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=TD++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:sm,useFormState:ex,useActionState:ex,useOptimistic:function(i){var o=Nn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=om.bind(null,Pe,!0,c),c.dispatch=o,[i,o]},useMemoCache:Xp,useCacheRefresh:function(){return Nn().memoizedState=zD.bind(null,Pe)},useEffectEvent:function(i){var o=Nn(),c={impl:i};return o.memoizedState=c,function(){if((it&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},am={readContext:bn,use:oh,useCallback:hx,useContext:bn,useEffect:tm,useImperativeHandle:ux,useInsertionEffect:ax,useLayoutEffect:lx,useMemo:dx,useReducer:ah,useRef:ix,useState:function(){return ah(Ii)},useDebugValue:nm,useDeferredValue:function(i,o){var c=jt();return fx(c,ct.memoizedState,i,o)},useTransition:function(){var i=ah(Ii)[0],o=jt().memoizedState;return[typeof i=="boolean"?i:$l(i),o]},useSyncExternalStore:U0,useId:vx,useHostTransitionStatus:sm,useFormState:tx,useActionState:tx,useOptimistic:function(i,o){var c=jt();return G0(c,ct,i,o)},useMemoCache:Xp,useCacheRefresh:_x};am.useEffectEvent=ox;var wx={readContext:bn,use:oh,useCallback:hx,useContext:bn,useEffect:tm,useImperativeHandle:ux,useInsertionEffect:ax,useLayoutEffect:lx,useMemo:dx,useReducer:Qp,useRef:ix,useState:function(){return Qp(Ii)},useDebugValue:nm,useDeferredValue:function(i,o){var c=jt();return ct===null?rm(c,i,o):fx(c,ct.memoizedState,i,o)},useTransition:function(){var i=Qp(Ii)[0],o=jt().memoizedState;return[typeof i=="boolean"?i:$l(i),o]},useSyncExternalStore:U0,useId:vx,useHostTransitionStatus:sm,useFormState:rx,useActionState:rx,useOptimistic:function(i,o){var c=jt();return ct!==null?G0(c,ct,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Xp,useCacheRefresh:_x};wx.useEffectEvent=ox;function lm(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:m({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var cm={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=dr(),g=gs(f);g.payload=o,c!=null&&(g.callback=c),o=vs(i,g,f),o!==null&&(Qn(o,i,f),Il(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=dr(),g=gs(f);g.tag=1,g.payload=o,c!=null&&(g.callback=c),o=vs(i,g,f),o!==null&&(Qn(o,i,f),Il(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=dr(),f=gs(c);f.tag=2,o!=null&&(f.callback=o),o=vs(i,f,c),o!==null&&(Qn(o,i,c),Il(o,i,c))}};function Cx(i,o,c,f,g,y,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,y,E):o.prototype&&o.prototype.isPureReactComponent?!Dl(c,f)||!Dl(g,y):!0}function kx(i,o,c,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==i&&cm.enqueueReplaceState(o,o.state,null)}function yo(i,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(i=i.defaultProps){c===o&&(c=m({},c));for(var g in i)c[g]===void 0&&(c[g]=i[g])}return c}function Ex(i){Uu(i)}function Rx(i){console.error(i)}function Mx(i){Uu(i)}function hh(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function Tx(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function um(i,o,c){return c=gs(c),c.tag=3,c.payload={element:null},c.callback=function(){hh(i,o)},c}function Ax(i){return i=gs(i),i.tag=3,i}function Dx(i,o,c,f){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var y=f.value;i.payload=function(){return g(y)},i.callback=function(){Tx(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){Tx(o,c,f),typeof g!="function"&&(ws===null?ws=new Set([this]):ws.add(this));var N=f.stack;this.componentDidCatch(f.value,{componentStack:N!==null?N:""})})}function BD(i,o,c,f,g){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&ma(o,c,g,!0),c=lr.current,c!==null){switch(c.tag){case 31:case 13:return Ar===null?wh():c.alternate===null&&Mt===0&&(Mt=3),c.flags&=-257,c.flags|=65536,c.lanes=g,f===Qu?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),zm(i,f,g)),!1;case 22:return c.flags|=65536,f===Qu?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),zm(i,f,g)),!1}throw Error(r(435,c.tag))}return zm(i,f,g),wh(),!1}if(Qe)return o=lr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,f!==Tp&&(i=Error(r(422),{cause:f}),Ll(Er(i,c)))):(f!==Tp&&(o=Error(r(423),{cause:f}),Ll(Er(o,c))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,f=Er(f,c),g=um(i.stateNode,f,g),Hp(i,g),Mt!==4&&(Mt=2)),!1;var y=Error(r(520),{cause:f});if(y=Er(y,c),Jl===null?Jl=[y]:Jl.push(y),Mt!==4&&(Mt=2),o===null)return!0;f=Er(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=g&-g,c.lanes|=i,i=um(c.stateNode,f,i),Hp(c,i),!1;case 1:if(o=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ws===null||!ws.has(y))))return c.flags|=65536,g&=-g,c.lanes|=g,g=Ax(g),Dx(g,i,c,f),Hp(c,g),!1}c=c.return}while(c!==null);return!1}var hm=Error(r(461)),Wt=!1;function xn(i,o,c,f){o.child=i===null?z0(o,null,c,f):vo(o,i.child,c,f)}function Nx(i,o,c,f,g){c=c.render;var y=o.ref;if("ref"in f){var E={};for(var N in f)N!=="ref"&&(E[N]=f[N])}else E=f;return fo(o),f=Vp(i,o,c,E,y,g),N=Kp(),i!==null&&!Wt?(Gp(i,o,g),Hi(i,o,g)):(Qe&&N&&Rp(o),o.flags|=1,xn(i,o,f,g),o.child)}function Ox(i,o,c,f,g){if(i===null){var y=c.type;return typeof y=="function"&&!Cp(y)&&y.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=y,Lx(i,o,y,f,g)):(i=Vu(c.type,null,f,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(y=i.child,!ym(i,g)){var E=y.memoizedProps;if(c=c.compare,c=c!==null?c:Dl,c(E,f)&&i.ref===o.ref)return Hi(i,o,g)}return o.flags|=1,i=Li(y,f),i.ref=o.ref,i.return=o,o.child=i}function Lx(i,o,c,f,g){if(i!==null){var y=i.memoizedProps;if(Dl(y,f)&&i.ref===o.ref)if(Wt=!1,o.pendingProps=f=y,ym(i,g))(i.flags&131072)!==0&&(Wt=!0);else return o.lanes=i.lanes,Hi(i,o,g)}return dm(i,o,c,f,g)}function zx(i,o,c,f){var g=f.children,y=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,i!==null){for(f=o.child=i.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~y}else f=0,o.child=null;return jx(i,o,y,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Xu(o,y!==null?y.cachePool:null),y!==null?P0(o,y):Up(),I0(o);else return f=o.lanes=536870912,jx(i,o,y!==null?y.baseLanes|c:c,c,f)}else y!==null?(Xu(o,y.cachePool),P0(o,y),ys(),o.memoizedState=null):(i!==null&&Xu(o,null),Up(),ys());return xn(i,o,g,c),o.child}function Vl(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function jx(i,o,c,f,g){var y=jp();return y=y===null?null:{parent:Ut._currentValue,pool:y},o.memoizedState={baseLanes:c,cachePool:y},i!==null&&Xu(o,null),Up(),I0(o),i!==null&&ma(i,o,f,!0),o.childLanes=g,null}function dh(i,o){return o=ph({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function Bx(i,o,c){return vo(o,i.child,null,c),i=dh(o,o.pendingProps),i.flags|=2,cr(o),o.memoizedState=null,i}function PD(i,o,c){var f=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Qe){if(f.mode==="hidden")return i=dh(o,f),o.lanes=536870912,Vl(null,i);if(Wp(o),(i=_t)?(i=Y1(i,Tr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:hs!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},c=b0(i),c.return=o,o.child=c,yn=o,_t=null)):i=null,i===null)throw fs(o);return o.lanes=536870912,null}return dh(o,f)}var y=i.memoizedState;if(y!==null){var E=y.dehydrated;if(Wp(o),g)if(o.flags&256)o.flags&=-257,o=Bx(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(Wt||ma(i,o,c,!1),g=(c&i.childLanes)!==0,Wt||g){if(f=pt,f!==null&&(E=xr(f,c),E!==0&&E!==y.retryLane))throw y.retryLane=E,lo(i,E),Qn(f,i,E),hm;wh(),o=Bx(i,o,c)}else i=y.treeContext,_t=Dr(E.nextSibling),yn=o,Qe=!0,ds=null,Tr=!1,i!==null&&w0(o,i),o=dh(o,f),o.flags|=4096;return o}return i=Li(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function fh(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function dm(i,o,c,f,g){return fo(o),c=Vp(i,o,c,f,void 0,g),f=Kp(),i!==null&&!Wt?(Gp(i,o,g),Hi(i,o,g)):(Qe&&f&&Rp(o),o.flags|=1,xn(i,o,c,g),o.child)}function Px(i,o,c,f,g,y){return fo(o),o.updateQueue=null,c=F0(o,f,c,g),H0(i),f=Kp(),i!==null&&!Wt?(Gp(i,o,y),Hi(i,o,y)):(Qe&&f&&Rp(o),o.flags|=1,xn(i,o,c,y),o.child)}function Ix(i,o,c,f,g){if(fo(o),o.stateNode===null){var y=ha,E=c.contextType;typeof E=="object"&&E!==null&&(y=bn(E)),y=new c(f,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=cm,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=f,y.state=o.memoizedState,y.refs={},Pp(o),E=c.contextType,y.context=typeof E=="object"&&E!==null?bn(E):ha,y.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(lm(o,c,E,f),y.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&cm.enqueueReplaceState(y,y.state,null),Fl(o,f,y,g),Hl(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){y=o.stateNode;var N=o.memoizedProps,q=yo(c,N);y.props=q;var te=y.context,oe=c.contextType;E=ha,typeof oe=="object"&&oe!==null&&(E=bn(oe));var ce=c.getDerivedStateFromProps;oe=typeof ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=o.pendingProps!==N,oe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||te!==E)&&kx(o,y,f,E),ms=!1;var ne=o.memoizedState;y.state=ne,Fl(o,f,y,g),Hl(),te=o.memoizedState,N||ne!==te||ms?(typeof ce=="function"&&(lm(o,c,ce,f),te=o.memoizedState),(q=ms||Cx(o,c,q,f,ne,te,E))?(oe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=te),y.props=f,y.state=te,y.context=E,f=q):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{y=o.stateNode,Ip(i,o),E=o.memoizedProps,oe=yo(c,E),y.props=oe,ce=o.pendingProps,ne=y.context,te=c.contextType,q=ha,typeof te=="object"&&te!==null&&(q=bn(te)),N=c.getDerivedStateFromProps,(te=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==ce||ne!==q)&&kx(o,y,f,q),ms=!1,ne=o.memoizedState,y.state=ne,Fl(o,f,y,g),Hl();var ie=o.memoizedState;E!==ce||ne!==ie||ms||i!==null&&i.dependencies!==null&&Gu(i.dependencies)?(typeof N=="function"&&(lm(o,c,N,f),ie=o.memoizedState),(oe=ms||Cx(o,c,oe,f,ne,ie,q)||i!==null&&i.dependencies!==null&&Gu(i.dependencies))?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,ie,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,ie,q)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=ie),y.props=f,y.state=ie,y.context=q,f=oe):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),f=!1)}return y=f,fh(i,o),f=(o.flags&128)!==0,y||f?(y=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,i!==null&&f?(o.child=vo(o,i.child,null,g),o.child=vo(o,null,c,g)):xn(i,o,c,g),o.memoizedState=y.state,i=o.child):i=Hi(i,o,g),i}function Hx(i,o,c,f){return uo(),o.flags|=256,xn(i,o,c,f),o.child}var fm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pm(i){return{baseLanes:i,cachePool:T0()}}function mm(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=hr),i}function Fx(i,o,c){var f=o.pendingProps,g=!1,y=(o.flags&128)!==0,E;if((E=y)||(E=i!==null&&i.memoizedState===null?!1:(zt.current&2)!==0),E&&(g=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(Qe){if(g?_s(o):ys(),(i=_t)?(i=Y1(i,Tr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:hs!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},c=b0(i),c.return=o,o.child=c,yn=o,_t=null)):i=null,i===null)throw fs(o);return Zm(i)?o.lanes=32:o.lanes=536870912,null}var N=f.children;return f=f.fallback,g?(ys(),g=o.mode,N=ph({mode:"hidden",children:N},g),f=co(f,g,c,null),N.return=o,f.return=o,N.sibling=f,o.child=N,f=o.child,f.memoizedState=pm(c),f.childLanes=mm(i,E,c),o.memoizedState=fm,Vl(null,f)):(_s(o),gm(o,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(y)o.flags&256?(_s(o),o.flags&=-257,o=vm(i,o,c)):o.memoizedState!==null?(ys(),o.child=i.child,o.flags|=128,o=null):(ys(),N=f.fallback,g=o.mode,f=ph({mode:"visible",children:f.children},g),N=co(N,g,c,null),N.flags|=2,f.return=o,N.return=o,f.sibling=N,o.child=f,vo(o,i.child,null,c),f=o.child,f.memoizedState=pm(c),f.childLanes=mm(i,E,c),o.memoizedState=fm,o=Vl(null,f));else if(_s(o),Zm(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var te=E.dgst;E=te,f=Error(r(419)),f.stack="",f.digest=E,Ll({value:f,source:null,stack:null}),o=vm(i,o,c)}else if(Wt||ma(i,o,c,!1),E=(c&i.childLanes)!==0,Wt||E){if(E=pt,E!==null&&(f=xr(E,c),f!==0&&f!==q.retryLane))throw q.retryLane=f,lo(i,f),Qn(E,i,f),hm;Xm(N)||wh(),o=vm(i,o,c)}else Xm(N)?(o.flags|=192,o.child=i.child,o=null):(i=q.treeContext,_t=Dr(N.nextSibling),yn=o,Qe=!0,ds=null,Tr=!1,i!==null&&w0(o,i),o=gm(o,f.children),o.flags|=4096);return o}return g?(ys(),N=f.fallback,g=o.mode,q=i.child,te=q.sibling,f=Li(q,{mode:"hidden",children:f.children}),f.subtreeFlags=q.subtreeFlags&65011712,te!==null?N=Li(te,N):(N=co(N,g,c,null),N.flags|=2),N.return=o,f.return=o,f.sibling=N,o.child=f,Vl(null,f),f=o.child,N=i.child.memoizedState,N===null?N=pm(c):(g=N.cachePool,g!==null?(q=Ut._currentValue,g=g.parent!==q?{parent:q,pool:q}:g):g=T0(),N={baseLanes:N.baseLanes|c,cachePool:g}),f.memoizedState=N,f.childLanes=mm(i,E,c),o.memoizedState=fm,Vl(i.child,f)):(_s(o),c=i.child,i=c.sibling,c=Li(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,i!==null&&(E=o.deletions,E===null?(o.deletions=[i],o.flags|=16):E.push(i)),o.child=c,o.memoizedState=null,c)}function gm(i,o){return o=ph({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function ph(i,o){return i=ar(22,i,null,o),i.lanes=0,i}function vm(i,o,c){return vo(o,i.child,null,c),i=gm(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function Ux(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Np(i.return,o,c)}function _m(i,o,c,f,g,y){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:g,treeForkCount:y}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=g,E.treeForkCount=y)}function $x(i,o,c){var f=o.pendingProps,g=f.revealOrder,y=f.tail;f=f.children;var E=zt.current,N=(E&2)!==0;if(N?(E=E&1|2,o.flags|=128):E&=1,M(zt,E),xn(i,o,f,c),f=Qe?Ol:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ux(i,c,o);else if(i.tag===19)Ux(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(g){case"forwards":for(c=o.child,g=null;c!==null;)i=c.alternate,i!==null&&nh(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=o.child,o.child=null):(g=c.sibling,c.sibling=null),_m(o,!1,g,c,y,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&nh(i)===null){o.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}_m(o,!0,c,null,y,f);break;case"together":_m(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Hi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Ss|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(ma(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=Li(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Li(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function ym(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Gu(i)))}function ID(i,o,c){switch(o.tag){case 3:Ce(o,o.stateNode.containerInfo),ps(o,Ut,i.memoizedState.cache),uo();break;case 27:case 5:ke(o);break;case 4:Ce(o,o.stateNode.containerInfo);break;case 10:ps(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Wp(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(_s(o),o.flags|=128,null):(c&o.child.childLanes)!==0?Fx(i,o,c):(_s(o),i=Hi(i,o,c),i!==null?i.sibling:null);_s(o);break;case 19:var g=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(ma(i,o,c,!1),f=(c&o.childLanes)!==0),g){if(f)return $x(i,o,c);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),M(zt,zt.current),f)break;return null;case 22:return o.lanes=0,zx(i,o,c,o.pendingProps);case 24:ps(o,Ut,i.memoizedState.cache)}return Hi(i,o,c)}function Wx(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)Wt=!0;else{if(!ym(i,c)&&(o.flags&128)===0)return Wt=!1,ID(i,o,c);Wt=(i.flags&131072)!==0}else Wt=!1,Qe&&(o.flags&1048576)!==0&&S0(o,Ol,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=mo(o.elementType),o.type=i,typeof i=="function")Cp(i)?(f=yo(i,f),o.tag=1,o=Ix(null,o,i,f,c)):(o.tag=0,o=dm(null,o,i,f,c));else{if(i!=null){var g=i.$$typeof;if(g===D){o.tag=11,o=Nx(null,o,i,f,c);break e}else if(g===j){o.tag=14,o=Ox(null,o,i,f,c);break e}}throw o=V(i)||i,Error(r(306,o,""))}}return o;case 0:return dm(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,g=yo(f,o.pendingProps),Ix(i,o,f,g,c);case 3:e:{if(Ce(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var y=o.memoizedState;g=y.element,Ip(i,o),Fl(o,f,null,c);var E=o.memoizedState;if(f=E.cache,ps(o,Ut,f),f!==y.cache&&Op(o,[Ut],c,!0),Hl(),f=E.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=y,o.memoizedState=y,o.flags&256){o=Hx(i,o,f,c);break e}else if(f!==g){g=Er(Error(r(424)),o),Ll(g),o=Hx(i,o,f,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(_t=Dr(i.firstChild),yn=o,Qe=!0,ds=null,Tr=!0,c=z0(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(uo(),f===g){o=Hi(i,o,c);break e}xn(i,o,f,c)}o=o.child}return o;case 26:return fh(i,o),i===null?(c=tS(o.type,null,o.pendingProps,null))?o.memoizedState=c:Qe||(c=o.type,i=o.pendingProps,f=Ah(re.current).createElement(c),f[_n]=o,f[Vn]=i,Sn(f,c,i),on(f),o.stateNode=f):o.memoizedState=tS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return ke(o),i===null&&Qe&&(f=o.stateNode=Q1(o.type,o.pendingProps,re.current),yn=o,Tr=!0,g=_t,Rs(o.type)?(Qm=g,_t=Dr(f.firstChild)):_t=g),xn(i,o,o.pendingProps.children,c),fh(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Qe&&((g=f=_t)&&(f=mN(f,o.type,o.pendingProps,Tr),f!==null?(o.stateNode=f,yn=o,_t=Dr(f.firstChild),Tr=!1,g=!0):g=!1),g||fs(o)),ke(o),g=o.type,y=o.pendingProps,E=i!==null?i.memoizedProps:null,f=y.children,Km(g,y)?f=null:E!==null&&Km(g,E)&&(o.flags|=32),o.memoizedState!==null&&(g=Vp(i,o,AD,null,null,c),ac._currentValue=g),fh(i,o),xn(i,o,f,c),o.child;case 6:return i===null&&Qe&&((i=c=_t)&&(c=gN(c,o.pendingProps,Tr),c!==null?(o.stateNode=c,yn=o,_t=null,i=!0):i=!1),i||fs(o)),null;case 13:return Fx(i,o,c);case 4:return Ce(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=vo(o,null,f,c):xn(i,o,f,c),o.child;case 11:return Nx(i,o,o.type,o.pendingProps,c);case 7:return xn(i,o,o.pendingProps,c),o.child;case 8:return xn(i,o,o.pendingProps.children,c),o.child;case 12:return xn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,ps(o,o.type,f.value),xn(i,o,f.children,c),o.child;case 9:return g=o.type._context,f=o.pendingProps.children,fo(o),g=bn(g),f=f(g),o.flags|=1,xn(i,o,f,c),o.child;case 14:return Ox(i,o,o.type,o.pendingProps,c);case 15:return Lx(i,o,o.type,o.pendingProps,c);case 19:return $x(i,o,c);case 31:return PD(i,o,c);case 22:return zx(i,o,c,o.pendingProps);case 24:return fo(o),f=bn(Ut),i===null?(g=jp(),g===null&&(g=pt,y=Lp(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=c),g=y),o.memoizedState={parent:f,cache:g},Pp(o),ps(o,Ut,g)):((i.lanes&c)!==0&&(Ip(i,o),Fl(o,null,null,c),Hl()),g=i.memoizedState,y=o.memoizedState,g.parent!==f?(g={parent:f,cache:f},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),ps(o,Ut,f)):(f=y.cache,ps(o,Ut,f),f!==g.cache&&Op(o,[Ut],c,!0))),xn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Fi(i){i.flags|=4}function bm(i,o,c,f,g){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(g&335544128)===g)if(i.stateNode.complete)i.flags|=8192;else if(v1())i.flags|=8192;else throw go=Qu,Bp}else i.flags&=-16777217}function qx(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!oS(o))if(v1())i.flags|=8192;else throw go=Qu,Bp}function mh(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?En():536870912,i.lanes|=o,Ra|=o)}function Kl(i,o){if(!Qe)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function yt(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function HD(i,o,c){var f=o.pendingProps;switch(Mp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(o),null;case 1:return yt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Bi(Ut),pe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(pa(o)?Fi(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Ap())),yt(o),null;case 26:var g=o.type,y=o.memoizedState;return i===null?(Fi(o),y!==null?(yt(o),qx(o,y)):(yt(o),bm(o,g,null,f,c))):y?y!==i.memoizedState?(Fi(o),yt(o),qx(o,y)):(yt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Fi(o),yt(o),bm(o,g,i,f,c)),null;case 27:if(Je(o),c=re.current,g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Fi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return yt(o),null}i=X.current,pa(o)?C0(o):(i=Q1(g,f,c),o.stateNode=i,Fi(o))}return yt(o),null;case 5:if(Je(o),g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Fi(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return yt(o),null}if(y=X.current,pa(o))C0(o);else{var E=Ah(re.current);switch(y){case 1:y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=E.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?E.createElement(g,{is:f.is}):E.createElement(g)}}y[_n]=o,y[Vn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)y.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=y;e:switch(Sn(y,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Fi(o)}}return yt(o),bm(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Fi(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=re.current,pa(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,g=yn,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}i[_n]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||F1(i.nodeValue,c)),i||fs(o,!0)}else i=Ah(i).createTextNode(f),i[_n]=o,o.stateNode=i}return yt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=pa(o),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[_n]=o}else uo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yt(o),i=!1}else c=Ap(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(cr(o),o):(cr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return yt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=pa(o),f!==null&&f.dehydrated!==null){if(i===null){if(!g)throw Error(r(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[_n]=o}else uo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yt(o),g=!1}else g=Ap(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(cr(o),o):(cr(o),null)}return cr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==g&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),mh(o,o.updateQueue),yt(o),null);case 4:return pe(),i===null&&Um(o.stateNode.containerInfo),yt(o),null;case 10:return Bi(o.type),yt(o),null;case 19:if(Y(zt),f=o.memoizedState,f===null)return yt(o),null;if(g=(o.flags&128)!==0,y=f.rendering,y===null)if(g)Kl(f,!1);else{if(Mt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(y=nh(i),y!==null){for(o.flags|=128,Kl(f,!1),i=y.updateQueue,o.updateQueue=i,mh(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)y0(c,i),c=c.sibling;return M(zt,zt.current&1|2),Qe&&zi(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&Ft()>bh&&(o.flags|=128,g=!0,Kl(f,!1),o.lanes=4194304)}else{if(!g)if(i=nh(y),i!==null){if(o.flags|=128,g=!0,i=i.updateQueue,o.updateQueue=i,mh(o,i),Kl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Qe)return yt(o),null}else 2*Ft()-f.renderingStartTime>bh&&c!==536870912&&(o.flags|=128,g=!0,Kl(f,!1),o.lanes=4194304);f.isBackwards?(y.sibling=o.child,o.child=y):(i=f.last,i!==null?i.sibling=y:o.child=y,f.last=y)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Ft(),i.sibling=null,c=zt.current,M(zt,g?c&1|2:c&1),Qe&&zi(o,f.treeForkCount),i):(yt(o),null);case 22:case 23:return cr(o),$p(),f=o.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(yt(o),o.subtreeFlags&6&&(o.flags|=8192)):yt(o),c=o.updateQueue,c!==null&&mh(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),i!==null&&Y(po),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Bi(Ut),yt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function FD(i,o){switch(Mp(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Bi(Ut),pe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Je(o),null;case 31:if(o.memoizedState!==null){if(cr(o),o.alternate===null)throw Error(r(340));uo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(cr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));uo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Y(zt),null;case 4:return pe(),null;case 10:return Bi(o.type),null;case 22:case 23:return cr(o),$p(),i!==null&&Y(po),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Bi(Ut),null;case 25:return null;default:return null}}function Vx(i,o){switch(Mp(o),o.tag){case 3:Bi(Ut),pe();break;case 26:case 27:case 5:Je(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&cr(o);break;case 13:cr(o);break;case 19:Y(zt);break;case 10:Bi(o.type);break;case 22:case 23:cr(o),$p(),i!==null&&Y(po);break;case 24:Bi(Ut)}}function Gl(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var g=f.next;c=g;do{if((c.tag&i)===i){f=void 0;var y=c.create,E=c.inst;f=y(),E.destroy=f}c=c.next}while(c!==g)}}catch(N){lt(o,o.return,N)}}function bs(i,o,c){try{var f=o.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&i)===i){var E=f.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,g=o;var q=c,te=N;try{te()}catch(oe){lt(g,q,oe)}}}f=f.next}while(f!==y)}}catch(oe){lt(o,o.return,oe)}}function Kx(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{B0(o,c)}catch(f){lt(i,i.return,f)}}}function Gx(i,o,c){c.props=yo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){lt(i,o,f)}}function Yl(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(g){lt(i,o,g)}}function ai(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(g){lt(i,o,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){lt(i,o,g)}else c.current=null}function Yx(i){var o=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(g){lt(i,i.return,g)}}function xm(i,o,c){try{var f=i.stateNode;cN(f,i.type,c,o),f[Vn]=o}catch(g){lt(i,i.return,g)}}function Xx(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Rs(i.type)||i.tag===4}function Sm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Xx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Rs(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function wm(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ni));else if(f!==4&&(f===27&&Rs(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(wm(i,o,c),i=i.sibling;i!==null;)wm(i,o,c),i=i.sibling}function gh(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(f!==4&&(f===27&&Rs(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(gh(i,o,c),i=i.sibling;i!==null;)gh(i,o,c),i=i.sibling}function Zx(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);Sn(o,f,c),o[_n]=i,o[Vn]=c}catch(y){lt(i,i.return,y)}}var Ui=!1,qt=!1,Cm=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,an=null;function UD(i,o){if(i=i.containerInfo,qm=Bh,i=u0(i),vp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var g=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var E=0,N=-1,q=-1,te=0,oe=0,ce=i,ne=null;t:for(;;){for(var ie;ce!==c||g!==0&&ce.nodeType!==3||(N=E+g),ce!==y||f!==0&&ce.nodeType!==3||(q=E+f),ce.nodeType===3&&(E+=ce.nodeValue.length),(ie=ce.firstChild)!==null;)ne=ce,ce=ie;for(;;){if(ce===i)break t;if(ne===c&&++te===g&&(N=E),ne===y&&++oe===f&&(q=E),(ie=ce.nextSibling)!==null)break;ce=ne,ne=ce.parentNode}ce=ie}c=N===-1||q===-1?null:{start:N,end:q}}else c=null}c=c||{start:0,end:0}}else c=null;for(Vm={focusedElem:i,selectionRange:c},Bh=!1,an=o;an!==null;)if(o=an,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,an=i;else for(;an!==null;){switch(o=an,y=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)g=i[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,c=o,g=y.memoizedProps,y=y.memoizedState,f=c.stateNode;try{var be=yo(c.type,g);i=f.getSnapshotBeforeUpdate(be,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(De){lt(c,c.return,De)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Ym(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ym(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,an=i;break}an=o.return}}function Jx(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Wi(i,c),f&4&&Gl(5,c);break;case 1:if(Wi(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){lt(c,c.return,E)}else{var g=yo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(g,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){lt(c,c.return,E)}}f&64&&Kx(c),f&512&&Yl(c,c.return);break;case 3:if(Wi(i,c),f&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{B0(i,o)}catch(E){lt(c,c.return,E)}}break;case 27:o===null&&f&4&&Zx(c);case 26:case 5:Wi(i,c),o===null&&f&4&&Yx(c),f&512&&Yl(c,c.return);break;case 12:Wi(i,c);break;case 31:Wi(i,c),f&4&&n1(i,c);break;case 13:Wi(i,c),f&4&&r1(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=ZD.bind(null,c),vN(i,c))));break;case 22:if(f=c.memoizedState!==null||Ui,!f){o=o!==null&&o.memoizedState!==null||qt,g=Ui;var y=qt;Ui=f,(qt=o)&&!y?qi(i,c,(c.subtreeFlags&8772)!==0):Wi(i,c),Ui=g,qt=y}break;case 30:break;default:Wi(i,c)}}function e1(i){var o=i.alternate;o!==null&&(i.alternate=null,e1(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&ep(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var xt=null,Gn=!1;function $i(i,o,c){for(c=c.child;c!==null;)t1(i,o,c),c=c.sibling}function t1(i,o,c){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(Be,c)}catch{}switch(c.tag){case 26:qt||ai(c,o),$i(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:qt||ai(c,o);var f=xt,g=Gn;Rs(c.type)&&(xt=c.stateNode,Gn=!1),$i(i,o,c),ic(c.stateNode),xt=f,Gn=g;break;case 5:qt||ai(c,o);case 6:if(f=xt,g=Gn,xt=null,$i(i,o,c),xt=f,Gn=g,xt!==null)if(Gn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(c.stateNode)}catch(y){lt(c,o,y)}else try{xt.removeChild(c.stateNode)}catch(y){lt(c,o,y)}break;case 18:xt!==null&&(Gn?(i=xt,K1(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),za(i)):K1(xt,c.stateNode));break;case 4:f=xt,g=Gn,xt=c.stateNode.containerInfo,Gn=!0,$i(i,o,c),xt=f,Gn=g;break;case 0:case 11:case 14:case 15:bs(2,c,o),qt||bs(4,c,o),$i(i,o,c);break;case 1:qt||(ai(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&Gx(c,o,f)),$i(i,o,c);break;case 21:$i(i,o,c);break;case 22:qt=(f=qt)||c.memoizedState!==null,$i(i,o,c),qt=f;break;default:$i(i,o,c)}}function n1(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{za(i)}catch(c){lt(o,o.return,c)}}}function r1(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{za(i)}catch(c){lt(o,o.return,c)}}function $D(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new Qx),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new Qx),o;default:throw Error(r(435,i.tag))}}function vh(i,o){var c=$D(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var g=QD.bind(null,i,f);f.then(g,g)}})}function Yn(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var g=c[f],y=i,E=o,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Rs(N.type)){xt=N.stateNode,Gn=!1;break e}break;case 5:xt=N.stateNode,Gn=!1;break e;case 3:case 4:xt=N.stateNode.containerInfo,Gn=!0;break e}N=N.return}if(xt===null)throw Error(r(160));t1(y,E,g),xt=null,Gn=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)i1(o,i),o=o.sibling}var Vr=null;function i1(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Yn(o,i),Xn(i),f&4&&(bs(3,i,i.return),Gl(3,i),bs(5,i,i.return));break;case 1:Yn(o,i),Xn(i),f&512&&(qt||c===null||ai(c,c.return)),f&64&&Ui&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var g=Vr;if(Yn(o,i),Xn(i),f&512&&(qt||c===null||ai(c,c.return)),f&4){var y=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Sl]||y[_n]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(f),g.head.insertBefore(y,g.querySelector("head > title"))),Sn(y,f,c),y[_n]=i,on(y),f=y;break e;case"link":var E=iS("link","href",g).get(f+(c.href||""));if(E){for(var N=0;N<E.length;N++)if(y=E[N],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(N,1);break t}}y=g.createElement(f),Sn(y,f,c),g.head.appendChild(y);break;case"meta":if(E=iS("meta","content",g).get(f+(c.content||""))){for(N=0;N<E.length;N++)if(y=E[N],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(N,1);break t}}y=g.createElement(f),Sn(y,f,c),g.head.appendChild(y);break;default:throw Error(r(468,f))}y[_n]=i,on(y),f=y}i.stateNode=f}else sS(g,i.type,i.stateNode);else i.stateNode=rS(g,f,i.memoizedProps);else y!==f?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,f===null?sS(g,i.type,i.stateNode):rS(g,f,i.memoizedProps)):f===null&&i.stateNode!==null&&xm(i,i.memoizedProps,c.memoizedProps)}break;case 27:Yn(o,i),Xn(i),f&512&&(qt||c===null||ai(c,c.return)),c!==null&&f&4&&xm(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Yn(o,i),Xn(i),f&512&&(qt||c===null||ai(c,c.return)),i.flags&32){g=i.stateNode;try{ia(g,"")}catch(be){lt(i,i.return,be)}}f&4&&i.stateNode!=null&&(g=i.memoizedProps,xm(i,g,c!==null?c.memoizedProps:g)),f&1024&&(Cm=!0);break;case 6:if(Yn(o,i),Xn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(be){lt(i,i.return,be)}}break;case 3:if(Oh=null,g=Vr,Vr=Dh(o.containerInfo),Yn(o,i),Vr=g,Xn(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{za(o.containerInfo)}catch(be){lt(i,i.return,be)}Cm&&(Cm=!1,s1(i));break;case 4:f=Vr,Vr=Dh(i.stateNode.containerInfo),Yn(o,i),Xn(i),Vr=f;break;case 12:Yn(o,i),Xn(i);break;case 31:Yn(o,i),Xn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,vh(i,f)));break;case 13:Yn(o,i),Xn(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(yh=Ft()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,vh(i,f)));break;case 22:g=i.memoizedState!==null;var q=c!==null&&c.memoizedState!==null,te=Ui,oe=qt;if(Ui=te||g,qt=oe||q,Yn(o,i),qt=oe,Ui=te,Xn(i),f&8192)e:for(o=i.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(c===null||q||Ui||qt||bo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){q=c=o;try{if(y=q.stateNode,g)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=q.stateNode;var ce=q.memoizedProps.style,ne=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(be){lt(q,q.return,be)}}}else if(o.tag===6){if(c===null){q=o;try{q.stateNode.nodeValue=g?"":q.memoizedProps}catch(be){lt(q,q.return,be)}}}else if(o.tag===18){if(c===null){q=o;try{var ie=q.stateNode;g?G1(ie,!0):G1(q.stateNode,!1)}catch(be){lt(q,q.return,be)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,vh(i,c))));break;case 19:Yn(o,i),Xn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,vh(i,f)));break;case 30:break;case 21:break;default:Yn(o,i),Xn(i)}}function Xn(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(Xx(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var g=c.stateNode,y=Sm(i);gh(i,y,g);break;case 5:var E=c.stateNode;c.flags&32&&(ia(E,""),c.flags&=-33);var N=Sm(i);gh(i,N,E);break;case 3:case 4:var q=c.stateNode.containerInfo,te=Sm(i);wm(i,te,q);break;default:throw Error(r(161))}}catch(oe){lt(i,i.return,oe)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function s1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;s1(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function Wi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Jx(i,o.alternate,o),o=o.sibling}function bo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:bs(4,o,o.return),bo(o);break;case 1:ai(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&Gx(o,o.return,c),bo(o);break;case 27:ic(o.stateNode);case 26:case 5:ai(o,o.return),bo(o);break;case 22:o.memoizedState===null&&bo(o);break;case 30:bo(o);break;default:bo(o)}i=i.sibling}}function qi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,g=i,y=o,E=y.flags;switch(y.tag){case 0:case 11:case 15:qi(g,y,c),Gl(4,y);break;case 1:if(qi(g,y,c),f=y,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(te){lt(f,f.return,te)}if(f=y,g=f.updateQueue,g!==null){var N=f.stateNode;try{var q=g.shared.hiddenCallbacks;if(q!==null)for(g.shared.hiddenCallbacks=null,g=0;g<q.length;g++)j0(q[g],N)}catch(te){lt(f,f.return,te)}}c&&E&64&&Kx(y),Yl(y,y.return);break;case 27:Zx(y);case 26:case 5:qi(g,y,c),c&&f===null&&E&4&&Yx(y),Yl(y,y.return);break;case 12:qi(g,y,c);break;case 31:qi(g,y,c),c&&E&4&&n1(g,y);break;case 13:qi(g,y,c),c&&E&4&&r1(g,y);break;case 22:y.memoizedState===null&&qi(g,y,c),Yl(y,y.return);break;case 30:break;default:qi(g,y,c)}o=o.sibling}}function km(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&zl(c))}function Em(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&zl(i))}function Kr(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)o1(i,o,c,f),o=o.sibling}function o1(i,o,c,f){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Kr(i,o,c,f),g&2048&&Gl(9,o);break;case 1:Kr(i,o,c,f);break;case 3:Kr(i,o,c,f),g&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&zl(i)));break;case 12:if(g&2048){Kr(i,o,c,f),i=o.stateNode;try{var y=o.memoizedProps,E=y.id,N=y.onPostCommit;typeof N=="function"&&N(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){lt(o,o.return,q)}}else Kr(i,o,c,f);break;case 31:Kr(i,o,c,f);break;case 13:Kr(i,o,c,f);break;case 23:break;case 22:y=o.stateNode,E=o.alternate,o.memoizedState!==null?y._visibility&2?Kr(i,o,c,f):Xl(i,o):y._visibility&2?Kr(i,o,c,f):(y._visibility|=2,Ca(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),g&2048&&km(E,o);break;case 24:Kr(i,o,c,f),g&2048&&Em(o.alternate,o);break;default:Kr(i,o,c,f)}}function Ca(i,o,c,f,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var y=i,E=o,N=c,q=f,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ca(y,E,N,q,g),Gl(8,E);break;case 23:break;case 22:var oe=E.stateNode;E.memoizedState!==null?oe._visibility&2?Ca(y,E,N,q,g):Xl(y,E):(oe._visibility|=2,Ca(y,E,N,q,g)),g&&te&2048&&km(E.alternate,E);break;case 24:Ca(y,E,N,q,g),g&&te&2048&&Em(E.alternate,E);break;default:Ca(y,E,N,q,g)}o=o.sibling}}function Xl(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,g=f.flags;switch(f.tag){case 22:Xl(c,f),g&2048&&km(f.alternate,f);break;case 24:Xl(c,f),g&2048&&Em(f.alternate,f);break;default:Xl(c,f)}o=o.sibling}}var Zl=8192;function ka(i,o,c){if(i.subtreeFlags&Zl)for(i=i.child;i!==null;)a1(i,o,c),i=i.sibling}function a1(i,o,c){switch(i.tag){case 26:ka(i,o,c),i.flags&Zl&&i.memoizedState!==null&&TN(c,Vr,i.memoizedState,i.memoizedProps);break;case 5:ka(i,o,c);break;case 3:case 4:var f=Vr;Vr=Dh(i.stateNode.containerInfo),ka(i,o,c),Vr=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=Zl,Zl=16777216,ka(i,o,c),Zl=f):ka(i,o,c));break;default:ka(i,o,c)}}function l1(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Ql(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];an=f,u1(f,i)}l1(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)c1(i),i=i.sibling}function c1(i){switch(i.tag){case 0:case 11:case 15:Ql(i),i.flags&2048&&bs(9,i,i.return);break;case 3:Ql(i);break;case 12:Ql(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,_h(i)):Ql(i);break;default:Ql(i)}}function _h(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];an=f,u1(f,i)}l1(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:bs(8,o,o.return),_h(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,_h(o));break;default:_h(o)}i=i.sibling}}function u1(i,o){for(;an!==null;){var c=an;switch(c.tag){case 0:case 11:case 15:bs(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:zl(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,an=f;else e:for(c=i;an!==null;){f=an;var g=f.sibling,y=f.return;if(e1(f),f===c){an=null;break e}if(g!==null){g.return=y,an=g;break e}an=y}}}var WD={getCacheForType:function(i){var o=bn(Ut),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return bn(Ut).controller.signal}},qD=typeof WeakMap=="function"?WeakMap:Map,it=0,pt=null,Ke=null,Xe=0,at=0,ur=null,xs=!1,Ea=!1,Rm=!1,Vi=0,Mt=0,Ss=0,xo=0,Mm=0,hr=0,Ra=0,Jl=null,Zn=null,Tm=!1,yh=0,h1=0,bh=1/0,xh=null,ws=null,Zt=0,Cs=null,Ma=null,Ki=0,Am=0,Dm=null,d1=null,ec=0,Nm=null;function dr(){return(it&2)!==0&&Xe!==0?Xe&-Xe:O.T!==null?Pm():Wr()}function f1(){if(hr===0)if((Xe&536870912)===0||Qe){var i=Zo;Zo<<=1,(Zo&3932160)===0&&(Zo=262144),hr=i}else hr=536870912;return i=lr.current,i!==null&&(i.flags|=32),hr}function Qn(i,o,c){(i===pt&&(at===2||at===9)||i.cancelPendingCommit!==null)&&(Ta(i,0),ks(i,Xe,hr,!1)),br(i,c),((it&2)===0||i!==pt)&&(i===pt&&((it&2)===0&&(xo|=c),Mt===4&&ks(i,Xe,hr,!1)),li(i))}function p1(i,o,c){if((it&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||$n(i,o),g=f?GD(i,o):Lm(i,o,!0),y=f;do{if(g===0){Ea&&!f&&ks(i,o,0,!1);break}else{if(c=i.current.alternate,y&&!VD(c)){g=Lm(i,o,!1),y=!1;continue}if(g===2){if(y=o,i.errorRecoveryDisabledLanes&y)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var N=i;g=Jl;var q=N.current.memoizedState.isDehydrated;if(q&&(Ta(N,E).flags|=256),E=Lm(N,E,!1),E!==2){if(Rm&&!q){N.errorRecoveryDisabledLanes|=y,xo|=y,g=4;break e}y=Zn,Zn=g,y!==null&&(Zn===null?Zn=y:Zn.push.apply(Zn,y))}g=E}if(y=!1,g!==2)continue}}if(g===1){Ta(i,0),ks(i,o,0,!0);break}e:{switch(f=i,y=g,y){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ks(f,o,hr,!xs);break e;case 2:Zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(g=yh+300-Ft(),10<g)){if(ks(f,o,hr,!xs),sn(f,0,!0)!==0)break e;Ki=o,f.timeoutHandle=q1(m1.bind(null,f,c,Zn,xh,Tm,o,hr,xo,Ra,xs,y,"Throttled",-0,0),g);break e}m1(f,c,Zn,xh,Tm,o,hr,xo,Ra,xs,y,null,-0,0)}}break}while(!0);li(i)}function m1(i,o,c,f,g,y,E,N,q,te,oe,ce,ne,ie){if(i.timeoutHandle=-1,ce=o.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ni},a1(o,y,ce);var be=(y&62914560)===y?yh-Ft():(y&4194048)===y?h1-Ft():0;if(be=AN(ce,be),be!==null){Ki=y,i.cancelPendingCommit=be(w1.bind(null,i,o,y,c,f,g,E,N,q,oe,ce,null,ne,ie)),ks(i,y,E,!te);return}}w1(i,o,y,c,f,g,E,N,q)}function VD(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var g=c[f],y=g.getSnapshot;g=g.value;try{if(!or(y(),g))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ks(i,o,c,f){o&=~Mm,o&=~xo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var g=o;0<g;){var y=31-ot(g),E=1<<y;f[y]=-1,g&=~E}c!==0&&$r(i,c,o)}function Sh(){return(it&6)===0?(tc(0),!1):!0}function Om(){if(Ke!==null){if(at===0)var i=Ke.return;else i=Ke,ji=ho=null,Yp(i),ya=null,Bl=0,i=Ke;for(;i!==null;)Vx(i.alternate,i),i=i.return;Ke=null}}function Ta(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,dN(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Ki=0,Om(),pt=i,Ke=c=Li(i.current,null),Xe=o,at=0,ur=null,xs=!1,Ea=$n(i,o),Rm=!1,Ra=hr=Mm=xo=Ss=Mt=0,Zn=Jl=null,Tm=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var g=31-ot(f),y=1<<g;o|=i[g],f&=~y}return Vi=o,$u(),c}function g1(i,o){Pe=null,O.H=ql,o===_a||o===Zu?(o=N0(),at=3):o===Bp?(o=N0(),at=4):at=o===hm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ur=o,Ke===null&&(Mt=1,hh(i,Er(o,i.current)))}function v1(){var i=lr.current;return i===null?!0:(Xe&4194048)===Xe?Ar===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?i===Ar:!1}function _1(){var i=O.H;return O.H=ql,i===null?ql:i}function y1(){var i=O.A;return O.A=WD,i}function wh(){Mt=4,xs||(Xe&4194048)!==Xe&&lr.current!==null||(Ea=!0),(Ss&134217727)===0&&(xo&134217727)===0||pt===null||ks(pt,Xe,hr,!1)}function Lm(i,o,c){var f=it;it|=2;var g=_1(),y=y1();(pt!==i||Xe!==o)&&(xh=null,Ta(i,o)),o=!1;var E=Mt;e:do try{if(at!==0&&Ke!==null){var N=Ke,q=ur;switch(at){case 8:Om(),E=6;break e;case 3:case 2:case 9:case 6:lr.current===null&&(o=!0);var te=at;if(at=0,ur=null,Aa(i,N,q,te),c&&Ea){E=0;break e}break;default:te=at,at=0,ur=null,Aa(i,N,q,te)}}KD(),E=Mt;break}catch(oe){g1(i,oe)}while(!0);return o&&i.shellSuspendCounter++,ji=ho=null,it=f,O.H=g,O.A=y,Ke===null&&(pt=null,Xe=0,$u()),E}function KD(){for(;Ke!==null;)b1(Ke)}function GD(i,o){var c=it;it|=2;var f=_1(),g=y1();pt!==i||Xe!==o?(xh=null,bh=Ft()+500,Ta(i,o)):Ea=$n(i,o);e:do try{if(at!==0&&Ke!==null){o=Ke;var y=ur;t:switch(at){case 1:at=0,ur=null,Aa(i,o,y,1);break;case 2:case 9:if(A0(y)){at=0,ur=null,x1(o);break}o=function(){at!==2&&at!==9||pt!==i||(at=7),li(i)},y.then(o,o);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:A0(y)?(at=0,ur=null,x1(o)):(at=0,ur=null,Aa(i,o,y,7));break;case 5:var E=null;switch(Ke.tag){case 26:E=Ke.memoizedState;case 5:case 27:var N=Ke;if(E?oS(E):N.stateNode.complete){at=0,ur=null;var q=N.sibling;if(q!==null)Ke=q;else{var te=N.return;te!==null?(Ke=te,Ch(te)):Ke=null}break t}}at=0,ur=null,Aa(i,o,y,5);break;case 6:at=0,ur=null,Aa(i,o,y,6);break;case 8:Om(),Mt=6;break e;default:throw Error(r(462))}}YD();break}catch(oe){g1(i,oe)}while(!0);return ji=ho=null,O.H=f,O.A=g,it=c,Ke!==null?0:(pt=null,Xe=0,$u(),Mt)}function YD(){for(;Ke!==null&&!ri();)b1(Ke)}function b1(i){var o=Wx(i.alternate,i,Vi);i.memoizedProps=i.pendingProps,o===null?Ch(i):Ke=o}function x1(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=Px(c,o,o.pendingProps,o.type,void 0,Xe);break;case 11:o=Px(c,o,o.pendingProps,o.type.render,o.ref,Xe);break;case 5:Yp(o);default:Vx(c,o),o=Ke=y0(o,Vi),o=Wx(c,o,Vi)}i.memoizedProps=i.pendingProps,o===null?Ch(i):Ke=o}function Aa(i,o,c,f){ji=ho=null,Yp(o),ya=null,Bl=0;var g=o.return;try{if(BD(i,g,o,c,Xe)){Mt=1,hh(i,Er(c,i.current)),Ke=null;return}}catch(y){if(g!==null)throw Ke=g,y;Mt=1,hh(i,Er(c,i.current)),Ke=null;return}o.flags&32768?(Qe||f===1?i=!0:Ea||(Xe&536870912)!==0?i=!1:(xs=i=!0,(f===2||f===9||f===3||f===6)&&(f=lr.current,f!==null&&f.tag===13&&(f.flags|=16384))),S1(o,i)):Ch(o)}function Ch(i){var o=i;do{if((o.flags&32768)!==0){S1(o,xs);return}i=o.return;var c=HD(o.alternate,o,Vi);if(c!==null){Ke=c;return}if(o=o.sibling,o!==null){Ke=o;return}Ke=o=i}while(o!==null);Mt===0&&(Mt=5)}function S1(i,o){do{var c=FD(i.alternate,i);if(c!==null){c.flags&=32767,Ke=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Ke=i;return}Ke=i=c}while(i!==null);Mt=6,Ke=null}function w1(i,o,c,f,g,y,E,N,q){i.cancelPendingCommit=null;do kh();while(Zt!==0);if((it&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(y=o.lanes|o.childLanes,y|=Sp,Xt(i,c,y,E,N,q),i===pt&&(Ke=pt=null,Xe=0),Ma=o,Cs=i,Ki=c,Am=y,Dm=g,d1=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,JD(Ee,function(){return M1(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=O.T,O.T=null,g=K.p,K.p=2,E=it,it|=4;try{UD(i,o,c)}finally{it=E,K.p=g,O.T=f}}Zt=1,C1(),k1(),E1()}}function C1(){if(Zt===1){Zt=0;var i=Cs,o=Ma,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=O.T,O.T=null;var f=K.p;K.p=2;var g=it;it|=4;try{i1(o,i);var y=Vm,E=u0(i.containerInfo),N=y.focusedElem,q=y.selectionRange;if(E!==N&&N&&N.ownerDocument&&c0(N.ownerDocument.documentElement,N)){if(q!==null&&vp(N)){var te=q.start,oe=q.end;if(oe===void 0&&(oe=te),"selectionStart"in N)N.selectionStart=te,N.selectionEnd=Math.min(oe,N.value.length);else{var ce=N.ownerDocument||document,ne=ce&&ce.defaultView||window;if(ne.getSelection){var ie=ne.getSelection(),be=N.textContent.length,De=Math.min(q.start,be),ht=q.end===void 0?De:Math.min(q.end,be);!ie.extend&&De>ht&&(E=ht,ht=De,De=E);var Q=l0(N,De),G=l0(N,ht);if(Q&&G&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var ee=ce.createRange();ee.setStart(Q.node,Q.offset),ie.removeAllRanges(),De>ht?(ie.addRange(ee),ie.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),ie.addRange(ee))}}}}for(ce=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&ce.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var le=ce[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Bh=!!qm,Vm=qm=null}finally{it=g,K.p=f,O.T=c}}i.current=o,Zt=2}}function k1(){if(Zt===2){Zt=0;var i=Cs,o=Ma,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=O.T,O.T=null;var f=K.p;K.p=2;var g=it;it|=4;try{Jx(i,o.alternate,o)}finally{it=g,K.p=f,O.T=c}}Zt=3}}function E1(){if(Zt===4||Zt===3){Zt=0,Mi();var i=Cs,o=Ma,c=Ki,f=d1;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Zt=5:(Zt=0,Ma=Cs=null,R1(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(ws=null),Ai(c),o=o.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(Be,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=O.T,g=K.p,K.p=2,O.T=null;try{for(var y=i.onRecoverableError,E=0;E<f.length;E++){var N=f[E];y(N.value,{componentStack:N.stack})}}finally{O.T=o,K.p=g}}(Ki&3)!==0&&kh(),li(i),g=i.pendingLanes,(c&261930)!==0&&(g&42)!==0?i===Nm?ec++:(ec=0,Nm=i):ec=0,tc(0)}}function R1(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,zl(o)))}function kh(){return C1(),k1(),E1(),M1()}function M1(){if(Zt!==5)return!1;var i=Cs,o=Am;Am=0;var c=Ai(Ki),f=O.T,g=K.p;try{K.p=32>c?32:c,O.T=null,c=Dm,Dm=null;var y=Cs,E=Ki;if(Zt=0,Ma=Cs=null,Ki=0,(it&6)!==0)throw Error(r(331));var N=it;if(it|=4,c1(y.current),o1(y,y.current,E,c),it=N,tc(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(Be,y)}catch{}return!0}finally{K.p=g,O.T=f,R1(i,o)}}function T1(i,o,c){o=Er(c,o),o=um(i.stateNode,o,2),i=vs(i,o,2),i!==null&&(br(i,2),li(i))}function lt(i,o,c){if(i.tag===3)T1(i,i,c);else for(;o!==null;){if(o.tag===3){T1(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ws===null||!ws.has(f))){i=Er(c,i),c=Ax(2),f=vs(o,c,2),f!==null&&(Dx(c,f,o,i),br(f,2),li(f));break}}o=o.return}}function zm(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new qD;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(c)||(Rm=!0,g.add(c),i=XD.bind(null,i,o,c),o.then(i,i))}function XD(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,pt===i&&(Xe&c)===c&&(Mt===4||Mt===3&&(Xe&62914560)===Xe&&300>Ft()-yh?(it&2)===0&&Ta(i,0):Mm|=c,Ra===Xe&&(Ra=0)),li(i)}function A1(i,o){o===0&&(o=En()),i=lo(i,o),i!==null&&(br(i,o),li(i))}function ZD(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),A1(i,c)}function QD(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(o),A1(i,c)}function JD(i,o){return vn(i,o)}var Eh=null,Da=null,jm=!1,Rh=!1,Bm=!1,Es=0;function li(i){i!==Da&&i.next===null&&(Da===null?Eh=Da=i:Da=Da.next=i),Rh=!0,jm||(jm=!0,tN())}function tc(i,o){if(!Bm&&Rh){Bm=!0;do for(var c=!1,f=Eh;f!==null;){if(i!==0){var g=f.pendingLanes;if(g===0)var y=0;else{var E=f.suspendedLanes,N=f.pingedLanes;y=(1<<31-ot(42|i)+1)-1,y&=g&~(E&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,L1(f,y))}else y=Xe,y=sn(f,f===pt?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||$n(f,y)||(c=!0,L1(f,y));f=f.next}while(c);Bm=!1}}function eN(){D1()}function D1(){Rh=jm=!1;var i=0;Es!==0&&hN()&&(i=Es);for(var o=Ft(),c=null,f=Eh;f!==null;){var g=f.next,y=N1(f,o);y===0?(f.next=null,c===null?Eh=g:c.next=g,g===null&&(Da=c)):(c=f,(i!==0||(y&3)!==0)&&(Rh=!0)),f=g}Zt!==0&&Zt!==5||tc(i),Es!==0&&(Es=0)}function N1(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var E=31-ot(y),N=1<<E,q=g[E];q===-1?((N&c)===0||(N&f)!==0)&&(g[E]=Wn(N,o)):q<=o&&(i.expiredLanes|=N),y&=~N}if(o=pt,c=Xe,c=sn(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(at===2||at===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&yr(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||$n(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&yr(f),Ai(c)){case 2:case 8:c=de;break;case 32:c=Ee;break;case 268435456:c=he;break;default:c=Ee}return f=O1.bind(null,i),c=vn(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&yr(f),i.callbackPriority=2,i.callbackNode=null,2}function O1(i,o){if(Zt!==0&&Zt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(kh()&&i.callbackNode!==c)return null;var f=Xe;return f=sn(i,i===pt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(p1(i,f,o),N1(i,Ft()),i.callbackNode!=null&&i.callbackNode===c?O1.bind(null,i):null)}function L1(i,o){if(kh())return null;p1(i,o,!0)}function tN(){fN(function(){(it&6)!==0?vn(ae,eN):D1()})}function Pm(){if(Es===0){var i=ga;i===0&&(i=Xo,Xo<<=1,(Xo&261888)===0&&(Xo=256)),Es=i}return Es}function z1(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:zu(""+i)}function j1(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function nN(i,o,c,f,g){if(o==="submit"&&c&&c.stateNode===g){var y=z1((g[Vn]||null).action),E=f.submitter;E&&(o=(o=E[Vn]||null)?z1(o.formAction):E.getAttribute("formAction"),o!==null&&(y=o,E=null));var N=new Iu("action","action",null,f,g);i.push({event:N,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Es!==0){var q=E?j1(g,E):new FormData(g);im(c,{pending:!0,data:q,method:g.method,action:y},null,q)}}else typeof y=="function"&&(N.preventDefault(),q=E?j1(g,E):new FormData(g),im(c,{pending:!0,data:q,method:g.method,action:y},y,q))},currentTarget:g}]})}}for(var Im=0;Im<xp.length;Im++){var Hm=xp[Im],rN=Hm.toLowerCase(),iN=Hm[0].toUpperCase()+Hm.slice(1);qr(rN,"on"+iN)}qr(f0,"onAnimationEnd"),qr(p0,"onAnimationIteration"),qr(m0,"onAnimationStart"),qr("dblclick","onDoubleClick"),qr("focusin","onFocus"),qr("focusout","onBlur"),qr(bD,"onTransitionRun"),qr(xD,"onTransitionStart"),qr(SD,"onTransitionCancel"),qr(g0,"onTransitionEnd"),na("onMouseEnter",["mouseout","mouseover"]),na("onMouseLeave",["mouseout","mouseover"]),na("onPointerEnter",["pointerout","pointerover"]),na("onPointerLeave",["pointerout","pointerover"]),io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),io("onBeforeInput",["compositionend","keypress","textInput","paste"]),io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nc="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(" "),sN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nc));function B1(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],g=f.event;f=f.listeners;e:{var y=void 0;if(o)for(var E=f.length-1;0<=E;E--){var N=f[E],q=N.instance,te=N.currentTarget;if(N=N.listener,q!==y&&g.isPropagationStopped())break e;y=N,g.currentTarget=te;try{y(g)}catch(oe){Uu(oe)}g.currentTarget=null,y=q}else for(E=0;E<f.length;E++){if(N=f[E],q=N.instance,te=N.currentTarget,N=N.listener,q!==y&&g.isPropagationStopped())break e;y=N,g.currentTarget=te;try{y(g)}catch(oe){Uu(oe)}g.currentTarget=null,y=q}}}}function Ge(i,o){var c=o[Jf];c===void 0&&(c=o[Jf]=new Set);var f=i+"__bubble";c.has(f)||(P1(o,i,2,!1),c.add(f))}function Fm(i,o,c){var f=0;o&&(f|=4),P1(c,i,f,o)}var Mh="_reactListening"+Math.random().toString(36).slice(2);function Um(i){if(!i[Mh]){i[Mh]=!0,Db.forEach(function(c){c!=="selectionchange"&&(sN.has(c)||Fm(c,!1,i),Fm(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Mh]||(o[Mh]=!0,Fm("selectionchange",!1,o))}}function P1(i,o,c,f){switch(fS(o)){case 2:var g=ON;break;case 8:g=LN;break;default:g=rg}c=g.bind(null,o,c,i),g=void 0,!lp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(o,c,{capture:!0,passive:g}):i.addEventListener(o,c,!0):g!==void 0?i.addEventListener(o,c,{passive:g}):i.addEventListener(o,c,!1)}function $m(i,o,c,f,g){var y=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var N=f.stateNode.containerInfo;if(N===g)break;if(E===4)for(E=f.return;E!==null;){var q=E.tag;if((q===3||q===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;N!==null;){if(E=Jo(N),E===null)return;if(q=E.tag,q===5||q===6||q===26||q===27){f=y=E;continue e}N=N.parentNode}}f=f.return}$b(function(){var te=y,oe=op(c),ce=[];e:{var ne=v0.get(i);if(ne!==void 0){var ie=Iu,be=i;switch(i){case"keypress":if(Bu(c)===0)break e;case"keydown":case"keyup":ie=Q5;break;case"focusin":be="focus",ie=dp;break;case"focusout":be="blur",ie=dp;break;case"beforeblur":case"afterblur":ie=dp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Vb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=H5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=tD;break;case f0:case p0:case m0:ie=$5;break;case g0:ie=rD;break;case"scroll":case"scrollend":ie=P5;break;case"wheel":ie=sD;break;case"copy":case"cut":case"paste":ie=q5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Gb;break;case"toggle":case"beforetoggle":ie=aD}var De=(o&4)!==0,ht=!De&&(i==="scroll"||i==="scrollend"),Q=De?ne!==null?ne+"Capture":null:ne;De=[];for(var G=te,ee;G!==null;){var le=G;if(ee=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||ee===null||Q===null||(le=Cl(G,Q),le!=null&&De.push(rc(G,le,ee))),ht)break;G=G.return}0<De.length&&(ne=new ie(ne,be,null,c,oe),ce.push({event:ne,listeners:De}))}}if((o&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",ne&&c!==sp&&(be=c.relatedTarget||c.fromElement)&&(Jo(be)||be[Qo]))break e;if((ie||ne)&&(ne=oe.window===oe?oe:(ne=oe.ownerDocument)?ne.defaultView||ne.parentWindow:window,ie?(be=c.relatedTarget||c.toElement,ie=te,be=be?Jo(be):null,be!==null&&(ht=a(be),De=be.tag,be!==ht||De!==5&&De!==27&&De!==6)&&(be=null)):(ie=null,be=te),ie!==be)){if(De=Vb,le="onMouseLeave",Q="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(De=Gb,le="onPointerLeave",Q="onPointerEnter",G="pointer"),ht=ie==null?ne:wl(ie),ee=be==null?ne:wl(be),ne=new De(le,G+"leave",ie,c,oe),ne.target=ht,ne.relatedTarget=ee,le=null,Jo(oe)===te&&(De=new De(Q,G+"enter",be,c,oe),De.target=ee,De.relatedTarget=ht,le=De),ht=le,ie&&be)t:{for(De=oN,Q=ie,G=be,ee=0,le=Q;le;le=De(le))ee++;le=0;for(var Te=G;Te;Te=De(Te))le++;for(;0<ee-le;)Q=De(Q),ee--;for(;0<le-ee;)G=De(G),le--;for(;ee--;){if(Q===G||G!==null&&Q===G.alternate){De=Q;break t}Q=De(Q),G=De(G)}De=null}else De=null;ie!==null&&I1(ce,ne,ie,De,!1),be!==null&&ht!==null&&I1(ce,ht,be,De,!0)}}e:{if(ne=te?wl(te):window,ie=ne.nodeName&&ne.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ne.type==="file")var nt=n0;else if(e0(ne))if(r0)nt=vD;else{nt=mD;var we=pD}else ie=ne.nodeName,!ie||ie.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&ip(te.elementType)&&(nt=n0):nt=gD;if(nt&&(nt=nt(i,te))){t0(ce,nt,c,oe);break e}we&&we(i,ne,te),i==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&rp(ne,"number",ne.value)}switch(we=te?wl(te):window,i){case"focusin":(e0(we)||we.contentEditable==="true")&&(la=we,_p=te,Nl=null);break;case"focusout":Nl=_p=la=null;break;case"mousedown":yp=!0;break;case"contextmenu":case"mouseup":case"dragend":yp=!1,h0(ce,c,oe);break;case"selectionchange":if(yD)break;case"keydown":case"keyup":h0(ce,c,oe)}var Ie;if(pp)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else aa?Qb(i,c)&&(Ze="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Ze="onCompositionStart");Ze&&(Yb&&c.locale!=="ko"&&(aa||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&aa&&(Ie=Wb()):(us=oe,cp="value"in us?us.value:us.textContent,aa=!0)),we=Th(te,Ze),0<we.length&&(Ze=new Kb(Ze,i,null,c,oe),ce.push({event:Ze,listeners:we}),Ie?Ze.data=Ie:(Ie=Jb(c),Ie!==null&&(Ze.data=Ie)))),(Ie=cD?uD(i,c):hD(i,c))&&(Ze=Th(te,"onBeforeInput"),0<Ze.length&&(we=new Kb("onBeforeInput","beforeinput",null,c,oe),ce.push({event:we,listeners:Ze}),we.data=Ie)),nN(ce,i,te,c,oe)}B1(ce,o)})}function rc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Th(i,o){for(var c=o+"Capture",f=[];i!==null;){var g=i,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Cl(i,c),g!=null&&f.unshift(rc(i,g,y)),g=Cl(i,o),g!=null&&f.push(rc(i,g,y))),i.tag===3)return f;i=i.return}return[]}function oN(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function I1(i,o,c,f,g){for(var y=o._reactName,E=[];c!==null&&c!==f;){var N=c,q=N.alternate,te=N.stateNode;if(N=N.tag,q!==null&&q===f)break;N!==5&&N!==26&&N!==27||te===null||(q=te,g?(te=Cl(c,y),te!=null&&E.unshift(rc(c,te,q))):g||(te=Cl(c,y),te!=null&&E.push(rc(c,te,q)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var aN=/\r\n?/g,lN=/\u0000|\uFFFD/g;function H1(i){return(typeof i=="string"?i:""+i).replace(aN,`
49
+ `).replace(lN,"")}function F1(i,o){return o=H1(o),H1(i)===o}function ut(i,o,c,f,g,y){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||ia(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&ia(i,""+f);break;case"className":Ou(i,"class",f);break;case"tabIndex":Ou(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Ou(i,c,f);break;case"style":Fb(i,f,y);break;case"data":if(o!=="object"){Ou(i,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=zu(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(c,"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 y=="function"&&(c==="formAction"?(o!=="input"&&ut(i,o,"name",g.name,g,null),ut(i,o,"formEncType",g.formEncType,g,null),ut(i,o,"formMethod",g.formMethod,g,null),ut(i,o,"formTarget",g.formTarget,g,null)):(ut(i,o,"encType",g.encType,g,null),ut(i,o,"method",g.method,g,null),ut(i,o,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=zu(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Ni);break;case"onScroll":f!=null&&Ge("scroll",i);break;case"onScrollEnd":f!=null&&Ge("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=zu(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):i.removeAttribute(c);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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":Ge("beforetoggle",i),Ge("toggle",i),Nu(i,"popover",f);break;case"xlinkActuate":Di(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Di(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Di(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Di(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Di(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Di(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Di(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Di(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Di(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Nu(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=j5.get(c)||c,Nu(i,c,f))}}function Wm(i,o,c,f,g,y){switch(c){case"style":Fb(i,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?ia(i,f):(typeof f=="number"||typeof f=="bigint")&&ia(i,""+f);break;case"onScroll":f!=null&&Ge("scroll",i);break;case"onScrollEnd":f!=null&&Ge("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Ni);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),o=c.slice(2,g?c.length-7:void 0),y=i[Vn]||null,y=y!=null?y[c]:null,typeof y=="function"&&i.removeEventListener(o,y,g),typeof f=="function")){typeof y!="function"&&y!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,g);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):Nu(i,c,f)}}}function Sn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",i),Ge("load",i);var f=!1,g=!1,y;for(y in c)if(c.hasOwnProperty(y)){var E=c[y];if(E!=null)switch(y){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:ut(i,o,y,E,c,null)}}g&&ut(i,o,"srcSet",c.srcSet,c,null),f&&ut(i,o,"src",c.src,c,null);return;case"input":Ge("invalid",i);var N=y=E=g=null,q=null,te=null;for(f in c)if(c.hasOwnProperty(f)){var oe=c[f];if(oe!=null)switch(f){case"name":g=oe;break;case"type":E=oe;break;case"checked":q=oe;break;case"defaultChecked":te=oe;break;case"value":y=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,o));break;default:ut(i,o,f,oe,c,null)}}Bb(i,y,N,q,te,E,g,!1);return;case"select":Ge("invalid",i),f=E=y=null;for(g in c)if(c.hasOwnProperty(g)&&(N=c[g],N!=null))switch(g){case"value":y=N;break;case"defaultValue":E=N;break;case"multiple":f=N;default:ut(i,o,g,N,c,null)}o=y,c=E,i.multiple=!!f,o!=null?ra(i,!!f,o,!1):c!=null&&ra(i,!!f,c,!0);return;case"textarea":Ge("invalid",i),y=g=f=null;for(E in c)if(c.hasOwnProperty(E)&&(N=c[E],N!=null))switch(E){case"value":f=N;break;case"defaultValue":g=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:ut(i,o,E,N,c,null)}Ib(i,f,g,y);return;case"option":for(q in c)if(c.hasOwnProperty(q)&&(f=c[q],f!=null))switch(q){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:ut(i,o,q,f,c,null)}return;case"dialog":Ge("beforetoggle",i),Ge("toggle",i),Ge("cancel",i),Ge("close",i);break;case"iframe":case"object":Ge("load",i);break;case"video":case"audio":for(f=0;f<nc.length;f++)Ge(nc[f],i);break;case"image":Ge("error",i),Ge("load",i);break;case"details":Ge("toggle",i);break;case"embed":case"source":case"link":Ge("error",i),Ge("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in c)if(c.hasOwnProperty(te)&&(f=c[te],f!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:ut(i,o,te,f,c,null)}return;default:if(ip(o)){for(oe in c)c.hasOwnProperty(oe)&&(f=c[oe],f!==void 0&&Wm(i,o,oe,f,c,void 0));return}}for(N in c)c.hasOwnProperty(N)&&(f=c[N],f!=null&&ut(i,o,N,f,c,null))}function cN(i,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,E=null,N=null,q=null,te=null,oe=null;for(ie in c){var ce=c[ie];if(c.hasOwnProperty(ie)&&ce!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":q=ce;default:f.hasOwnProperty(ie)||ut(i,o,ie,null,f,ce)}}for(var ne in f){var ie=f[ne];if(ce=c[ne],f.hasOwnProperty(ne)&&(ie!=null||ce!=null))switch(ne){case"type":y=ie;break;case"name":g=ie;break;case"checked":te=ie;break;case"defaultChecked":oe=ie;break;case"value":E=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,o));break;default:ie!==ce&&ut(i,o,ne,ie,f,ce)}}np(i,E,N,q,te,oe,y,g);return;case"select":ie=E=N=ne=null;for(y in c)if(q=c[y],c.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":ie=q;default:f.hasOwnProperty(y)||ut(i,o,y,null,f,q)}for(g in f)if(y=f[g],q=c[g],f.hasOwnProperty(g)&&(y!=null||q!=null))switch(g){case"value":ne=y;break;case"defaultValue":N=y;break;case"multiple":E=y;default:y!==q&&ut(i,o,g,y,f,q)}o=N,c=E,f=ie,ne!=null?ra(i,!!c,ne,!1):!!f!=!!c&&(o!=null?ra(i,!!c,o,!0):ra(i,!!c,c?[]:"",!1));return;case"textarea":ie=ne=null;for(N in c)if(g=c[N],c.hasOwnProperty(N)&&g!=null&&!f.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:ut(i,o,N,null,f,g)}for(E in f)if(g=f[E],y=c[E],f.hasOwnProperty(E)&&(g!=null||y!=null))switch(E){case"value":ne=g;break;case"defaultValue":ie=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==y&&ut(i,o,E,g,f,y)}Pb(i,ne,ie);return;case"option":for(var be in c)if(ne=c[be],c.hasOwnProperty(be)&&ne!=null&&!f.hasOwnProperty(be))switch(be){case"selected":i.selected=!1;break;default:ut(i,o,be,null,f,ne)}for(q in f)if(ne=f[q],ie=c[q],f.hasOwnProperty(q)&&ne!==ie&&(ne!=null||ie!=null))switch(q){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:ut(i,o,q,ne,f,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in c)ne=c[De],c.hasOwnProperty(De)&&ne!=null&&!f.hasOwnProperty(De)&&ut(i,o,De,null,f,ne);for(te in f)if(ne=f[te],ie=c[te],f.hasOwnProperty(te)&&ne!==ie&&(ne!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,o));break;default:ut(i,o,te,ne,f,ie)}return;default:if(ip(o)){for(var ht in c)ne=c[ht],c.hasOwnProperty(ht)&&ne!==void 0&&!f.hasOwnProperty(ht)&&Wm(i,o,ht,void 0,f,ne);for(oe in f)ne=f[oe],ie=c[oe],!f.hasOwnProperty(oe)||ne===ie||ne===void 0&&ie===void 0||Wm(i,o,oe,ne,f,ie);return}}for(var Q in c)ne=c[Q],c.hasOwnProperty(Q)&&ne!=null&&!f.hasOwnProperty(Q)&&ut(i,o,Q,null,f,ne);for(ce in f)ne=f[ce],ie=c[ce],!f.hasOwnProperty(ce)||ne===ie||ne==null&&ie==null||ut(i,o,ce,ne,f,ie)}function U1(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uN(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var g=c[f],y=g.transferSize,E=g.initiatorType,N=g.duration;if(y&&N&&U1(E)){for(E=0,N=g.responseEnd,f+=1;f<c.length;f++){var q=c[f],te=q.startTime;if(te>N)break;var oe=q.transferSize,ce=q.initiatorType;oe&&U1(ce)&&(q=q.responseEnd,E+=oe*(q<N?1:(N-te)/(q-te)))}if(--f,o+=8*(y+E)/(g.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var qm=null,Vm=null;function Ah(i){return i.nodeType===9?i:i.ownerDocument}function $1(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function W1(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function Km(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Gm=null;function hN(){var i=window.event;return i&&i.type==="popstate"?i===Gm?!1:(Gm=i,!0):(Gm=null,!1)}var q1=typeof setTimeout=="function"?setTimeout:void 0,dN=typeof clearTimeout=="function"?clearTimeout:void 0,V1=typeof Promise=="function"?Promise:void 0,fN=typeof queueMicrotask=="function"?queueMicrotask:typeof V1<"u"?function(i){return V1.resolve(null).then(i).catch(pN)}:q1;function pN(i){setTimeout(function(){throw i})}function Rs(i){return i==="head"}function K1(i,o){var c=o,f=0;do{var g=c.nextSibling;if(i.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(g),za(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")ic(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,ic(c);for(var y=c.firstChild;y;){var E=y.nextSibling,N=y.nodeName;y[Sl]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=E}}else c==="body"&&ic(i.ownerDocument.body);c=g}while(c);za(o)}function G1(i,o){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function Ym(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ym(c),ep(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function mN(i,o,c,f){for(;i.nodeType===1;){var g=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Sl])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==g.rel||i.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||i.getAttribute("title")!==(g.title==null?null:g.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(g.src==null?null:g.src)||i.getAttribute("type")!==(g.type==null?null:g.type)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Dr(i.nextSibling),i===null)break}return null}function gN(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Dr(i.nextSibling),i===null))return null;return i}function Y1(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Dr(i.nextSibling),i===null))return null;return i}function Xm(i){return i.data==="$?"||i.data==="$~"}function Zm(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function vN(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Dr(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Qm=null;function X1(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return Dr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function Z1(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function Q1(i,o,c){switch(o=Ah(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function ic(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);ep(i)}var Nr=new Map,J1=new Set;function Dh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Gi=K.d;K.d={f:_N,r:yN,D:bN,C:xN,L:SN,m:wN,X:kN,S:CN,M:EN};function _N(){var i=Gi.f(),o=Sh();return i||o}function yN(i){var o=ea(i);o!==null&&o.tag===5&&o.type==="form"?gx(o):Gi.r(i)}var Na=typeof document>"u"?null:document;function eS(i,o,c){var f=Na;if(f&&typeof o=="string"&&o){var g=Cr(o);g='link[rel="'+i+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),J1.has(g)||(J1.add(g),i={rel:i,crossOrigin:c,href:o},f.querySelector(g)===null&&(o=f.createElement("link"),Sn(o,"link",i),on(o),f.head.appendChild(o)))}}function bN(i){Gi.D(i),eS("dns-prefetch",i,null)}function xN(i,o){Gi.C(i,o),eS("preconnect",i,o)}function SN(i,o,c){Gi.L(i,o,c);var f=Na;if(f&&i&&o){var g='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+Cr(c.imageSizes)+'"]')):g+='[href="'+Cr(i)+'"]';var y=g;switch(o){case"style":y=Oa(i);break;case"script":y=La(i)}Nr.has(y)||(i=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),Nr.set(y,i),f.querySelector(g)!==null||o==="style"&&f.querySelector(sc(y))||o==="script"&&f.querySelector(oc(y))||(o=f.createElement("link"),Sn(o,"link",i),on(o),f.head.appendChild(o)))}}function wN(i,o){Gi.m(i,o);var c=Na;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+Cr(f)+'"][href="'+Cr(i)+'"]',y=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=La(i)}if(!Nr.has(y)&&(i=m({rel:"modulepreload",href:i},o),Nr.set(y,i),c.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(oc(y)))return}f=c.createElement("link"),Sn(f,"link",i),on(f),c.head.appendChild(f)}}}function CN(i,o,c){Gi.S(i,o,c);var f=Na;if(f&&i){var g=ta(f).hoistableStyles,y=Oa(i);o=o||"default";var E=g.get(y);if(!E){var N={loading:0,preload:null};if(E=f.querySelector(sc(y)))N.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},c),(c=Nr.get(y))&&Jm(i,c);var q=E=f.createElement("link");on(q),Sn(q,"link",i),q._p=new Promise(function(te,oe){q.onload=te,q.onerror=oe}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Nh(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:N},g.set(y,E)}}}function kN(i,o){Gi.X(i,o);var c=Na;if(c&&i){var f=ta(c).hoistableScripts,g=La(i),y=f.get(g);y||(y=c.querySelector(oc(g)),y||(i=m({src:i,async:!0},o),(o=Nr.get(g))&&eg(i,o),y=c.createElement("script"),on(y),Sn(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function EN(i,o){Gi.M(i,o);var c=Na;if(c&&i){var f=ta(c).hoistableScripts,g=La(i),y=f.get(g);y||(y=c.querySelector(oc(g)),y||(i=m({src:i,async:!0,type:"module"},o),(o=Nr.get(g))&&eg(i,o),y=c.createElement("script"),on(y),Sn(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function tS(i,o,c,f){var g=(g=re.current)?Dh(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Oa(c.href),c=ta(g).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Oa(c.href);var y=ta(g).hoistableStyles,E=y.get(i);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,E),(y=g.querySelector(sc(i)))&&!y._p&&(E.instance=y,E.state.loading=5),Nr.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Nr.set(i,c),y||RN(g,i,c,E.state))),o&&f===null)throw Error(r(528,""));return E}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=La(c),c=ta(g).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Oa(i){return'href="'+Cr(i)+'"'}function sc(i){return'link[rel="stylesheet"]['+i+"]"}function nS(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function RN(i,o,c,f){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=i.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),Sn(o,"link",c),on(o),i.head.appendChild(o))}function La(i){return'[src="'+Cr(i)+'"]'}function oc(i){return"script[async]"+i}function rS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(f)return o.instance=f,on(f),f;var g=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),on(f),Sn(f,"style",g),Nh(f,c.precedence,i),o.instance=f;case"stylesheet":g=Oa(c.href);var y=i.querySelector(sc(g));if(y)return o.state.loading|=4,o.instance=y,on(y),y;f=nS(c),(g=Nr.get(g))&&Jm(f,g),y=(i.ownerDocument||i).createElement("link"),on(y);var E=y;return E._p=new Promise(function(N,q){E.onload=N,E.onerror=q}),Sn(y,"link",f),o.state.loading|=4,Nh(y,c.precedence,i),o.instance=y;case"script":return y=La(c.src),(g=i.querySelector(oc(y)))?(o.instance=g,on(g),g):(f=c,(g=Nr.get(y))&&(f=m({},c),eg(f,g)),i=i.ownerDocument||i,g=i.createElement("script"),on(g),Sn(g,"link",f),i.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,Nh(f,c.precedence,i));return o.instance}function Nh(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,y=g,E=0;E<f.length;E++){var N=f[E];if(N.dataset.precedence===o)y=N;else if(y!==g)break}y?y.parentNode.insertBefore(i,y.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Jm(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function eg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Oh=null;function iS(i,o,c){if(Oh===null){var f=new Map,g=Oh=new Map;g.set(c,f)}else g=Oh,f=g.get(c),f||(f=new Map,g.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),g=0;g<c.length;g++){var y=c[g];if(!(y[Sl]||y[_n]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(o)||"";E=i+E;var N=f.get(E);N?N.push(y):f.set(E,[y])}}return f}function sS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function MN(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function oS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function TN(i,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=Oa(f.href),y=o.querySelector(sc(g));if(y){o=y._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=Lh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=y,on(y);return}y=o.ownerDocument||o,f=nS(f),(g=Nr.get(g))&&Jm(f,g),y=y.createElement("link"),on(y);var E=y;E._p=new Promise(function(N,q){E.onload=N,E.onerror=q}),Sn(y,"link",f),c.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=Lh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var tg=0;function AN(i,o){return i.stylesheets&&i.count===0&&jh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&jh(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+o);0<i.imgBytes&&tg===0&&(tg=62500*uN());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&jh(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>tg?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function Lh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var zh=null;function jh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,zh=new Map,o.forEach(DN,i),zh=null,Lh.call(i))}function DN(i,o){if(!(o.state.loading&4)){var c=zh.get(i);if(c)var f=c.get(null);else{c=new Map,zh.set(i,c);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var E=g[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}g=o.instance,E=g.getAttribute("data-precedence"),y=c.get(E)||f,y===f&&c.set(null,g),c.set(E,g),this.count++,f=Lh.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),y?y.parentNode.insertBefore(g,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(g,i.firstChild)),o.state.loading|=4}}var ac={$$typeof:R,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function NN(i,o,c,f,g,y,E,N,q){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qn(0),this.hiddenUpdates=qn(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function aS(i,o,c,f,g,y,E,N,q,te,oe,ce){return i=new NN(i,o,c,E,q,te,oe,ce,N),o=1,y===!0&&(o|=24),y=ar(3,null,null,o),i.current=y,y.stateNode=i,o=Lp(),o.refCount++,i.pooledCache=o,o.refCount++,y.memoizedState={element:f,isDehydrated:c,cache:o},Pp(y),i}function lS(i){return i?(i=ha,i):ha}function cS(i,o,c,f,g,y){g=lS(g),f.context===null?f.context=g:f.pendingContext=g,f=gs(o),f.payload={element:c},y=y===void 0?null:y,y!==null&&(f.callback=y),c=vs(i,f,o),c!==null&&(Qn(c,i,o),Il(c,i,o))}function uS(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function ng(i,o){uS(i,o),(i=i.alternate)&&uS(i,o)}function hS(i){if(i.tag===13||i.tag===31){var o=lo(i,67108864);o!==null&&Qn(o,i,67108864),ng(i,67108864)}}function dS(i){if(i.tag===13||i.tag===31){var o=dr();o=Ti(o);var c=lo(i,o);c!==null&&Qn(c,i,o),ng(i,o)}}var Bh=!0;function ON(i,o,c,f){var g=O.T;O.T=null;var y=K.p;try{K.p=2,rg(i,o,c,f)}finally{K.p=y,O.T=g}}function LN(i,o,c,f){var g=O.T;O.T=null;var y=K.p;try{K.p=8,rg(i,o,c,f)}finally{K.p=y,O.T=g}}function rg(i,o,c,f){if(Bh){var g=ig(f);if(g===null)$m(i,o,f,Ph,c),pS(i,f);else if(jN(g,i,o,c,f))f.stopPropagation();else if(pS(i,f),o&4&&-1<zN.indexOf(i)){for(;g!==null;){var y=ea(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=Lt(y.pendingLanes);if(E!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var q=1<<31-ot(E);N.entanglements[1]|=q,E&=~q}li(y),(it&6)===0&&(bh=Ft()+500,tc(0))}}break;case 31:case 13:N=lo(y,2),N!==null&&Qn(N,y,2),Sh(),ng(y,2)}if(y=ig(f),y===null&&$m(i,o,f,Ph,c),y===g)break;g=y}g!==null&&f.stopPropagation()}else $m(i,o,f,null,c)}}function ig(i){return i=op(i),sg(i)}var Ph=null;function sg(i){if(Ph=null,i=Jo(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Ph=i,null}function fS(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ro()){case ae:return 2;case de:return 8;case Ee:case Le:return 32;case he:return 268435456;default:return 32}default:return 32}}var og=!1,Ms=null,Ts=null,As=null,lc=new Map,cc=new Map,Ds=[],zN="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 pS(i,o){switch(i){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":lc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":cc.delete(o.pointerId)}}function uc(i,o,c,f,g,y){return i===null||i.nativeEvent!==y?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:y,targetContainers:[g]},o!==null&&(o=ea(o),o!==null&&hS(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function jN(i,o,c,f,g){switch(o){case"focusin":return Ms=uc(Ms,i,o,c,f,g),!0;case"dragenter":return Ts=uc(Ts,i,o,c,f,g),!0;case"mouseover":return As=uc(As,i,o,c,f,g),!0;case"pointerover":var y=g.pointerId;return lc.set(y,uc(lc.get(y)||null,i,o,c,f,g)),!0;case"gotpointercapture":return y=g.pointerId,cc.set(y,uc(cc.get(y)||null,i,o,c,f,g)),!0}return!1}function mS(i){var o=Jo(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,cs(i.priority,function(){dS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,cs(i.priority,function(){dS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ih(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=ig(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);sp=f,c.target.dispatchEvent(f),sp=null}else return o=ea(c),o!==null&&hS(o),i.blockedOn=c,!1;o.shift()}return!0}function gS(i,o,c){Ih(i)&&c.delete(o)}function BN(){og=!1,Ms!==null&&Ih(Ms)&&(Ms=null),Ts!==null&&Ih(Ts)&&(Ts=null),As!==null&&Ih(As)&&(As=null),lc.forEach(gS),cc.forEach(gS)}function Hh(i,o){i.blockedOn===o&&(i.blockedOn=null,og||(og=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,BN)))}var Fh=null;function vS(i){Fh!==i&&(Fh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fh===i&&(Fh=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],g=i[o+2];if(typeof f!="function"){if(sg(f||c)===null)continue;break}var y=ea(c);y!==null&&(i.splice(o,3),o-=3,im(y,{pending:!0,data:g,method:c.method,action:f},f,g))}}))}function za(i){function o(q){return Hh(q,i)}Ms!==null&&Hh(Ms,i),Ts!==null&&Hh(Ts,i),As!==null&&Hh(As,i),lc.forEach(o),cc.forEach(o);for(var c=0;c<Ds.length;c++){var f=Ds[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Ds.length&&(c=Ds[0],c.blockedOn===null);)mS(c),c.blockedOn===null&&Ds.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var g=c[f],y=c[f+1],E=g[Vn]||null;if(typeof y=="function")E||vS(c);else if(E){var N=null;if(y&&y.hasAttribute("formAction")){if(g=y,E=y[Vn]||null)N=E.formAction;else if(sg(g)!==null)continue}else N=E.action;typeof N=="function"?c[f+1]=N:(c.splice(f,3),f-=3),vS(c)}}}function _S(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function ag(i){this._internalRoot=i}Uh.prototype.render=ag.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=dr();cS(c,f,i,o,null,null)},Uh.prototype.unmount=ag.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;cS(i.current,2,null,i,null,null),Sh(),o[Qo]=null}};function Uh(i){this._internalRoot=i}Uh.prototype.unstable_scheduleHydration=function(i){if(i){var o=Wr();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ds.length&&o!==0&&o<Ds[c].priority;c++);Ds.splice(c,0,i),c===0&&mS(i)}};var yS=t.version;if(yS!=="19.2.1")throw Error(r(527,yS,"19.2.1"));K.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var PN={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Be=$h.inject(PN),Fe=$h}catch{}}return fc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",g=Ex,y=Rx,E=Mx;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=aS(i,1,!1,null,null,c,f,null,g,y,E,_S),i[Qo]=o.current,Um(i),new ag(o)},fc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,g="",y=Ex,E=Rx,N=Mx,q=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(N=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),o=aS(i,1,!0,o,c??null,f,g,q,y,E,N,_S),o.context=lS(null),c=o.current,f=dr(),f=Ti(f),g=gs(f),g.callback=null,vs(c,g,f),c=f,o.current.lanes=c,br(o,c),li(o),i[Qo]=o.current,Um(i),new Uh(o)},fc.version="19.2.1",fc}var OS;function XN(){if(OS)return ug.exports;OS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ug.exports=YN(),ug.exports}var ZN=XN();/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var LS="popstate";function zS(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function QN(e={}){function t(r,s){var h;let a=(h=s.state)==null?void 0:h.masked,{pathname:l,search:u,hash:d}=a||r.location;return yv("",{pathname:l,search:u,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:qc(s)}return e3(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JN(){return Math.random().toString(36).substring(2,10)}function jS(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function yv(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ul(t):t,state:n,key:t&&t.key||r||JN(),unstable_mask:s}}function qc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ul(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function e3(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,u="POP",d=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function m(){u="POP";let C=p(),k=C==null?null:C-h;h=C,d&&d({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=zS(C)?C:yv(w.location,C,k);h=p()+1;let R=jS(T,h),D=w.createHref(T.unstable_mask||T);try{l.pushState(R,"",D)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;s.location.assign(D)}a&&d&&d({action:u,location:w.location,delta:1})}function b(C,k){u="REPLACE";let T=zS(C)?C:yv(w.location,C,k);h=p();let R=jS(T,h),D=w.createHref(T.unstable_mask||T);l.replaceState(R,"",D),a&&d&&d({action:u,location:w.location,delta:0})}function S(C){return t3(C)}let w={get action(){return u},get location(){return e(s,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(LS,m),d=C,()=>{s.removeEventListener(LS,m),d=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let k=S(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:b,go(C){return l.go(C)}};return w}function t3(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Et(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function gk(e,t,n="/"){return n3(e,t,n,!1)}function n3(e,t,n,r){let s=typeof t=="string"?ul(t):t,a=es(s.pathname||"/",n);if(a==null)return null;let l=vk(e);r3(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let h=p3(a);u=d3(l[d],h,r)}return u}function vk(e,t=[],n=[],r="",s=!1){let a=(l,u,d=s,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;Et(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=_i([r,p.relativePath]),_=n.concat(p);l.children&&l.children.length>0&&(Et(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),vk(l.children,t,_,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:u3(m,l.index),routesMeta:_})};return e.forEach((l,u)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,u);else for(let h of _k(l.path))a(l,u,!0,h)}),t}function _k(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=_k(r.join("/")),u=[];return u.push(...l.map(d=>d===""?a:[a,d].join("/"))),s&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function r3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:h3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var i3=/^:[\w-]+$/,s3=3,o3=2,a3=1,l3=10,c3=-2,BS=e=>e==="*";function u3(e,t){let n=e.split("/"),r=n.length;return n.some(BS)&&(r+=c3),t&&(r+=o3),n.filter(s=>!BS(s)).reduce((s,a)=>s+(i3.test(a)?s3:a===""?a3:l3),r)}function h3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function d3(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],h=u===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",m=Pd({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},p),_=d.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=Pd({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;Object.assign(s,m.params),l.push({params:s,pathname:_i([a,m.pathname]),pathnameBase:_3(_i([a,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(a=_i([a,m.pathnameBase]))}return l}function Pd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=f3(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:m},_)=>{if(p==="*"){let S=u[_]||"";l=a.slice(0,a.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[_];return m&&!b?h[p]=void 0:h[p]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:a,pathnameBase:l,pattern:e}}function f3(e,t=!1,n=!0){xi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d,h,p)=>{if(r.push({paramName:u,isOptional:d!=null}),d){let m=p.charAt(h+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function p3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function es(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var m3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function g3(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ul(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=PS(n.substring(1),"/"):a=PS(n,t)):a=t,{pathname:a,search:y3(r),hash:b3(s)}}function PS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function pg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function v3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yk(e){let t=v3(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function V_(e,t,n,r=!1){let s;typeof e=="string"?s=ul(e):(s={...e},Et(!s.pathname||!s.pathname.includes("?"),pg("?","pathname","search",s)),Et(!s.pathname||!s.pathname.includes("#"),pg("#","pathname","hash",s)),Et(!s.search||!s.search.includes("#"),pg("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let _=l.split("/");for(;_[0]==="..";)_.shift(),m-=1;s.pathname=_.join("/")}u=m>=0?t[m]:"/"}let d=g3(s,u),h=l&&l!=="/"&&l.endsWith("/"),p=(a||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||p)&&(d.pathname+="/"),d}var _i=e=>e.join("/").replace(/\/\/+/g,"/"),_3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),y3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,b3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,x3=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function S3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function w3(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xk(e,t){let n=e;if(typeof n!="string"||!m3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(bk)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=es(l.pathname,t);l.origin===a.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{xi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Sk=["POST","PUT","PATCH","DELETE"];new Set(Sk);var C3=["GET",...Sk];new Set(C3);var hl=x.createContext(null);hl.displayName="DataRouter";var gf=x.createContext(null);gf.displayName="DataRouterState";var k3=x.createContext(!1),wk=x.createContext({isTransitioning:!1});wk.displayName="ViewTransition";var E3=x.createContext(new Map);E3.displayName="Fetchers";var R3=x.createContext(null);R3.displayName="Await";var Fr=x.createContext(null);Fr.displayName="Navigation";var lu=x.createContext(null);lu.displayName="Location";var ti=x.createContext({outlet:null,matches:[],isDataRoute:!1});ti.displayName="Route";var K_=x.createContext(null);K_.displayName="RouteError";var Ck="REACT_ROUTER_ERROR",M3="REDIRECT",T3="ROUTE_ERROR_RESPONSE";function A3(e){if(e.startsWith(`${Ck}:${M3}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function D3(e){if(e.startsWith(`${Ck}:${T3}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new x3(t.status,t.statusText,t.data)}catch{}}function N3(e,{relative:t}={}){Et(cu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Fr),{hash:s,pathname:a,search:l}=uu(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:_i([n,a])),r.createHref({pathname:u,search:l,hash:s})}function cu(){return x.useContext(lu)!=null}function ki(){return Et(cu(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(lu).location}var kk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ek(e){x.useContext(Fr).static||x.useLayoutEffect(e)}function G_(){let{isDataRoute:e}=x.useContext(ti);return e?K3():O3()}function O3(){Et(cu(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(hl),{basename:t,navigator:n}=x.useContext(Fr),{matches:r}=x.useContext(ti),{pathname:s}=ki(),a=JSON.stringify(yk(r)),l=x.useRef(!1);return Ek(()=>{l.current=!0}),x.useCallback((d,h={})=>{if(xi(l.current,kk),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=V_(d,JSON.parse(a),s,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:_i([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,a,s,e])}var Rk=x.createContext(null);function Y_(){return x.useContext(Rk)}function L3(e){let t=x.useContext(ti).outlet;return x.useMemo(()=>t&&x.createElement(Rk.Provider,{value:e},t),[t,e])}function z3(){let{matches:e}=x.useContext(ti),t=e[e.length-1];return t?t.params:{}}function uu(e,{relative:t}={}){let{matches:n}=x.useContext(ti),{pathname:r}=ki(),s=JSON.stringify(yk(n));return x.useMemo(()=>V_(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function j3(e,t){return Mk(e,t)}function Mk(e,t,n){var C;Et(cu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(Fr),{matches:s}=x.useContext(ti),a=s[s.length-1],l=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",h=a&&a.route;{let k=h&&h.path||"";Ak(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=ki(),m;if(t){let k=typeof t=="string"?ul(t):t;Et(d==="/"||((C=k.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),m=k}else m=p;let _=m.pathname||"/",b=_;if(d!=="/"){let k=d.replace(/^\//,"").split("/");b="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=gk(e,{pathname:b});xi(h||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),xi(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=F3(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:_i([d,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:_i([d,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?x.createElement(lu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},w):w}function B3(){let e=V3(),t=S3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:a},"ErrorBoundary")," or"," ",x.createElement("code",{style:a},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:s},n):null,l)}var P3=x.createElement(B3,null),Tk=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=D3(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(ti.Provider,{value:this.props.routeContext},x.createElement(K_.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(I3,{error:e},t):t}};Tk.contextType=k3;var mg=new WeakMap;function I3({children:e,error:t}){let{basename:n}=x.useContext(Fr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=A3(t.digest);if(r){let s=mg.get(t);if(s)throw s;let a=xk(r.location,n);if(bk&&!mg.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw mg.set(t,l),l}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function H3({routeContext:e,match:t,children:n}){let r=x.useContext(hl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(ti.Provider,{value:e},n)}function F3(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,a=r==null?void 0:r.errors;if(a!=null){let p=s.findIndex(m=>m.route.id&&(a==null?void 0:a[m.route.id])!==void 0);Et(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<s.length;p++){let m=s[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:_,errors:b}=r,S=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||S){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,h=r&&d?(p,m)=>{var _,b;d(p,{location:r.location,params:((b=(_=r.matches)==null?void 0:_[0])==null?void 0:b.params)??{},unstable_pattern:w3(r.matches),errorInfo:m})}:void 0;return s.reduceRight((p,m,_)=>{let b,S=!1,w=null,C=null;r&&(b=a&&m.route.id?a[m.route.id]:void 0,w=m.route.errorElement||P3,l&&(u<0&&_===0?(Ak("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):u===_&&(S=!0,C=m.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),T=()=>{let R;return b?R=w:S?R=C:m.route.Component?R=x.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=p,x.createElement(H3,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:R})};return r&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?x.createElement(Tk,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):T()},null)}function X_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function U3(e){let t=x.useContext(hl);return Et(t,X_(e)),t}function $3(e){let t=x.useContext(gf);return Et(t,X_(e)),t}function W3(e){let t=x.useContext(ti);return Et(t,X_(e)),t}function Z_(e){let t=W3(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function q3(){return Z_("useRouteId")}function V3(){var r;let e=x.useContext(K_),t=$3("useRouteError"),n=Z_("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function K3(){let{router:e}=U3("useNavigate"),t=Z_("useNavigate"),n=x.useRef(!1);return Ek(()=>{n.current=!0}),x.useCallback(async(s,a={})=>{xi(n.current,kk),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var IS={};function Ak(e,t,n){!t&&!IS[e]&&(IS[e]=!0,xi(!1,n))}x.memo(G3);function G3({routes:e,future:t,state:n,isStatic:r,onError:s}){return Mk(e,void 0,{state:n,isStatic:r,onError:s})}function Y3(e){return L3(e.context)}function Mc(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function X3({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1,unstable_useTransitions:l}){Et(!cu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:u,navigator:s,static:a,unstable_useTransitions:l,future:{}}),[u,s,a,l]);typeof n=="string"&&(n=ul(n));let{pathname:h="/",search:p="",hash:m="",state:_=null,key:b="default",unstable_mask:S}=n,w=x.useMemo(()=>{let C=es(h,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:_,key:b,unstable_mask:S},navigationType:r}},[u,h,p,m,_,b,r,S]);return xi(w!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Fr.Provider,{value:d},x.createElement(lu.Provider,{children:t,value:w}))}function Z3({children:e,location:t}){return j3(bv(e),t)}function bv(e,t=[]){let n=[];return x.Children.forEach(e,(r,s)=>{if(!x.isValidElement(r))return;let a=[...t,s];if(r.type===x.Fragment){n.push.apply(n,bv(r.props.children,a));return}Et(r.type===Mc,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Et(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=bv(r.props.children,a)),n.push(l)}),n}var Sd="get",wd="application/x-www-form-urlencoded";function vf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Q3(e){return vf(e)&&e.tagName.toLowerCase()==="button"}function J3(e){return vf(e)&&e.tagName.toLowerCase()==="form"}function e4(e){return vf(e)&&e.tagName.toLowerCase()==="input"}function t4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function n4(e,t){return e.button===0&&(!t||t==="_self")&&!t4(e)}var Wh=null;function r4(){if(Wh===null)try{new FormData(document.createElement("form"),0),Wh=!1}catch{Wh=!0}return Wh}var i4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gg(e){return e!=null&&!i4.has(e)?(xi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wd}"`),null):e}function s4(e,t){let n,r,s,a,l;if(J3(e)){let u=e.getAttribute("action");r=u?es(u,t):null,n=e.getAttribute("method")||Sd,s=gg(e.getAttribute("enctype"))||wd,a=new FormData(e)}else if(Q3(e)||e4(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(r=d?es(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Sd,s=gg(e.getAttribute("formenctype"))||gg(u.getAttribute("enctype"))||wd,a=new FormData(u,e),!r4()){let{name:h,type:p,value:m}=e;if(p==="image"){let _=h?`${h}.`:"";a.append(`${_}x`,"0"),a.append(`${_}y`,"0")}else h&&a.append(h,m)}}else{if(vf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sd,r=null,s=wd,l=e}return a&&s==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Q_(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function o4(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&es(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function a4(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function l4(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function c4(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let l=await a4(a,n);return l.links?l.links():[]}return[]}));return f4(r.flat(1).filter(l4).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function HS(e,t,n,r,s,a){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,u=(d,h)=>{var p;return n[h].pathname!==d.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,h)=>l(d,h)||u(d,h)):a==="data"?t.filter((d,h)=>{var m;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let _=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function u4(e,t,{includeHydrateFallback:n}={}){return h4(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function h4(e){return[...new Set(e)]}function d4(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function f4(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(d4(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function Dk(){let e=x.useContext(hl);return Q_(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function p4(){let e=x.useContext(gf);return Q_(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var J_=x.createContext(void 0);J_.displayName="FrameworkContext";function Nk(){let e=x.useContext(J_);return Q_(e,"You must render this element inside a <HydratedRouter> element"),e}function m4(e,t){let n=x.useContext(J_),[r,s]=x.useState(!1),[a,l]=x.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:p,onTouchStart:m}=t,_=x.useRef(null);x.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=k=>{k.forEach(T=>{l(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[a,_,{}]:[a,_,{onFocus:pc(u,b),onBlur:pc(d,S),onMouseEnter:pc(h,b),onMouseLeave:pc(p,S),onTouchStart:pc(m,b)}]:[!1,_,{}]}function pc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function g4({page:e,...t}){let{router:n}=Dk(),r=x.useMemo(()=>gk(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(_4,{page:e,matches:r,...t}):null}function v4(e){let{manifest:t,routeModules:n}=Nk(),[r,s]=x.useState([]);return x.useEffect(()=>{let a=!1;return c4(e,t,n).then(l=>{a||s(l)}),()=>{a=!0}},[e,t,n]),r}function _4({page:e,matches:t,...n}){let r=ki(),{future:s,manifest:a,routeModules:l}=Nk(),{basename:u}=Dk(),{loaderData:d,matches:h}=p4(),p=x.useMemo(()=>HS(e,t,h,a,r,"data"),[e,t,h,a,r]),m=x.useMemo(()=>HS(e,t,h,a,r,"assets"),[e,t,h,a,r]),_=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var D;let R=a.routes[T.route.id];!R||!R.hasLoader||(!p.some(z=>z.route.id===T.route.id)&&T.route.id in d&&((D=l[T.route.id])!=null&&D.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=o4(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&k.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,d,r,a,p,t,e,l]),b=x.useMemo(()=>u4(m,a),[m,a]),S=v4(m);return x.createElement(x.Fragment,null,_.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>x.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function y4(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var b4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{b4&&(window.__reactRouterVersion="7.13.1")}catch{}function x4({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=x.useRef();s.current==null&&(s.current=QN({window:r,v5Compat:!0}));let a=s.current,[l,u]=x.useState({action:a.action,location:a.location}),d=x.useCallback(h=>{n===!1?u(h):x.startTransition(()=>u(h))},[n]);return x.useLayoutEffect(()=>a.listen(d),[a,d]),x.createElement(X3,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:n})}var Ok=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lk=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:l,unstable_mask:u,state:d,target:h,to:p,preventScrollReset:m,viewTransition:_,unstable_defaultShouldRevalidate:b,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=x.useContext(Fr),R=typeof p=="string"&&Ok.test(p),D=xk(p,C);p=D.to;let z=N3(p,{relative:s}),L=ki(),j=null;if(u){let U=V_(u,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);C!=="/"&&(U.pathname=U.pathname==="/"?C:_i([C,U.pathname])),j=k.createHref(U)}let[I,Z,P]=m4(r,S),W=k4(p,{replace:l,unstable_mask:u,state:d,target:h,preventScrollReset:m,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:b,unstable_useTransitions:T});function H(U){t&&t(U),U.defaultPrevented||W(U)}let F=!(D.isExternal||a),V=x.createElement("a",{...S,...P,href:(F?j:void 0)||D.absoluteURL||z,onClick:F?H:t,ref:y4(w,Z),target:h,"data-discover":!R&&n==="render"?"true":void 0});return I&&!R?x.createElement(x.Fragment,null,V,x.createElement(g4,{page:z})):V});Lk.displayName="Link";var S4=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:l,viewTransition:u,children:d,...h},p){let m=uu(l,{relative:h.relative}),_=ki(),b=x.useContext(gf),{navigator:S,basename:w}=x.useContext(Fr),C=b!=null&&A4(m)&&u===!0,k=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,T=_.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=es(R,w)||R);const D=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=T===k||!s&&T.startsWith(k)&&T.charAt(D)==="/",L=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),j={isActive:z,isPending:L,isTransitioning:C},I=z?t:void 0,Z;typeof r=="function"?Z=r(j):Z=[r,z?"active":null,L?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let P=typeof a=="function"?a(j):a;return x.createElement(Lk,{...h,"aria-current":I,className:Z,ref:p,style:P,to:l,viewTransition:u},typeof d=="function"?d(j):d)});S4.displayName="NavLink";var w4=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:l=Sd,action:u,onSubmit:d,relative:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_,...b},S)=>{let{unstable_useTransitions:w}=x.useContext(Fr),C=M4(),k=T4(u,{relative:h}),T=l.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&Ok.test(u),D=z=>{if(d&&d(z),z.defaultPrevented)return;z.preventDefault();let L=z.nativeEvent.submitter,j=(L==null?void 0:L.getAttribute("formmethod"))||l,I=()=>C(L||z.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:s,state:a,relative:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_});w&&n!==!1?x.startTransition(()=>I()):I()};return x.createElement("form",{ref:S,method:T,action:k,onSubmit:r?d:D,...b,"data-discover":!R&&e==="render"?"true":void 0})});w4.displayName="Form";function C4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zk(e){let t=x.useContext(hl);return Et(t,C4(e)),t}function k4(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let p=G_(),m=ki(),_=uu(e,{relative:l});return x.useCallback(b=>{if(n4(b,t)){b.preventDefault();let S=n!==void 0?n:qc(m)===qc(_),w=()=>p(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:a,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d});h?x.startTransition(()=>w()):w()}},[m,p,_,n,r,s,t,e,a,l,u,d,h])}var E4=0,R4=()=>`__${String(++E4)}__`;function M4(){let{router:e}=zk("useSubmit"),{basename:t}=x.useContext(Fr),n=q3(),r=e.fetch,s=e.navigate;return x.useCallback(async(a,l={})=>{let{action:u,method:d,encType:h,formData:p,body:m}=s4(a,t);if(l.navigate===!1){let _=l.fetcherKey||R4();await r(_,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function T4(e,{relative:t}={}){let{basename:n}=x.useContext(Fr),r=x.useContext(ti);Et(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...uu(e||".",{relative:t})},l=ki();if(e==null){a.search=l.search;let u=new URLSearchParams(a.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:_i([n,a.pathname])),qc(a)}function A4(e,{relative:t}={}){let n=x.useContext(wk);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zk("useViewTransitionState"),s=uu(e,{relative:t});if(!n.isTransitioning)return!1;let a=es(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=es(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Pd(s.pathname,l)!=null||Pd(s.pathname,a)!=null}var $s=mk();const D4=mf($s);function jk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=jk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bk(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=jk(e))&&(r&&(r+=" "),r+=t);return r}const FS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,US=Bk,N4=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return US(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(h=>{const p=n==null?void 0:n[h],m=a==null?void 0:a[h];if(p===null)return null;const _=FS(p)||FS(m);return s[h][_]}),u=n&&Object.entries(n).reduce((h,p)=>{let[m,_]=p;return _===void 0||(h[m]=_),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:_,...b}=p;return Object.entries(b).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...a,...u}[w]):{...a,...u}[w]===C})?[...h,m,_]:h},[]);return US(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},O4=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},L4=(e,t)=>({classGroupId:e,validator:t}),Pk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Id="-",$S=[],z4="arbitrary..",j4=e=>{const t=P4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return B4(l);const u=l.split(Id),d=u[0]===""&&u.length>1?1:0;return Ik(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?O4(h,d):d:h||$S}return n[l]||$S}}},Ik=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const h=Ik(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Id):e.slice(t).join(Id),d=l.length;for(let h=0;h<d;h++){const p=l[h];if(p.validator(u))return p.classGroupId}},B4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?z4+r:void 0})(),P4=e=>{const{theme:t,classGroups:n}=e;return I4(n,t)},I4=(e,t)=>{const n=Pk();for(const r in e){const s=e[r];ey(s,n,r,t)}return n},ey=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];H4(l,t,n,r)}},H4=(e,t,n,r)=>{if(typeof e=="string"){F4(e,t,n);return}if(typeof e=="function"){U4(e,t,n,r);return}$4(e,t,n,r)},F4=(e,t,n)=>{const r=e===""?t:Hk(t,e);r.classGroupId=n},U4=(e,t,n,r)=>{if(W4(e)){ey(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(L4(n,e))},$4=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,d]=s[l];ey(d,Hk(t,u),n,r)}},Hk=(e,t)=>{let n=e;const r=t.split(Id),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=Pk(),n.nextPart.set(l,u)),n=u}return n},W4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,q4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},xv="!",WS=":",V4=[],qS=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),K4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,d=0,h;const p=s.length;for(let w=0;w<p;w++){const C=s[w];if(l===0&&u===0){if(C===WS){a.push(s.slice(d,w)),d=w+1;continue}if(C==="/"){h=w;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?s:s.slice(d);let _=m,b=!1;m.endsWith(xv)?(_=m.slice(0,-1),b=!0):m.startsWith(xv)&&(_=m.slice(1),b=!0);const S=h&&h>d?h-d:void 0;return qS(a,b,_,S)};if(t){const s=t+WS,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):qS(V4,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},G4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},Y4=e=>({cache:q4(e.cacheSize),parseClassName:K4(e),sortModifiers:G4(e),...j4(e)}),X4=/\s+/,Z4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],u=e.trim().split(X4);let d="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:m,modifiers:_,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){d=p+(d.length>0?" "+d:d);continue}if(k=r(S),!k){d=p+(d.length>0?" "+d:d);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:a(_).join(":"),R=b?T+xv:T,D=R+k;if(l.indexOf(D)>-1)continue;l.push(D);const z=s(k,C);for(let L=0;L<z.length;++L){const j=z[L];l.push(R+j)}d=p+(d.length>0?" "+d:d)}return d},Q4=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Fk(n))&&(s&&(s+=" "),s+=r);return s},Fk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Fk(e[r]))&&(n&&(n+=" "),n+=t);return n},J4=(e,...t)=>{let n,r,s,a;const l=d=>{const h=t.reduce((p,m)=>m(p),e());return n=Y4(h),r=n.cache.get,s=n.cache.set,a=u,u(d)},u=d=>{const h=r(d);if(h)return h;const p=Z4(d,n);return s(d,p),p};return a=l,(...d)=>a(Q4(...d))},eO=[],Jt=e=>{const t=n=>n[e]||eO;return t.isThemeGetter=!0,t},Uk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$k=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rO=/\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$/,iO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Os=e=>tO.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),Ls=e=>!!e&&Number.isInteger(Number(e)),vg=e=>e.endsWith("%")&&$e(e.slice(0,-1)),Yi=e=>nO.test(e),Wk=()=>!0,aO=e=>rO.test(e)&&!iO.test(e),ty=()=>!1,lO=e=>sO.test(e),cO=e=>oO.test(e),uO=e=>!xe(e)&&!Se(e),hO=e=>Zs(e,Kk,ty),xe=e=>Uk.test(e),So=e=>Zs(e,Gk,aO),VS=e=>Zs(e,yO,$e),dO=e=>Zs(e,Xk,Wk),fO=e=>Zs(e,Yk,ty),KS=e=>Zs(e,qk,ty),pO=e=>Zs(e,Vk,cO),qh=e=>Zs(e,Zk,lO),Se=e=>$k.test(e),mc=e=>$o(e,Gk),mO=e=>$o(e,Yk),GS=e=>$o(e,qk),gO=e=>$o(e,Kk),vO=e=>$o(e,Vk),Vh=e=>$o(e,Zk,!0),_O=e=>$o(e,Xk,!0),Zs=(e,t,n)=>{const r=Uk.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$o=(e,t,n=!1)=>{const r=$k.exec(e);return r?r[1]?t(r[1]):n:!1},qk=e=>e==="position"||e==="percentage",Vk=e=>e==="image"||e==="url",Kk=e=>e==="length"||e==="size"||e==="bg-size",Gk=e=>e==="length",yO=e=>e==="number",Yk=e=>e==="family-name",Xk=e=>e==="number"||e==="weight",Zk=e=>e==="shadow",bO=()=>{const e=Jt("color"),t=Jt("font"),n=Jt("text"),r=Jt("font-weight"),s=Jt("tracking"),a=Jt("leading"),l=Jt("breakpoint"),u=Jt("container"),d=Jt("spacing"),h=Jt("radius"),p=Jt("shadow"),m=Jt("inset-shadow"),_=Jt("text-shadow"),b=Jt("drop-shadow"),S=Jt("blur"),w=Jt("perspective"),C=Jt("aspect"),k=Jt("ease"),T=Jt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...D(),Se,xe],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],I=()=>[Se,xe,d],Z=()=>[Os,"full","auto",...I()],P=()=>[Ls,"none","subgrid",Se,xe],W=()=>["auto",{span:["full",Ls,Se,xe]},Ls,Se,xe],H=()=>[Ls,"auto",Se,xe],F=()=>["auto","min","max","fr",Se,xe],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...I()],K=()=>[Os,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[Os,"screen","full","dvw","lvw","svw","min","max","fit",...I()],J=()=>[Os,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],A=()=>[e,Se,xe],B=()=>[...D(),GS,KS,{position:[Se,xe]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",gO,hO,{size:[Se,xe]}],X=()=>[vg,mc,So],se=()=>["","none","full",h,Se,xe],re=()=>["",$e,mc,So],me=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[$e,vg,GS,KS],ke=()=>["","none",S,Se,xe],Je=()=>["none",$e,Se,xe],qe=()=>["none",$e,Se,xe],Me=()=>[$e,Se,xe],Ve=()=>[Os,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yi],breakpoint:[Yi],color:[Wk],container:[Yi],"drop-shadow":[Yi],ease:["in","out","in-out"],font:[uO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yi],shadow:[Yi],spacing:["px",$e],text:[Yi],"text-shadow":[Yi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Os,xe,Se,C]}],container:["container"],columns:[{columns:[$e,xe,Se,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[Ls,"auto",Se,xe]}],basis:[{basis:[Os,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,Os,"auto","initial","none",xe]}],grow:[{grow:["",$e,Se,xe]}],shrink:[{shrink:["",$e,Se,xe]}],order:[{order:[Ls,"first","last","none",Se,xe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,mc,So]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,_O,dO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vg,xe]}],"font-family":[{font:[mO,fO,t]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Se,xe]}],"line-clamp":[{"line-clamp":[$e,"none",Se,VS]}],leading:[{leading:[a,...I()]}],"list-image":[{"list-image":["none",Se,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",Se,So]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[$e,"auto",Se,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ls,Se,xe],radial:["",Se,xe],conic:[Ls,Se,xe]},vO,pO]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,Se,xe]}],"outline-w":[{outline:["",$e,mc,So]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,Vh,qh]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,Vh,qh]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[$e,So]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",_,Vh,qh]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[$e,Se,xe]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"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":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Se,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,xe]}],filter:[{filter:["","none",Se,xe]}],blur:[{blur:ke()}],brightness:[{brightness:[$e,Se,xe]}],contrast:[{contrast:[$e,Se,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Vh,qh]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",$e,Se,xe]}],"hue-rotate":[{"hue-rotate":[$e,Se,xe]}],invert:[{invert:["",$e,Se,xe]}],saturate:[{saturate:[$e,Se,xe]}],sepia:[{sepia:["",$e,Se,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,xe]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[$e,Se,xe]}],"backdrop-contrast":[{"backdrop-contrast":[$e,Se,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,Se,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,Se,xe]}],"backdrop-invert":[{"backdrop-invert":["",$e,Se,xe]}],"backdrop-opacity":[{"backdrop-opacity":[$e,Se,xe]}],"backdrop-saturate":[{"backdrop-saturate":[$e,Se,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,Se,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",Se,xe]}],ease:[{ease:["linear","initial",k,Se,xe]}],delay:[{delay:[$e,Se,xe]}],animate:[{animate:["none",T,Se,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Se,xe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:Je()}],"rotate-x":[{"rotate-x":Je()}],"rotate-y":[{"rotate-y":Je()}],"rotate-z":[{"rotate-z":Je()}],scale:[{scale:qe()}],"scale-x":[{"scale-x":qe()}],"scale-y":[{"scale-y":qe()}],"scale-z":[{"scale-z":qe()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Se,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ve()}],"translate-x":[{"translate-x":Ve()}],"translate-y":[{"translate-y":Ve()}],"translate-z":[{"translate-z":Ve()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Se,xe]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Se,xe]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[$e,mc,So,VS]}],stroke:[{stroke:["none",...A()]}],"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"]}},xO=J4(bO);function ye(...e){return xO(Bk(e))}function YS(e){return e.startsWith("chatId:")?e.slice(7):e}const SO=N4("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{default:"bg-primary text-primary-foreground disabled:bg-primary/50 disabled:text-primary-foreground/90 hover:bg-primary/90",juicy:"bg-logo text-primary-foreground disabled:text-primary-foreground/50 hover:bg-logo/90",destructive:"bg-destructive/80 dark:text-white",outline:"border disabled:bg-transparent disabled:text-foreground/50 border-inpu disabled:border-input/90 bg-card hover:bg-muted hover:text-accent-foreground",secondary:"bg-transparent border border-border text-secondary-foreground hover:text-secondary-foreground/60 disabled:text-secondary-foreground/50",ghost:"hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground disabled:text-muted-foreground/50 border border-border/0 hover:border-border",link:"text-primary disabled:text-primary/50 underline-offset-4 hover:underline",none:""},size:{default:"h-10 px-4 rounded-full py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-10 w-10 rounded-lg","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),et=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>v.jsx("button",{className:ye(SO({variant:t,size:n,className:e})),ref:s,...r}));et.displayName="Button";function Ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function XS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ny(...e){return t=>{let n=!1;const r=e.map(s=>{const a=XS(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():XS(e[s],null)}}}}function Pt(...e){return x.useCallback(ny(...e),e)}function wO(e,t){const n=x.createContext(t),r=a=>{const{children:l,...u}=a,d=x.useMemo(()=>u,Object.values(u));return v.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function s(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function Qs(e,t=[]){let n=[];function r(a,l){const u=x.createContext(l),d=n.length;n=[...n,l];const h=m=>{var k;const{scope:_,children:b,...S}=m,w=((k=_==null?void 0:_[e])==null?void 0:k[d])||u,C=x.useMemo(()=>S,Object.values(S));return v.jsx(w.Provider,{value:C,children:b})};h.displayName=a+"Provider";function p(m,_){var w;const b=((w=_==null?void 0:_[e])==null?void 0:w[d])||u,S=x.useContext(b);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[h,p]}const s=()=>{const a=n.map(l=>x.createContext(l));return function(u){const d=(u==null?void 0:u[e])||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return s.scopeName=e,[r,CO(s,...t)]}function CO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const m=d(a)[`__scope${h}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ks=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},kO=pk[" useId ".trim().toString()]||(()=>{}),EO=0;function Ka(e){const[t,n]=x.useState(kO());return Ks(()=>{n(r=>r??String(EO++))},[e]),t?`radix-${t}`:""}var RO=pk[" useInsertionEffect ".trim().toString()]||Ks;function _f({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,l]=MO({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:s;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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=u},[u,r])}const h=x.useCallback(p=>{var m;if(u){const _=TO(p)?p(e):p;_!==e&&((m=l.current)==null||m.call(l,_))}else a(p)},[u,e,a,l]);return[d,h]}function MO({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),s=x.useRef(n),a=x.useRef(t);return RO(()=>{a.current=t},[t]),x.useEffect(()=>{var l;s.current!==n&&((l=a.current)==null||l.call(a,n),s.current=n)},[n,s]),[n,r,a]}function TO(e){return typeof e=="function"}function el(e){const t=AO(e),n=x.forwardRef((r,s)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(NO);if(d){const h=d.props.children,p=u.map(m=>m===d?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:m);return v.jsx(t,{...l,ref:s,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return v.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function AO(e){const t=x.forwardRef((n,r)=>{const{children:s,...a}=n;if(x.isValidElement(s)){const l=LO(s),u=OO(a,s.props);return s.type!==x.Fragment&&(u.ref=r?ny(r,l):l),x.cloneElement(s,u)}return x.Children.count(s)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qk=Symbol("radix.slottable");function DO(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Qk,t}function NO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qk}function OO(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...u)=>{const d=a(...u);return s(...u),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function LO(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wt=zO.reduce((e,t)=>{const n=el(`Primitive.${t}`),r=x.forwardRef((s,a)=>{const{asChild:l,...u}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Jk(e,t){e&&$s.flushSync(()=>e.dispatchEvent(t))}function Si(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function jO(e,t=globalThis==null?void 0:globalThis.document){const n=Si(e);x.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var BO="DismissableLayer",Sv="dismissableLayer.update",PO="dismissableLayer.pointerDownOutside",IO="dismissableLayer.focusOutside",ZS,eE=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hu=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,h=x.useContext(eE),[p,m]=x.useState(null),_=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=x.useState({}),S=Pt(t,j=>m(j)),w=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=p?w.indexOf(p):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,D=T>=k,z=UO(j=>{const I=j.target,Z=[...h.branches].some(P=>P.contains(I));!D||Z||(s==null||s(j),l==null||l(j),j.defaultPrevented||u==null||u())},_),L=$O(j=>{const I=j.target;[...h.branches].some(P=>P.contains(I))||(a==null||a(j),l==null||l(j),j.defaultPrevented||u==null||u())},_);return jO(j=>{T===h.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},_),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ZS=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),QS(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=ZS)}},[p,_,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),QS())},[p,h]),x.useEffect(()=>{const j=()=>b({});return document.addEventListener(Sv,j),()=>document.removeEventListener(Sv,j)},[]),v.jsx(wt.div,{...d,ref:S,style:{pointerEvents:R?D?"auto":"none":void 0,...e.style},onFocusCapture:Ne(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Ne(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ne(e.onPointerDownCapture,z.onPointerDownCapture)})});hu.displayName=BO;var HO="DismissableLayerBranch",FO=x.forwardRef((e,t)=>{const n=x.useContext(eE),r=x.useRef(null),s=Pt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),v.jsx(wt.div,{...e,ref:s})});FO.displayName=HO;function UO(e,t=globalThis==null?void 0:globalThis.document){const n=Si(e),r=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){tE(PO,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $O(e,t=globalThis==null?void 0:globalThis.document){const n=Si(e),r=x.useRef(!1);return x.useEffect(()=>{const s=a=>{a.target&&!r.current&&tE(IO,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function QS(){const e=new CustomEvent(Sv);document.dispatchEvent(e)}function tE(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Jk(s,a):s.dispatchEvent(a)}var _g="focusScope.autoFocusOnMount",yg="focusScope.autoFocusOnUnmount",JS={bubbles:!1,cancelable:!0},WO="FocusScope",yf=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[u,d]=x.useState(null),h=Si(s),p=Si(a),m=x.useRef(null),_=Pt(t,w=>d(w)),b=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(R){if(b.paused||!u)return;const D=R.target;u.contains(D)?m.current=D:Is(m.current,{select:!0})},C=function(R){if(b.paused||!u)return;const D=R.relatedTarget;D!==null&&(u.contains(D)||Is(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const z of R)z.removedNodes.length>0&&Is(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),T.disconnect()}}},[r,u,b.paused]),x.useEffect(()=>{if(u){tw.add(b);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(_g,JS);u.addEventListener(_g,h),u.dispatchEvent(k),k.defaultPrevented||(qO(XO(nE(u)),{select:!0}),document.activeElement===w&&Is(u))}return()=>{u.removeEventListener(_g,h),setTimeout(()=>{const k=new CustomEvent(yg,JS);u.addEventListener(yg,p),u.dispatchEvent(k),k.defaultPrevented||Is(w??document.body,{select:!0}),u.removeEventListener(yg,p),tw.remove(b)},0)}}},[u,h,p,b]);const S=x.useCallback(w=>{if(!n&&!r||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,D]=VO(T);R&&D?!w.shiftKey&&k===D?(w.preventDefault(),n&&Is(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Is(D,{select:!0})):k===T&&w.preventDefault()}},[n,r,b.paused]);return v.jsx(wt.div,{tabIndex:-1,...l,ref:_,onKeyDown:S})});yf.displayName=WO;function qO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Is(r,{select:t}),document.activeElement!==n)return}function VO(e){const t=nE(e),n=ew(t,e),r=ew(t.reverse(),e);return[n,r]}function nE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ew(e,t){for(const n of e)if(!KO(n,{upTo:t}))return n}function KO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GO(e){return e instanceof HTMLInputElement&&"select"in e}function Is(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GO(e)&&t&&e.select()}}var tw=YO();function YO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=nw(e,t),e.unshift(t)},remove(t){var n;e=nw(e,t),(n=e[0])==null||n.resume()}}}function nw(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function XO(e){return e.filter(t=>t.tagName!=="A")}var ZO="Portal",du=x.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,a]=x.useState(!1);Ks(()=>a(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?D4.createPortal(v.jsx(wt.div,{...r,ref:t}),l):null});du.displayName=ZO;function QO(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ur=e=>{const{present:t,children:n}=e,r=JO(t),s=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Pt(r.ref,eL(s));return typeof n=="function"||r.isPresent?x.cloneElement(s,{ref:a}):null};Ur.displayName="Presence";function JO(e){const[t,n]=x.useState(),r=x.useRef(null),s=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=QO(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Kh(r.current);a.current=u==="mounted"?h:"none"},[u]),Ks(()=>{const h=r.current,p=s.current;if(p!==e){const _=a.current,b=Kh(h);e?d("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&_!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ks(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,m=b=>{const w=Kh(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(d("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=b=>{b.target===t&&(a.current=Kh(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Kh(e){return(e==null?void 0:e.animationName)||"none"}function eL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bg=0;function ry(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rw()),document.body.insertAdjacentElement("beforeend",e[1]??rw()),bg++,()=>{bg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bg--}},[])}function rw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pi=function(){return pi=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},pi.apply(this,arguments)};function rE(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function tL(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Cd="right-scroll-bar-position",kd="width-before-scroll-bar",nL="with-scroll-bars-hidden",rL="--removed-body-scroll-bar-size";function xg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iL(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var sL=typeof window<"u"?x.useLayoutEffect:x.useEffect,iw=new WeakMap;function oL(e,t){var n=iL(null,function(r){return e.forEach(function(s){return xg(s,r)})});return sL(function(){var r=iw.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(u){a.has(u)||xg(u,null)}),a.forEach(function(u){s.has(u)||xg(u,l)})}iw.set(n,e)},[e]),n}function aL(e){return e}function lL(e,t){t===void 0&&(t=aL);var n=[],r=!1,s={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]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return s}function cL(e){e===void 0&&(e={});var t=lL(null);return t.options=pi({async:!0,ssr:!1},e),t}var iE=function(e){var t=e.sideCar,n=rE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,pi({},n))};iE.isSideCarExport=!0;function uL(e,t){return e.useMedium(t),iE}var sE=cL(),Sg=function(){},bf=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Sg,onWheelCapture:Sg,onTouchMoveCapture:Sg}),s=r[0],a=r[1],l=e.forwardProps,u=e.children,d=e.className,h=e.removeScrollBar,p=e.enabled,m=e.shards,_=e.sideCar,b=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,D=rE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=_,L=oL([n,t]),j=pi(pi({},D),s);return x.createElement(x.Fragment,null,p&&x.createElement(z,{sideCar:sE,removeScrollBar:h,shards:m,noRelative:b,noIsolation:S,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:R}),l?x.cloneElement(x.Children.only(u),pi(pi({},j),{ref:L})):x.createElement(T,pi({},j,{className:d,ref:L}),u))});bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bf.classNames={fullWidth:kd,zeroRight:Cd};var hL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hL();return t&&e.setAttribute("nonce",t),e}function fL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dL())&&(fL(t,n),pL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gL=function(){var e=mL();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oE=function(){var e=gL(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},vL={left:0,top:0,right:0,gap:0},wg=function(e){return parseInt(e||"",10)||0},_L=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[wg(n),wg(r),wg(s)]},yL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vL;var t=_L(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bL=oE(),Ga="data-scroll-locked",xL=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
61
+ .`.concat(nL,` {
62
+ overflow: hidden `).concat(r,`;
63
+ padding-right: `).concat(u,"px ").concat(r,`;
64
+ }
65
+ body[`).concat(Ga,`] {
66
+ overflow: hidden `).concat(r,`;
67
+ overscroll-behavior: contain;
68
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
69
+ padding-left: `.concat(s,`px;
70
+ padding-top: `).concat(a,`px;
71
+ padding-right: `).concat(l,`px;
72
+ margin-left:0;
73
+ margin-top:0;
74
+ margin-right: `).concat(u,"px ").concat(r,`;
75
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
76
+ }
77
+
78
+ .`).concat(Cd,` {
79
+ right: `).concat(u,"px ").concat(r,`;
80
+ }
81
+
82
+ .`).concat(kd,` {
83
+ margin-right: `).concat(u,"px ").concat(r,`;
84
+ }
85
+
86
+ .`).concat(Cd," .").concat(Cd,` {
87
+ right: 0 `).concat(r,`;
88
+ }
89
+
90
+ .`).concat(kd," .").concat(kd,` {
91
+ margin-right: 0 `).concat(r,`;
92
+ }
93
+
94
+ body[`).concat(Ga,`] {
95
+ `).concat(rL,": ").concat(u,`px;
96
+ }
97
+ `)},sw=function(){var e=parseInt(document.body.getAttribute(Ga)||"0",10);return isFinite(e)?e:0},SL=function(){x.useEffect(function(){return document.body.setAttribute(Ga,(sw()+1).toString()),function(){var e=sw()-1;e<=0?document.body.removeAttribute(Ga):document.body.setAttribute(Ga,e.toString())}},[])},wL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;SL();var a=x.useMemo(function(){return yL(s)},[s]);return x.createElement(bL,{styles:xL(a,!t,s,n?"":"!important")})},wv=!1;if(typeof window<"u")try{var Gh=Object.defineProperty({},"passive",{get:function(){return wv=!0,!0}});window.addEventListener("test",Gh,Gh),window.removeEventListener("test",Gh,Gh)}catch{wv=!1}var ja=wv?{passive:!1}:!1,CL=function(e){return e.tagName==="TEXTAREA"},aE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CL(e)&&n[t]==="visible")},kL=function(e){return aE(e,"overflowY")},EL=function(e){return aE(e,"overflowX")},ow=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=lE(e,r);if(s){var a=cE(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},RL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ML=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lE=function(e,t){return e==="v"?kL(t):EL(t)},cE=function(e,t){return e==="v"?RL(t):ML(t)},TL=function(e,t){return e==="h"&&t==="rtl"?-1:1},AL=function(e,t,n,r,s){var a=TL(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,d=t.contains(u),h=!1,p=l>0,m=0,_=0;do{if(!u)break;var b=cE(e,u),S=b[0],w=b[1],C=b[2],k=w-C-a*S;(S||k)&&lE(e,u)&&(m+=k,_+=S);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(h=!0),h},Yh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aw=function(e){return[e.deltaX,e.deltaY]},lw=function(e){return e&&"current"in e?e.current:e},DL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},NL=function(e){return`
98
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
99
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
100
+ `)},OL=0,Ba=[];function LL(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),s=x.useState(OL++)[0],a=x.useState(oE)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=tL([e.lockRef.current],(e.shards||[]).map(lw),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var k=Yh(w),T=n.current,R="deltaX"in w?w.deltaX:T[0]-k[0],D="deltaY"in w?w.deltaY:T[1]-k[1],z,L=w.target,j=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in w&&j==="h"&&L.type==="range")return!1;var I=window.getSelection(),Z=I&&I.anchorNode,P=Z?Z===L||Z.contains(L):!1;if(P)return!1;var W=ow(j,L);if(!W)return!0;if(W?z=j:(z=j==="v"?"h":"v",W=ow(j,L)),!W)return!1;if(!r.current&&"changedTouches"in w&&(R||D)&&(r.current=z),!z)return!0;var H=r.current||z;return AL(H,C,w,H==="h"?R:D)},[]),d=x.useCallback(function(w){var C=w;if(!(!Ba.length||Ba[Ba.length-1]!==a)){var k="deltaY"in C?aw(C):Yh(C),T=t.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&DL(z.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(l.current.shards||[]).map(lw).filter(Boolean).filter(function(z){return z.contains(C.target)}),D=R.length>0?u(C,R[0]):!l.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=x.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:zL(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(D){return D!==R})},1)},[]),p=x.useCallback(function(w){n.current=Yh(w),r.current=void 0},[]),m=x.useCallback(function(w){h(w.type,aw(w),w.target,u(w,e.lockRef.current))},[]),_=x.useCallback(function(w){h(w.type,Yh(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Ba.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",d,ja),document.addEventListener("touchmove",d,ja),document.addEventListener("touchstart",p,ja),function(){Ba=Ba.filter(function(w){return w!==a}),document.removeEventListener("wheel",d,ja),document.removeEventListener("touchmove",d,ja),document.removeEventListener("touchstart",p,ja)}},[]);var b=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(a,{styles:NL(s)}):null,b?x.createElement(wL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jL=uL(sE,LL);var xf=x.forwardRef(function(e,t){return x.createElement(bf,pi({},e,{ref:t,sideCar:jL}))});xf.classNames=bf.classNames;var BL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Pa=new WeakMap,Xh=new WeakMap,Zh={},Cg=0,uE=function(e){return e&&(e.host||uE(e.parentNode))},PL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uE(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},IL=function(e,t,n,r){var s=PL(t,Array.isArray(e)?e:[e]);Zh[n]||(Zh[n]=new WeakMap);var a=Zh[n],l=[],u=new Set,d=new Set(s),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};s.forEach(h);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(_){if(u.has(_))p(_);else try{var b=_.getAttribute(r),S=b!==null&&b!=="false",w=(Pa.get(_)||0)+1,C=(a.get(_)||0)+1;Pa.set(_,w),a.set(_,C),l.push(_),w===1&&S&&Xh.set(_,!0),C===1&&_.setAttribute(n,"true"),S||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return p(t),u.clear(),Cg++,function(){l.forEach(function(m){var _=Pa.get(m)-1,b=a.get(m)-1;Pa.set(m,_),a.set(m,b),_||(Xh.has(m)||m.removeAttribute(r),Xh.delete(m)),b||m.removeAttribute(n)}),Cg--,Cg||(Pa=new WeakMap,Pa=new WeakMap,Xh=new WeakMap,Zh={})}},iy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=BL(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),IL(r,s,n,"aria-hidden")):function(){return null}},Sf="Dialog",[hE]=Qs(Sf),[HL,ni]=hE(Sf),dE=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),d=x.useRef(null),[h,p]=_f({prop:r,defaultProp:s??!1,onChange:a,caller:Sf});return v.jsx(HL,{scope:t,triggerRef:u,contentRef:d,contentId:Ka(),titleId:Ka(),descriptionId:Ka(),open:h,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};dE.displayName=Sf;var fE="DialogTrigger",FL=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ni(fE,n),a=Pt(t,s.triggerRef);return v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ay(s.open),...r,ref:a,onClick:Ne(e.onClick,s.onOpenToggle)})});FL.displayName=fE;var sy="DialogPortal",[UL,pE]=hE(sy,{forceMount:void 0}),mE=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=ni(sy,t);return v.jsx(UL,{scope:t,forceMount:n,children:x.Children.map(r,l=>v.jsx(Ur,{present:n||a.open,children:v.jsx(du,{asChild:!0,container:s,children:l})}))})};mE.displayName=sy;var Hd="DialogOverlay",gE=x.forwardRef((e,t)=>{const n=pE(Hd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ni(Hd,e.__scopeDialog);return a.modal?v.jsx(Ur,{present:r||a.open,children:v.jsx(WL,{...s,ref:t})}):null});gE.displayName=Hd;var $L=el("DialogOverlay.RemoveScroll"),WL=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ni(Hd,n);return v.jsx(xf,{as:$L,allowPinchZoom:!0,shards:[s.contentRef],children:v.jsx(wt.div,{"data-state":ay(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Lo="DialogContent",vE=x.forwardRef((e,t)=>{const n=pE(Lo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ni(Lo,e.__scopeDialog);return v.jsx(Ur,{present:r||a.open,children:a.modal?v.jsx(qL,{...s,ref:t}):v.jsx(VL,{...s,ref:t})})});vE.displayName=Lo;var qL=x.forwardRef((e,t)=>{const n=ni(Lo,e.__scopeDialog),r=x.useRef(null),s=Pt(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return iy(a)},[]),v.jsx(_E,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Ne(e.onFocusOutside,a=>a.preventDefault())})}),VL=x.forwardRef((e,t)=>{const n=ni(Lo,e.__scopeDialog),r=x.useRef(!1),s=x.useRef(!1);return v.jsx(_E,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),_E=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,u=ni(Lo,n),d=x.useRef(null),h=Pt(t,d);return ry(),v.jsxs(v.Fragment,{children:[v.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:v.jsx(hu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":ay(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(KL,{titleId:u.titleId}),v.jsx(YL,{contentRef:d,descriptionId:u.descriptionId})]})]})}),oy="DialogTitle",yE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ni(oy,n);return v.jsx(wt.h2,{id:s.titleId,...r,ref:t})});yE.displayName=oy;var bE="DialogDescription",xE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ni(bE,n);return v.jsx(wt.p,{id:s.descriptionId,...r,ref:t})});xE.displayName=bE;var SE="DialogClose",wE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ni(SE,n);return v.jsx(wt.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});wE.displayName=SE;function ay(e){return e?"open":"closed"}var CE="DialogTitleWarning",[uZ,kE]=wO(CE,{contentName:Lo,titleName:oy,docsSlug:"dialog"}),KL=({titleId:e})=>{const t=kE(CE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
101
+
102
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
103
+
104
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},GL="DialogDescriptionWarning",YL=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kE(GL).contentName}}.`;return x.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},XL=dE,ZL=mE,EE=gE,RE=vE,QL=yE,JL=xE,ez=wE;/**
105
+ * @license lucide-react v0.562.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const tz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),cw=e=>{const t=nz(e);return t.charAt(0).toUpperCase()+t.slice(1)},ME=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),rz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
110
+ * @license lucide-react v0.562.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */var iz={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"};/**
115
+ * @license lucide-react v0.562.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const sz=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...iz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ME("lucide",s),...!a&&!rz(u)&&{"aria-hidden":"true"},...u},[...l.map(([h,p])=>x.createElement(h,p)),...Array.isArray(a)?a:[a]]));/**
120
+ * @license lucide-react v0.562.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Re=(e,t)=>{const n=x.forwardRef(({className:r,...s},a)=>x.createElement(sz,{ref:a,iconNode:t,className:ME(`lucide-${tz(cw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=cw(e),n};/**
125
+ * @license lucide-react v0.562.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const oz=[["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"}]],az=Re("archive",oz);/**
130
+ * @license lucide-react v0.562.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const lz=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],cz=Re("arrow-down-to-line",lz);/**
135
+ * @license lucide-react v0.562.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const uz=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],hz=Re("arrow-down",uz);/**
140
+ * @license lucide-react v0.562.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const dz=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],fz=Re("arrow-left-right",dz);/**
145
+ * @license lucide-react v0.562.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const pz=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],mz=Re("arrow-up",pz);/**
150
+ * @license lucide-react v0.562.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const gz=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],vz=Re("asterisk",gz);/**
155
+ * @license lucide-react v0.562.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const _z=[["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"}]],uw=Re("brain",_z);/**
160
+ * @license lucide-react v0.562.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const yz=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],bz=Re("check-check",yz);/**
165
+ * @license lucide-react v0.562.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const xz=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],Sz=Re("check-line",xz);/**
170
+ * @license lucide-react v0.562.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const wz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zo=Re("check",wz);/**
175
+ * @license lucide-react v0.562.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Cz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kz=Re("chevron-down",Cz);/**
180
+ * @license lucide-react v0.562.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const Ez=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Rz=Re("chevron-left",Ez);/**
185
+ * @license lucide-react v0.562.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const Mz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ts=Re("chevron-right",Mz);/**
190
+ * @license lucide-react v0.562.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Tz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],Az=Re("circle-slash",Tz);/**
195
+ * @license lucide-react v0.562.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const Dz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Nz=Re("circle",Dz);/**
200
+ * @license lucide-react v0.562.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Oz=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],hw=Re("code-xml",Oz);/**
205
+ * @license lucide-react v0.562.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const Lz=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],zz=Re("code",Lz);/**
210
+ * @license lucide-react v0.562.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const jz=[["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"}]],wf=Re("copy",jz);/**
215
+ * @license lucide-react v0.562.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const Bz=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Pz=Re("corner-down-left",Bz);/**
220
+ * @license lucide-react v0.562.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const Iz=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],Hz=Re("eraser",Iz);/**
225
+ * @license lucide-react v0.562.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Fz=[["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"}]],Uz=Re("file-pen",Fz);/**
230
+ * @license lucide-react v0.562.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const $z=[["path",{d:"M11.35 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.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Wz=Re("file-plus-corner",$z);/**
235
+ * @license lucide-react v0.562.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const qz=[["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"}]],Vz=Re("file",qz);/**
240
+ * @license lucide-react v0.562.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const Kz=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],jc=Re("flower",Kz);/**
245
+ * @license lucide-react v0.562.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const Gz=[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["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:"1u1bxd"}]],Yz=Re("folder-code",Gz);/**
250
+ * @license lucide-react v0.562.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Xz=[["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"}]],TE=Re("folder-open",Xz);/**
255
+ * @license lucide-react v0.562.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const Zz=[["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"}]],Qz=Re("folder",Zz);/**
260
+ * @license lucide-react v0.562.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const Jz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Qh=Re("gauge",Jz);/**
265
+ * @license lucide-react v0.562.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const e6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t6=Re("info",e6);/**
270
+ * @license lucide-react v0.562.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const n6=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],r6=Re("list-checks",n6);/**
275
+ * @license lucide-react v0.562.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const i6=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Fd=Re("list-todo",i6);/**
280
+ * @license lucide-react v0.562.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const s6=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Js=Re("loader-circle",s6);/**
285
+ * @license lucide-react v0.562.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const o6=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],dw=Re("lock-open",o6);/**
290
+ * @license lucide-react v0.562.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const a6=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],fw=Re("map",a6);/**
295
+ * @license lucide-react v0.562.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const l6=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],AE=Re("menu",l6);/**
300
+ * @license lucide-react v0.562.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const c6=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],DE=Re("message-circle-question-mark",c6);/**
305
+ * @license lucide-react v0.562.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const u6=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],NE=Re("minimize",u6);/**
310
+ * @license lucide-react v0.562.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const h6=[["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"}]],ly=Re("monitor",h6);/**
315
+ * @license lucide-react v0.562.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const d6=[["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"}]],f6=Re("moon",d6);/**
320
+ * @license lucide-react v0.562.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const p6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Cv=Re("panel-left",p6);/**
325
+ * @license lucide-react v0.562.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const m6=[["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"}]],OE=Re("pencil",m6);/**
330
+ * @license lucide-react v0.562.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const g6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],cy=Re("plus",g6);/**
335
+ * @license lucide-react v0.562.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const v6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kg=Re("search",v6);/**
340
+ * @license lucide-react v0.562.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const _6=[["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"}]],y6=Re("send",_6);/**
345
+ * @license lucide-react v0.562.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const b6=[["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"}]],x6=Re("settings",b6);/**
350
+ * @license lucide-react v0.562.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const S6=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],w6=Re("settings-2",S6);/**
355
+ * @license lucide-react v0.562.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const C6=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],k6=Re("slash",C6);/**
360
+ * @license lucide-react v0.562.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const E6=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],tl=Re("sparkles",E6);/**
365
+ * @license lucide-react v0.562.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const R6=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],uy=Re("square-pen",R6);/**
370
+ * @license lucide-react v0.562.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const M6=[["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"}]],T6=Re("square-terminal",M6);/**
375
+ * @license lucide-react v0.562.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const A6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],D6=Re("square-x",A6);/**
380
+ * @license lucide-react v0.562.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const N6=[["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"}]],O6=Re("sun",N6);/**
385
+ * @license lucide-react v0.562.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const L6=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],hy=Re("terminal",L6);/**
390
+ * @license lucide-react v0.562.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const z6=[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]],j6=Re("toy-brick",z6);/**
395
+ * @license lucide-react v0.562.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const B6=[["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"}]],P6=Re("trash-2",B6);/**
400
+ * @license lucide-react v0.562.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const I6=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],dy=Re("user-round",I6);/**
405
+ * @license lucide-react v0.562.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const H6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fu=Re("x",H6);/**
410
+ * @license lucide-react v0.562.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */const F6=[["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"}]],Ud=Re("zap",F6),Vc="data-focus-fallback-ignore",LE="data-allow-focus-retain",$d="kanna:restore-chat-input-focus",fy="data-chat-input",kv="data-chat-selection-zone";function nl(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function zE(e){var n;const t=e;return t!=null&&t.matches?t.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||t.isContentEditable||((n=t.getAttribute)==null?void 0:n.call(t,"role"))==="textbox"?!0:nl(e,LE):!1}function U6(e){const t=e;return t!=null&&t.matches?zE(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:nl(e,LE):!1}function pw(e){return!!e.querySelector(`[${Vc}][data-state='open']`)}function $6(e){return nl(e,fy)}function mw(e){return nl(e,kv)}function W6(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function q6(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${fy}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,a=n[s];return a?(a.focus({preventScroll:!0}),!0):!1}function V6(e){const{activeElement:t,fallback:n,hasActiveOverlay:r,canCancel:s,defaultPrevented:a}=e;return!(a||!n||n.disabled||r||t===n||$6(t)||s)}function K6(e){const{activeElement:t,pointerStartTarget:n,pointerEndTarget:r,root:s,fallback:a,hasActiveOverlay:l,hasActiveSelection:u}=e,d=r??n;return!s||!a||a.disabled||!d||!s.contains(d)||nl(d,Vc)||l||t===a||nl(t,Vc)||u&&(mw(n)||mw(d))||zE(t)?!1:t&&t===d?!0:!U6(t)}const jE=XL,G6=ZL,BE=x.forwardRef(({className:e,...t},n)=>v.jsx(EE,{ref:n,className:ye("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));BE.displayName=EE.displayName;const Y6={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},py=x.forwardRef(({className:e,children:t,size:n="md",...r},s)=>v.jsxs(G6,{children:[v.jsx(BE,{}),v.jsxs(RE,{ref:s,[Vc]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event($d)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:ye("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","max-h-[85vh] flex flex-col",Y6[n],e),...r,children:[t,v.jsxs(ez,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(fu,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));py.displayName=RE.displayName;function PE({className:e,...t}){return v.jsx(QL,{className:ye("text-lg font-medium leading-none tracking-tight",e),...t})}function X6({className:e,...t}){return v.jsx(JL,{className:ye("text-sm text-muted-foreground",e),...t})}function IE({className:e,...t}){return v.jsx("div",{className:ye("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function HE({className:e,...t}){return v.jsx("div",{className:ye("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const FE=x.createContext(null);function Z6({children:e}){const[t,n]=x.useState(null),[r,s]=x.useState(""),a=x.useRef(null);x.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var p,m;(p=a.current)==null||p.focus(),(m=a.current)==null||m.select()},0))},[t]);const l=x.useCallback(()=>{n(null),s("")},[]),u=x.useCallback(p=>new Promise(m=>{n({kind:"confirm",options:p,resolve:m})}),[]),d=x.useCallback(p=>new Promise(m=>{n({kind:"prompt",options:p,resolve:m})}),[]),h=x.useMemo(()=>({confirm:u,prompt:d}),[u,d]);return v.jsxs(FE.Provider,{value:h,children:[e,v.jsx(jE,{open:t!==null,onOpenChange:p=>{p||!t||(t.kind==="confirm"?t.resolve(!1):t.resolve(null),l())},children:v.jsx(py,{size:"sm",children:t?v.jsxs(v.Fragment,{children:[v.jsxs(IE,{className:"space-y-4",children:[v.jsx(PE,{children:t.options.title}),t.options.description?v.jsx(X6,{children:t.options.description}):null,t.kind==="prompt"?v.jsx("input",{ref:a,type:"text",value:r,onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),t.resolve(r.trim()||null),l())},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:t.options.placeholder}):null]}),v.jsxs(HE,{children:[v.jsx(et,{variant:"ghost",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!1):t.resolve(null),l()},children:t.options.cancelLabel??"Cancel"}),v.jsx(et,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!0):t.resolve(r.trim()||null),l()},disabled:t.kind==="prompt"&&!r.trim(),children:t.options.confirmLabel??"Confirm"})]})]}):null})})]})}function Q6(){const e=x.useContext(FE);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const J6=["top","right","bottom","left"],Gs=Math.min,gr=Math.max,Wd=Math.round,Jh=Math.floor,yi=e=>({x:e,y:e}),ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ev(e,t,n){return gr(e,Gs(t,n))}function ns(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function dl(e){return e.split("-")[1]}function my(e){return e==="x"?"y":"x"}function gy(e){return e==="y"?"height":"width"}function mi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function vy(e){return my(mi(e))}function tj(e,t,n){n===void 0&&(n=!1);const r=dl(e),s=vy(e),a=gy(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=qd(l)),[l,qd(l)]}function nj(e){const t=qd(e);return[Rv(e),t,Rv(t)]}function Rv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gw=["left","right"],vw=["right","left"],rj=["top","bottom"],ij=["bottom","top"];function sj(e,t,n){switch(e){case"top":case"bottom":return n?t?vw:gw:t?gw:vw;case"left":case"right":return t?rj:ij;default:return[]}}function oj(e,t,n,r){const s=dl(e);let a=sj(rs(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Rv)))),a}function qd(e){const t=rs(e);return ej[t]+e.slice(t.length)}function aj(e){return{top:0,right:0,bottom:0,left:0,...e}}function UE(e){return typeof e!="number"?aj(e):{top:e,right:e,bottom:e,left:e}}function Vd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function _w(e,t,n){let{reference:r,floating:s}=e;const a=mi(t),l=vy(t),u=gy(l),d=rs(t),h=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let b;switch(d){case"top":b={x:p,y:r.y-s.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-s.width,y:m};break;default:b={x:r.x,y:r.y}}switch(dl(t)){case"start":b[l]-=_*(n&&h?-1:1);break;case"end":b[l]+=_*(n&&h?-1:1);break}return b}async function lj(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:b=0}=ns(t,e),S=UE(b),C=u[_?m==="floating"?"reference":"floating":m],k=Vd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:d})),T=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),D=await(a.isElement==null?void 0:a.isElement(R))?await(a.getScale==null?void 0:a.getScale(R))||{x:1,y:1}:{x:1,y:1},z=Vd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:d}):T);return{top:(k.top-z.top+S.top)/D.y,bottom:(z.bottom-k.bottom+S.bottom)/D.y,left:(k.left-z.left+S.left)/D.x,right:(z.right-k.right+S.right)/D.x}}const cj=50,uj=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:lj},d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=_w(h,r,d),_=r,b=0;const S={};for(let w=0;w<a.length;w++){const C=a[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:D,data:z,reset:L}=await T({x:p,y:m,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:h,platform:u,elements:{reference:e,floating:t}});p=R??p,m=D??m,S[k]={...S[k],...z},L&&b<cj&&(b++,typeof L=="object"&&(L.placement&&(_=L.placement),L.rects&&(h=L.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:p,y:m}=_w(h,_,d)),w=-1)}return{x:p,y:m,placement:_,strategy:s,middlewareData:S}},hj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:p=0}=ns(e,t)||{};if(h==null)return{};const m=UE(p),_={x:n,y:r},b=vy(s),S=gy(b),w=await l.getDimensions(h),C=b==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",D=a.reference[S]+a.reference[b]-_[b]-a.floating[S],z=_[b]-a.reference[b],L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let j=L?L[R]:0;(!j||!await(l.isElement==null?void 0:l.isElement(L)))&&(j=u.floating[R]||a.floating[S]);const I=D/2-z/2,Z=j/2-w[S]/2-1,P=Gs(m[k],Z),W=Gs(m[T],Z),H=P,F=j-w[S]-W,V=j/2-w[S]/2+I,U=Ev(H,V,F),O=!d.arrow&&dl(s)!=null&&V!==U&&a.reference[S]/2-(V<H?P:W)-w[S]/2<0,K=O?V<H?V-H:V-F:0;return{[b]:_[b]+K,data:{[b]:U,centerOffset:V-U-K,...O&&{alignmentOffset:K}},reset:O}}}),dj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=ns(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=rs(s),T=mi(u),R=rs(u)===u,D=await(d.isRTL==null?void 0:d.isRTL(h.floating)),z=_||(R||!w?[qd(u)]:nj(u)),L=S!=="none";!_&&L&&z.push(...oj(u,w,S,D));const j=[u,...z],I=await d.detectOverflow(t,C),Z=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&Z.push(I[k]),m){const V=tj(s,l,D);Z.push(I[V[0]],I[V[1]])}if(P=[...P,{placement:s,overflows:Z}],!Z.every(V=>V<=0)){var W,H;const V=(((W=a.flip)==null?void 0:W.index)||0)+1,U=j[V];if(U&&(!(m==="alignment"?T!==mi(U):!1)||P.every($=>mi($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:V,overflows:P},reset:{placement:U}};let O=(H=P.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:H.placement;if(!O)switch(b){case"bestFit":{var F;const K=(F=P.filter($=>{if(L){const J=mi($.placement);return J===T||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,A)=>J+A,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:F[0];K&&(O=K);break}case"initialPlacement":O=u;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function yw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bw(e){return J6.some(t=>e[t]>=0)}const fj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=ns(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=yw(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:bw(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=yw(l,n.floating);return{data:{escapedOffsets:u,escaped:bw(u)}}}default:return{}}}}},$E=new Set(["left","top"]);async function pj(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=rs(n),u=dl(n),d=mi(n)==="y",h=$E.has(l)?-1:1,p=a&&d?-1:1,m=ns(t,e);let{mainAxis:_,crossAxis:b,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),d?{x:b*p,y:_*h}:{x:_*h,y:b*p}}const mj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,d=await pj(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},gj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...h}=ns(e,t),p={x:n,y:r},m=await a.detectOverflow(t,h),_=mi(rs(s)),b=my(_);let S=p[b],w=p[_];if(l){const k=b==="y"?"top":"left",T=b==="y"?"bottom":"right",R=S+m[k],D=S-m[T];S=Ev(R,S,D)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+m[k],D=w-m[T];w=Ev(R,w,D)}const C=d.fn({...t,[b]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:l,[_]:u}}}}}},vj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=ns(e,t),p={x:n,y:r},m=mi(s),_=my(m);let b=p[_],S=p[m];const w=ns(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const R=_==="y"?"height":"width",D=a.reference[_]-a.floating[R]+C.mainAxis,z=a.reference[_]+a.reference[R]-C.mainAxis;b<D?b=D:b>z&&(b=z)}if(h){var k,T;const R=_==="y"?"width":"height",D=$E.has(rs(s)),z=a.reference[m]-a.floating[R]+(D&&((k=l.offset)==null?void 0:k[m])||0)+(D?0:C.crossAxis),L=a.reference[m]+a.reference[R]+(D?0:((T=l.offset)==null?void 0:T[m])||0)-(D?C.crossAxis:0);S<z?S=z:S>L&&(S=L)}return{[_]:b,[m]:S}}}},_j=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:l,elements:u}=t,{apply:d=()=>{},...h}=ns(e,t),p=await l.detectOverflow(t,h),m=rs(s),_=dl(s),b=mi(s)==="y",{width:S,height:w}=a.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=_===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=m,C=_==="end"?"top":"bottom");const T=w-p.top-p.bottom,R=S-p.left-p.right,D=Gs(w-p[C],T),z=Gs(S-p[k],R),L=!t.middlewareData.shift;let j=D,I=z;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=T),L&&!_){const P=gr(p.left,0),W=gr(p.right,0),H=gr(p.top,0),F=gr(p.bottom,0);b?I=S-2*(P!==0||W!==0?P+W:gr(p.left,p.right)):j=w-2*(H!==0||F!==0?H+F:gr(p.top,p.bottom))}await d({...t,availableWidth:I,availableHeight:j});const Z=await l.getDimensions(u.floating);return S!==Z.width||w!==Z.height?{reset:{rects:!0}}:{}}}};function Cf(){return typeof window<"u"}function fl(e){return WE(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ei(e){var t;return(t=(WE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function WE(e){return Cf()?e instanceof Node||e instanceof vr(e).Node:!1}function Qr(e){return Cf()?e instanceof Element||e instanceof vr(e).Element:!1}function ss(e){return Cf()?e instanceof HTMLElement||e instanceof vr(e).HTMLElement:!1}function xw(e){return!Cf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function pu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Jr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function yj(e){return/^(table|td|th)$/.test(fl(e))}function kf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const bj=/transform|translate|scale|rotate|perspective|filter/,xj=/paint|layout|strict|content/,wo=e=>!!e&&e!=="none";let Eg;function _y(e){const t=Qr(e)?Jr(e):e;return wo(t.transform)||wo(t.translate)||wo(t.scale)||wo(t.rotate)||wo(t.perspective)||!yy()&&(wo(t.backdropFilter)||wo(t.filter))||bj.test(t.willChange||"")||xj.test(t.contain||"")}function Sj(e){let t=Ys(e);for(;ss(t)&&!rl(t);){if(_y(t))return t;if(kf(t))return null;t=Ys(t)}return null}function yy(){return Eg==null&&(Eg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Eg}function rl(e){return/^(html|body|#document)$/.test(fl(e))}function Jr(e){return vr(e).getComputedStyle(e)}function Ef(e){return Qr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ys(e){if(fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xw(e)&&e.host||Ei(e);return xw(t)?t.host:t}function qE(e){const t=Ys(e);return rl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ss(t)&&pu(t)?t:qE(t)}function Kc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=qE(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=vr(s);if(a){const u=Mv(l);return t.concat(l,l.visualViewport||[],pu(s)?s:[],u&&n?Kc(u):[])}else return t.concat(s,Kc(s,[],n))}function Mv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function VE(e){const t=Jr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ss(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Wd(n)!==a||Wd(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function by(e){return Qr(e)?e:e.contextElement}function Ya(e){const t=by(e);if(!ss(t))return yi(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=VE(t);let l=(a?Wd(n.width):n.width)/r,u=(a?Wd(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const wj=yi(0);function KE(e){const t=vr(e);return!yy()||!t.visualViewport?wj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vr(e)?!1:t}function jo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=by(e);let l=yi(1);t&&(r?Qr(r)&&(l=Ya(r)):l=Ya(e));const u=Cj(a,n,r)?KE(a):yi(0);let d=(s.left+u.x)/l.x,h=(s.top+u.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(a){const _=vr(a),b=r&&Qr(r)?vr(r):r;let S=_,w=Mv(S);for(;w&&r&&b!==S;){const C=Ya(w),k=w.getBoundingClientRect(),T=Jr(w),R=k.left+(w.clientLeft+parseFloat(T.paddingLeft))*C.x,D=k.top+(w.clientTop+parseFloat(T.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,m*=C.y,d+=R,h+=D,S=vr(w),w=Mv(S)}}return Vd({width:p,height:m,x:d,y:h})}function Rf(e,t){const n=Ef(e).scrollLeft;return t?t.left+n:jo(Ei(e)).left+n}function GE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Rf(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function kj(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Ei(r),u=t?kf(t.floating):!1;if(r===l||u&&a)return n;let d={scrollLeft:0,scrollTop:0},h=yi(1);const p=yi(0),m=ss(r);if((m||!m&&!a)&&((fl(r)!=="body"||pu(l))&&(d=Ef(r)),m)){const b=jo(r);h=Ya(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const _=l&&!m&&!a?GE(l,d):yi(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+_.x,y:n.y*h.y-d.scrollTop*h.y+p.y+_.y}}function Ej(e){return Array.from(e.getClientRects())}function Rj(e){const t=Ei(e),n=Ef(e),r=e.ownerDocument.body,s=gr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=gr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Rf(e);const u=-n.scrollTop;return Jr(r).direction==="rtl"&&(l+=gr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:l,y:u}}const Sw=25;function Mj(e,t){const n=vr(e),r=Ei(e),s=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,u=0,d=0;if(s){a=s.width,l=s.height;const p=yy();(!p||p&&t==="fixed")&&(u=s.offsetLeft,d=s.offsetTop)}const h=Rf(r);if(h<=0){const p=r.ownerDocument,m=p.body,_=getComputedStyle(m),b=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-b);S<=Sw&&(a-=S)}else h<=Sw&&(a+=h);return{width:a,height:l,x:u,y:d}}function Tj(e,t){const n=jo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ss(e)?Ya(e):yi(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=s*a.x,h=r*a.y;return{width:l,height:u,x:d,y:h}}function ww(e,t,n){let r;if(t==="viewport")r=Mj(e,n);else if(t==="document")r=Rj(Ei(e));else if(Qr(t))r=Tj(t,n);else{const s=KE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vd(r)}function YE(e,t){const n=Ys(e);return n===t||!Qr(n)||rl(n)?!1:Jr(n).position==="fixed"||YE(n,t)}function Aj(e,t){const n=t.get(e);if(n)return n;let r=Kc(e,[],!1).filter(u=>Qr(u)&&fl(u)!=="body"),s=null;const a=Jr(e).position==="fixed";let l=a?Ys(e):e;for(;Qr(l)&&!rl(l);){const u=Jr(l),d=_y(l);!d&&u.position==="fixed"&&(s=null),(a?!d&&!s:!d&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||pu(l)&&!d&&YE(e,l))?r=r.filter(p=>p!==l):s=u,l=Ys(l)}return t.set(e,r),r}function Dj(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?kf(t)?[]:Aj(t,this._c):[].concat(n),r],u=ww(t,l[0],s);let d=u.top,h=u.right,p=u.bottom,m=u.left;for(let _=1;_<l.length;_++){const b=ww(t,l[_],s);d=gr(b.top,d),h=Gs(b.right,h),p=Gs(b.bottom,p),m=gr(b.left,m)}return{width:h-m,height:p-d,x:m,y:d}}function Nj(e){const{width:t,height:n}=VE(e);return{width:t,height:n}}function Oj(e,t,n){const r=ss(t),s=Ei(t),a=n==="fixed",l=jo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=yi(0);function h(){d.x=Rf(s)}if(r||!r&&!a)if((fl(t)!=="body"||pu(s))&&(u=Ef(t)),r){const b=jo(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}else s&&h();a&&!r&&s&&h();const p=s&&!r&&!a?GE(s,u):yi(0),m=l.left+u.scrollLeft-d.x-p.x,_=l.top+u.scrollTop-d.y-p.y;return{x:m,y:_,width:l.width,height:l.height}}function Rg(e){return Jr(e).position==="static"}function Cw(e,t){if(!ss(e)||Jr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ei(e)===n&&(n=n.ownerDocument.body),n}function XE(e,t){const n=vr(e);if(kf(e))return n;if(!ss(e)){let s=Ys(e);for(;s&&!rl(s);){if(Qr(s)&&!Rg(s))return s;s=Ys(s)}return n}let r=Cw(e,t);for(;r&&yj(r)&&Rg(r);)r=Cw(r,t);return r&&rl(r)&&Rg(r)&&!_y(r)?n:r||Sj(e)||n}const Lj=async function(e){const t=this.getOffsetParent||XE,n=this.getDimensions,r=await n(e.floating);return{reference:Oj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zj(e){return Jr(e).direction==="rtl"}const jj={convertOffsetParentRelativeRectToViewportRelativeRect:kj,getDocumentElement:Ei,getClippingRect:Dj,getOffsetParent:XE,getElementRects:Lj,getClientRects:Ej,getDimensions:Nj,getScale:Ya,isElement:Qr,isRTL:zj};function ZE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bj(e,t){let n=null,r;const s=Ei(e);function a(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),a();const h=e.getBoundingClientRect(),{left:p,top:m,width:_,height:b}=h;if(u||t(),!_||!b)return;const S=Jh(m),w=Jh(s.clientWidth-(p+_)),C=Jh(s.clientHeight-(m+b)),k=Jh(p),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:gr(0,Gs(1,d))||1};let D=!0;function z(L){const j=L[0].intersectionRatio;if(j!==d){if(!D)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!ZE(h,e.getBoundingClientRect())&&l(),D=!1}try{n=new IntersectionObserver(z,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(z,R)}n.observe(e)}return l(!0),a}function Pj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=by(e),p=s||a?[...h?Kc(h):[],...t?Kc(t):[]]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const m=h&&u?Bj(h,n):null;let _=-1,b=null;l&&(b=new ResizeObserver(k=>{let[T]=k;T&&T.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),h&&!d&&b.observe(h),t&&b.observe(t));let S,w=d?jo(e):null;d&&C();function C(){const k=jo(e);w&&!ZE(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;p.forEach(T=>{s&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),m==null||m(),(k=b)==null||k.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const Ij=mj,Hj=gj,Fj=dj,Uj=_j,$j=fj,kw=hj,Wj=vj,qj=(e,t,n)=>{const r=new Map,s={platform:jj,...n},a={...s.platform,_c:r};return uj(e,t,{...s,platform:a})};var Vj=typeof document<"u",Kj=function(){},Ed=Vj?x.useLayoutEffect:Kj;function Kd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Kd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function QE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ew(e,t){const n=QE(e);return Math.round(t*n)/n}function Mg(e){const t=x.useRef(e);return Ed(()=>{t.current=e}),t}function Gj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[p,m]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,b]=x.useState(r);Kd(_,r)||b(r);const[S,w]=x.useState(null),[C,k]=x.useState(null),T=x.useCallback($=>{$!==L.current&&(L.current=$,w($))},[]),R=x.useCallback($=>{$!==j.current&&(j.current=$,k($))},[]),D=a||S,z=l||C,L=x.useRef(null),j=x.useRef(null),I=x.useRef(p),Z=d!=null,P=Mg(d),W=Mg(s),H=Mg(h),F=x.useCallback(()=>{if(!L.current||!j.current)return;const $={placement:t,strategy:n,middleware:_};W.current&&($.platform=W.current),qj(L.current,j.current,$).then(J=>{const A={...J,isPositioned:H.current!==!1};V.current&&!Kd(I.current,A)&&(I.current=A,$s.flushSync(()=>{m(A)}))})},[_,t,n,W,H]);Ed(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m($=>({...$,isPositioned:!1})))},[h]);const V=x.useRef(!1);Ed(()=>(V.current=!0,()=>{V.current=!1}),[]),Ed(()=>{if(D&&(L.current=D),z&&(j.current=z),D&&z){if(P.current)return P.current(D,z,F);F()}},[D,z,F,P,Z]);const U=x.useMemo(()=>({reference:L,floating:j,setReference:T,setFloating:R}),[T,R]),O=x.useMemo(()=>({reference:D,floating:z}),[D,z]),K=x.useMemo(()=>{const $={position:n,left:0,top:0};if(!O.floating)return $;const J=Ew(O.floating,p.x),A=Ew(O.floating,p.y);return u?{...$,transform:"translate("+J+"px, "+A+"px)",...QE(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:A}},[n,u,O.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:F,refs:U,elements:O,floatingStyles:K}),[p,F,U,O,K])}const Yj=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?kw({element:r.current,padding:s}).fn(n):{}:r?kw({element:r,padding:s}).fn(n):{}}}},Xj=(e,t)=>{const n=Ij(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zj=(e,t)=>{const n=Hj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qj=(e,t)=>({fn:Wj(e).fn,options:[e,t]}),Jj=(e,t)=>{const n=Fj(e);return{name:n.name,fn:n.fn,options:[e,t]}},eB=(e,t)=>{const n=Uj(e);return{name:n.name,fn:n.fn,options:[e,t]}},tB=(e,t)=>{const n=$j(e);return{name:n.name,fn:n.fn,options:[e,t]}},nB=(e,t)=>{const n=Yj(e);return{name:n.name,fn:n.fn,options:[e,t]}};var rB="Arrow",JE=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return v.jsx(wt.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});JE.displayName=rB;var iB=JE;function sB(e){const[t,n]=x.useState(void 0);return Ks(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const d=a.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var xy="Popper",[eR,pl]=Qs(xy),[oB,tR]=eR(xy),nR=e=>{const{__scopePopper:t,children:n}=e,[r,s]=x.useState(null);return v.jsx(oB,{scope:t,anchor:r,onAnchorChange:s,children:n})};nR.displayName=xy;var rR="PopperAnchor",iR=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=tR(rR,n),l=x.useRef(null),u=Pt(t,l),d=x.useRef(null);return x.useEffect(()=>{const h=d.current;d.current=(r==null?void 0:r.current)||l.current,h!==d.current&&a.onAnchorChange(d.current)}),r?null:v.jsx(wt.div,{...s,ref:u})});iR.displayName=rR;var Sy="PopperContent",[aB,lB]=eR(Sy),sR=x.forwardRef((e,t)=>{var me,Ce,pe,ke,Je,qe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:b="optimized",onPlaced:S,...w}=e,C=tR(Sy,n),[k,T]=x.useState(null),R=Pt(t,Me=>T(Me)),[D,z]=x.useState(null),L=sB(D),j=(L==null?void 0:L.width)??0,I=(L==null?void 0:L.height)??0,Z=r+(a!=="center"?"-"+a:""),P=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},W=Array.isArray(h)?h:[h],H=W.length>0,F={padding:P,boundary:W.filter(uB),altBoundary:H},{refs:V,floatingStyles:U,placement:O,isPositioned:K,middlewareData:$}=Gj({strategy:"fixed",placement:Z,whileElementsMounted:(...Me)=>Pj(...Me,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[Xj({mainAxis:s+I,alignmentAxis:l}),d&&Zj({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Qj():void 0,...F}),d&&Jj({...F}),eB({...F,apply:({elements:Me,rects:Ve,availableWidth:Nt,availableHeight:It})=>{const{width:ir,height:Fn}=Ve.reference,Ht=Me.floating.style;Ht.setProperty("--radix-popper-available-width",`${Nt}px`),Ht.setProperty("--radix-popper-available-height",`${It}px`),Ht.setProperty("--radix-popper-anchor-width",`${ir}px`),Ht.setProperty("--radix-popper-anchor-height",`${Fn}px`)}}),D&&nB({element:D,padding:u}),hB({arrowWidth:j,arrowHeight:I}),_&&tB({strategy:"referenceHidden",...F})]}),[J,A]=lR(O),B=Si(S);Ks(()=>{K&&(B==null||B())},[K,B]);const Y=(me=$.arrow)==null?void 0:me.x,M=(Ce=$.arrow)==null?void 0:Ce.y,X=((pe=$.arrow)==null?void 0:pe.centerOffset)!==0,[se,re]=x.useState();return Ks(()=>{k&&re(window.getComputedStyle(k).zIndex)},[k]),v.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:K?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(ke=$.transformOrigin)==null?void 0:ke.x,(Je=$.transformOrigin)==null?void 0:Je.y].join(" "),...((qe=$.hide)==null?void 0:qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(aB,{scope:n,placedSide:J,onArrowChange:z,arrowX:Y,arrowY:M,shouldHideArrow:X,children:v.jsx(wt.div,{"data-side":J,"data-align":A,...w,ref:R,style:{...w.style,animation:K?void 0:"none"}})})})});sR.displayName=Sy;var oR="PopperArrow",cB={top:"bottom",right:"left",bottom:"top",left:"right"},aR=x.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=lB(oR,r),l=cB[a.placedSide];return v.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:v.jsx(iB,{...s,ref:n,style:{...s.style,display:"block"}})})});aR.displayName=oR;function uB(e){return e!==null}var hB=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,p]=lR(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+d/2;let S="",w="";return h==="bottom"?(S=l?m:`${_}px`,w=`${-d}px`):h==="top"?(S=l?m:`${_}px`,w=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,w=l?m:`${b}px`):h==="left"&&(S=`${r.floating.width+d}px`,w=l?m:`${b}px`),{data:{x:S,y:w}}}});function lR(e){const[t,n="center"]=e.split("-");return[t,n]}var wy=nR,Mf=iR,Cy=sR,ky=aR,dB=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"}),fB="VisuallyHidden",cR=x.forwardRef((e,t)=>v.jsx(wt.span,{...e,ref:t,style:{...dB,...e.style}}));cR.displayName=fB;var pB=cR,[Tf]=Qs("Tooltip",[pl]),Af=pl(),uR="TooltipProvider",mB=700,Tv="tooltip.open",[gB,Ey]=Tf(uR),hR=e=>{const{__scopeTooltip:t,delayDuration:n=mB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),v.jsx(gB,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(h=>{u.current=h},[]),disableHoverableContent:s,children:a})};hR.displayName=uR;var Gc="Tooltip",[vB,mu]=Tf(Gc),dR=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,d=Ey(Gc,e.__scopeTooltip),h=Af(t),[p,m]=x.useState(null),_=Ka(),b=x.useRef(0),S=l??d.disableHoverableContent,w=u??d.delayDuration,C=x.useRef(!1),[k,T]=_f({prop:r,defaultProp:s??!1,onChange:j=>{j?(d.onOpen(),document.dispatchEvent(new CustomEvent(Tv))):d.onClose(),a==null||a(j)},caller:Gc}),R=x.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),D=x.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,T(!0)},[T]),z=x.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),L=x.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,T(!0),b.current=0},w)},[w,T]);return x.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),v.jsx(wy,{...h,children:v.jsx(vB,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?L():D()},[d.isOpenDelayedRef,L,D]),onTriggerLeave:x.useCallback(()=>{S?z():(window.clearTimeout(b.current),b.current=0)},[z,S]),onOpen:D,onClose:z,disableHoverableContent:S,children:n})})};dR.displayName=Gc;var Av="TooltipTrigger",fR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mu(Av,n),a=Ey(Av,n),l=Af(n),u=x.useRef(null),d=Pt(t,u,s.onTriggerChange),h=x.useRef(!1),p=x.useRef(!1),m=x.useCallback(()=>h.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),v.jsx(Mf,{asChild:!0,...l,children:v.jsx(wt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Ne(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ne(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Ne(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Ne(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:Ne(e.onBlur,s.onClose),onClick:Ne(e.onClick,s.onClose)})})});fR.displayName=Av;var Ry="TooltipPortal",[_B,yB]=Tf(Ry,{forceMount:void 0}),pR=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=mu(Ry,t);return v.jsx(_B,{scope:t,forceMount:n,children:v.jsx(Ur,{present:n||a.open,children:v.jsx(du,{asChild:!0,container:s,children:r})})})};pR.displayName=Ry;var il="TooltipContent",mR=x.forwardRef((e,t)=>{const n=yB(il,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,l=mu(il,e.__scopeTooltip);return v.jsx(Ur,{present:r||l.open,children:l.disableHoverableContent?v.jsx(gR,{side:s,...a,ref:t}):v.jsx(bB,{side:s,...a,ref:t})})}),bB=x.forwardRef((e,t)=>{const n=mu(il,e.__scopeTooltip),r=Ey(il,e.__scopeTooltip),s=x.useRef(null),a=Pt(t,s),[l,u]=x.useState(null),{trigger:d,onClose:h}=n,p=s.current,{onPointerInTransitChange:m}=r,_=x.useCallback(()=>{u(null),m(!1)},[m]),b=x.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=kB(k,C.getBoundingClientRect()),R=EB(k,T),D=RB(w.getBoundingClientRect()),z=TB([...R,...D]);u(z),m(!0)},[m]);return x.useEffect(()=>()=>_(),[_]),x.useEffect(()=>{if(d&&p){const S=C=>b(C,p),w=C=>b(C,d);return d.addEventListener("pointerleave",S),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",w)}}},[d,p,b,_]),x.useEffect(()=>{if(l){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(d==null?void 0:d.contains(C))||(p==null?void 0:p.contains(C)),R=!MB(k,l);T?_():R&&(_(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,p,l,h,_]),v.jsx(gR,{...e,ref:a})}),[xB,SB]=Tf(Gc,{isInside:!1}),wB=DO("TooltipContent"),gR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,d=mu(il,n),h=Af(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(Tv,p),()=>document.removeEventListener(Tv,p)),[p]),x.useEffect(()=>{if(d.trigger){const m=_=>{const b=_.target;b!=null&&b.contains(d.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,p]),v.jsx(hu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:v.jsxs(Cy,{"data-state":d.stateAttribute,...h,...u,ref:t,style:{...u.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:[v.jsx(wB,{children:r}),v.jsx(xB,{scope:n,isInside:!0,children:v.jsx(pB,{id:d.contentId,role:"tooltip",children:s||r})})]})})});mR.displayName=il;var vR="TooltipArrow",CB=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Af(n);return SB(vR,n).isInside?null:v.jsx(ky,{...s,...r,ref:t})});CB.displayName=vR;function kB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function EB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function RB(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function MB(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],h=u.x,p=u.y,m=d.x,_=d.y;p>r!=_>r&&n<(m-h)*(r-p)/(_-p)+h&&(s=!s)}return s}function TB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),AB(t)}function AB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var DB=hR,NB=dR,OB=fR,LB=pR,_R=mR;const zB=DB,Yc=NB,Xc=OB,sl=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(LB,{children:v.jsx(_R,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n})}));sl.displayName=_R.displayName;const jB="0.7.0",BB={version:jB},zn="Kanna",Rw="kanna",yR=`kanna/${BB.version}`,PB="[kanna]",IB=`~/${zn}`;function ed(e){return e?`${Rw} ${e}`:Rw}const Df=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>v.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:ye("mx-auto max-w-md text-foreground/50",r?["animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]","bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80"]:["text-neutral"],t),...s,children:e});function Dv(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const HB=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function FB(e){const t=e.trim();for(const n of HB){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function bR(e){return e.split("/").pop()||e}function UB(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,a=24*s,l=7*a;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<a?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/a)}d`:`${Math.floor(n/l)}w`}const $B=new Set(["starting","running"]);function WB({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const a=UB(e.lastMessageAt,n);return v.jsxs("div",{"data-chat-id":YS(e.chatId),className:ye("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 active:scale-[0.985] border transition-all",t===YS(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[$B.has(e.status)?v.jsx(Js,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?v.jsx("div",{className:"relative ",children:v.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[v.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),v.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,v.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?v.jsx(Df,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),v.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[a?v.jsx("span",{className:"hidden md:flex absolute inset-0 items-center justify-end pr-1 text-[11px] text-muted-foreground opacity-50 transition-opacity group-hover:opacity-0",children:a}):null,v.jsx(et,{variant:"ghost",size:"icon",className:ye("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",a?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:l=>{l.stopPropagation(),s(e.chatId)},title:"Delete chat",children:v.jsx(az,{className:"size-3.5"})})]})]},e._id)}function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Nf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ml(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function My(e){return"nodeType"in e}function nr(e){var t,n;return e?ml(e)?e:My(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ty(e){const{Document:t}=nr(e);return e instanceof t}function gu(e){return ml(e)?!1:e instanceof nr(e).HTMLElement}function xR(e){return e instanceof nr(e).SVGElement}function gl(e){return e?ml(e)?e.document:My(e)?Ty(e)?e:gu(e)||xR(e)?e.ownerDocument:document:document:document}const wi=Nf?x.useLayoutEffect:x.useEffect;function Ay(e){const t=x.useRef(e);return wi(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function VB(){const e=x.useRef(null),t=x.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Zc(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return wi(()=>{n.current!==e&&(n.current=e)},t),n}function vu(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Gd(e){const t=Ay(e),n=x.useRef(null),r=x.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Nv(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let Tg={};function _u(e,t){return x.useMemo(()=>{if(t)return t;const n=Tg[e]==null?0:Tg[e]+1;return Tg[e]=n,e+"-"+n},[e,t])}function SR(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((a,l)=>{const u=Object.entries(l);for(const[d,h]of u){const p=a[d];p!=null&&(a[d]=p+e*h)}return a},{...t})}}const Xa=SR(1),Yd=SR(-1);function KB(e){return"clientX"in e&&"clientY"in e}function Dy(e){if(!e)return!1;const{KeyboardEvent:t}=nr(e.target);return t&&e instanceof t}function GB(e){if(!e)return!1;const{TouchEvent:t}=nr(e.target);return t&&e instanceof t}function Ov(e){if(GB(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return KB(e)?{x:e.clientX,y:e.clientY}:null}const Qc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Qc.Translate.toString(e),Qc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Mw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function YB(e){return e.matches(Mw)?e:e.querySelector(Mw)}const XB={display:"none"};function ZB(e){let{id:t,value:n}=e;return vt.createElement("div",{id:t,style:XB},n)}function QB(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return vt.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function JB(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wR=x.createContext(null);function eP(e){const t=x.useContext(wR);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function tP(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:s,event:a}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,a)})},[e]),t]}const nP={draggable:`
415
+ To pick up a draggable item, press the space bar.
416
+ While dragging, use the arrow keys to move the item.
417
+ Press space again to drop the item in its new position, or press escape to cancel.
418
+ `},rP={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function iP(e){let{announcements:t=rP,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=nP}=e;const{announce:a,announcement:l}=JB(),u=_u("DndLiveRegion"),[d,h]=x.useState(!1);if(x.useEffect(()=>{h(!0)},[]),eP(x.useMemo(()=>({onDragStart(m){let{active:_}=m;a(t.onDragStart({active:_}))},onDragMove(m){let{active:_,over:b}=m;t.onDragMove&&a(t.onDragMove({active:_,over:b}))},onDragOver(m){let{active:_,over:b}=m;a(t.onDragOver({active:_,over:b}))},onDragEnd(m){let{active:_,over:b}=m;a(t.onDragEnd({active:_,over:b}))},onDragCancel(m){let{active:_,over:b}=m;a(t.onDragCancel({active:_,over:b}))}}),[a,t])),!d)return null;const p=vt.createElement(vt.Fragment,null,vt.createElement(ZB,{id:r,value:s.draggable}),vt.createElement(QB,{id:u,announcement:l}));return n?$s.createPortal(p,n):p}var nn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(nn||(nn={}));function Xd(){}function Tw(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function sP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ei=Object.freeze({x:0,y:0});function oP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function aP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function lP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function cP(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Aw(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const uP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=Aw(t,t.left,t.top),a=[];for(const l of r){const{id:u}=l,d=n.get(u);if(d){const h=oP(Aw(d),s);a.push({id:u,data:{droppableContainer:l,value:h}})}}return a.sort(aP)};function hP(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=a-n;if(r<s&&n<a){const d=t.width*t.height,h=e.width*e.height,p=l*u,m=p/(d+h-p);return Number(m.toFixed(4))}return 0}const dP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const a of r){const{id:l}=a,u=n.get(l);if(u){const d=hP(u,t);d>0&&s.push({id:l,data:{droppableContainer:a,value:d}})}}return s.sort(lP)};function fP(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function CR(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ei}function pP(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return s.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const mP=pP(1);function gP(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function vP(e,t,n){const r=gP(t);if(!r)return e;const{scaleX:s,scaleY:a,x:l,y:u}=r,d=e.left-l-(1-s)*parseFloat(n),h=e.top-u-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),p=s?e.width/s:e.width,m=a?e.height/a:e.height;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d}}const _P={ignoreTransform:!1};function vl(e,t){t===void 0&&(t=_P);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:p}=nr(e).getComputedStyle(e);h&&(n=vP(n,h,p))}const{top:r,left:s,width:a,height:l,bottom:u,right:d}=n;return{top:r,left:s,width:a,height:l,bottom:u,right:d}}function Dw(e){return vl(e,{ignoreTransform:!0})}function yP(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function bP(e,t){return t===void 0&&(t=nr(e).getComputedStyle(e)),t.position==="fixed"}function xP(e,t){t===void 0&&(t=nr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?n.test(a):!1})}function Ny(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Ty(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!gu(s)||xR(s)||n.includes(s))return n;const a=nr(e).getComputedStyle(s);return s!==e&&xP(s,a)&&n.push(s),bP(s,a)?n:r(s.parentNode)}return e?r(e):n}function kR(e){const[t]=Ny(e,1);return t??null}function Ag(e){return!Nf||!e?null:ml(e)?e:My(e)?Ty(e)||e===gl(e).scrollingElement?window:gu(e)?e:null:null}function ER(e){return ml(e)?e.scrollX:e.scrollLeft}function RR(e){return ml(e)?e.scrollY:e.scrollTop}function Lv(e){return{x:ER(e),y:RR(e)}}var cn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(cn||(cn={}));function MR(e){return!Nf||!e?!1:e===document.scrollingElement}function TR(e){const t={x:0,y:0},n=MR(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:a,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const SP={x:.2,y:.2};function wP(e,t,n,r,s){let{top:a,left:l,right:u,bottom:d}=n;r===void 0&&(r=10),s===void 0&&(s=SP);const{isTop:h,isBottom:p,isLeft:m,isRight:_}=TR(e),b={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!h&&a<=t.top+w.height?(b.y=cn.Backward,S.y=r*Math.abs((t.top+w.height-a)/w.height)):!p&&d>=t.bottom-w.height&&(b.y=cn.Forward,S.y=r*Math.abs((t.bottom-w.height-d)/w.height)),!_&&u>=t.right-w.width?(b.x=cn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!m&&l<=t.left+w.width&&(b.x=cn.Backward,S.x=r*Math.abs((t.left+w.width-l)/w.width)),{direction:b,speed:S}}function CP(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function AR(e){return e.reduce((t,n)=>Xa(t,Lv(n)),ei)}function kP(e){return e.reduce((t,n)=>t+ER(n),0)}function EP(e){return e.reduce((t,n)=>t+RR(n),0)}function RP(e,t){if(t===void 0&&(t=vl),!e)return;const{top:n,left:r,bottom:s,right:a}=t(e);kR(e)&&(s<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const MP=[["x",["left","right"],kP],["y",["top","bottom"],EP]];class Oy{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ny(n),s=AR(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,u]of MP)for(const d of l)Object.defineProperty(this,d,{get:()=>{const h=u(r),p=s[a]-h;return this.rect[d]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Bc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function TP(e){const{EventTarget:t}=nr(e);return e instanceof t?e:gl(e)}function Dg(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var jr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(jr||(jr={}));function Nw(e){e.preventDefault()}function AP(e){e.stopPropagation()}var st;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(st||(st={}));const DR={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},DP=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class Ly{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Bc(gl(n)),this.windowListeners=new Bc(nr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(jr.Resize,this.handleCancel),this.windowListeners.add(jr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(jr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&RP(r),n(ei)}handleKeyDown(t){if(Dy(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:a=DR,coordinateGetter:l=DP,scrollBehavior:u="smooth"}=s,{code:d}=t;if(a.end.includes(d)){this.handleEnd(t);return}if(a.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:h}=r.current,p=h?{x:h.left,y:h.top}:ei;this.referenceCoordinates||(this.referenceCoordinates=p);const m=l(t,{active:n,context:r.current,currentCoordinates:p});if(m){const _=Yd(m,p),b={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:D,maxScroll:z,minScroll:L}=TR(w),j=CP(w),I={x:Math.min(C===st.Right?j.right-j.width/2:j.right,Math.max(C===st.Right?j.left:j.left+j.width/2,m.x)),y:Math.min(C===st.Down?j.bottom-j.height/2:j.bottom,Math.max(C===st.Down?j.top:j.top+j.height/2,m.y))},Z=C===st.Right&&!T||C===st.Left&&!R,P=C===st.Down&&!D||C===st.Up&&!k;if(Z&&I.x!==m.x){const W=w.scrollLeft+_.x,H=C===st.Right&&W<=z.x||C===st.Left&&W>=L.x;if(H&&!_.y){w.scrollTo({left:W,behavior:u});return}H?b.x=w.scrollLeft-W:b.x=C===st.Right?w.scrollLeft-z.x:w.scrollLeft-L.x,b.x&&w.scrollBy({left:-b.x,behavior:u});break}else if(P&&I.y!==m.y){const W=w.scrollTop+_.y,H=C===st.Down&&W<=z.y||C===st.Up&&W>=L.y;if(H&&!_.x){w.scrollTo({top:W,behavior:u});return}H?b.y=w.scrollTop-W:b.y=C===st.Down?w.scrollTop-z.y:w.scrollTop-L.y,b.y&&w.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,Xa(Yd(m,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ly.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=DR,onActivation:s}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=a.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function Ow(e){return!!(e&&"distance"in e)}function Lw(e){return!!(e&&"delay"in e)}class zy{constructor(t,n,r){var s;r===void 0&&(r=TP(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=gl(l),this.documentListeners=new Bc(this.document),this.listeners=new Bc(r),this.windowListeners=new Bc(nr(l)),this.initialCoordinates=(s=Ov(a))!=null?s:ei,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(jr.Resize,this.handleCancel),this.windowListeners.add(jr.DragStart,Nw),this.windowListeners.add(jr.VisibilityChange,this.handleCancel),this.windowListeners.add(jr.ContextMenu,Nw),this.documentListeners.add(jr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lw(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ow(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(jr.Click,AP,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(jr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:u}}=a;if(!s)return;const d=(n=Ov(t))!=null?n:ei,h=Yd(s,d);if(!r&&u){if(Ow(u)){if(u.tolerance!=null&&Dg(h,u.tolerance))return this.handleCancel();if(Dg(h,u.distance))return this.handleStart()}if(Lw(u)&&Dg(h,u.tolerance))return this.handleCancel();this.handlePending(u,h);return}t.cancelable&&t.preventDefault(),l(d)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===st.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const NP={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class jy extends zy{constructor(t){const{event:n}=t,r=gl(n.target);super(t,NP,r)}}jy.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const OP={move:{name:"mousemove"},end:{name:"mouseup"}};var zv;(function(e){e[e.RightClick=2]="RightClick"})(zv||(zv={}));class LP extends zy{constructor(t){super(t,OP,gl(t.event.target))}}LP.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zv.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ng={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zP extends zy{constructor(t){super(t,Ng)}static setup(){return window.addEventListener(Ng.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ng.move.name,t)};function t(){}}}zP.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Pc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Pc||(Pc={}));var Zd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zd||(Zd={}));function jP(e){let{acceleration:t,activator:n=Pc.Pointer,canScroll:r,draggingRect:s,enabled:a,interval:l=5,order:u=Zd.TreeOrder,pointerCoordinates:d,scrollableAncestors:h,scrollableAncestorRects:p,delta:m,threshold:_}=e;const b=PP({delta:m,disabled:!a}),[S,w]=VB(),C=x.useRef({x:0,y:0}),k=x.useRef({x:0,y:0}),T=x.useMemo(()=>{switch(n){case Pc.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Pc.DraggableRect:return s}},[n,s,d]),R=x.useRef(null),D=x.useCallback(()=>{const L=R.current;if(!L)return;const j=C.current.x*k.current.x,I=C.current.y*k.current.y;L.scrollBy(j,I)},[]),z=x.useMemo(()=>u===Zd.TreeOrder?[...h].reverse():h,[u,h]);x.useEffect(()=>{if(!a||!h.length||!T){w();return}for(const L of z){if((r==null?void 0:r(L))===!1)continue;const j=h.indexOf(L),I=p[j];if(!I)continue;const{direction:Z,speed:P}=wP(L,I,T,t,_);for(const W of["x","y"])b[W][Z[W]]||(P[W]=0,Z[W]=0);if(P.x>0||P.y>0){w(),R.current=L,S(D,l),C.current=P,k.current=Z;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,D,r,w,a,l,JSON.stringify(T),JSON.stringify(b),S,h,z,p,JSON.stringify(_)])}const BP={x:{[cn.Backward]:!1,[cn.Forward]:!1},y:{[cn.Backward]:!1,[cn.Forward]:!1}};function PP(e){let{delta:t,disabled:n}=e;const r=Nv(t);return vu(s=>{if(n||!r||!s)return BP;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[cn.Backward]:s.x[cn.Backward]||a.x===-1,[cn.Forward]:s.x[cn.Forward]||a.x===1},y:{[cn.Backward]:s.y[cn.Backward]||a.y===-1,[cn.Forward]:s.y[cn.Forward]||a.y===1}}},[n,t,r])}function IP(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return vu(s=>{var a;return t==null?null:(a=r??s)!=null?a:null},[r,t])}function HP(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var Jc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Jc||(Jc={}));var jv;(function(e){e.Optimized="optimized"})(jv||(jv={}));const zw=new Map;function FP(e,t){let{dragging:n,dependencies:r,config:s}=t;const[a,l]=x.useState(null),{frequency:u,measure:d,strategy:h}=s,p=x.useRef(e),m=C(),_=Zc(m),b=x.useCallback(function(k){k===void 0&&(k=[]),!_.current&&l(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=x.useRef(null),w=vu(k=>{if(m&&!n)return zw;if(!k||k===zw||p.current!==e||a!=null){const T=new Map;for(let R of e){if(!R)continue;if(a&&a.length>0&&!a.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const D=R.node.current,z=D?new Oy(d(D),D):null;R.rect.current=z,z&&T.set(R.id,z)}return T}return k},[e,a,n,m,d]);return x.useEffect(()=>{p.current=e},[e]),x.useEffect(()=>{m||b()},[n,m]),x.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),x.useEffect(()=>{m||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{b(),S.current=null},u))},[u,m,b,...r]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:a!=null};function C(){switch(h){case Jc.Always:return!1;case Jc.BeforeDragging:return n;default:return!n}}}function NR(e,t){return vu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function UP(e,t){return NR(e,t)}function $P(e){let{callback:t,disabled:n}=e;const r=Ay(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Of(e){let{callback:t,disabled:n}=e;const r=Ay(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function WP(e){return new Oy(vl(e),e)}function jw(e,t,n){t===void 0&&(t=WP);const[r,s]=x.useState(null);function a(){s(d=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=d??n)!=null?h:null}const p=t(e);return JSON.stringify(d)===JSON.stringify(p)?d:p})}const l=$P({callback(d){if(e)for(const h of d){const{type:p,target:m}=h;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){a();break}}}}),u=Of({callback:a});return wi(()=>{a(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function qP(e){const t=NR(e);return CR(e,t)}const Bw=[];function VP(e){const t=x.useRef(e),n=vu(r=>e?r&&r!==Bw&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ny(e):Bw,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function KP(e){const[t,n]=x.useState(null),r=x.useRef(e),s=x.useCallback(a=>{const l=Ag(a.target);l&&n(u=>u?(u.set(l,Lv(l)),new Map(u)):null)},[]);return x.useEffect(()=>{const a=r.current;if(e!==a){l(a);const u=e.map(d=>{const h=Ag(d);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,Lv(h)]):null}).filter(d=>d!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(a)};function l(u){u.forEach(d=>{const h=Ag(d);h==null||h.removeEventListener("scroll",s)})}},[s,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>Xa(a,l),ei):AR(e):ei,[e,t])}function Pw(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==ei;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Yd(e,n.current):ei}function GP(e){x.useEffect(()=>{if(!Nf)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function YP(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:a}=r;return n[s]=l=>{a(l,t)},n},{}),[e,t])}function OR(e){return x.useMemo(()=>e?yP(e):null,[e])}const Iw=[];function XP(e,t){t===void 0&&(t=vl);const[n]=e,r=OR(n?nr(n):null),[s,a]=x.useState(Iw);function l(){a(()=>e.length?e.map(d=>MR(d)?r:new Oy(t(d),d)):Iw)}const u=Of({callback:l});return wi(()=>{u==null||u.disconnect(),l(),e.forEach(d=>u==null?void 0:u.observe(d))},[e]),s}function ZP(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gu(t)?t:e}function QP(e){let{measure:t}=e;const[n,r]=x.useState(null),s=x.useCallback(h=>{for(const{target:p}of h)if(gu(p)){r(m=>{const _=t(p);return m?{...m,width:_.width,height:_.height}:_});break}},[t]),a=Of({callback:s}),l=x.useCallback(h=>{const p=ZP(h);a==null||a.disconnect(),p&&(a==null||a.observe(p)),r(p?t(p):null)},[t,a]),[u,d]=Gd(l);return x.useMemo(()=>({nodeRef:u,rect:n,setRef:d}),[n,u,d])}const JP=[{sensor:jy,options:{}},{sensor:Ly,options:{}}],e8={current:{}},Rd={draggable:{measure:Dw},droppable:{measure:Dw,strategy:Jc.WhileDragging,frequency:jv.Optimized},dragOverlay:{measure:vl}};class Ic extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const t8={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ic,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Rd,measureDroppableContainers:Xd,windowRect:null,measuringScheduled:!1},n8={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xd,draggableNodes:new Map,over:null,measureDroppableContainers:Xd},Lf=x.createContext(n8),LR=x.createContext(t8);function r8(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ic}}}function i8(e,t){switch(t.type){case nn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case nn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case nn.DragEnd:case nn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case nn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Ic(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case nn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new Ic(e.droppable.containers);return l.set(n,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case nn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new Ic(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function s8(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=x.useContext(Lf),a=Nv(r),l=Nv(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!Dy(a)||document.activeElement===a.target)return;const u=s.get(l);if(!u)return;const{activatorNode:d,node:h}=u;if(!d.current&&!h.current)return;requestAnimationFrame(()=>{for(const p of[d.current,h.current]){if(!p)continue;const m=YB(p);if(m){m.focus();break}}})}},[r,t,s,l,a]),null}function o8(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...r}),n):n}function a8(e){return x.useMemo(()=>({draggable:{...Rd.draggable,...e==null?void 0:e.draggable},droppable:{...Rd.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Rd.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function l8(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const a=x.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;wi(()=>{if(!l&&!u||!t){a.current=!1;return}if(a.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const p=n(h),m=CR(p,r);if(l||(m.x=0),u||(m.y=0),a.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const _=kR(h);_&&_.scrollBy({top:m.y,left:m.x})}},[t,l,u,r,n])}const zR=x.createContext({...ei,scaleX:1,scaleY:1});var Hs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Hs||(Hs={}));const c8=x.memo(function(t){var n,r,s,a;let{id:l,accessibility:u,autoScroll:d=!0,children:h,sensors:p=JP,collisionDetection:m=dP,measuring:_,modifiers:b,...S}=t;const w=x.useReducer(i8,void 0,r8),[C,k]=w,[T,R]=tP(),[D,z]=x.useState(Hs.Uninitialized),L=D===Hs.Initialized,{draggable:{active:j,nodes:I,translate:Z},droppable:{containers:P}}=C,W=j!=null?I.get(j):null,H=x.useRef({initial:null,translated:null}),F=x.useMemo(()=>{var Ot;return j!=null?{id:j,data:(Ot=W==null?void 0:W.data)!=null?Ot:e8,rect:H}:null},[j,W]),V=x.useRef(null),[U,O]=x.useState(null),[K,$]=x.useState(null),J=Zc(S,Object.values(S)),A=_u("DndDescribedBy",l),B=x.useMemo(()=>P.getEnabled(),[P]),Y=a8(_),{droppableRects:M,measureDroppableContainers:X,measuringScheduled:se}=FP(B,{dragging:L,dependencies:[Z.x,Z.y],config:Y.droppable}),re=IP(I,j),me=x.useMemo(()=>K?Ov(K):null,[K]),Ce=Zo(),pe=UP(re,Y.draggable.measure);l8({activeNode:j!=null?I.get(j):null,config:Ce.layoutShiftCompensation,initialRect:pe,measure:Y.draggable.measure});const ke=jw(re,Y.draggable.measure,pe),Je=jw(re?re.parentElement:null),qe=x.useRef({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:M,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=P.getNodeFor((n=qe.current.over)==null?void 0:n.id),Ve=QP({measure:Y.dragOverlay.measure}),Nt=(r=Ve.nodeRef.current)!=null?r:re,It=L?(s=Ve.rect)!=null?s:ke:null,ir=!!(Ve.nodeRef.current&&Ve.rect),Fn=qP(ir?null:ke),Ht=OR(Nt?nr(Nt):null),vn=VP(L?Me??re:null),yr=XP(vn),ri=o8(b,{transform:{x:Z.x-Fn.x,y:Z.y-Fn.y,scaleX:1,scaleY:1},activatorEvent:K,active:F,activeNodeRect:ke,containerNodeRect:Je,draggingNodeRect:It,over:qe.current.over,overlayNodeRect:Ve.rect,scrollableAncestors:vn,scrollableAncestorRects:yr,windowRect:Ht}),Mi=me?Xa(me,Z):null,Ft=KP(vn),ro=Pw(Ft),ae=Pw(Ft,[ke]),de=Xa(ri,ro),Ee=It?mP(It,ri):null,Le=F&&Ee?m({active:F,collisionRect:Ee,droppableRects:M,droppableContainers:B,pointerCoordinates:Mi}):null,he=cP(Le,"id"),[ge,je]=x.useState(null),Be=ir?ri:Xa(ri,ae),Fe=fP(Be,(a=ge==null?void 0:ge.rect)!=null?a:null,ke),Yt=x.useRef(null),ot=x.useCallback((Ot,Lt)=>{let{sensor:sn,options:$n}=Lt;if(V.current==null)return;const Wn=I.get(V.current);if(!Wn)return;const En=Ot.nativeEvent,qn=new sn({active:V.current,activeNode:Wn,event:En,options:$n,context:qe,onAbort(Xt){if(!I.get(Xt))return;const{onDragAbort:sr}=J.current,xr={id:Xt};sr==null||sr(xr),T({type:"onDragAbort",event:xr})},onPending(Xt,$r,sr,xr){if(!I.get(Xt))return;const{onDragPending:Ai}=J.current,Wr={id:Xt,constraint:$r,initialCoordinates:sr,offset:xr};Ai==null||Ai(Wr),T({type:"onDragPending",event:Wr})},onStart(Xt){const $r=V.current;if($r==null)return;const sr=I.get($r);if(!sr)return;const{onDragStart:xr}=J.current,Ti={activatorEvent:En,active:{id:$r,data:sr.data,rect:H}};$s.unstable_batchedUpdates(()=>{xr==null||xr(Ti),z(Hs.Initializing),k({type:nn.DragStart,initialCoordinates:Xt,active:$r}),T({type:"onDragStart",event:Ti}),O(Yt.current),$(En)})},onMove(Xt){k({type:nn.DragMove,coordinates:Xt})},onEnd:br(nn.DragEnd),onCancel:br(nn.DragCancel)});Yt.current=qn;function br(Xt){return async function(){const{active:sr,collisions:xr,over:Ti,scrollAdjustedTranslate:Ai}=qe.current;let Wr=null;if(sr&&Ai){const{cancelDrop:cs}=J.current;Wr={activatorEvent:En,active:sr,collisions:xr,delta:Ai,over:Ti},Xt===nn.DragEnd&&typeof cs=="function"&&await Promise.resolve(cs(Wr))&&(Xt=nn.DragCancel)}V.current=null,$s.unstable_batchedUpdates(()=>{k({type:Xt}),z(Hs.Uninitialized),je(null),O(null),$(null),Yt.current=null;const cs=Xt===nn.DragEnd?"onDragEnd":"onDragCancel";if(Wr){const Sr=J.current[cs];Sr==null||Sr(Wr),T({type:cs,event:Wr})}})}}},[I]),ii=x.useCallback((Ot,Lt)=>(sn,$n)=>{const Wn=sn.nativeEvent,En=I.get($n);if(V.current!==null||!En||Wn.dndKit||Wn.defaultPrevented)return;const qn={active:En};Ot(sn,Lt.options,qn)===!0&&(Wn.dndKit={capturedBy:Lt.sensor},V.current=$n,ot(sn,Lt))},[I,ot]),Un=HP(p,ii);GP(p),wi(()=>{ke&&D===Hs.Initializing&&z(Hs.Initialized)},[ke,D]),x.useEffect(()=>{const{onDragMove:Ot}=J.current,{active:Lt,activatorEvent:sn,collisions:$n,over:Wn}=qe.current;if(!Lt||!sn)return;const En={active:Lt,activatorEvent:sn,collisions:$n,delta:{x:de.x,y:de.y},over:Wn};$s.unstable_batchedUpdates(()=>{Ot==null||Ot(En),T({type:"onDragMove",event:En})})},[de.x,de.y]),x.useEffect(()=>{const{active:Ot,activatorEvent:Lt,collisions:sn,droppableContainers:$n,scrollAdjustedTranslate:Wn}=qe.current;if(!Ot||V.current==null||!Lt||!Wn)return;const{onDragOver:En}=J.current,qn=$n.get(he),br=qn&&qn.rect.current?{id:qn.id,rect:qn.rect.current,data:qn.data,disabled:qn.disabled}:null,Xt={active:Ot,activatorEvent:Lt,collisions:sn,delta:{x:Wn.x,y:Wn.y},over:br};$s.unstable_batchedUpdates(()=>{je(br),En==null||En(Xt),T({type:"onDragOver",event:Xt})})},[he]),wi(()=>{qe.current={activatorEvent:K,active:F,activeNode:re,collisionRect:Ee,collisions:Le,droppableRects:M,draggableNodes:I,draggingNode:Nt,draggingNodeRect:It,droppableContainers:P,over:ge,scrollableAncestors:vn,scrollAdjustedTranslate:de},H.current={initial:It,translated:Ee}},[F,re,Le,Ee,I,Nt,It,M,P,ge,vn,de]),jP({...Ce,delta:Z,draggingRect:Ee,pointerCoordinates:Mi,scrollableAncestors:vn,scrollableAncestorRects:yr});const Qf=x.useMemo(()=>({active:F,activeNode:re,activeNodeRect:ke,activatorEvent:K,collisions:Le,containerNodeRect:Je,dragOverlay:Ve,draggableNodes:I,droppableContainers:P,droppableRects:M,over:ge,measureDroppableContainers:X,scrollableAncestors:vn,scrollableAncestorRects:yr,measuringConfiguration:Y,measuringScheduled:se,windowRect:Ht}),[F,re,ke,K,Le,Je,Ve,I,P,M,ge,X,vn,yr,Y,se,Ht]),Xo=x.useMemo(()=>({activatorEvent:K,activators:Un,active:F,activeNodeRect:ke,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:I,over:ge,measureDroppableContainers:X}),[K,Un,F,ke,k,A,I,ge,X]);return vt.createElement(wR.Provider,{value:R},vt.createElement(Lf.Provider,{value:Xo},vt.createElement(LR.Provider,{value:Qf},vt.createElement(zR.Provider,{value:Fe},h)),vt.createElement(s8,{disabled:(u==null?void 0:u.restoreFocus)===!1})),vt.createElement(iP,{...u,hiddenTextDescribedById:A}));function Zo(){const Ot=(U==null?void 0:U.autoScrollEnabled)===!1,Lt=typeof d=="object"?d.enabled===!1:d===!1,sn=L&&!Ot&&!Lt;return typeof d=="object"?{...d,enabled:sn}:{enabled:sn}}}),u8=x.createContext(null),Hw="button",h8="Draggable";function d8(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const a=_u(h8),{activators:l,activatorEvent:u,active:d,activeNodeRect:h,ariaDescribedById:p,draggableNodes:m,over:_}=x.useContext(Lf),{role:b=Hw,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(d==null?void 0:d.id)===t,k=x.useContext(C?zR:u8),[T,R]=Gd(),[D,z]=Gd(),L=YP(l,t),j=Zc(n);wi(()=>(m.set(t,{id:t,key:a,node:T,activatorNode:D,data:j}),()=>{const Z=m.get(t);Z&&Z.key===a&&m.delete(t)}),[m,t]);const I=x.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&b===Hw?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[r,b,w,C,S,p.draggable]);return{active:d,activatorEvent:u,activeNodeRect:h,attributes:I,isDragging:C,listeners:r?void 0:L,node:T,over:_,setNodeRef:R,setActivatorNodeRef:z,transform:k}}function f8(){return x.useContext(LR)}const p8="Droppable",m8={timeout:25};function g8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const a=_u(p8),{active:l,dispatch:u,over:d,measureDroppableContainers:h}=x.useContext(Lf),p=x.useRef({disabled:n}),m=x.useRef(!1),_=x.useRef(null),b=x.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...m8,...s},k=Zc(w??r),T=x.useCallback(()=>{if(!m.current){m.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{h(Array.isArray(k.current)?k.current:[k.current]),b.current=null},C)},[C]),R=Of({callback:T,disabled:S||!l}),D=x.useCallback((I,Z)=>{R&&(Z&&(R.unobserve(Z),m.current=!1),I&&R.observe(I))},[R]),[z,L]=Gd(D),j=Zc(t);return x.useEffect(()=>{!R||!z.current||(R.disconnect(),m.current=!1,R.observe(z.current))},[z,R]),x.useEffect(()=>(u({type:nn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:z,rect:_,data:j}}),()=>u({type:nn.UnregisterDroppable,key:a,id:r})),[r]),x.useEffect(()=>{n!==p.current.disabled&&(u({type:nn.SetDroppableDisabled,id:r,key:a,disabled:n}),p.current.disabled=n)},[r,a,n,u]),{active:l,rect:_,isOver:(d==null?void 0:d.id)===r,node:z,over:d,setNodeRef:L}}function By(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function v8(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function td(e){return e!==null&&e>=0}function _8(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function y8(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const jR=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=By(t,r,n),l=t[s],u=a[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},nd={scaleX:1,scaleY:1},b8=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:l}=e;const u=(t=a[n])!=null?t:r;if(!u)return null;if(s===n){const h=a[l];return h?{x:0,y:n<l?h.top+h.height-(u.top+u.height):h.top-u.top,...nd}:null}const d=x8(a,s,n);return s>n&&s<=l?{x:0,y:-u.height-d,...nd}:s<n&&s>=l?{x:0,y:u.height+d,...nd}:{x:0,y:0,...nd}};function x8(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const BR="Sortable",PR=vt.createContext({activeIndex:-1,containerId:BR,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jR,disabled:{draggable:!1,droppable:!1}});function S8(e){let{children:t,id:n,items:r,strategy:s=jR,disabled:a=!1}=e;const{active:l,dragOverlay:u,droppableRects:d,over:h,measureDroppableContainers:p}=f8(),m=_u(BR,n),_=u.rect!==null,b=x.useMemo(()=>r.map(L=>typeof L=="object"&&"id"in L?L.id:L),[r]),S=l!=null,w=l?b.indexOf(l.id):-1,C=h?b.indexOf(h.id):-1,k=x.useRef(b),T=!_8(b,k.current),R=C!==-1&&w===-1||T,D=y8(a);wi(()=>{T&&S&&p(b)},[T,b,S,p]),x.useEffect(()=>{k.current=b},[b]);const z=x.useMemo(()=>({activeIndex:w,containerId:m,disabled:D,disableTransforms:R,items:b,overIndex:C,useDragOverlay:_,sortedRects:v8(b,d),strategy:s}),[w,m,D.draggable,D.droppable,R,b,C,d,_,s]);return vt.createElement(PR.Provider,{value:z},t)}const w8=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return By(n,r,s).indexOf(t)},C8=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:l,previousItems:u,previousContainerId:d,transition:h}=e;return!h||!r||u!==a&&s===l?!1:n?!0:l!==s&&t===d},k8={duration:200,easing:"ease"},IR="transform",E8=Qc.Transition.toString({property:IR,duration:0,easing:"linear"}),R8={roleDescription:"sortable"};function M8(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,l]=x.useState(null),u=x.useRef(n);return wi(()=>{if(!t&&n!==u.current&&r.current){const d=s.current;if(d){const h=vl(r.current,{ignoreTransform:!0}),p={x:d.left-h.left,y:d.top-h.top,scaleX:d.width/h.width,scaleY:d.height/h.height};(p.x||p.y)&&l(p)}}n!==u.current&&(u.current=n)},[t,n,r,s]),x.useEffect(()=>{a&&l(null)},[a]),a}function T8(e){let{animateLayoutChanges:t=C8,attributes:n,disabled:r,data:s,getNewIndex:a=w8,id:l,strategy:u,resizeObserverConfig:d,transition:h=k8}=e;const{items:p,containerId:m,activeIndex:_,disabled:b,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=x.useContext(PR),R=A8(r,b),D=p.indexOf(l),z=x.useMemo(()=>({sortable:{containerId:m,index:D,items:p},...s}),[m,s,D,p]),L=x.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:j,node:I,isOver:Z,setNodeRef:P}=g8({id:l,data:z,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...d}}),{active:W,activatorEvent:H,activeNodeRect:F,attributes:V,setNodeRef:U,listeners:O,isDragging:K,over:$,setActivatorNodeRef:J,transform:A}=d8({id:l,data:z,attributes:{...R8,...n},disabled:R.draggable}),B=qB(P,U),Y=!!W,M=Y&&!S&&td(_)&&td(C),X=!k&&K,se=X&&M?A:null,me=M?se??(u??T)({rects:w,activeNodeRect:F,activeIndex:_,overIndex:C,index:D}):null,Ce=td(_)&&td(C)?a({id:l,items:p,activeIndex:_,overIndex:C}):D,pe=W==null?void 0:W.id,ke=x.useRef({activeId:pe,items:p,newIndex:Ce,containerId:m}),Je=p!==ke.current.items,qe=t({active:W,containerId:m,isDragging:K,isSorting:Y,id:l,index:D,items:p,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:h,wasDragging:ke.current.activeId!=null}),Me=M8({disabled:!qe,index:D,node:I,rect:j});return x.useEffect(()=>{Y&&ke.current.newIndex!==Ce&&(ke.current.newIndex=Ce),m!==ke.current.containerId&&(ke.current.containerId=m),p!==ke.current.items&&(ke.current.items=p)},[Y,Ce,m,p]),x.useEffect(()=>{if(pe===ke.current.activeId)return;if(pe!=null&&ke.current.activeId==null){ke.current.activeId=pe;return}const Nt=setTimeout(()=>{ke.current.activeId=pe},50);return()=>clearTimeout(Nt)},[pe]),{active:W,activeIndex:_,attributes:V,data:z,rect:j,index:D,newIndex:Ce,items:p,isOver:Z,isSorting:Y,isDragging:K,listeners:O,node:I,overIndex:C,over:$,setNodeRef:B,setActivatorNodeRef:J,setDroppableNodeRef:P,setDraggableNodeRef:U,transform:Me??me,transition:Ve()};function Ve(){if(Me||Je&&ke.current.newIndex===D)return E8;if(!(X&&!Dy(H)||!h)&&(Y||qe))return Qc.Transition.toString({...h,property:IR})}}function A8(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}st.Down,st.Right,st.Up,st.Left;function HR(e){const t=e+"CollectionProvider",[n,r]=Qs(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:C,children:k}=w,T=vt.useRef(null),R=vt.useRef(new Map).current;return v.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};l.displayName=t;const u=e+"CollectionSlot",d=el(u),h=vt.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=a(u,k),D=Pt(C,R.collectionRef);return v.jsx(d,{ref:D,children:T})});h.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",_=el(p),b=vt.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,D=vt.useRef(null),z=Pt(C,D),L=a(p,k);return vt.useEffect(()=>(L.itemMap.set(D,{ref:D,...R}),()=>void L.itemMap.delete(D))),v.jsx(_,{[m]:"",ref:z,children:T})});b.displayName=p;function S(w){const C=a(e+"CollectionConsumer",w);return vt.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((L,j)=>R.indexOf(L.ref.current)-R.indexOf(j.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:h,ItemSlot:b},S,r]}var D8=x.createContext(void 0);function FR(e){const t=x.useContext(D8);return e||t||"ltr"}var Og="rovingFocusGroup.onEntryFocus",N8={bubbles:!1,cancelable:!0},yu="RovingFocusGroup",[Bv,UR,O8]=HR(yu),[L8,$R]=Qs(yu,[O8]),[z8,j8]=L8(yu),WR=x.forwardRef((e,t)=>v.jsx(Bv.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Bv.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(B8,{...e,ref:t})})}));WR.displayName=yu;var B8=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=e,_=x.useRef(null),b=Pt(t,_),S=FR(a),[w,C]=_f({prop:l,defaultProp:u??null,onChange:d,caller:yu}),[k,T]=x.useState(!1),R=Si(h),D=UR(n),z=x.useRef(!1),[L,j]=x.useState(0);return x.useEffect(()=>{const I=_.current;if(I)return I.addEventListener(Og,R),()=>I.removeEventListener(Og,R)},[R]),v.jsx(z8,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:x.useCallback(I=>C(I),[C]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>j(I=>I+1),[]),onFocusableItemRemove:x.useCallback(()=>j(I=>I-1),[]),children:v.jsx(wt.div,{tabIndex:k||L===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...e.style},onMouseDown:Ne(e.onMouseDown,()=>{z.current=!0}),onFocus:Ne(e.onFocus,I=>{const Z=!z.current;if(I.target===I.currentTarget&&Z&&!k){const P=new CustomEvent(Og,N8);if(I.currentTarget.dispatchEvent(P),!P.defaultPrevented){const W=D().filter(O=>O.focusable),H=W.find(O=>O.active),F=W.find(O=>O.id===w),U=[H,F,...W].filter(Boolean).map(O=>O.ref.current);KR(U,p)}}z.current=!1}),onBlur:Ne(e.onBlur,()=>T(!1))})})}),qR="RovingFocusGroupItem",VR=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...u}=e,d=Ka(),h=a||d,p=j8(qR,n),m=p.currentTabStopId===h,_=UR(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:w}=p;return x.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),v.jsx(Bv.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:v.jsx(wt.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Ne(e.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:Ne(e.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ne(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=H8(C,p.orientation,p.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(D=>D.focusable).map(D=>D.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const D=R.indexOf(C.currentTarget);R=p.loop?F8(R,D+1):R.slice(D+1)}setTimeout(()=>KR(R))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:w!=null}):l})})});VR.displayName=qR;var P8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function H8(e,t,n){const r=I8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return P8[r]}function KR(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function F8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var U8=WR,$8=VR,Pv=["Enter"," "],W8=["ArrowDown","PageUp","Home"],GR=["ArrowUp","PageDown","End"],q8=[...W8,...GR],V8={ltr:[...Pv,"ArrowRight"],rtl:[...Pv,"ArrowLeft"]},K8={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bu="Menu",[eu,G8,Y8]=HR(bu),[Wo,YR]=Qs(bu,[Y8,pl,$R]),zf=pl(),XR=$R(),[X8,qo]=Wo(bu),[Z8,xu]=Wo(bu),ZR=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,u=zf(t),[d,h]=x.useState(null),p=x.useRef(!1),m=Si(a),_=FR(s);return x.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),v.jsx(wy,{...u,children:v.jsx(X8,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:v.jsx(Z8,{scope:t,onClose:x.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:_,modal:l,children:r})})})};ZR.displayName=bu;var Q8="MenuAnchor",Py=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=zf(n);return v.jsx(Mf,{...s,...r,ref:t})});Py.displayName=Q8;var Iy="MenuPortal",[J8,QR]=Wo(Iy,{forceMount:void 0}),JR=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=qo(Iy,t);return v.jsx(J8,{scope:t,forceMount:n,children:v.jsx(Ur,{present:n||a.open,children:v.jsx(du,{asChild:!0,container:s,children:r})})})};JR.displayName=Iy;var Ir="MenuContent",[eI,Hy]=Wo(Ir),eM=x.forwardRef((e,t)=>{const n=QR(Ir,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=qo(Ir,e.__scopeMenu),l=xu(Ir,e.__scopeMenu);return v.jsx(eu.Provider,{scope:e.__scopeMenu,children:v.jsx(Ur,{present:r||a.open,children:v.jsx(eu.Slot,{scope:e.__scopeMenu,children:l.modal?v.jsx(tI,{...s,ref:t}):v.jsx(nI,{...s,ref:t})})})})}),tI=x.forwardRef((e,t)=>{const n=qo(Ir,e.__scopeMenu),r=x.useRef(null),s=Pt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return iy(a)},[]),v.jsx(Fy,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),nI=x.forwardRef((e,t)=>{const n=qo(Ir,e.__scopeMenu);return v.jsx(Fy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),rI=el("MenuContent.ScrollLock"),Fy=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:b,disableOutsideScroll:S,...w}=e,C=qo(Ir,n),k=xu(Ir,n),T=zf(n),R=XR(n),D=G8(n),[z,L]=x.useState(null),j=x.useRef(null),I=Pt(t,j,C.onContentChange),Z=x.useRef(0),P=x.useRef(""),W=x.useRef(0),H=x.useRef(null),F=x.useRef("right"),V=x.useRef(0),U=S?xf:x.Fragment,O=S?{as:rI,allowPinchZoom:!0}:void 0,K=J=>{var me,Ce;const A=P.current+J,B=D().filter(pe=>!pe.disabled),Y=document.activeElement,M=(me=B.find(pe=>pe.ref.current===Y))==null?void 0:me.textValue,X=B.map(pe=>pe.textValue),se=mI(X,A,M),re=(Ce=B.find(pe=>pe.textValue===se))==null?void 0:Ce.ref.current;(function pe(ke){P.current=ke,window.clearTimeout(Z.current),ke!==""&&(Z.current=window.setTimeout(()=>pe(""),1e3))})(A),re&&setTimeout(()=>re.focus())};x.useEffect(()=>()=>window.clearTimeout(Z.current),[]),ry();const $=x.useCallback(J=>{var B,Y;return F.current===((B=H.current)==null?void 0:B.side)&&vI(J,(Y=H.current)==null?void 0:Y.area)},[]);return v.jsx(eI,{scope:n,searchRef:P,onItemEnter:x.useCallback(J=>{$(J)&&J.preventDefault()},[$]),onItemLeave:x.useCallback(J=>{var A;$(J)||((A=j.current)==null||A.focus(),L(null))},[$]),onTriggerLeave:x.useCallback(J=>{$(J)&&J.preventDefault()},[$]),pointerGraceTimerRef:W,onPointerGraceIntentChange:x.useCallback(J=>{H.current=J},[]),children:v.jsx(U,{...O,children:v.jsx(yf,{asChild:!0,trapped:s,onMountAutoFocus:Ne(a,J=>{var A;J.preventDefault(),(A=j.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:v.jsx(hu,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:b,children:v.jsx(U8,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:z,onCurrentTabStopIdChange:L,onEntryFocus:Ne(d,J=>{k.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(Cy,{role:"menu","aria-orientation":"vertical","data-state":gM(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:I,style:{outline:"none",...w.style},onKeyDown:Ne(w.onKeyDown,J=>{const B=J.target.closest("[data-radix-menu-content]")===J.currentTarget,Y=J.ctrlKey||J.altKey||J.metaKey,M=J.key.length===1;B&&(J.key==="Tab"&&J.preventDefault(),!Y&&M&&K(J.key));const X=j.current;if(J.target!==X||!q8.includes(J.key))return;J.preventDefault();const re=D().filter(me=>!me.disabled).map(me=>me.ref.current);GR.includes(J.key)&&re.reverse(),fI(re)}),onBlur:Ne(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(Z.current),P.current="")}),onPointerMove:Ne(e.onPointerMove,tu(J=>{const A=J.target,B=V.current!==J.clientX;if(J.currentTarget.contains(A)&&B){const Y=J.clientX>V.current?"right":"left";F.current=Y,V.current=J.clientX}}))})})})})})})});eM.displayName=Ir;var iI="MenuGroup",Uy=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(wt.div,{role:"group",...r,ref:t})});Uy.displayName=iI;var sI="MenuLabel",tM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(wt.div,{...r,ref:t})});tM.displayName=sI;var Qd="MenuItem",Fw="menu.itemSelect",jf=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=x.useRef(null),l=xu(Qd,e.__scopeMenu),u=Hy(Qd,e.__scopeMenu),d=Pt(t,a),h=x.useRef(!1),p=()=>{const m=a.current;if(!n&&m){const _=new CustomEvent(Fw,{bubbles:!0,cancelable:!0});m.addEventListener(Fw,b=>r==null?void 0:r(b),{once:!0}),Jk(m,_),_.defaultPrevented?h.current=!1:l.onClose()}};return v.jsx(nM,{...s,ref:d,disabled:n,onClick:Ne(e.onClick,p),onPointerDown:m=>{var _;(_=e.onPointerDown)==null||_.call(e,m),h.current=!0},onPointerUp:Ne(e.onPointerUp,m=>{var _;h.current||(_=m.currentTarget)==null||_.click()}),onKeyDown:Ne(e.onKeyDown,m=>{const _=u.searchRef.current!=="";n||_&&m.key===" "||Pv.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});jf.displayName=Qd;var nM=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=Hy(Qd,n),u=XR(n),d=x.useRef(null),h=Pt(t,d),[p,m]=x.useState(!1),[_,b]=x.useState("");return x.useEffect(()=>{const S=d.current;S&&b((S.textContent??"").trim())},[a.children]),v.jsx(eu.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:v.jsx($8,{asChild:!0,...u,focusable:!r,children:v.jsx(wt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:h,onPointerMove:Ne(e.onPointerMove,tu(S=>{r?l.onItemLeave(S):(l.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(e.onPointerLeave,tu(S=>l.onItemLeave(S))),onFocus:Ne(e.onFocus,()=>m(!0)),onBlur:Ne(e.onBlur,()=>m(!1))})})})}),oI="MenuCheckboxItem",rM=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return v.jsx(lM,{scope:e.__scopeMenu,checked:n,children:v.jsx(jf,{role:"menuitemcheckbox","aria-checked":Jd(n)?"mixed":n,...s,ref:t,"data-state":Wy(n),onSelect:Ne(s.onSelect,()=>r==null?void 0:r(Jd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rM.displayName=oI;var iM="MenuRadioGroup",[aI,lI]=Wo(iM,{value:void 0,onValueChange:()=>{}}),sM=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Si(r);return v.jsx(aI,{scope:e.__scopeMenu,value:n,onValueChange:a,children:v.jsx(Uy,{...s,ref:t})})});sM.displayName=iM;var oM="MenuRadioItem",aM=x.forwardRef((e,t)=>{const{value:n,...r}=e,s=lI(oM,e.__scopeMenu),a=n===s.value;return v.jsx(lM,{scope:e.__scopeMenu,checked:a,children:v.jsx(jf,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Wy(a),onSelect:Ne(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});aM.displayName=oM;var $y="MenuItemIndicator",[lM,cI]=Wo($y,{checked:!1}),cM=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=cI($y,n);return v.jsx(Ur,{present:r||Jd(a.checked)||a.checked===!0,children:v.jsx(wt.span,{...s,ref:t,"data-state":Wy(a.checked)})})});cM.displayName=$y;var uI="MenuSeparator",uM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(wt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uM.displayName=uI;var hI="MenuArrow",hM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=zf(n);return v.jsx(ky,{...s,...r,ref:t})});hM.displayName=hI;var dI="MenuSub",[hZ,dM]=Wo(dI),Tc="MenuSubTrigger",fM=x.forwardRef((e,t)=>{const n=qo(Tc,e.__scopeMenu),r=xu(Tc,e.__scopeMenu),s=dM(Tc,e.__scopeMenu),a=Hy(Tc,e.__scopeMenu),l=x.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=a,h={__scopeMenu:e.__scopeMenu},p=x.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return x.useEffect(()=>p,[p]),x.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),v.jsx(Py,{asChild:!0,...h,children:v.jsx(nM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":gM(n.open),...e,ref:ny(t,s.onTriggerChange),onClick:m=>{var _;(_=e.onClick)==null||_.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(e.onPointerMove,tu(m=>{a.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Ne(e.onPointerLeave,tu(m=>{var b,S;p();const _=(b=n.content)==null?void 0:b.getBoundingClientRect();if(_){const w=(S=n.content)==null?void 0:S.dataset.side,C=w==="right",k=C?-5:5,T=_[C?"left":"right"],R=_[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+k,y:m.clientY},{x:T,y:_.top},{x:R,y:_.top},{x:R,y:_.bottom},{x:T,y:_.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(e.onKeyDown,m=>{var b;const _=a.searchRef.current!=="";e.disabled||_&&m.key===" "||V8[r.dir].includes(m.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),m.preventDefault())})})})});fM.displayName=Tc;var pM="MenuSubContent",mM=x.forwardRef((e,t)=>{const n=QR(Ir,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=qo(Ir,e.__scopeMenu),l=xu(Ir,e.__scopeMenu),u=dM(pM,e.__scopeMenu),d=x.useRef(null),h=Pt(t,d);return v.jsx(eu.Provider,{scope:e.__scopeMenu,children:v.jsx(Ur,{present:r||a.open,children:v.jsx(eu.Slot,{scope:e.__scopeMenu,children:v.jsx(Fy,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;l.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ne(e.onFocusOutside,p=>{p.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ne(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:Ne(e.onKeyDown,p=>{var b;const m=p.currentTarget.contains(p.target),_=K8[l.dir].includes(p.key);m&&_&&(a.onOpenChange(!1),(b=u.trigger)==null||b.focus(),p.preventDefault())})})})})})});mM.displayName=pM;function gM(e){return e?"open":"closed"}function Jd(e){return e==="indeterminate"}function Wy(e){return Jd(e)?"indeterminate":e?"checked":"unchecked"}function fI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function mI(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=pI(e,Math.max(a,0));s.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function gI(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],d=t[l],h=u.x,p=u.y,m=d.x,_=d.y;p>r!=_>r&&n<(m-h)*(r-p)/(_-p)+h&&(s=!s)}return s}function vI(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return gI(n,t)}function tu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var _I=ZR,yI=Py,bI=JR,xI=eM,SI=Uy,wI=tM,CI=jf,kI=rM,EI=sM,RI=aM,MI=cM,TI=uM,AI=hM,DI=fM,NI=mM,qy="ContextMenu",[OI]=Qs(qy,[YR]),Pn=YR(),[LI,vM]=OI(qy),_M=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:a=!0}=e,[l,u]=x.useState(!1),d=Pn(t),h=Si(r),p=x.useCallback(m=>{u(m),h(m)},[h]);return v.jsx(LI,{scope:t,open:l,onOpenChange:p,modal:a,children:v.jsx(_I,{...d,dir:s,open:l,onOpenChange:p,modal:a,children:n})})};_M.displayName=qy;var yM="ContextMenuTrigger",bM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,a=vM(yM,n),l=Pn(n),u=x.useRef({x:0,y:0}),d=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),h=x.useRef(0),p=x.useCallback(()=>window.clearTimeout(h.current),[]),m=_=>{u.current={x:_.clientX,y:_.clientY},a.onOpenChange(!0)};return x.useEffect(()=>p,[p]),x.useEffect(()=>void(r&&p()),[r,p]),v.jsxs(v.Fragment,{children:[v.jsx(yI,{...l,virtualRef:d}),v.jsx(wt.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ne(e.onContextMenu,_=>{p(),m(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Ne(e.onPointerDown,rd(_=>{p(),h.current=window.setTimeout(()=>m(_),700)})),onPointerMove:r?e.onPointerMove:Ne(e.onPointerMove,rd(p)),onPointerCancel:r?e.onPointerCancel:Ne(e.onPointerCancel,rd(p)),onPointerUp:r?e.onPointerUp:Ne(e.onPointerUp,rd(p))})]})});bM.displayName=yM;var zI="ContextMenuPortal",xM=e=>{const{__scopeContextMenu:t,...n}=e,r=Pn(t);return v.jsx(bI,{...r,...n})};xM.displayName=zI;var SM="ContextMenuContent",wM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=vM(SM,n),a=Pn(n),l=x.useRef(!1);return v.jsx(xI,{...a,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var d;(d=e.onInteractOutside)==null||d.call(e,u),!u.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wM.displayName=SM;var jI="ContextMenuGroup",BI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(SI,{...s,...r,ref:t})});BI.displayName=jI;var PI="ContextMenuLabel",II=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(wI,{...s,...r,ref:t})});II.displayName=PI;var HI="ContextMenuItem",CM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(CI,{...s,...r,ref:t})});CM.displayName=HI;var FI="ContextMenuCheckboxItem",UI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(kI,{...s,...r,ref:t})});UI.displayName=FI;var $I="ContextMenuRadioGroup",WI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(EI,{...s,...r,ref:t})});WI.displayName=$I;var qI="ContextMenuRadioItem",VI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(RI,{...s,...r,ref:t})});VI.displayName=qI;var KI="ContextMenuItemIndicator",GI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(MI,{...s,...r,ref:t})});GI.displayName=KI;var YI="ContextMenuSeparator",XI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(TI,{...s,...r,ref:t})});XI.displayName=YI;var ZI="ContextMenuArrow",QI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(AI,{...s,...r,ref:t})});QI.displayName=ZI;var JI="ContextMenuSubTrigger",e9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(DI,{...s,...r,ref:t})});e9.displayName=JI;var t9="ContextMenuSubContent",n9=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Pn(n);return v.jsx(NI,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});n9.displayName=t9;function rd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var r9=_M,i9=bM,s9=xM,kM=wM,EM=CM;const o9=r9,a9=i9,RM=x.forwardRef(({className:e,...t},n)=>v.jsx(s9,{children:v.jsx(kM,{ref:n,className:ye("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));RM.displayName=kM.displayName;const MM=x.forwardRef(({className:e,...t},n)=>v.jsx(EM,{ref:n,className:ye("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));MM.displayName=EM.displayName;function l9({onRemove:e,children:t}){return v.jsxs(o9,{children:[v.jsx(a9,{asChild:!0,children:t}),v.jsx(RM,{children:v.jsxs(MM,{onSelect:n=>{n.stopPropagation(),e()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[v.jsx(P6,{className:"h-4 w-4"}),v.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function c9({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,isConnected:h,startingLocalPath:p}){const{groupKey:m,localPath:_,chats:b}=e,S=n.has(m),w=S?b:b.slice(0,l),C=b.length>l,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:D,transform:z,transition:L,isDragging:j}=T8({id:m}),I={transform:Qc.Translate.toString(z),transition:L},Z=v.jsxs("div",{ref:D,className:ye("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between","cursor-grab active:cursor-grabbing",j&&"cursor-grabbing"),onClick:()=>r(m),...T,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:t.has(m)?v.jsx(ts,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):v.jsxs(v.Fragment,{children:[v.jsx(TE,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 text-slate-400 dark:text-slate-500 transition-all duration-200 group-hover/section:opacity-0"}),v.jsx(ts,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 rotate-90 text-slate-400 opacity-0 transition-all duration-200 group-hover/section:opacity-100"})]})}),v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:bR(_)})}),v.jsx(sl,{side:"right",sideOffset:4,children:_})]})]}),u&&v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx(et,{variant:"ghost",size:"icon",className:ye("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!h||p===_)&&"opacity-50 cursor-not-allowed"),disabled:!h||p===_,onClick:P=>{P.stopPropagation(),u(_)},children:p===_?v.jsx(Js,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):v.jsx(uy,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),v.jsx(sl,{side:"right",sideOffset:4,children:h?"New chat":`Start ${zn} to connect`})]})]});return v.jsxs("div",{ref:R,style:I,className:ye("group/section",j&&"opacity-50 shadow-lg z-50 relative"),...k,children:[d?v.jsx(l9,{onRemove:()=>d(m),children:Z}):Z,!t.has(m)&&(w.length>0||C)&&v.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(a),C&&v.jsx("button",{onClick:()=>s(m),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:S?"Show less":`Show more (${b.length-l})`})]})]})}function u9({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,onReorderGroups:h,isConnected:p,startingLocalPath:m}){const _=sP(Tw(jy,{activationConstraint:{distance:8}}),Tw(Ly)),b=x.useMemo(()=>e.map(k=>k.groupKey),[e]),S=x.useRef(null);function w(k){const T=k.active.id;t.has(T)?S.current=null:(S.current=T,r(T))}function C(k){const{active:T,over:R}=k;if(R&&T.id!==R.id&&h){const D=b.indexOf(T.id),z=b.indexOf(R.id);if(D!==-1&&z!==-1){const L=By(b,D,z);h(L)}}if(S.current){const D=S.current;S.current=null,requestAnimationFrame(()=>r(D))}}return v.jsx(c8,{sensors:_,collisionDetection:uP,onDragStart:w,onDragEnd:C,children:v.jsx(S8,{items:b,strategy:b8,children:e.map(k=>v.jsx(c9,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:a,chatsPerProject:l,onNewLocalChat:u,onRemoveProject:d,isConnected:p,startingLocalPath:m},k.groupKey))})})}const Uw=e=>{let t;const n=new Set,r=(h,p)=>{const m=typeof h=="function"?h(t):h;if(!Object.is(m,t)){const _=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(b=>b(t,_))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,s,u);return u},h9=(e=>e?Uw(e):Uw),d9=e=>e;function f9(e,t=d9){const n=vt.useSyncExternalStore(e.subscribe,vt.useCallback(()=>t(e.getState()),[e,t]),vt.useCallback(()=>t(e.getInitialState()),[e,t]));return vt.useDebugValue(n),n}const p9=e=>{const t=h9(e),n=r=>f9(t,r);return Object.assign(n,t),n},Su=(e=>p9);function m9(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const l=d=>d===null?null:JSON.parse(d,void 0),u=(a=n.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const Iv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Iv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Iv(r)(n)}}}},g9=(e,t)=>(n,r,s)=>{let a={storage:m9(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const d=new Set,h=new Set;let p=a.storage;if(!p)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...C)},r,s);const m=()=>{const C=a.partialize({...r()});return p.setItem(a.name,{state:C,version:a.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),m());const b=e((...C)=>(n(...C),m()),r,s);s.getInitialState=()=>b;let S;const w=()=>{var C,k;if(!p)return;const T=++u;l=!1,d.forEach(D=>{var z;return D((z=r())!=null?z:b)});const R=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(C=r())!=null?C:b))||void 0;return Iv(p.getItem.bind(p))(a.name).then(D=>{if(D)if(typeof D.version=="number"&&D.version!==a.version){if(a.migrate){const z=a.migrate(D.state,D.version);return z instanceof Promise?z.then(L=>[!0,L]):[!0,z]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,D.state];return[!1,void 0]}).then(D=>{var z;if(T!==u)return;const[L,j]=D;if(S=a.merge(j,(z=r())!=null?z:b),n(S,!0),L)return m()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),l=!0,h.forEach(D=>D(S)))}).catch(D=>{T===u&&(R==null||R(void 0,D))})};return s.persist={setOptions:C=>{a={...a,...C},C.storage&&(p=C.storage)},clearStorage:()=>{p==null||p.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:C=>(d.add(C),()=>{d.delete(C)}),onFinishHydration:C=>(h.add(C),()=>{h.delete(C)})},a.skipHydration||w(),S||b},wu=g9,$w=Su()(wu(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function v9({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:a,showMobileOpenButton:l,onOpen:u,onClose:d,onCollapse:h,onExpand:p,onCreateChat:m,onDeleteChat:_,onRemoveProject:b}){const S=ki(),w=G_(),C=x.useRef(null),[k,T]=x.useState(new Set),[R,D]=x.useState(new Set),[z,L]=x.useState(()=>Date.now()),j=10,I=$w(X=>X.order),Z=$w(X=>X.setOrder),P=x.useMemo(()=>{if(I.length===0)return e.projectGroups;const X=new Map(e.projectGroups.map(me=>[me.groupKey,me])),se=I.filter(me=>X.has(me)).map(me=>X.get(me)),re=new Set(I);for(const me of e.projectGroups)re.has(me.groupKey)||se.push(me);return se},[e.projectGroups,I]),W=x.useCallback(X=>Z(X),[Z]),H=x.useMemo(()=>new Map(e.projectGroups.map(X=>[X.localPath,X.groupKey])),[e.projectGroups]),F=x.useMemo(()=>e.projectGroups.reduce((X,se)=>X+se.chats.length,0),[e.projectGroups]),V=x.useCallback(X=>{T(se=>{const re=new Set(se);return re.has(X)?re.delete(X):re.add(X),re})},[]),U=x.useCallback(X=>{D(se=>{const re=new Set(se);return re.has(X)?re.delete(X):re.add(X),re})},[]),O=x.useCallback(X=>v.jsx(WB,{chat:X,activeChatId:t,nowMs:z,onSelectChat:se=>w(`/chat/${se}`),onDeleteChat:()=>_(X)},X._id),[t,w,z,_]);x.useEffect(()=>{const X=window.setInterval(()=>{L(Date.now())},3e4);return()=>window.clearInterval(X)},[]),x.useEffect(()=>{!t||!C.current||requestAnimationFrame(()=>{const X=C.current,se=X==null?void 0:X.querySelector(`[data-chat-id="${t}"]`);if(!se||!X)return;const re=se.getBoundingClientRect(),me=X.getBoundingClientRect();if(re.top<me.top+38){const Ce=re.top-me.top+X.scrollTop;X.scrollTo({top:Ce-38,behavior:"smooth"})}else if(re.bottom>me.bottom){const Ce=re.top+re.height/2-me.top+X.scrollTop,pe=X.clientHeight/2;X.scrollTo({top:Ce-pe,behavior:"smooth"})}})},[t,F]);const K=F>0,$=S.pathname==="/",J=S.pathname==="/settings",A=$||J,B=n==="connecting"||!r,Y=B?"Connecting":n==="connected"?"Connected":"Disconnected",M=n==="connected"?"bg-emerald-500":"bg-amber-500";return v.jsxs(v.Fragment,{children:[!s&&l&&v.jsx(et,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:v.jsx(AE,{className:"h-5 w-5"})}),a&&A&&v.jsx("div",{className:"hidden md:flex fixed left-0 top-0 h-full z-40 items-start pt-4 pl-5 border-l border-border/0",children:v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(jc,{className:"size-6 text-logo"}),v.jsx(et,{variant:"ghost",size:"icon",onClick:p,title:"Expand sidebar",children:v.jsx(Cv,{className:"h-5 w-5"})})]})}),v.jsxs("div",{"data-sidebar":"open",className:ye("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",a&&"md:hidden"),children:[v.jsxs("div",{className:" pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("button",{type:"button",onClick:h,title:"Collapse sidebar",className:"hidden md:flex group/sidebar-collapse relative items-center justify-center h-5 w-5 sm:h-6 sm:w-6",children:[v.jsx(jc,{className:"absolute inset-0.5 h-4 w-4 sm:h-5 sm:w-5 text-logo transition-all duration-200 ease-out opacity-100 scale-100 group-hover/sidebar-collapse:opacity-0 group-hover/sidebar-collapse:scale-0"}),v.jsx(Cv,{className:"absolute inset-0 h-4 w-4 sm:h-6 sm:w-6 text-slate-500 dark:text-slate-400 transition-all duration-200 ease-out opacity-0 scale-0 group-hover/sidebar-collapse:opacity-100 group-hover/sidebar-collapse:scale-80 hover:opacity-50"})]}),v.jsx(jc,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),v.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:zn})]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(et,{variant:"ghost",size:"icon",onClick:()=>{w("/"),d()},title:"New project",children:v.jsx(cy,{className:"size-4"})}),v.jsx(et,{variant:"ghost",size:"icon",className:"md:hidden",onClick:d,children:v.jsx(fu,{className:"h-5 w-5"})})]})]}),v.jsx("div",{ref:C,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:v.jsxs("div",{className:"p-[7px]",children:[!K&&B?v.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(X=>v.jsxs("div",{className:"space-y-2 animate-pulse",children:[v.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),v.jsx("div",{className:"space-y-1",children:[0,1,2].map(se=>v.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[v.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),v.jsx("div",{className:ye("h-3.5 rounded bg-muted",se===0?"w-32":se===1?"w-40":"w-28")})]},se))})]},X))}):null,!K&&!B&&e.projectGroups.length===0?v.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,v.jsx(u9,{projectGroups:P,onReorderGroups:W,collapsedSections:k,expandedGroups:R,onToggleSection:V,onToggleExpandedGroup:U,renderChatRow:O,chatsPerProject:j,onNewLocalChat:X=>{const se=H.get(X);se&&m(se)},onRemoveProject:b,isConnected:n==="connected"})]})}),v.jsx("div",{className:"border-t border-border p-2",children:v.jsx("button",{type:"button",onClick:()=>{w("/settings"),d()},className:ye("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",J?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:v.jsxs("div",{className:"flex items- justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(x6,{className:"h-4 w-4 text-muted-foreground"}),v.jsx("span",{className:"text-sm",children:"Settings"})]}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx("span",{children:Y}),B?v.jsx(Js,{className:"h-2 w-2 animate-spin"}):v.jsx("span",{className:ye("h-2 w-2 rounded-full",M)})]})]})})})]}),s?v.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:d}):null]})}const Vy=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],TM=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],AM={reasoningEffort:"high"},Hv={reasoningEffort:"high",fastMode:!1};function Ww(e){return Vy.some(t=>t.id===e)}function qw(e){return TM.some(t=>t.id===e)}const _9=[{id:"claude",label:"Claude",defaultModel:"opus",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0},{id:"sonnet",label:"Sonnet",supportsEffort:!0},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Vy]},{id:"codex",label:"Codex",defaultModel:"gpt-5.4",supportsPlanMode:!0,models:[{id:"gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"gpt-5.3-codex",label:"GPT-5.3 Codex",supportsEffort:!1},{id:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark",supportsEffort:!1}],efforts:[]}];var Bf="Popover",[DM]=Qs(Bf,[pl]),Cu=pl(),[y9,eo]=DM(Bf),NM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=Cu(t),d=x.useRef(null),[h,p]=x.useState(!1),[m,_]=_f({prop:r,defaultProp:s??!1,onChange:a,caller:Bf});return v.jsx(wy,{...u,children:v.jsx(y9,{scope:t,contentId:Ka(),triggerRef:d,open:m,onOpenChange:_,onOpenToggle:x.useCallback(()=>_(b=>!b),[_]),hasCustomAnchor:h,onCustomAnchorAdd:x.useCallback(()=>p(!0),[]),onCustomAnchorRemove:x.useCallback(()=>p(!1),[]),modal:l,children:n})})};NM.displayName=Bf;var OM="PopoverAnchor",b9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(OM,n),a=Cu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return x.useEffect(()=>(l(),()=>u()),[l,u]),v.jsx(Mf,{...a,...r,ref:t})});b9.displayName=OM;var LM="PopoverTrigger",zM=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(LM,n),a=Cu(n),l=Pt(t,s.triggerRef),u=v.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":HM(s.open),...r,ref:l,onClick:Ne(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:v.jsx(Mf,{asChild:!0,...a,children:u})});zM.displayName=LM;var Ky="PopoverPortal",[x9,S9]=DM(Ky,{forceMount:void 0}),jM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=eo(Ky,t);return v.jsx(x9,{scope:t,forceMount:n,children:v.jsx(Ur,{present:n||a.open,children:v.jsx(du,{asChild:!0,container:s,children:r})})})};jM.displayName=Ky;var ol="PopoverContent",BM=x.forwardRef((e,t)=>{const n=S9(ol,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=eo(ol,e.__scopePopover);return v.jsx(Ur,{present:r||a.open,children:a.modal?v.jsx(C9,{...s,ref:t}):v.jsx(k9,{...s,ref:t})})});BM.displayName=ol;var w9=el("PopoverContent.RemoveScroll"),C9=x.forwardRef((e,t)=>{const n=eo(ol,e.__scopePopover),r=x.useRef(null),s=Pt(t,r),a=x.useRef(!1);return x.useEffect(()=>{const l=r.current;if(l)return iy(l)},[]),v.jsx(xf,{as:w9,allowPinchZoom:!0,children:v.jsx(PM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),a.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Ne(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),k9=x.forwardRef((e,t)=>{const n=eo(ol,e.__scopePopover),r=x.useRef(!1),s=x.useRef(!1);return v.jsx(PM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),PM=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,_=eo(ol,n),b=Cu(n);return ry(),v.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:v.jsx(hu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),children:v.jsx(Cy,{"data-state":HM(_.open),role:"dialog",id:_.contentId,...b,...m,ref:t,style:{...m.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)"}})})})}),IM="PopoverClose",E9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(IM,n);return v.jsx(wt.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});E9.displayName=IM;var R9="PopoverArrow",M9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Cu(n);return v.jsx(ky,{...s,...r,ref:t})});M9.displayName=R9;function HM(e){return e?"open":"closed"}var T9=NM,A9=zM,D9=jM,FM=BM;const N9=T9,O9=A9,UM=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>v.jsx(D9,{children:v.jsx(FM,{ref:s,align:t,sideOffset:n,[Vc]:"",onCloseAutoFocus:a=>{var l;a.preventDefault(),window.dispatchEvent(new Event($d)),(l=r.onCloseAutoFocus)==null||l.call(r,a)},className:ye("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...r})}));UM.displayName=FM.displayName;const $M=x.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ye("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));$M.displayName="Textarea";function L9(){const[e,t]=x.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return x.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=s=>{t(s.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const z9=Su()(wu((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:a,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...a}=r.drafts;return{drafts:a}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));function j9(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function B9(e){var n;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:(e==null?void 0:e.model)??"opus",modelOptions:{reasoningEffort:Ww(t)?t:Ww(e==null?void 0:e.effort)?e.effort:AM.reasoningEffort}}}function P9(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:j9(e==null?void 0:e.model),modelOptions:{reasoningEffort:qw(t)?t:qw(e==null?void 0:e.effort)?e.effort:Hv.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:Hv.fastMode}}}const WM=Su()(wu(e=>({provider:"claude",planMode:!1,preferences:{claude:{model:"opus",modelOptions:{...AM}},codex:{model:"gpt-5.4",modelOptions:{...Hv}}},setProvider:t=>e({provider:t}),setModel:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],model:n,modelOptions:t==="claude"&&n!=="opus"&&r.preferences.claude.modelOptions.reasoningEffort==="max"?{reasoningEffort:"high"}:r.preferences[t].modelOptions}}})),setModelOptions:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],modelOptions:{...r.preferences[t].modelOptions,...n}}}})),setPlanMode:t=>e({planMode:t})}),{name:"chat-preferences",version:2,migrate:e=>{var n,r;const t=e;return{provider:(t==null?void 0:t.provider)??"claude",planMode:(t==null?void 0:t.planMode)??!1,preferences:{claude:B9((n=t==null?void 0:t.preferences)==null?void 0:n.claude),codex:P9((r=t==null?void 0:t.preferences)==null?void 0:r.codex)}}}}));function Co({onClick:e,selected:t,icon:n,label:r,description:s,disabled:a}){return v.jsxs("button",{onClick:e,disabled:a,className:ye("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",a&&"opacity-40 cursor-not-allowed"),children:[n,v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:r}),s?v.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function gc({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,a]=x.useState(!1);return n?v.jsx("button",{disabled:!0,className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default",t),children:e}):v.jsxs(N9,{open:s,onOpenChange:a,children:[v.jsx(O9,{asChild:!0,children:v.jsx("button",{className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0","hover:bg-muted/50",t),children:e})}),v.jsx(UM,{align:"center",className:"w-64 p-1",children:v.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>a(!1)):r})})]})}function I9({className:e,...t}){return v.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:v.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function H9({className:e,...t}){return v.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:v.jsx("path",{d:"M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z"})})}const Vw={claude:I9,codex:H9},Kw={opus:uw,sonnet:tl,haiku:Ud,"gpt-5.4":uw,"gpt-5.3-codex":tl,"gpt-5.3-codex-spark":Ud},F9=x.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:a,activeProvider:l,availableProviders:u},d){var B,Y;const{getDraft:h,setDraft:p,clearDraft:m}=z9(),{provider:_,preferences:b,planMode:S,setProvider:w,setModel:C,setModelOptions:k,setPlanMode:T}=WM(),[R,D]=x.useState(()=>a?h(a):""),z=x.useRef(null),L=L9(),j=l??_,I=u.find(M=>M.id===j)??u[0],Z=b[j],P=l!==null,W=(I==null?void 0:I.supportsPlanMode)??!1,H=j==="claude"?b.claude.modelOptions.reasoningEffort:b.codex.modelOptions.reasoningEffort,F=b.codex.modelOptions.fastMode,V=j==="claude"?Vy:TM,U=x.useCallback(()=>{const M=z.current;M&&(M.style.height="auto",M.style.height=`${M.scrollHeight}px`)},[]);x.useEffect(()=>{U()},[R,U]),x.useEffect(()=>(window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)),[U]),x.useEffect(()=>{var M;(M=z.current)==null||M.focus()},[a]),x.useEffect(()=>{if(d){if(typeof d=="function"){d(z.current);return}d.current=z.current}},[d]);function O(M){if(j==="claude"){k("claude",{reasoningEffort:M});return}k("codex",{reasoningEffort:M})}async function K(){if(!R.trim())return;const M=R;D(""),a&&m(a),z.current&&(z.current.style.height="auto");try{await t(M,{provider:j,model:Z.model,modelOptions:j==="claude"?{claude:{...b.claude.modelOptions}}:{codex:{...b.codex.modelOptions}},planMode:W?S:!1})}catch(X){console.error("[ChatInput] Submit failed:",X),D(M),a&&p(a,M)}}function $(M){if(M.key==="Tab"&&!M.shiftKey){M.preventDefault(),q6(z.current,document);return}if(M.key==="Tab"&&M.shiftKey&&W){M.preventDefault(),T(!S);return}if(M.key==="Escape"&&s){M.preventDefault(),n==null||n();return}const X="ontouchstart"in window||navigator.maxTouchPoints>0;M.key==="Enter"&&!M.shiftKey&&!s&&!X&&(M.preventDefault(),K())}const J=Vw[j],A=Kw[Z.model]??tl;return v.jsxs("div",{className:ye("p-3 pt-0 md:pb-2",L&&"px-5 pb-5"),children:[v.jsxs("div",{className:"flex items-end gap-2 max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[v.jsx($M,{ref:z,placeholder:"Build something...",value:R,autoFocus:!0,[fy]:"",rows:1,onChange:M=>{D(M.target.value),a&&p(a,M.target.value),U()},onKeyDown:$,disabled:r,className:"flex-1 text-base p-3 md:p-4 pl-4.5 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),v.jsx(et,{type:"button",onPointerDown:M=>{M.preventDefault(),s?n==null||n():!r&&R.trim()&&K()},disabled:!s&&(r||!R.trim()),size:"icon",className:"flex-shrink-0 bg-slate-600 text-white dark:bg-white dark:text-slate-900 rounded-full cursor-pointer h-10 w-10 md:h-11 md:w-11 mb-1 -mr-0.5 md:mr-0 md:mb-1.5 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?v.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):v.jsx(mz,{className:"h-5 w-5 md:h-6 md:w-6"})})]}),v.jsxs("div",{className:"flex justify-center items-center gap-0.5 max-w-[840px] mx-auto mt-2 animate-fade-in",children:[v.jsx(gc,{disabled:P,trigger:v.jsxs(v.Fragment,{children:[v.jsx(J,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:(I==null?void 0:I.label)??j})]}),children:M=>u.map(X=>{const se=Vw[X.id];return v.jsx(Co,{onClick:()=>{w(X.id),M()},selected:j===X.id,icon:v.jsx(se,{className:"h-4 w-4 text-muted-foreground"}),label:X.label},X.id)})}),v.jsx(gc,{trigger:v.jsxs(v.Fragment,{children:[v.jsx(A,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:((B=I.models.find(M=>M.id===Z.model))==null?void 0:B.label)??Z.model})]}),children:M=>I.models.map(X=>{const se=Kw[X.id]??tl;return v.jsx(Co,{onClick:()=>{C(j,X.id),M()},selected:Z.model===X.id,icon:v.jsx(se,{className:"h-4 w-4 text-muted-foreground"}),label:X.label},X.id)})}),v.jsx(gc,{trigger:v.jsxs(v.Fragment,{children:[v.jsx(Qh,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:((Y=V.find(M=>M.id===H))==null?void 0:Y.label)??H})]}),children:M=>V.map(X=>v.jsx(Co,{onClick:()=>{O(X.id),M()},selected:H===X.id,icon:v.jsx(Qh,{className:"h-4 w-4 text-muted-foreground"}),label:X.label,disabled:j==="claude"&&X.id==="max"&&Z.model!=="opus"},X.id))}),j==="codex"?v.jsx(gc,{trigger:v.jsxs(v.Fragment,{children:[F?v.jsx(Ud,{className:"h-3.5 w-3.5"}):v.jsx(Qh,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:F?"Fast Mode":"Standard"})]}),triggerClassName:F?"text-emerald-500 dark:text-emerald-400":void 0,children:M=>v.jsxs(v.Fragment,{children:[v.jsx(Co,{onClick:()=>{k("codex",{fastMode:!1}),M()},selected:!F,icon:v.jsx(Qh,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),v.jsx(Co,{onClick:()=>{k("codex",{fastMode:!0}),M()},selected:F,icon:v.jsx(Ud,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,W?v.jsx(gc,{trigger:v.jsxs(v.Fragment,{children:[S?v.jsx(Fd,{className:"h-3.5 w-3.5"}):v.jsx(dw,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:S?"Plan Mode":"Full Access"})]}),triggerClassName:S?"text-blue-400 dark:text-blue-300":void 0,children:M=>v.jsxs(v.Fragment,{children:[v.jsx(Co,{onClick:()=>{T(!1),M()},selected:!S,icon:v.jsx(dw,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),v.jsx(Co,{onClick:()=>{T(!0),M()},selected:S,icon:v.jsx(Fd,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})]})}),U9=x.memo(F9),qM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("bg-card text-card-foreground",e),...t}));qM.displayName="Card";const VM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-2",e),...t}));VM.displayName="CardHeader";const $9=x.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));$9.displayName="CardTitle";const W9=x.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));W9.displayName="CardDescription";const KM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));KM.displayName="CardContent";const q9=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));q9.displayName="CardFooter";function V9({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:a=!1,onToggleEmbeddedTerminal:l,onOpenExternal:u,editorLabel:d="Editor"}){return v.jsx(VM,{className:ye("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 pr-4 border-border/0 md:pb-0 flex items-center justify-center",e?"md:px-2.5 md:pr-4":"md:px-4 md:pr-4","backdrop-blur-lg md:backdrop-blur-none bg-gradient-to-b from-background md:from-transparent border-b border-x-0 md:border-x border-border md:border-none"),children:v.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border-l border-border/0",children:[v.jsx(et,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:v.jsx(AE,{className:"h-5 w-5"})}),e&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex items-center justify-center w-[40px] h-[40px]",children:v.jsx(jc,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),v.jsx(et,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:v.jsx(Cv,{className:"h-5 w-5"})})]}),v.jsx(et,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:v.jsx(uy,{className:"h-5 w-5"})})]}),v.jsx("div",{className:"flex-1 min-w-0"}),v.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:s&&(u||l)&&v.jsxs(v.Fragment,{children:[u?v.jsx(et,{variant:"ghost",size:"icon",onClick:()=>u("open_finder"),title:"Open in Finder",className:"border border-border/0",children:v.jsx(TE,{className:"h-4.5 w-4.5"})}):null,l?v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx(et,{variant:"ghost",size:"icon",onClick:l,className:ye("border border-border/0",a&&"text-white"),children:v.jsx(hy,{className:"h-4.5 w-4.5"})})}),v.jsx(sl,{side:"bottom",children:"Cmd+J"})]}):null,u?v.jsx(et,{variant:"ghost",size:"icon",onClick:()=>u("open_editor"),title:`Open in ${d}`,className:"border border-border/0",children:v.jsx(zz,{className:"h-4.5 w-4.5"})}):null]})})]})})}function K9(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function G9(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function Y9(e){return e/100*window.innerHeight}function X9(e){return e/100*window.innerWidth}function Z9(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Ac({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=Z9(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=G9(t,s);break}case"em":{r=K9(t,s);break}case"vh":{r=Y9(s);break}case"vw":{r=X9(s);break}}return r}function tr(e){return parseFloat(e.toFixed(3))}function al({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function Fv(e){const{panels:t}=e,n=al({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let l=0;if(a.collapsedSize!==void 0){const p=Ac({groupSize:n,panelElement:s,styleProp:a.collapsedSize});l=tr(p/n*100)}let u;if(a.defaultSize!==void 0){const p=Ac({groupSize:n,panelElement:s,styleProp:a.defaultSize});u=tr(p/n*100)}let d=0;if(a.minSize!==void 0){const p=Ac({groupSize:n,panelElement:s,styleProp:a.minSize});d=tr(p/n*100)}let h=100;if(a.maxSize!==void 0){const p=Ac({groupSize:n,panelElement:s,styleProp:a.maxSize});h=tr(p/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:u,disabled:a.disabled,minSize:d,maxSize:h,panelId:r.id}})}function ft(e,t="Assertion error"){if(!e)throw Error(t)}function Uv(e,t){return Array.from(t).sort(e==="horizontal"?Q9:J9)}function Q9(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function J9(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function GM(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function YM(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function e7({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const l of t){const{x:u,y:d}=YM(r,l),h=e==="horizontal"?u:d;h<a&&(a=h,s=l)}return ft(s,"No rect found"),s}let id;function t7(){return id===void 0&&(typeof matchMedia=="function"?id=!!matchMedia("(pointer:coarse)").matches:id=!1),id}function XM(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=Uv(n,Array.from(t.children).filter(GM).map(S=>({element:S}))).map(({element:S})=>S),l=[];let u=!1,d=!1,h=-1,p=-1,m=0,_,b=[];{let S=-1;for(const w of a)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(m++,h===-1&&(h=S),p=S))}if(m>1){let S=-1;for(const w of a)if(w.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===w);if(C){if(_){const k=_.element.getBoundingClientRect(),T=w.getBoundingClientRect();let R;if(d){const D=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),z=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(b.length){case 0:{R=[D,z];break}case 1:{const L=b[0],j=e7({orientation:n,rects:[k,T],targetRect:L.element.getBoundingClientRect()});R=[L,j===k?z:D];break}default:{R=b;break}}}else b.length?R=b:R=[n==="horizontal"?new DOMRect(k.right,T.top,T.left-k.right,T.height):new DOMRect(T.left,k.bottom,T.width,T.top-k.bottom)];for(const D of R){let z="width"in D?D:D.element.getBoundingClientRect();const L=t7()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(z.width<L){const I=L-z.width;z=new DOMRect(z.x-I/2,z.y,z.width+I,z.height)}if(z.height<L){const I=L-z.height;z=new DOMRect(z.x,z.y-I/2,z.width,z.height+I)}const j=S<=h||S>p;!u&&!j&&l.push({group:e,groupSize:al({group:e}),panels:[_,C],separator:"width"in D?void 0:D,rect:z}),u=!1}}d=!1,_=C,b=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?b.push(C):(_=void 0,b=[])}else d=!0}return l}var Us,uk;let ZM=(uk=class{constructor(){SS(this,Us,{})}addListener(t,n){const r=hc(this,Us)[t];return r===void 0?hc(this,Us)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=hc(this,Us)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const d=l[u];try{d.call(null,n)}catch(h){a===null&&(s=!0,a=h)}}if(s)throw a}}removeAllListeners(){wS(this,Us,{})}removeListener(t,n){const r=hc(this,Us)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Us=new WeakMap,uk),gi=new Map;const QM=new ZM;function n7(e){gi=new Map(gi),gi.delete(e)}function Gw(e,t){for(const[n]of gi)if(n.id===e)return n}function qs(e,t){for(const[n,r]of gi)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Vo(){return gi}function Gy(e,t){return QM.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function is(e,t){const n=gi.get(e);gi=new Map(gi),gi.set(e,t),QM.emit("groupChange",{group:e,prev:n,next:t})}function r7(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const l=YM(n,a.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=a,s=l);break}case"vertical":{l.y<=s.y&&(r=a,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function i7(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function s7(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Zw(e),b:Zw(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();ft(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:Xw(Yw(n.a)),b:Xw(Yw(n.b))};if(s.a===s.b){const a=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=a.length;for(;u--;){const d=a[u];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(s.a-s.b)}const o7=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function a7(e){const t=getComputedStyle(JM(e)??e).display;return t==="flex"||t==="inline-flex"}function l7(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||a7(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||o7.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Yw(e){let t=e.length;for(;t--;){const n=e[t];if(ft(n,"Missing node"),l7(n))return n}return null}function Xw(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Zw(e){const t=[];for(;e;)t.push(e),e=JM(e);return t}function JM(e){const{parentNode:t}=e;return i7(t)?t.host:t}function c7(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function u7({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!GM(n)||n.contains(e)||e.contains(n))return!0;if(s7(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(c7(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Yy(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=XM(s),l=r7(s.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&u7({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function h7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function jn(e,t,n=0){return Math.abs(tr(e)-tr(t))<=n}function fi(e,t){return jn(e,t)?0:e>t?1:-1}function qa({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:l,maxSize:u=100,minSize:d=0}=t;if(l&&!e)return n;if(fi(r,d)<0)if(a){const h=(s+d)/2;fi(r,h)<0?r=s:r=d}else r=d;return r=Math.min(u,r),r=tr(r),r}function nu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(jn(e,0))return t;const l=a==="imperative-api",u=Object.values(t),d=Object.values(s),h=[...u],[p,m]=r;ft(p!=null,"Invalid first pivot index"),ft(m!=null,"Invalid second pivot index");let _=0;switch(a){case"keyboard":{{const w=e<0?m:p,C=n[w];ft(C,`Panel constraints not found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const D=u[w];if(ft(D!=null,`Previous layout not found for panel index ${w}`),jn(D,k)){const z=R-D;fi(z,Math.abs(e))>0&&(e=e<0?0-z:z)}}}{const w=e<0?p:m,C=n[w];ft(C,`No panel constraints found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const D=u[w];if(ft(D!=null,`Previous layout not found for panel index ${w}`),jn(D,R)){const z=D-k;fi(z,Math.abs(e))>0&&(e=e<0?0-z:z)}}}break}default:{const w=e<0?m:p,C=n[w];ft(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:D}=C;if(T&&fi(k,D)<0)if(e>0){const z=D-R,L=z/2,j=k+e;fi(j,D)<0&&(e=fi(e,L)<=0?0:z)}else{const z=D-R,L=100-z/2,j=k-e;fi(j,D)<0&&(e=fi(100+e,L)>0?0:-z)}break}}{const w=e<0?1:-1;let C=e<0?m:p,k=0;for(;;){const R=u[C];ft(R!=null,`Previous layout not found for panel index ${C}`);const D=qa({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=D,C+=w,C<0||C>=n.length)break}const T=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-T:T}{let w=e<0?p:m;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[w];ft(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=qa({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:k,size:T});if(!jn(k,R)&&(_+=k-R,h[w]=R,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(h7(d,h))return s;{const w=e<0?m:p,C=u[w];ft(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=qa({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:C,size:k});if(h[w]=T,!jn(T,k)){let R=k-T,D=e<0?m:p;for(;D>=0&&D<n.length;){const z=h[D];ft(z!=null,`Previous layout not found for panel index ${D}`);const L=z+R,j=qa({overrideDisabledPanels:l,panelConstraints:n[D],prevSize:z,size:L});if(jn(z,j)||(R-=j-z,h[D]=j),jn(R,0))break;e>0?D--:D++}}}const b=Object.values(h).reduce((w,C)=>C+w,0);if(!jn(b,100,.1))return s;const S=Object.keys(s);return h.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function Bo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||fi(e[n],t[n])!==0)return!1;return!0}function Po({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,d)=>u+d,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!jn(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const d=r[u];ft(d!=null,`No layout data found for index ${u}`);const h=100/s*d;r[u]=h}let a=0;for(let u=0;u<t.length;u++){const d=n[u];ft(d!=null,`No layout data found for index ${u}`);const h=r[u];ft(h!=null,`No layout data found for index ${u}`);const p=qa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:d,size:h});h!=p&&(a+=h-p,r[u]=p)}if(!jn(a,0))for(let u=0;u<t.length;u++){const d=r[u];ft(d!=null,`No layout data found for index ${u}`);const h=d+a,p=qa({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:d,size:h});if(d!==p&&(a-=p-d,r[u]=p,jn(a,0)))break}const l=Object.keys(e);return r.reduce((u,d,h)=>(u[l[h]]=d,u),{})}function eT({groupId:e,panelId:t}){const n=()=>{const u=Vo();for(const[d,{defaultLayoutDeferred:h,derivedPanelConstraints:p,layout:m,groupSize:_,separatorToPanels:b}]of u)if(d.id===e)return{defaultLayoutDeferred:h,derivedPanelConstraints:p,group:d,groupSize:_,layout:m,separatorToPanels:b};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(d=>d.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(d=>d.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const d=a();if(u===d)return;const{defaultLayoutDeferred:h,derivedPanelConstraints:p,group:m,groupSize:_,layout:b,separatorToPanels:S}=n(),w=m.panels.findIndex(R=>R.id===t),C=w===m.panels.length-1,k=nu({delta:C?d-u:u-d,initialLayout:b,panelConstraints:p,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:b,trigger:"imperative-api"}),T=Po({layout:k,panelConstraints:p});Bo(b,T)||is(m,{defaultLayoutDeferred:h,derivedPanelConstraints:p,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:d}=r(),{mutableValues:h}=s(),p=a();u&&p!==d&&(h.expandToSize=p,l(d))},expand:()=>{const{collapsible:u,collapsedSize:d,minSize:h}=r(),{mutableValues:p}=s(),m=a();if(u&&m===d){let _=p.expandToSize??h;_===0&&(_=1),l(_)}},getSize:()=>{const{group:u}=n(),d=a(),{element:h}=s(),p=u.orientation==="horizontal"?h.offsetWidth:h.offsetHeight;return{asPercentage:d,inPixels:p}},isCollapsed:()=>{const{collapsible:u,collapsedSize:d}=r(),h=a();return u&&jn(d,h)},resize:u=>{const{group:d}=n(),{element:h}=s(),p=al({group:d}),m=Ac({groupSize:p,panelElement:h,styleProp:u}),_=tr(m/p*100);l(_)}}}function Qw(e){if(e.defaultPrevented)return;const t=Vo();Yy(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=eT({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function Md(e){const t=Vo();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function tT({groupId:e}){const t=()=>{const n=Vo();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:l,layout:u,separatorToPanels:d}=t(),h=Po({layout:n,panelConstraints:s});return r?u:(Bo(u,h)||is(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:d}),h)}}}function ko(e,t){const n=Md(e),r=qs(n.id,!0),s=n.separators.find(p=>p.element===e);ft(s,"Matching separator not found");const a=r.separatorToPanels.get(s);ft(a,"Matching panels not found");const l=a.map(p=>n.panels.indexOf(p)),u=tT({groupId:n.id}).getLayout(),d=nu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),h=Po({layout:d,panelConstraints:r.derivedPanelConstraints});Bo(u,h)||is(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:h,separatorToPanels:r.separatorToPanels})}function Jw(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Md(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&ko(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&ko(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&ko(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&ko(t,-5);break}case"End":{e.preventDefault(),ko(t,100);break}case"Enter":{e.preventDefault();const r=Md(t),s=qs(r.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:u}=s,d=r.separators.find(_=>_.element===t);ft(d,"Matching separator not found");const h=u.get(d);ft(h,"Matching panels not found");const p=h[0],m=a.find(_=>_.panelId===p.id);if(ft(m,"Panel metadata not found"),m.collapsible){const _=l[p.id],b=m.collapsedSize===_?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;ko(t,b-_)}break}case"F6":{e.preventDefault();const r=Md(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);ft(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),ko(t,-100);break}}}let Za={cursorFlags:0,state:"inactive"};const Xy=new ZM;function Io(){return Za}function d7(e){return Xy.addListener("change",e)}function f7(e){const t=Za,n={...Za};n.cursorFlags=e,Za=n,Xy.emit("change",{prev:t,next:n})}function Qa(e){const t=Za;Za=e,Xy.emit("change",{prev:t,next:e})}function eC(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Vo(),n=Yy(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const l=t.get(a.group);l&&r.set(a.group,l.layout)}),Qa({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const p7=e=>e,Lg=()=>{},nT=1,rT=2,iT=4,sT=8,tC=3,nC=12;let sd;function rC(){return sd===void 0&&(sd=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(sd=!0)),sd}function m7({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&rC()){const a=(e&nT)!==0,l=(e&rT)!==0,u=(e&iT)!==0,d=(e&sT)!==0;if(a)return u?"se-resize":d?"ne-resize":"e-resize";if(l)return u?"sw-resize":d?"nw-resize":"w-resize";if(u)return"s-resize";if(d)return"n-resize"}break}}return rC()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const iC=new WeakMap;function Zy(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=iC.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Io();switch(r.state){case"active":case"hover":{const s=m7({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}iC.set(e,{prevStyle:t,styleSheet:n})}function oT({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:l}){let u=0;n.forEach(h=>{const{group:p,groupSize:m}=h,{orientation:_,panels:b}=p,{disableCursor:S}=p.mutableState;let w=0;a?_==="horizontal"?w=(t.clientX-a.x)/m*100:w=(t.clientY-a.y)/m*100:_==="horizontal"?w=t.clientX<0?-100:100:w=t.clientY<0?-100:100;const C=r.get(p),k=s.get(p);if(!C||!k)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:D,layout:z,separatorToPanels:L}=k;if(R&&z&&L){const j=nu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:h.panels.map(I=>b.indexOf(I)),prevLayout:z,trigger:"mouse-or-touch"});if(Bo(j,z)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?nT:rT;break}case"vertical":{u|=w<0?iT:sT;break}}}else is(h.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:D,layout:j,separatorToPanels:L})}});let d=0;t.movementX===0?d|=l&tC:d|=u&tC,t.movementY===0?d|=l&nC:d|=u&nC,f7(d),Zy(e)}function sC(e){const t=Vo(),n=Io();switch(n.state){case"active":oT({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function oC(e){if(e.defaultPrevented)return;const t=Io(),n=Vo();switch(t.state){case"active":{if(e.buttons===0){Qa({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=qs(r.group.id,!0);is(r.group,s)});return}oT({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Yy(e,n);r.length===0?t.state!=="inactive"&&Qa({cursorFlags:0,state:"inactive"}):Qa({cursorFlags:0,hitRegions:r,state:"hover"}),Zy(e.currentTarget);break}}}function aC(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Io().state){case"hover":Qa({cursorFlags:0,state:"inactive"})}}function lC(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Io();switch(t.state){case"active":Qa({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Zy(e.currentTarget),t.hitRegions.forEach(n=>{const r=qs(n.group.id,!0);is(n.group,r)}),e.preventDefault())}}function cC(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=tr(a.defaultSize);n+=l,r[a.panelId]=l}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=tr((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=a)}return r}function g7(e,t,n){if(!n[0])return;const r=e.panels.find(d=>d.element===t);if(!r||!r.onResize)return;const s=al({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:tr(a/s*100),inPixels:a};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function v7(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _7({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,l=!1;const u=new Map,d=[];for(const m of e.panels){const _=r[m.id]??0;switch(m.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const b=_/100*n,S=tr(b/t*100);u.set(m.id,S),s+=S;break}case"preserve-relative-size":default:{d.push(m.id),a+=_;break}}}if(!l||d.length===0)return r;const h=100-s,p={...r};if(u.forEach((m,_)=>{p[_]=m}),a>0)for(const m of d){const _=r[m]??0;p[m]=tr(_/a*h)}else{const m=tr(h/d.length);for(const _ of d)p[_]=m}return p}function y7(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Ia=new Map;function b7(e){let t=!0;ft(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=al({group:e});if(T===0)return;const R=qs(e.id);if(!R)return;const D=Fv(e),z=R.defaultLayoutDeferred?cC(D):R.layout,L=_7({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:z}),j=Po({layout:L,panelConstraints:D});if(!R.defaultLayoutDeferred&&Bo(R.layout,j)&&v7(R.derivedPanelConstraints,D)&&R.groupSize===T)return;is(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:D,groupSize:T,layout:j,separatorToPanels:R.separatorToPanels})}}else g7(e,k,C)}});a.observe(e.element),e.panels.forEach(S=>{ft(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&a.observe(S.element)});const l=al({group:e}),u=Fv(e),d=e.panels.map(({id:S})=>S).join(",");let h=e.mutableState.defaultLayout;h&&(y7(e.panels,h)||(h=void 0));const p=e.mutableState.layouts[d]??h??cC(u),m=Po({layout:p,panelConstraints:u}),_=e.element.ownerDocument;Ia.set(_,(Ia.get(_)??0)+1);const b=new Map;return XM(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),is(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:m,separatorToPanels:b}),e.separators.forEach(S=>{ft(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",Jw)}),Ia.get(_)===1&&(_.addEventListener("dblclick",Qw,!0),_.addEventListener("pointerdown",eC,!0),_.addEventListener("pointerleave",sC),_.addEventListener("pointermove",oC),_.addEventListener("pointerout",aC),_.addEventListener("pointerup",lC,!0)),function(){t=!1,Ia.set(_,Math.max(0,(Ia.get(_)??0)-1)),n7(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",Jw)}),Ia.get(_)||(_.removeEventListener("dblclick",Qw,!0),_.removeEventListener("pointerdown",eC,!0),_.removeEventListener("pointerleave",sC),_.removeEventListener("pointermove",oC),_.removeEventListener("pointerout",aC),_.removeEventListener("pointerup",lC,!0)),a.disconnect()}}function x7(){const[e,t]=x.useState({}),n=x.useCallback(()=>t({}),[]);return[e,n]}function Qy(e){const t=x.useId();return`${e??t}`}const Ko=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Hc(e){const t=x.useRef(e);return Ko(()=>{t.current=e},[e]),x.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function Jy(...e){return Hc(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function eb(e){const t=x.useRef({...e});return Ko(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const aT=x.createContext(null);function S7(e,t){const n=x.useRef({getLayout:()=>({}),setLayout:p7});x.useImperativeHandle(t,()=>n.current,[]),Ko(()=>{Object.assign(n.current,tT({groupId:e}))})}function lT({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:l,id:u,onLayoutChange:d,onLayoutChanged:h,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:_,...b}){const S=x.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=Hc(W=>{Bo(S.current.onLayoutChange,W)||(S.current.onLayoutChange=W,d==null||d(W))}),C=Hc(W=>{Bo(S.current.onLayoutChanged,W)||(S.current.onLayoutChanged=W,h==null||h(W))}),k=Qy(u),T=x.useRef(null),[R,D]=x7(),z=x.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),L=Jy(T,a);S7(k,l);const j=Hc((W,H)=>{const F=Io(),V=Gw(W),U=qs(W);if(U){let O=!1;switch(F.state){case"active":{O=F.hitRegions.some(K=>K.group===V);break}}return{flexGrow:U.layout[H]??1,pointerEvents:O?"none":void 0}}return{flexGrow:(n==null?void 0:n[H])??1}}),I=eb({defaultLayout:n,disableCursor:r}),Z=x.useMemo(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:j,id:k,orientation:p,registerPanel:W=>{const H=z.current;return H.panels=Uv(p,[...H.panels,W]),D(),()=>{H.panels=H.panels.filter(F=>F!==W),D()}},registerSeparator:W=>{const H=z.current;return H.separators=Uv(p,[...H.separators,W]),D(),()=>{H.separators=H.separators.filter(F=>F!==W),D()}},togglePanelDisabled:(W,H)=>{const F=z.current.panels.find(O=>O.id===W);F&&(F.panelConstraints.disabled=H);const V=Gw(k),U=qs(k);V&&U&&is(V,{...U,derivedPanelConstraints:Fv(V)})},toggleSeparatorDisabled:(W,H)=>{const F=z.current.separators.find(V=>V.id===W);F&&(F.disabled=H)}}),[j,k,D,p,I]),P=x.useRef(null);return Ko(()=>{const W=T.current;if(W===null)return;const H=z.current;let F;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===H.panels.length){F={};for(const A of H.panels){const B=I.defaultLayout[A.id];B!==void 0&&(F[A.id]=B)}}const V={disabled:!!s,element:W,id:k,mutableState:{defaultLayout:F,disableCursor:!!I.disableCursor,expandedPanelSizes:z.current.lastExpandedPanelSizes,layouts:z.current.layouts},orientation:p,panels:H.panels,resizeTargetMinimumSize:H.resizeTargetMinimumSize,separators:H.separators};P.current=V;const U=b7(V),{defaultLayoutDeferred:O,derivedPanelConstraints:K,layout:$}=qs(V.id,!0);!O&&K.length>0&&(w($),C($));const J=Gy(k,A=>{const{defaultLayoutDeferred:B,derivedPanelConstraints:Y,layout:M}=A.next;if(B||Y.length===0)return;const X=V.panels.map(({id:re})=>re).join(",");V.mutableState.layouts[X]=M,Y.forEach(re=>{if(re.collapsible){const{layout:me}=A.prev??{};if(me){const Ce=jn(re.collapsedSize,M[re.panelId]),pe=jn(re.collapsedSize,me[re.panelId]);Ce&&!pe&&(V.mutableState.expandedPanelSizes[re.panelId]=me[re.panelId])}}});const se=Io().state!=="active";w(M),se&&C(M)});return()=>{P.current=null,U(),J()}},[s,k,C,w,p,R,I]),x.useEffect(()=>{const W=P.current;W&&(W.mutableState.defaultLayout=n,W.mutableState.disableCursor=!!r)}),v.jsx(aT.Provider,{value:Z,children:v.jsx("div",{...b,className:t,"data-group":!0,"data-testid":k,id:k,ref:L,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}lT.displayName="Group";function tb(){const e=x.useContext(aT);return ft(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function w7(e,t){const{id:n}=tb(),r=x.useRef({collapse:Lg,expand:Lg,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Lg});x.useImperativeHandle(t,()=>r.current,[]),Ko(()=>{Object.assign(r.current,eT({groupId:n,panelId:e}))})}function cT({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:d,maxSize:h="100%",minSize:p="0%",onResize:m,panelRef:_,style:b,...S}){const w=!!d,C=Qy(d),k=eb({disabled:a}),T=x.useRef(null),R=Jy(T,l),{getPanelStyles:D,id:z,orientation:L,registerPanel:j,togglePanelDisabled:I}=tb(),Z=m!==null,P=Hc((H,F,V)=>{m==null||m(H,d,V)});Ko(()=>{const H=T.current;if(H!==null){const F={element:H,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Z?P:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:h,minSize:p}};return j(F)}},[u,n,r,s,Z,C,w,h,p,P,j,k]),x.useEffect(()=>{I(C,!!a)},[a,C,I]),w7(C,_);const W=x.useSyncExternalStore(H=>Gy(z,H),()=>JSON.stringify(D(z,C)),()=>JSON.stringify(D(z,C)));return v.jsx("div",{...S,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...C7,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(W)},children:v.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:L==="horizontal"?"pan-y":"pan-x"},children:e})})}cT.displayName="Panel";const C7={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function k7({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const l=e[n],u=t.find(d=>d.panelId===n);if(u){const d=u.maxSize,h=u.collapsible?u.collapsedSize:u.minSize,p=[r,r+1];a=Po({layout:nu({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],s=Po({layout:nu({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:l}}function uT({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...l}){const u=Qy(s),d=eb({disabled:n}),[h,p]=x.useState({}),[m,_]=x.useState("inactive"),b=x.useRef(null),S=Jy(b,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=tb(),D=k==="horizontal"?"vertical":"horizontal";Ko(()=>{const L=b.current;if(L!==null){const j={disabled:d.disabled,element:L,id:u},I=T(j),Z=d7(W=>{_(W.next.state!=="inactive"&&W.next.hitRegions.some(H=>H.separator===j)?W.next.state:"inactive")}),P=Gy(C,W=>{const{derivedPanelConstraints:H,layout:F,separatorToPanels:V}=W.next,U=V.get(j);if(U){const O=U[0],K=U.indexOf(O);p(k7({layout:F,panelConstraints:H,panelId:O.id,panelIndex:K}))}});return()=>{Z(),P(),I()}}},[C,u,T,d]),x.useEffect(()=>{R(u,!!n)},[n,u,R]);let z;return n&&!w&&(z="not-allowed"),v.jsx("div",{...l,"aria-controls":h.valueControls,"aria-disabled":n||void 0,"aria-orientation":D,"aria-valuemax":h.valueMax,"aria-valuemin":h.valueMin,"aria-valuenow":h.valueNow,children:e,className:t,"data-separator":n?"disabled":m,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:z,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}uT.displayName="Separator";const hT=({className:e,...t})=>v.jsx(lT,{className:ye("flex h-full w-full",e),...t}),$v=e=>v.jsx(cT,{...e}),dT=({withHandle:e,orientation:t,className:n,...r})=>v.jsx(uT,{className:ye("relative flex items-center justify-center bg-transparent focus-visible:outline-none",t==="vertical"?"h-2 w-full -my-1 cursor-row-resize before:absolute before:inset-x-0 before:top-1/2 before:h-0.5 before:-translate-y-1/2 before:bg-border":"h-full w-2 -mx-1 cursor-col-resize before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border",n),...r,children:v.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
419
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
420
+ * @license MIT
421
+ *
422
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
423
+ * @license MIT
424
+ *
425
+ * Originally forked from (with the author's permission):
426
+ * Fabrice Bellard's javascript vt100 for jslinux:
427
+ * http://bellard.org/jslinux/
428
+ * Copyright (c) 2011 Fabrice Bellard
429
+ */var un=0,hn=0,dn=0,Tt=0,Tn;(e=>{function t(s,a,l,u){return u!==void 0?`#${Eo(s)}${Eo(a)}${Eo(l)}${Eo(u)}`:`#${Eo(s)}${Eo(a)}${Eo(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(Tn||(Tn={}));var E7;(e=>{function t(d,h){if(Tt=(h.rgba&255)/255,Tt===1)return{css:h.css,rgba:h.rgba};let p=h.rgba>>24&255,m=h.rgba>>16&255,_=h.rgba>>8&255,b=d.rgba>>24&255,S=d.rgba>>16&255,w=d.rgba>>8&255;un=b+Math.round((p-b)*Tt),hn=S+Math.round((m-S)*Tt),dn=w+Math.round((_-w)*Tt);let C=Tn.toCss(un,hn,dn),k=Tn.toRgba(un,hn,dn);return{css:C,rgba:k}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function r(d,h,p){let m=Td.ensureContrastRatio(d.rgba,h.rgba,p);if(m)return Tn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(d){let h=(d.rgba|255)>>>0;return[un,hn,dn]=Td.toChannels(h),{css:Tn.toCss(un,hn,dn),rgba:h}}e.opaque=s;function a(d,h){return Tt=Math.round(h*255),[un,hn,dn]=Td.toChannels(d.rgba),{css:Tn.toCss(un,hn,dn,Tt),rgba:Tn.toRgba(un,hn,dn,Tt)}}e.opacity=a;function l(d,h){return Tt=d.rgba&255,a(d,Tt*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(E7||(E7={}));var wn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return un=parseInt(s.slice(1,2).repeat(2),16),hn=parseInt(s.slice(2,3).repeat(2),16),dn=parseInt(s.slice(3,4).repeat(2),16),Tn.toColor(un,hn,dn);case 5:return un=parseInt(s.slice(1,2).repeat(2),16),hn=parseInt(s.slice(2,3).repeat(2),16),dn=parseInt(s.slice(3,4).repeat(2),16),Tt=parseInt(s.slice(4,5).repeat(2),16),Tn.toColor(un,hn,dn,Tt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return un=parseInt(a[1]),hn=parseInt(a[2]),dn=parseInt(a[3]),Tt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Tn.toColor(un,hn,dn,Tt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[un,hn,dn,Tt]=t.getImageData(0,0,1,1).data,Tt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Tn.toRgba(un,hn,dn,Tt),css:s}}e.toColor=r})(wn||(wn={}));var On;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,d=a/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return h*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(On||(On={}));var Td;(e=>{function t(l,u){if(Tt=(u&255)/255,Tt===1)return u;let d=u>>24&255,h=u>>16&255,p=u>>8&255,m=l>>24&255,_=l>>16&255,b=l>>8&255;return un=m+Math.round((d-m)*Tt),hn=_+Math.round((h-_)*Tt),dn=b+Math.round((p-b)*Tt),Tn.toRgba(un,hn,dn)}e.blend=t;function n(l,u,d){let h=On.relativeLuminance(l>>8),p=On.relativeLuminance(u>>8);if(Xi(h,p)<d){if(p<h){let b=r(l,u,d),S=Xi(h,On.relativeLuminance(b>>8));if(S<d){let w=s(l,u,d),C=Xi(h,On.relativeLuminance(w>>8));return S>C?b:w}return b}let m=s(l,u,d),_=Xi(h,On.relativeLuminance(m>>8));if(_<d){let b=r(l,u,d),S=Xi(h,On.relativeLuminance(b>>8));return _>S?m:b}return m}}e.ensureContrastRatio=n;function r(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Xi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(h,p,m));for(;w<d&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Xi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(h,p,m));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Xi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(h,p,m));for(;w<d&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Xi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(h,p,m));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Td||(Td={}));function Eo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Xi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var R7=Object.freeze((()=>{let e=[wn.toColor("#2e3436"),wn.toColor("#cc0000"),wn.toColor("#4e9a06"),wn.toColor("#c4a000"),wn.toColor("#3465a4"),wn.toColor("#75507b"),wn.toColor("#06989a"),wn.toColor("#d3d7cf"),wn.toColor("#555753"),wn.toColor("#ef2929"),wn.toColor("#8ae234"),wn.toColor("#fce94f"),wn.toColor("#729fcf"),wn.toColor("#ad7fa8"),wn.toColor("#34e2e2"),wn.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Tn.toCss(r,s,a),rgba:Tn.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Tn.toCss(r,r,r),rgba:Tn.toRgba(r,r,r)})}return e})());function uC(e,t,n){return Math.max(t,Math.min(e,n))}function M7(e){switch(e){case"&":return"&amp;";case"<":return"&lt;"}return e}var fT=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),a=r,l=t.start.y,u=t.end.y,d=t.start.x,h=t.end.x;this._beforeSerialize(u-l,l,u);for(let p=l;p<=u;p++){let m=this._buffer.getLine(p);if(m){let _=p===t.start.y?d:0,b=p===t.end.y?h:m.length;for(let S=_;S<b;S++){let w=m.getCell(S,a===r?s:r);if(!w){console.warn(`Can't get cell at row=${p}, col=${S}`);continue}this._nextCell(w,a,p,S),a=w}}this._rowEnd(p,p===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function pT(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Qi(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function mT(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var T7=class extends fT{constructor(t,n){super(t),this._terminal=n,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,n,r){this._allRows=new Array(t),this._lastContentCursorRow=n,this._lastCursorRow=n,this._firstRow=n}_rowEnd(t,n){var s;this._nullCellCount>0&&!Qi(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let a=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
430
+ `,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=a.getCell(a.length-1,this._thisRowLastChar),d=a.getCell(a.length-2,this._thisRowLastSecondChar),h=l.getCell(0,this._nextRowFirstChar),p=h.getWidth()>1,m=!1;(h.getChars()&&p?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&Qi(u,h)&&(m=!0),p&&(d.getChars()||d.getWidth()===0)&&Qi(u,h)&&Qi(d,h)&&(m=!0)),m||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${a.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${a.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(t,n){let r=[],s=!pT(t,n),a=!Qi(t,n),l=!mT(t,n);if(s||a||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(s){let u=t.getFgColor();t.isFgRGB()?r.push(38,2,u>>>16&255,u>>>8&255,u&255):t.isFgPalette()?u>=16?r.push(38,5,u):r.push(u&8?90+(u&7):30+(u&7)):r.push(39)}if(a){let u=t.getBgColor();t.isBgRGB()?r.push(48,2,u>>>16&255,u>>>8&255,u&255):t.isBgPalette()?u>=16?r.push(48,5,u):r.push(u&8?100+(u&7):40+(u&7)):r.push(49)}l&&(t.isInverse()!==n.isInverse()&&r.push(t.isInverse()?7:27),t.isBold()!==n.isBold()&&r.push(t.isBold()?1:22),t.isUnderline()!==n.isUnderline()&&r.push(t.isUnderline()?4:24),t.isOverline()!==n.isOverline()&&r.push(t.isOverline()?53:55),t.isBlink()!==n.isBlink()&&r.push(t.isBlink()?5:25),t.isInvisible()!==n.isInvisible()&&r.push(t.isInvisible()?8:28),t.isItalic()!==n.isItalic()&&r.push(t.isItalic()?3:23),t.isDim()!==n.isDim()&&r.push(t.isDim()?2:22),t.isStrikethrough()!==n.isStrikethrough()&&r.push(t.isStrikethrough()?9:29))}return r}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(a?!Qi(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(Qi(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${l.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}a?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Qi(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+t.getWidth())}_serializeString(t){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let l=0;l<n;l++)r+=this._allRows[l],l+1<n&&(r+=this._allRowSeparators[l]);if(!t){let l=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,d=l!==this._lastCursorRow||u!==this._lastCursorCol,h=p=>{p>0?r+=`\x1B[${p}C`:p<0&&(r+=`\x1B[${-p}D`)};d&&((p=>{p>0?r+=`\x1B[${p}B`:p<0&&(r+=`\x1B[${-p}A`)})(l-this._lastCursorRow),h(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,a=this._diffStyle(s,this._cursorStyle);return a.length>0&&(r+=`\x1B[${a.join(";")}m`),r}},A7=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,a=r===void 0?s:uC(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-a,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new T7(n,t).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:t.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(t,n){var d;let r=t.buffer.active,s=new D7(r,t,n),a=n.onlySelection??!1,l=n.range;if(l)return s.serialize({start:{x:l.startCol,y:(l.startLine,l.startLine)},end:{x:t.cols,y:(l.endLine,l.endLine)}});if(!a){let h=r.length,p=n.scrollback,m=p===void 0?h:uC(p+t.rows,0,h);return s.serialize({start:{x:0,y:h-m},end:{x:t.cols,y:h-1}})}let u=(d=this._terminal)==null?void 0:d.getSelectionPosition();return u!==void 0?s.serialize({start:{x:u.start.x,y:u.start.y},end:{x:u.end.x,y:u.end.y}}):""}_serializeModes(t){let n="",r=t.modes;if(r.applicationCursorKeysMode&&(n+="\x1B[?1h"),r.applicationKeypadMode&&(n+="\x1B[?66h"),r.bracketedPasteMode&&(n+="\x1B[?2004h"),r.insertMode&&(n+="\x1B[4h"),r.originMode&&(n+="\x1B[?6h"),r.reverseWraparoundMode&&(n+="\x1B[?45h"),r.sendFocusMode&&(n+="\x1B[?1004h"),r.wraparoundMode===!1&&(n+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h";break}return n}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);n+=`\x1B[?1049h\x1B[H${r}`}return t!=null&&t.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},D7=class extends fT{constructor(t,n,r){super(t),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=R7}_padStart(t,n,r){return n=n>>0,r=r??" ",t.length>n?t:(n-=t.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+t)}_beforeSerialize(t,n,r){var u,d;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",a=((d=this._terminal.options.theme)==null?void 0:d.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+a+";"),l.push("font-family: "+this._terminal.options.fontFamily+";"),l.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+l.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!pT(t,n),a=!Qi(t,n),l=!mT(t,n);if(s||a||l){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let d=this._getHexColor(t,!1);return d&&r.push("background-color: "+d+";"),t.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&r.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?r.push("text-decoration: overline underline;"):t.isUnderline()?r.push("text-decoration: underline;"):t.isOverline()&&r.push("text-decoration: overline;"),t.isBlink()&&r.push("text-decoration: blink;"),t.isInvisible()&&r.push("visibility: hidden;"),t.isItalic()&&r.push("font-style: italic;"),t.isDim()&&r.push("opacity: 0.5;"),t.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let a=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=M7(t.getChars())}_serializeString(){return this._htmlContent}};/**
431
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
432
+ * @license MIT
433
+ *
434
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
435
+ * @license MIT
436
+ *
437
+ * Originally forked from (with the author's permission):
438
+ * Fabrice Bellard's javascript vt100 for jslinux:
439
+ * http://bellard.org/jslinux/
440
+ * Copyright (c) 2011 Fabrice Bellard
441
+ */var N7=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=L7.computeLink(t,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(t){return t.map(n=>(n.leave=this._options.leave,n.hover=(r,s)=>{if(this._options.hover){let{range:a}=n;this._options.hover(r,s,a)}},n))}};function O7(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var L7=class Ad{static computeLink(t,n,r,s){let a=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=Ad._getWindowedLineStrings(t-1,r),d=l.join(""),h,p=[];for(;h=a.exec(d);){let m=h[0];if(!O7(m))continue;let[_,b]=Ad._mapStrIdx(r,u,0,h.index),[S,w]=Ad._mapStrIdx(r,_,b,m.length);if(_===-1||b===-1||S===-1||w===-1)continue;let C={start:{x:b+1,y:_+1},end:{x:w,y:S+1}};p.push({range:C,text:m,activate:s})}return p}static _getWindowedLineStrings(t,n){let r,s=t,a=t,l=0,u="",d=[];if(r=n.buffer.active.getLine(t)){let h=r.translateToString(!0);if(r.isWrapped&&h[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,d.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););d.reverse()}for(d.push(h),l=0;(r=n.buffer.active.getLine(++a))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,d.push(u),u.indexOf(" ")===-1););}return[d,s]}static _mapStrIdx(t,n,r,s){let a=t.buffer.active,l=a.getNullCell(),u=r;for(;s;){let d=a.getLine(n);if(!d)return[-1,-1];for(let h=u;h<d.length;++h){d.getCell(h,l);let p=l.getChars();if(l.getWidth()&&(s-=p.length||1,h===d.length-1&&p==="")){let m=a.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,h]}n++,u=0}return[n,u]}},z7=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function j7(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var B7=class{constructor(t=j7,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||z7;this._linkProvider=this._terminal.registerLinkProvider(new N7(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
442
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
443
+ * @license MIT
444
+ *
445
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
446
+ * @license MIT
447
+ *
448
+ * Originally forked from (with the author's permission):
449
+ * Fabrice Bellard's javascript vt100 for jslinux:
450
+ * http://bellard.org/jslinux/
451
+ * Copyright (c) 2011 Fabrice Bellard
452
+ */var gT=Object.defineProperty,P7=Object.getOwnPropertyDescriptor,I7=(e,t)=>{for(var n in t)gT(e,n,{get:t[n],enumerable:!0})},Dt=(e,t,n,r)=>{for(var s=r>1?void 0:r?P7(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&gT(t,n,s),s},_e=(e,t)=>(n,r)=>t(n,r,e),hC="Terminal input",Wv={get:()=>hC,set:e=>hC=e},dC="Too much output to announce, navigate to rows manually to read",qv={get:()=>dC,set:e=>dC=e};function H7(e){return e.replace(/\r?\n/g,"\r")}function F7(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function U7(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function $7(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");vT(s,t,n,r)}}function vT(e,t,n,r){e=H7(e),e=F7(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function _T(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function fC(e,t,n,r,s){_T(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Fs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Pf(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let a=e[s];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var W7=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let a=e.charCodeAt(s++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=s;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,r;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},q7=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,a,l,u,d=0,h=0;if(this.interim[0]){let _=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)b<<=6,b|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;h<k;){if(h>=n)return 0;if(w=e[h++],(w&192)!==128){h--,_=!0;break}else this.interim[S++]=w,b<<=6,b|=w&63}_||(C===2?b<128?h--:t[r++]=b:C===3?b<2048||b>=55296&&b<=57343||b===65279||(t[r++]=b):b<65536||b>1114111||(t[r++]=b)),this.interim.fill(0)}let p=n-4,m=h;for(;m<n;){for(;m<p&&!((s=e[m])&128)&&!((a=e[m+1])&128)&&!((l=e[m+2])&128)&&!((u=e[m+3])&128);)t[r++]=s,t[r++]=a,t[r++]=l,t[r++]=u,m+=4;if(s=e[m++],s<128)t[r++]=s;else if((s&224)===192){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(d=(s&31)<<6|a&63,d<128){m--;continue}t[r++]=d}else if((s&240)===224){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[m++],(l&192)!==128){m--;continue}if(d=(s&15)<<12|(a&63)<<6|l&63,d<2048||d>=55296&&d<=57343||d===65279)continue;t[r++]=d}else if((s&248)===240){if(m>=n)return this.interim[0]=s,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,this.interim[2]=l,r;if(u=e[m++],(u&192)!==128){m--;continue}if(d=(s&7)<<18|(a&63)<<12|(l&63)<<6|u&63,d<65536||d>1114111)continue;t[r++]=d}}return r}},yT="",Ws=" ",ku=class bT{constructor(){this.fg=0,this.bg=0,this.extended=new ef}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new bT;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ef=class xT{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new xT(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Hr=class ST extends ku{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ef,this.combinedData=""}static fromCharData(t){let n=new ST;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Fs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},pC="di$target",Vv="di$dependencies",zg=new Map;function V7(e){return e[Vv]||[]}function gn(e){if(zg.has(e))return zg.get(e);let t=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");K7(t,n,s)};return t._id=e,zg.set(e,t),t}function K7(e,t,n){t[pC]===t?t[Vv].push({id:e,index:n}):(t[Vv]=[{id:e,index:n}],t[pC]=t)}var In=gn("BufferService"),wT=gn("CoreMouseService"),Go=gn("CoreService"),G7=gn("CharsetService"),nb=gn("InstantiationService"),CT=gn("LogService"),Hn=gn("OptionsService"),kT=gn("OscLinkService"),Y7=gn("UnicodeService"),Eu=gn("DecorationService"),Kv=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,a=new Hr,l=n.getTrimmedLength(),u=-1,d=-1,h=!1;for(let m=0;m<l;m++)if(!(d===-1&&!n.hasContent(m))){if(n.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId)if(d===-1){d=m,u=a.extended.urlId;continue}else h=a.extended.urlId!==u;else d!==-1&&(h=!0);if(h||d!==-1&&m===l-1){let _=(p=this._oscLinkService.getLinkData(u))==null?void 0:p.uri;if(_){let b={start:{x:d+1,y:e},end:{x:m+(!h&&m===l-1?1:0),y:e}},S=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let w=new URL(_);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:_,range:b,activate:(w,C)=>s?s.activate(w,C,b):X7(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,b)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,b)}})}h=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=m,u=a.extended.urlId):(d=-1,u=-1)}}t(r)}};Kv=Dt([_e(0,In),_e(1,Hn),_e(2,kT)],Kv);function X7(e,t){if(confirm(`Do you want to navigate to ${t}?
453
+
454
+ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var If=gn("CharSizeService"),os=gn("CoreBrowserService"),rb=gn("MouseService"),as=gn("RenderService"),Z7=gn("SelectionService"),ET=gn("CharacterJoinerService"),_l=gn("ThemeService"),RT=gn("LinkProviderService"),Q7=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?mC.isErrorNoTelemetry(e)?new mC(e.message+`
455
+
456
+ `+e.stack):new Error(e.message+`
457
+
458
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},J7=new Q7;function Dd(e){eH(e)||J7.onUnexpectedError(e)}var Gv="Canceled";function eH(e){return e instanceof tH?!0:e instanceof Error&&e.name===Gv&&e.message===Gv}var tH=class extends Error{constructor(){super(Gv),this.name=this.message}};function nH(e){return new Error(`Illegal argument: ${e}`)}var mC=class Yv extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Yv)return t;let n=new Yv;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Xv=class MT extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,MT.prototype)}};function fr(e,t=0){return e[e.length-(1+t)]}var rH;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function r(a){return a>0}e.isGreaterThan=r;function s(a){return a===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(rH||(rH={}));function iH(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var TT;(e=>{function t(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(D){yield D}e.single=s;function a(D){return t(D)?D:s(D)}e.wrap=a;function l(D){return D||n}e.from=l;function*u(D){for(let z=D.length-1;z>=0;z--)yield D[z]}e.reverse=u;function d(D){return!D||D[Symbol.iterator]().next().done===!0}e.isEmpty=d;function h(D){return D[Symbol.iterator]().next().value}e.first=h;function p(D,z){let L=0;for(let j of D)if(z(j,L++))return!0;return!1}e.some=p;function m(D,z){for(let L of D)if(z(L))return L}e.find=m;function*_(D,z){for(let L of D)z(L)&&(yield L)}e.filter=_;function*b(D,z){let L=0;for(let j of D)yield z(j,L++)}e.map=b;function*S(D,z){let L=0;for(let j of D)yield*z(j,L++)}e.flatMap=S;function*w(...D){for(let z of D)yield*z}e.concat=w;function C(D,z,L){let j=L;for(let I of D)j=z(j,I);return j}e.reduce=C;function*k(D,z,L=D.length){for(z<0&&(z+=D.length),L<0?L+=D.length:L>D.length&&(L=D.length);z<L;z++)yield D[z]}e.slice=k;function T(D,z=Number.POSITIVE_INFINITY){let L=[];if(z===0)return[L,D];let j=D[Symbol.iterator]();for(let I=0;I<z;I++){let Z=j.next();if(Z.done)return[L,e.empty()];L.push(Z.value)}return[L,{[Symbol.iterator](){return j}}]}e.consume=T;async function R(D){let z=[];for await(let L of D)z.push(L);return Promise.resolve(z)}e.asyncToArray=R})(TT||(TT={}));function Ho(e){if(TT.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function sH(...e){return St(()=>Ho(e))}function St(e){return{dispose:iH(()=>{e()})}}var AT=class DT{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ho(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?DT.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};AT.DISABLE_DISPOSED_WARNING=!1;var Vs=AT,We=class{constructor(){this._store=new Vs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};We.None=Object.freeze({dispose(){}});var ll=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Ji=typeof window=="object"?window:globalThis,Zv=class Qv{constructor(t){this.element=t,this.next=Qv.Undefined,this.prev=Qv.Undefined}};Zv.Undefined=new Zv(void 0);var Ct=Zv,gC=class{constructor(){this._first=Ct.Undefined,this._last=Ct.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ct.Undefined}clear(){let e=this._first;for(;e!==Ct.Undefined;){let t=e.next;e.prev=Ct.Undefined,e.next=Ct.Undefined,e=t}this._first=Ct.Undefined,this._last=Ct.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Ct(e);if(this._first===Ct.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Ct.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ct.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ct.Undefined&&e.next!==Ct.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ct.Undefined&&e.next===Ct.Undefined?(this._first=Ct.Undefined,this._last=Ct.Undefined):e.next===Ct.Undefined?(this._last=this._last.prev,this._last.next=Ct.Undefined):e.prev===Ct.Undefined&&(this._first=this._first.next,this._first.prev=Ct.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ct.Undefined;)yield e.element,e=e.next}},oH=globalThis.performance&&typeof globalThis.performance.now=="function",aH=class NT{static create(t){return new NT(t)}constructor(t){this._now=oH&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},kn;(e=>{e.None=()=>We.None;function t(H,F){return m(H,()=>{},0,void 0,!0,void 0,F)}e.defer=t;function n(H){return(F,V=null,U)=>{let O=!1,K;return K=H($=>{if(!O)return K?K.dispose():O=!0,F.call(V,$)},null,U),O&&K.dispose(),K}}e.once=n;function r(H,F,V){return h((U,O=null,K)=>H($=>U.call(O,F($)),null,K),V)}e.map=r;function s(H,F,V){return h((U,O=null,K)=>H($=>{F($),U.call(O,$)},null,K),V)}e.forEach=s;function a(H,F,V){return h((U,O=null,K)=>H($=>F($)&&U.call(O,$),null,K),V)}e.filter=a;function l(H){return H}e.signal=l;function u(...H){return(F,V=null,U)=>{let O=sH(...H.map(K=>K($=>F.call(V,$))));return p(O,U)}}e.any=u;function d(H,F,V,U){let O=V;return r(H,K=>(O=F(O,K),O),U)}e.reduce=d;function h(H,F){let V,U={onWillAddFirstListener(){V=H(O.fire,O)},onDidRemoveLastListener(){V==null||V.dispose()}},O=new ve(U);return F==null||F.add(O),O.event}function p(H,F){return F instanceof Array?F.push(H):F&&F.add(H),H}function m(H,F,V=100,U=!1,O=!1,K,$){let J,A,B,Y=0,M,X={leakWarningThreshold:K,onWillAddFirstListener(){J=H(re=>{Y++,A=F(A,re),U&&!B&&(se.fire(A),A=void 0),M=()=>{let me=A;A=void 0,B=void 0,(!U||Y>1)&&se.fire(me),Y=0},typeof V=="number"?(clearTimeout(B),B=setTimeout(M,V)):B===void 0&&(B=0,queueMicrotask(M))})},onWillRemoveListener(){O&&Y>0&&(M==null||M())},onDidRemoveLastListener(){M=void 0,J.dispose()}},se=new ve(X);return $==null||$.add(se),se.event}e.debounce=m;function _(H,F=0,V){return e.debounce(H,(U,O)=>U?(U.push(O),U):[O],F,void 0,!0,void 0,V)}e.accumulate=_;function b(H,F=(U,O)=>U===O,V){let U=!0,O;return a(H,K=>{let $=U||!F(K,O);return U=!1,O=K,$},V)}e.latch=b;function S(H,F,V){return[e.filter(H,F,V),e.filter(H,U=>!F(U),V)]}e.split=S;function w(H,F=!1,V=[],U){let O=V.slice(),K=H(A=>{O?O.push(A):J.fire(A)});U&&U.add(K);let $=()=>{O==null||O.forEach(A=>J.fire(A)),O=null},J=new ve({onWillAddFirstListener(){K||(K=H(A=>J.fire(A)),U&&U.add(K))},onDidAddFirstListener(){O&&(F?setTimeout($):$())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return U&&U.add(J),J.event}e.buffer=w;function C(H,F){return(V,U,O)=>{let K=F(new T);return H(function($){let J=K.evaluate($);J!==k&&V.call(U,J)},void 0,O)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(V=>(F(V),V)),this}filter(F){return this.steps.push(V=>F(V)?V:k),this}reduce(F,V){let U=V;return this.steps.push(O=>(U=F(U,O),U)),this}latch(F=(V,U)=>V===U){let V=!0,U;return this.steps.push(O=>{let K=V||!F(O,U);return V=!1,U=O,K?O:k}),this}evaluate(F){for(let V of this.steps)if(F=V(F),F===k)break;return F}}function R(H,F,V=U=>U){let U=(...J)=>$.fire(V(...J)),O=()=>H.on(F,U),K=()=>H.removeListener(F,U),$=new ve({onWillAddFirstListener:O,onDidRemoveLastListener:K});return $.event}e.fromNodeEventEmitter=R;function D(H,F,V=U=>U){let U=(...J)=>$.fire(V(...J)),O=()=>H.addEventListener(F,U),K=()=>H.removeEventListener(F,U),$=new ve({onWillAddFirstListener:O,onDidRemoveLastListener:K});return $.event}e.fromDOMEventEmitter=D;function z(H){return new Promise(F=>n(H)(F))}e.toPromise=z;function L(H){let F=new ve;return H.then(V=>{F.fire(V)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}e.fromPromise=L;function j(H,F){return H(V=>F.fire(V))}e.forward=j;function I(H,F,V){return F(V),H(U=>F(U))}e.runAndSubscribe=I;class Z{constructor(F,V){this._observable=F,this._counter=0,this._hasChanged=!1;let U={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new ve(U),V&&V.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,V){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(H,F){return new Z(H,F).emitter.event}e.fromObservable=P;function W(H){return(F,V,U)=>{let O=0,K=!1,$={beginUpdate(){O++},endUpdate(){O--,O===0&&(H.reportChanges(),K&&(K=!1,F.call(V)))},handlePossibleChange(){},handleChange(){K=!0}};H.addObserver($),H.reportChanges();let J={dispose(){H.removeObserver($)}};return U instanceof Vs?U.add(J):Array.isArray(U)&&U.push(J),J}}e.fromObservableLight=W})(kn||(kn={}));var Jv=class e_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e_._idPool++}`,e_.all.add(this)}start(t){this._stopWatch=new aH,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Jv.all=new Set,Jv._idPool=0;var lH=Jv,cH=-1,OT=class LT{constructor(t,n,r=(LT._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let d=new dH(u,a);this._errorHandler(d)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};OT._idPool=1;var uH=OT,hH=class zT{constructor(t){this.value=t}static create(){let t=new Error;return new zT(t.stack??"")}print(){console.warn(this.value.split(`
459
+ `).slice(2).join(`
460
+ `))}},dH=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},fH=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},pH=0,jg=class{constructor(e){this.value=e,this.id=pH++}},mH=2,gH,ve=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new uH((e==null?void 0:e.onListenerError)??Dd,((n=this._options)==null?void 0:n.leakWarningThreshold)??cH):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new lH(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,d,h,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],b=new fH(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Dd)(b),We.None}if(this._disposed)return We.None;t&&(e=e.bind(t));let r=new jg(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=hH.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof jg?(this._deliveryQueue??(this._deliveryQueue=new vH),this._listeners=[this._listeners,r]):this._listeners.push(r):((d=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||d.call(u,this),this._listeners=r,(p=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||p.call(h,this)),this._size++;let a=St(()=>{s==null||s(),this._removeListener(r)});return n instanceof Vs?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var s,a,l,u;if((a=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||a.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*mH<=t.length){let d=0;for(let h=0;h<t.length;h++)t[h]?t[d++]=t[h]:r&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=d}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Dd;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof jg)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},vH=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},t_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ve,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ve,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};t_.INSTANCE=new t_;var ib=t_;function _H(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}ib.INSTANCE.onDidChangeZoomLevel;function yH(e){return ib.INSTANCE.getZoomFactor(e)}ib.INSTANCE.onDidChangeFullscreen;var yl=typeof navigator=="object"?navigator.userAgent:"",n_=yl.indexOf("Firefox")>=0,bH=yl.indexOf("AppleWebKit")>=0,sb=yl.indexOf("Chrome")>=0,xH=!sb&&yl.indexOf("Safari")>=0;yl.indexOf("Electron/")>=0;yl.indexOf("Android")>=0;var Bg=!1;if(typeof Ji.matchMedia=="function"){let e=Ji.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ji.matchMedia("(display-mode: fullscreen)");Bg=e.matches,_H(Ji,e,({matches:n})=>{Bg&&t.matches||(Bg=n)})}var Va="en",r_=!1,i_=!1,Nd=!1,jT=!1,od,Od=Va,vC=Va,SH,Xr,Oo=globalThis,Cn,hk;typeof Oo.vscode<"u"&&typeof Oo.vscode.process<"u"?Cn=Oo.vscode.process:typeof process<"u"&&typeof((hk=process==null?void 0:process.versions)==null?void 0:hk.node)=="string"&&(Cn=process);var dk,wH=typeof((dk=Cn==null?void 0:Cn.versions)==null?void 0:dk.electron)=="string",CH=wH&&(Cn==null?void 0:Cn.type)==="renderer",fk;if(typeof Cn=="object"){r_=Cn.platform==="win32",i_=Cn.platform==="darwin",Nd=Cn.platform==="linux",Nd&&Cn.env.SNAP&&Cn.env.SNAP_REVISION,Cn.env.CI||Cn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,od=Va,Od=Va;let e=Cn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);od=t.userLocale,vC=t.osLocale,Od=t.resolvedLanguage||Va,SH=(fk=t.languagePack)==null?void 0:fk.translationsConfigFile}catch{}jT=!0}else typeof navigator=="object"&&!CH?(Xr=navigator.userAgent,r_=Xr.indexOf("Windows")>=0,i_=Xr.indexOf("Macintosh")>=0,(Xr.indexOf("Macintosh")>=0||Xr.indexOf("iPad")>=0||Xr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Nd=Xr.indexOf("Linux")>=0,(Xr==null?void 0:Xr.indexOf("Mobi"))>=0,Od=globalThis._VSCODE_NLS_LANGUAGE||Va,od=navigator.language.toLowerCase(),vC=od):console.error("Unable to resolve platform.");var BT=r_,bi=i_,kH=Nd,_C=jT,Ci=Xr,zs=Od,EH;(e=>{function t(){return zs}e.value=t;function n(){return zs.length===2?zs==="en":zs.length>=3?zs[0]==="e"&&zs[1]==="n"&&zs[2]==="-":!1}e.isDefaultVariant=n;function r(){return zs==="en"}e.isDefault=r})(EH||(EH={}));var RH=typeof Oo.postMessage=="function"&&!Oo.importScripts;(()=>{if(RH){let e=[];Oo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let a=e[r];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Oo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var MH=!!(Ci&&Ci.indexOf("Chrome")>=0);Ci&&Ci.indexOf("Firefox")>=0;!MH&&Ci&&Ci.indexOf("Safari")>=0;Ci&&Ci.indexOf("Edg/")>=0;Ci&&Ci.indexOf("Android")>=0;var Ha=typeof navigator=="object"?navigator:{};_C||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ha&&Ha.clipboard&&Ha.clipboard.writeText,_C||Ha&&Ha.clipboard&&Ha.clipboard.readText;var ob=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Pg=new ob,yC=new ob,bC=new ob,TH=new Array(230),PT;(e=>{function t(u){return Pg.keyCodeToStr(u)}e.toString=t;function n(u){return Pg.strToKeyCode(u)}e.fromString=n;function r(u){return yC.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return bC.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function a(u){return yC.strToKeyCode(u)||bC.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Pg.keyCodeToStr(u)}e.toElectronAccelerator=l})(PT||(PT={}));var AH=class IT{constructor(t,n,r,s,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=a}equals(t){return t instanceof IT&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${r}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new DH([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},DH=class{constructor(e){if(e.length===0)throw nH("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function NH(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return PT.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(n_)switch(t){case 59:return 85;case 60:if(kH)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(bi)return 57;break}else if(bH&&(bi&&t===93||!bi&&t===92))return 57;return TH[t]||0}var OH=bi?256:2048,LH=512,zH=1024,jH=bi?2048:256,xC=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=NH(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=OH),this.altKey&&(t|=LH),this.shiftKey&&(t|=zH),this.metaKey&&(t|=jH),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new AH(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},SC=new WeakMap;function BH(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var PH=class{static getSameOriginWindowChain(e){let t=SC.get(e);if(!t){t=[],SC.set(e,t);let n=e,r;do r=BH(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let a of s){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},ad=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=PH.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},wC=class{constructor(e,t=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(sb){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?n_&&!bi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")xH&&BT?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let d=e;d.deltaMode===d.DOM_DELTA_LINE?n_&&!bi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},HT=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),IH;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof HH?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:HT})})(IH||(IH={}));var HH=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?HT:(this._emitter||(this._emitter=new ve),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ab=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Xv("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Xv("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},FH=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Xv("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=St(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},UH;(e=>{async function t(r){let s,a=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return a}e.settled=t;function n(r){return new Promise(async(s,a)=>{try{await r(s,a)}catch(l){a(l)}})}e.withAsyncBody=n})(UH||(UH={}));var CC=class Lr{static fromArray(t){return new Lr(n=>{n.emitMany(t)})}static fromPromise(t){return new Lr(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Lr(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Lr(async n=>{await Promise.all(t.map(async r=>{for await(let s of r)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ve,queueMicrotask(async()=>{let r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await kn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new Lr(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return Lr.map(this,t)}static filter(t,n){return new Lr(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return Lr.filter(this,t)}static coalesce(t){return Lr.filter(t,n=>!!n)}coalesce(){return Lr.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Lr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};CC.EMPTY=CC.fromArray([]);var{getWindow:vi,getWindowId:$H,onDidRegisterWindow:WH}=(function(){let e=new Map,t={window:Ji,disposables:new Vs};e.set(Ji.vscodeWindowId,t);let n=new ve,r=new ve,s=new ve;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return We.None;let u=new Vs,d={window:l,disposables:u.add(new Vs)};return e.set(l.vscodeWindowId,d),u.add(St(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(Oe(l,ln.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(d),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){var h;let u=l;if((h=u==null?void 0:u.ownerDocument)!=null&&h.defaultView)return u.ownerDocument.defaultView.window;let d=l;return d!=null&&d.view?d.view.window:Ji},getDocument(l){return vi(l).document}}})(),qH=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Oe(e,t,n,r){return new qH(e,t,n,r)}var kC=function(e,t,n,r){return Oe(e,t,n,r)},lb,VH=class extends FH{constructor(e){super(),this.defaultTarget=e&&vi(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},EC=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Dd(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),r.set(a,!0);l.length>0;)l.sort(EC.sort),l.shift().execute();r.set(a,!1)};lb=(a,l,u=0)=>{let d=$H(a),h=new EC(l,u),p=e.get(d);return p||(p=[],e.set(d,p)),p.push(h),n.get(d)||(n.set(d,!0),a.requestAnimationFrame(()=>s(d))),h}})();function KH(e){let t=e.getBoundingClientRect(),n=vi(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var ln={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},GH=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Jn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Jn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Jn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Jn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Jn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Jn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Jn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Jn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Jn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Jn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Jn(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Jn(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Jn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Jn(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Jn(e){return typeof e=="number"?`${e}px`:e}function Fc(e){return new GH(e)}var FT=class{constructor(){this._hooks=new Vs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let a=e;try{e.setPointerCapture(t),this._hooks.add(St(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=vi(e)}this._hooks.add(Oe(a,ln.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Oe(a,ln.POINTER_UP,l=>this.stopMonitoring(!0)))}};function YH(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let a=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[a]}}var hi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(hi||(hi={}));var Dc=class Mn extends We{constructor(){super(),this.dispatched=!1,this.targets=new gC,this.ignoreTargets=new gC,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(kn.runAndSubscribe(WH,({window:t,disposables:n})=>{n.add(Oe(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Oe(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Oe(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Ji,disposables:this._store}))}static addTarget(t){if(!Mn.isTouchDevice())return We.None;Mn.INSTANCE||(Mn.INSTANCE=new Mn);let n=Mn.INSTANCE.targets.push(t);return St(n)}static ignoreTarget(t){if(!Mn.isTouchDevice())return We.None;Mn.INSTANCE||(Mn.INSTANCE=new Mn);let n=Mn.INSTANCE.ignoreTargets.push(t);return St(n)}static isTouchDevice(){return"ontouchstart"in Ji||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(hi.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let d=this.activeTouches[u.identifier],h=Date.now()-d.initialTimeStamp;if(h<Mn.HOLD_DELAY&&Math.abs(d.initialPageX-fr(d.rollingPageX))<30&&Math.abs(d.initialPageY-fr(d.rollingPageY))<30){let p=this.newGestureEvent(hi.Tap,d.initialTarget);p.pageX=fr(d.rollingPageX),p.pageY=fr(d.rollingPageY),this.dispatchEvent(p)}else if(h>=Mn.HOLD_DELAY&&Math.abs(d.initialPageX-fr(d.rollingPageX))<30&&Math.abs(d.initialPageY-fr(d.rollingPageY))<30){let p=this.newGestureEvent(hi.Contextmenu,d.initialTarget);p.pageX=fr(d.rollingPageX),p.pageY=fr(d.rollingPageY),this.dispatchEvent(p)}else if(s===1){let p=fr(d.rollingPageX),m=fr(d.rollingPageY),_=fr(d.rollingTimestamps)-d.rollingTimestamps[0],b=p-d.rollingPageX[0],S=m-d.rollingPageY[0],w=[...this.targets].filter(C=>d.initialTarget instanceof Node&&C.contains(d.initialTarget));this.inertia(t,w,r,Math.abs(b)/_,b>0?1:-1,p,Math.abs(S)/_,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(hi.End,d.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===hi.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Mn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===hi.Change||t.type===hi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,a=t.initialTarget;for(;a&&a!==r;)s++,a=a.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,a,l,u,d,h){this.handle=lb(t,()=>{let p=Date.now(),m=p-r,_=0,b=0,S=!0;s+=Mn.SCROLL_FRICTION*m,u+=Mn.SCROLL_FRICTION*m,s>0&&(S=!1,_=a*s*m),u>0&&(S=!1,b=d*u*m);let w=this.newGestureEvent(hi.Change);w.translationX=_,w.translationY=b,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,p,s,a,l+_,u,d,h+b)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(hi.Change,l.initialTarget);u.translationX=a.pageX-fr(l.rollingPageX),u.translationY=a.pageY-fr(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Dc.SCROLL_FRICTION=-.005,Dc.HOLD_DELAY=700,Dc.CLEAR_TAP_COUNT_TIME=400,Dt([YH],Dc,"isTouchDevice",1);var XH=Dc,cb=class extends We{onclick(e,t){this._register(Oe(e,ln.CLICK,n=>t(new ad(vi(e),n))))}onmousedown(e,t){this._register(Oe(e,ln.MOUSE_DOWN,n=>t(new ad(vi(e),n))))}onmouseover(e,t){this._register(Oe(e,ln.MOUSE_OVER,n=>t(new ad(vi(e),n))))}onmouseleave(e,t){this._register(Oe(e,ln.MOUSE_LEAVE,n=>t(new ad(vi(e),n))))}onkeydown(e,t){this._register(Oe(e,ln.KEY_DOWN,n=>t(new xC(n))))}onkeyup(e,t){this._register(Oe(e,ln.KEY_UP,n=>t(new xC(n))))}oninput(e,t){this._register(Oe(e,ln.INPUT,t))}onblur(e,t){this._register(Oe(e,ln.BLUR,t))}onfocus(e,t){this._register(Oe(e,ln.FOCUS,t))}onchange(e,t){this._register(Oe(e,ln.CHANGE,t))}ignoreGesture(e){return XH.ignoreTarget(e)}},RC=11,ZH=class extends cb{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=RC+"px",this.domNode.style.height=RC+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new FT),this._register(kC(this.bgDomNode,ln.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(kC(this.domNode,ln.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new VH),this._pointerdownScheduleRepeatTimer=this._register(new ab)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,vi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},QH=class s_{constructor(t,n,r,s,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=a,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new s_(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new s_(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,d=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:s,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:d}}},JH=class extends We{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ve),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new QH(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new TC(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=TC.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},MC=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Ig(e,t){let n=t-e;return function(r){return e+n*nF(r)}}function eF(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var TC=class o_{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let s,a;return t<n?(s=t+.75*r,a=n-.75*r):(s=t-.75*r,a=n+.75*r),eF(Ig(t,s),Ig(a,n),.33)}return Ig(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),s=this.scrollTop(n);return new MC(r,s,!1)}return new MC(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return o_.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new o_(t,n,s,r)}};function tF(e){return Math.pow(e,3)}function nF(e){return 1-tF(1-e)}var rF=class extends We{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ab)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},iF=140,UT=class extends cb{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new rF(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new FT),this._shouldRender=!0,this.domNode=Fc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Oe(this.domNode.domNode,ln.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new ZH(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Fc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Oe(this.slider.domNode,ln.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=KH(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let a=this._sliderOrthogonalPointerPosition(s),l=Math.abs(a-n);if(BT&&l>iF){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},$T=class a_{constructor(t,n,r,s,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new a_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,a){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),d=s>0&&s>r;if(!d)return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(r*u/s))),p=(u-h)/(s-r),m=a*p;return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=a_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},sF=class extends UT{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new $T(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},oF=class extends UT{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new $T(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},aF=500,AC=50,lF=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},l_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,s=this._rear;do{let a=s===this._front?t:Math.pow(2,-r);if(t-=a,n+=this._memory[s].score*a,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(sb){let n=vi(t.browserEvent),r=yH(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,a=new lF(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=a),a.score=this._computeScore(a,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),d=Math.max(Math.min(s,l),1),h=Math.max(Math.min(a,u),1),p=Math.max(s,l),m=Math.max(a,u);p%d===0&&m%h===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};l_.INSTANCE=new l_;var cF=l_,uF=class extends cb{constructor(e,t,n){super(),this._onScroll=this._register(new ve),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ve),this.onWillScroll=this._onWillScroll.event,this._options=dF(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new oF(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new sF(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Fc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Fc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Fc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new ab),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ho(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,bi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new wC(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ho(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new wC(n))};this._mouseWheelToDispose.push(Oe(this._listenOnDomNode,ln.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=cF.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!bi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let d=this._scrollable.getFutureScrollPosition(),h={};if(a){let p=AC*a,m=d.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(h,m)}if(l){let p=AC*l,m=d.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(d.scrollLeft!==h.scrollLeft||d.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",s=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${s}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),aF)}},hF=class extends uF{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function dF(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,bi&&(t.className+=" mac"),t}var c_=class extends We{constructor(e,t,n,r,s,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new ve),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new JH({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>lb(r.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new hF(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(kn.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(St(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(St(()=>this._styleElement.remove())),this._register(kn.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
461
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};c_=Dt([_e(2,In),_e(3,os),_e(4,wT),_e(5,_l),_e(6,Hn),_e(7,as)],c_);var u_=class extends We{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,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(a=>this._removeDecoration(a))),this._register(St(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};u_=Dt([_e(1,In),_e(2,os),_e(3,Eu),_e(4,as)],u_);var fF=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},ci={full:0,left:0,center:0,right:0},js={full:0,left:0,center:0,right:0},vc={full:0,left:0,center:0,right:0},tf=class extends We{constructor(e,t,n,r,s,a,l,u){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new fF,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(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(St(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);js.full=this._canvas.width,js.left=e,js.center=t,js.right=e,this._refreshDrawHeightConstants(),vc.full=1,vc.left=1,vc.center=1+js.left,vc.right=1+js.left+js.center}_refreshDrawHeightConstants(){ci.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);ci.left=t,ci.center=t,ci.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ci.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ci.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ci.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ci.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(vc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-ci[e.position||"full"]/2),js[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+ci[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};tf=Dt([_e(2,In),_e(3,Eu),_e(4,as),_e(5,Hn),_e(6,_l),_e(7,os)],tf);var ue;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
462
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ue||(ue={}));var Ld;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(Ld||(Ld={}));var WT;(e=>e.ST=`${ue.ESC}\\`)(WT||(WT={}));var h_=class{constructor(e,t,n,r,s,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ue.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};h_=Dt([_e(2,In),_e(3,Hn),_e(4,Go),_e(5,as)],h_);var fn=0,pn=0,mn=0,At=0,DC={css:"#00000000",rgba:0},Gt;(e=>{function t(s,a,l,u){return u!==void 0?`#${Ro(s)}${Ro(a)}${Ro(l)}${Ro(u)}`:`#${Ro(s)}${Ro(a)}${Ro(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=r})(Gt||(Gt={}));var bt;(e=>{function t(d,h){if(At=(h.rgba&255)/255,At===1)return{css:h.css,rgba:h.rgba};let p=h.rgba>>24&255,m=h.rgba>>16&255,_=h.rgba>>8&255,b=d.rgba>>24&255,S=d.rgba>>16&255,w=d.rgba>>8&255;fn=b+Math.round((p-b)*At),pn=S+Math.round((m-S)*At),mn=w+Math.round((_-w)*At);let C=Gt.toCss(fn,pn,mn),k=Gt.toRgba(fn,pn,mn);return{css:C,rgba:k}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function r(d,h,p){let m=zd.ensureContrastRatio(d.rgba,h.rgba,p);if(m)return Gt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(d){let h=(d.rgba|255)>>>0;return[fn,pn,mn]=zd.toChannels(h),{css:Gt.toCss(fn,pn,mn),rgba:h}}e.opaque=s;function a(d,h){return At=Math.round(h*255),[fn,pn,mn]=zd.toChannels(d.rgba),{css:Gt.toCss(fn,pn,mn,At),rgba:Gt.toRgba(fn,pn,mn,At)}}e.opacity=a;function l(d,h){return At=d.rgba&255,a(d,At*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(bt||(bt={}));var kt;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return fn=parseInt(s.slice(1,2).repeat(2),16),pn=parseInt(s.slice(2,3).repeat(2),16),mn=parseInt(s.slice(3,4).repeat(2),16),Gt.toColor(fn,pn,mn);case 5:return fn=parseInt(s.slice(1,2).repeat(2),16),pn=parseInt(s.slice(2,3).repeat(2),16),mn=parseInt(s.slice(3,4).repeat(2),16),At=parseInt(s.slice(4,5).repeat(2),16),Gt.toColor(fn,pn,mn,At);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return fn=parseInt(a[1]),pn=parseInt(a[2]),mn=parseInt(a[3]),At=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Gt.toColor(fn,pn,mn,At);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[fn,pn,mn,At]=t.getImageData(0,0,1,1).data,At!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Gt.toRgba(fn,pn,mn,At),css:s}}e.toColor=r})(kt||(kt={}));var Ln;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,a){let l=r/255,u=s/255,d=a/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return h*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Ln||(Ln={}));var zd;(e=>{function t(l,u){if(At=(u&255)/255,At===1)return u;let d=u>>24&255,h=u>>16&255,p=u>>8&255,m=l>>24&255,_=l>>16&255,b=l>>8&255;return fn=m+Math.round((d-m)*At),pn=_+Math.round((h-_)*At),mn=b+Math.round((p-b)*At),Gt.toRgba(fn,pn,mn)}e.blend=t;function n(l,u,d){let h=Ln.relativeLuminance(l>>8),p=Ln.relativeLuminance(u>>8);if(Zi(h,p)<d){if(p<h){let b=r(l,u,d),S=Zi(h,Ln.relativeLuminance(b>>8));if(S<d){let w=s(l,u,d),C=Zi(h,Ln.relativeLuminance(w>>8));return S>C?b:w}return b}let m=s(l,u,d),_=Zi(h,Ln.relativeLuminance(m>>8));if(_<d){let b=r(l,u,d),S=Zi(h,Ln.relativeLuminance(b>>8));return _>S?m:b}return m}}e.ensureContrastRatio=n;function r(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Zi(Ln.relativeLuminance2(_,b,S),Ln.relativeLuminance2(h,p,m));for(;w<d&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Zi(Ln.relativeLuminance2(_,b,S),Ln.relativeLuminance2(h,p,m));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,d){let h=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Zi(Ln.relativeLuminance2(_,b,S),Ln.relativeLuminance2(h,p,m));for(;w<d&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Zi(Ln.relativeLuminance2(_,b,S),Ln.relativeLuminance2(h,p,m));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(zd||(zd={}));function Ro(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Zi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var pF=class extends ku{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},nf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Hr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),s=0,a=0,l=0,u=t.getFg(0),d=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==d){if(h-s>1){let p=this._getJoinedRanges(r,l,a,t,s);for(let m=0;m<p.length;m++)n.push(p[m])}s=h,l=a,u=this._workCell.fg,d=this._workCell.bg}a+=this._workCell.getChars().length||Ws.length}if(this._bufferService.cols-s>1){let h=this._getJoinedRanges(r,l,a,t,s);for(let p=0;p<h.length;p++)n.push(h[p])}return n}_getJoinedRanges(e,t,n,r,s){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let d=this._characterJoiners[u].handler(a);for(let h=0;h<d.length;h++)nf._mergeRanges(l,d[h])}catch(d){console.error(d)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,a=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let d=t.getWidth(u),h=t.getString(u).length||Ws.length;if(d!==0){if(!s&&l[0]<=a&&(l[0]=u,s=!0),l[1]<=a){if(l[1]=u,l=e[++r],!l)break;l[0]<=a?(l[0]=u,s=!0):s=!1}a+=h}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};nf=Dt([_e(0,In)],nf);function mF(e){return 57508<=e&&e<=57558}function gF(e){return 9472<=e&&e<=9631}function vF(e){return mF(e)||gF(e)}function _F(){return{css:{canvas:ld(),cell:ld()},device:{canvas:ld(),cell:ld(),char:{width:0,height:0,left:0,top:0}}}}function ld(){return{width:0,height:0}}var d_=class{constructor(e,t,n,r,s,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=a,this._themeService=l,this._workCell=new Hr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,a,l,u,d,h,p){let m=[],_=this._characterJoinerService.getJoinedCharacters(t),b=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<a+1&&(S=a+1);let w,C=0,k="",T=0,R=0,D=0,z=0,L=!1,j=0,I=!1,Z=0,P=0,W=[],H=h!==-1&&p!==-1;for(let F=0;F<S;F++){e.loadCell(F,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let U=!1,O=F>=P,K=F,$=this._workCell;if(_.length>0&&F===_[0][0]&&O){let Me=_.shift(),Ve=this._isCellInSelection(Me[0],t);for(T=Me[0]+1;T<Me[1];T++)O&&(O=Ve===this._isCellInSelection(T,t));O&&(O=!n||a<Me[0]||a>=Me[1]),O?(U=!0,$=new pF(this._workCell,e.translateToString(!0,Me[0],Me[1]),Me[1]-Me[0]),K=Me[1]-1,V=$.getWidth()):P=Me[1]}let J=this._isCellInSelection(F,t),A=n&&F===a,B=H&&F>=h&&F<=p,Y=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,Me=>{Y=!0});let M=$.getChars()||Ws;if(M===" "&&($.isUnderline()||$.isOverline())&&(M=" "),Z=V*u-d.get(M,$.isBold(),$.isItalic()),!w)w=this._document.createElement("span");else if(C&&(J&&I||!J&&!I&&$.bg===R)&&(J&&I&&b.selectionForeground||$.fg===D)&&$.extended.ext===z&&B===L&&Z===j&&!A&&!U&&!Y&&O){$.isInvisible()?k+=Ws:k+=M,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=$.bg,D=$.fg,z=$.extended.ext,L=B,j=Z,I=J,U&&a>=F&&a<=K&&(a=F),!this._coreService.isCursorHidden&&A&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&W.push("xterm-cursor-blink"),W.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline");break}}if($.isBold()&&W.push("xterm-bold"),$.isItalic()&&W.push("xterm-italic"),$.isDim()&&W.push("xterm-dim"),$.isInvisible()?k=Ws:k=$.getChars()||Ws,$.isUnderline()&&(W.push(`xterm-underline-${$.extended.underlineStyle}`),k===" "&&(k=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${ku.toColorRGB($.getUnderlineColor()).join(",")})`;else{let Me=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&Me<8&&(Me+=8),w.style.textDecorationColor=b.ansi[Me].css}$.isOverline()&&(W.push("xterm-overline"),k===" "&&(k=" ")),$.isStrikethrough()&&W.push("xterm-strikethrough"),B&&(w.style.textDecoration="underline");let X=$.getFgColor(),se=$.getFgColorMode(),re=$.getBgColor(),me=$.getBgColorMode(),Ce=!!$.isInverse();if(Ce){let Me=X;X=re,re=Me;let Ve=se;se=me,me=Ve}let pe,ke,Je=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,Me=>{Me.options.layer!=="top"&&Je||(Me.backgroundColorRGB&&(me=50331648,re=Me.backgroundColorRGB.rgba>>8&16777215,pe=Me.backgroundColorRGB),Me.foregroundColorRGB&&(se=50331648,X=Me.foregroundColorRGB.rgba>>8&16777215,ke=Me.foregroundColorRGB),Je=Me.options.layer==="top")}),!Je&&J&&(pe=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,re=pe.rgba>>8&16777215,me=50331648,Je=!0,b.selectionForeground&&(se=50331648,X=b.selectionForeground.rgba>>8&16777215,ke=b.selectionForeground)),Je&&W.push("xterm-decoration-top");let qe;switch(me){case 16777216:case 33554432:qe=b.ansi[re],W.push(`xterm-bg-${re}`);break;case 50331648:qe=Gt.toColor(re>>16,re>>8&255,re&255),this._addStyle(w,`background-color:#${NC((re>>>0).toString(16),"0",6)}`);break;case 0:default:Ce?(qe=b.foreground,W.push("xterm-bg-257")):qe=b.background}switch(pe||$.isDim()&&(pe=bt.multiplyOpacity(qe,.5)),se){case 16777216:case 33554432:$.isBold()&&X<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(X+=8),this._applyMinimumContrast(w,qe,b.ansi[X],$,pe,void 0)||W.push(`xterm-fg-${X}`);break;case 50331648:let Me=Gt.toColor(X>>16&255,X>>8&255,X&255);this._applyMinimumContrast(w,qe,Me,$,pe,ke)||this._addStyle(w,`color:#${NC(X.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,qe,b.foreground,$,pe,ke)||Ce&&W.push("xterm-fg-257")}W.length&&(w.className=W.join(" "),W.length=0),!A&&!U&&!Y&&O?C++:w.textContent=k,Z!==this.defaultSpacing&&(w.style.letterSpacing=`${Z}px`),m.push(w),F=K}return w&&C&&(w.textContent=k),m}_applyMinimumContrast(e,t,n,r,s,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||vF(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=bt.ensureContrastRatio(s||t,a||n,d),l.setColor((s||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};d_=Dt([_e(1,ET),_e(2,Hn),_e(3,os),_e(4,Go),_e(5,Eu),_e(6,_l)],d_);function NC(e,t,n){for(;e.length<n;)e=t+e;return e}var yF=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,r,s,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let a=this._holey.get(s);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(s,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},bF=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,a=t[1]-s,l=n[1]-s,u=Math.max(a,0),d=Math.min(l,e.rows-1);if(u>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=d,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function xF(){return new bF}var Hg="xterm-dom-renderer-owner-",Or="xterm-rows",cd="xterm-fg-",OC="xterm-bg-",_c="xterm-focus",ud="xterm-selection",SF=1,f_=class extends We{constructor(e,t,n,r,s,a,l,u,d,h,p,m,_,b){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=a,this._linkifier2=l,this._charSizeService=d,this._optionsService=h,this._bufferService=p,this._coreService=m,this._coreBrowserService=_,this._themeService=b,this._terminalClass=SF++,this._rowElements=[],this._selectionRenderModel=xF(),this.onRequestRedraw=this._register(new ve).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Or),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(ud),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=_F(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(d_,document),this._element.classList.add(Hg+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(St(()=>{this._element.classList.remove(Hg+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new yF(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Or} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Or} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Or} .xterm-dim { color: ${bt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Or}.${_c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Or}.${_c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Or}.${_c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Or} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Or} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Or} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Or} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Or} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${ud} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${ud} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${ud} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${cd}${a} { color: ${l.css}; }${this._terminalSelector} .${cd}${a}.xterm-dim { color: ${bt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${OC}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${cd}257 { color: ${bt.opaque(e.background).css}; }${this._terminalSelector} .${cd}257.xterm-dim { color: ${bt.multiplyOpacity(bt.opaque(e.background),.5).css}; }${this._terminalSelector} .${OC}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(_c),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(_c),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let d=e[0]>t[0];u.appendChild(this._createSelectionElement(a,d?t[0]:e[0],d?e[0]:t[0],l-a+1))}else{let d=r===a?e[0]:0,h=a===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,d,h));let p=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,p)),a!==l){let m=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,m))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${a}px`,s.style.width=`${l}px`,s}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=t;d++){let h=d+n.ydisp,p=this._rowElements[d],m=n.lines.get(h);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,h,h===r,l,u,s,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Hg}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,s,a){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,d=u.ybase+u.y,h=Math.min(u.x,s-1),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let S=b+u.ydisp,w=this._rowElements[b],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===d,m,_,h,p,this.dimensions.css.cell.width,this._widthCache,a?b===n?e:0:-1,a?(b===r?t:s)-1:-1))}}};f_=Dt([_e(7,nb),_e(8,If),_e(9,Hn),_e(10,In),_e(11,Go),_e(12,os),_e(13,_l)],f_);var p_=class extends We{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ve),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new CF(this._optionsService))}catch{this._measureStrategy=this._register(new wF(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};p_=Dt([_e(2,Hn)],p_);var qT=class extends We{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},wF=class extends qT{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},CF=class extends qT{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},kF=class extends We{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new EF(this._window)),this._onDprChange=this._register(new ve),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ve),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(kn.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Oe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Oe(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},EF=class extends We{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ll),this._onDprChange=this._register(new ve),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(St(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Oe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},RF=class extends We{constructor(){super(),this.linkProviders=[],this._register(St(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function ub(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),a=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-l]}function MF(e,t,n,r,s,a,l,u,d){if(!a)return;let h=ub(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(d?l/2:0))/l),h[1]=Math.ceil(h[1]/u),h[0]=Math.min(Math.max(h[0],1),r+(d?1:0)),h[1]=Math.min(Math.max(h[1],1),s),h}var m_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return MF(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=ub(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};m_=Dt([_e(0,as),_e(1,If)],m_);var TF=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},VT={};I7(VT,{getSafariVersion:()=>DF,isChromeOS:()=>XT,isFirefox:()=>KT,isIpad:()=>NF,isIphone:()=>OF,isLegacyEdge:()=>AF,isLinux:()=>hb,isMac:()=>rf,isNode:()=>Hf,isSafari:()=>GT,isWindows:()=>YT});var Hf=typeof process<"u"&&"title"in process,Ru=Hf?"node":navigator.userAgent,Mu=Hf?"node":navigator.platform,KT=Ru.includes("Firefox"),AF=Ru.includes("Edge"),GT=/^((?!chrome|android).)*safari/i.test(Ru);function DF(){if(!GT)return 0;let e=Ru.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var rf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Mu),NF=Mu==="iPad",OF=Mu==="iPhone",YT=["Windows","Win16","Win32","WinCE"].includes(Mu),hb=Mu.indexOf("Linux")>=0,XT=/\bCrOS\b/.test(Ru),ZT=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=s}this.clear()}},LF=class extends ZT{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},zF=class extends ZT{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},sf=!Hf&&"requestIdleCallback"in window?zF:LF,jF=class{constructor(){this._queue=new sf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},g_=class extends We{constructor(e,t,n,r,s,a,l,u,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new ll),this._pausedResizeTask=new jF,this._observerDisposable=this._register(new ll),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 ve),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ve),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ve),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ve),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new TF((h,p)=>this._renderRows(h,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new BF(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(St(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=St(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};g_=Dt([_e(2,Hn),_e(3,If),_e(4,Go),_e(5,Eu),_e(6,In),_e(7,os),_e(8,_l)],g_);var BF=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function PF(e,t,n,r){let s=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return FF(s,a,e,t,n,r)+Ff(a,t,n,r)+UF(s,a,e,t,n,r);let l;if(a===t)return l=s>e?"D":"C",iu(Math.abs(s-e),ru(l,r));l=a>t?"D":"C";let u=Math.abs(a-t),d=HF(a>t?e:s,n)+(u-1)*n.cols+1+IF(a>t?s:e);return iu(d,ru(l,r))}function IF(e,t){return e-1}function HF(e,t){return t.cols-e}function FF(e,t,n,r,s,a){return Ff(t,r,s,a).length===0?"":iu(JT(e,t,e,t-Fo(t,s),!1,s).length,ru("D",a))}function Ff(e,t,n,r){let s=e-Fo(e,n),a=t-Fo(t,n),l=Math.abs(s-a)-$F(e,t,n);return iu(l,ru(QT(e,t),r))}function UF(e,t,n,r,s,a){let l;Ff(t,r,s,a).length>0?l=r-Fo(r,s):l=t;let u=r,d=WF(e,t,n,r,s,a);return iu(JT(e,l,n,u,d==="C",s).length,ru(d,a))}function $F(e,t,n){var l;let r=0,s=e-Fo(e,n),a=t-Fo(t,n);for(let u=0;u<Math.abs(s-a);u++){let d=QT(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+d*u))!=null&&l.isWrapped&&r++}return r}function Fo(e,t){let n=0,r=t.buffer.lines.get(e),s=r==null?void 0:r.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),s=r==null?void 0:r.isWrapped;return n}function WF(e,t,n,r,s,a){let l;return Ff(n,r,s,a).length>0?l=r-Fo(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function QT(e,t){return e>t?"A":"B"}function JT(e,t,n,r,s,a){let l=e,u=t,d="";for(;(l!==n||u!==r)&&u>=0&&u<a.buffer.lines.length;)l+=s?1:-1,s&&l>a.cols-1?(d+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(d+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return d+a.buffer.translateBufferLineToString(u,!1,e,l)}function ru(e,t){let n=t?"O":"[";return ue.ESC+n+e}function iu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var qF=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function LC(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Fg=50,VF=15,KF=50,GF=500,YF=" ",XF=new RegExp(YF,"g"),v_=class extends We{constructor(e,t,n,r,s,a,l,u,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Hr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ve),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ve),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ve),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ve),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new qF(this._bufferService),this._activeSelectionMode=0,this._register(St(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,a);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(XF," ")).join(YT?`\r
463
+ `:`
464
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),hb&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,a;let n=(a=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:a.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=LC(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=ub(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Fg),Fg),t/=Fg,t/Math.abs(t)+Math.round(t*(VF-1)))}shouldForceSelection(e){return rf?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),KF)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(rf&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<GF&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=PF(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,a=s.lines.get(e[1]);if(!a)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),d=u,h=e[0]-u,p=0,m=0,_=0,b=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;d<l.length&&l.charAt(d+1)===" ";)d++}else{let C=e[0],k=e[0];a.getWidth(C)===0&&(p++,C--),a.getWidth(k)===2&&(m++,k++);let T=a.getString(k).length;for(T>1&&(b+=T-1,d+=T-1);C>0&&u>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<a.length&&d+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(b+=R-1,d+=R-1),d++,k++}}d++;let S=u+h-p+_,w=Math.min(this._bufferService.cols,d-u+p+m-_-b);if(!(!t&&l.slice(u,d).trim()==="")){if(n&&S===0&&a.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;S-=T,w+=T}}}if(r&&S+w===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(w+=k.length)}}return{start:S,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=LC(n,this._bufferService.cols)}};v_=Dt([_e(3,In),_e(4,Go),_e(5,rb),_e(6,Hn),_e(7,as),_e(8,os)],v_);var zC=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},jC=class{constructor(){this._color=new zC,this._css=new zC}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},en=Object.freeze((()=>{let e=[kt.toColor("#2e3436"),kt.toColor("#cc0000"),kt.toColor("#4e9a06"),kt.toColor("#c4a000"),kt.toColor("#3465a4"),kt.toColor("#75507b"),kt.toColor("#06989a"),kt.toColor("#d3d7cf"),kt.toColor("#555753"),kt.toColor("#ef2929"),kt.toColor("#8ae234"),kt.toColor("#fce94f"),kt.toColor("#729fcf"),kt.toColor("#ad7fa8"),kt.toColor("#34e2e2"),kt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Gt.toCss(r,s,a),rgba:Gt.toRgba(r,s,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Gt.toCss(r,r,r),rgba:Gt.toRgba(r,r,r)})}return e})()),To=kt.toColor("#ffffff"),Nc=kt.toColor("#000000"),BC=kt.toColor("#ffffff"),PC=Nc,yc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},ZF=To,__=class extends We{constructor(e){super(),this._optionsService=e,this._contrastCache=new jC,this._halfContrastCache=new jC,this._onChangeColors=this._register(new ve),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:To,background:Nc,cursor:BC,cursorAccent:PC,selectionForeground:void 0,selectionBackgroundTransparent:yc,selectionBackgroundOpaque:bt.blend(Nc,yc),selectionInactiveBackgroundTransparent:yc,selectionInactiveBackgroundOpaque:bt.blend(Nc,yc),scrollbarSliderBackground:bt.opacity(To,.2),scrollbarSliderHoverBackground:bt.opacity(To,.4),scrollbarSliderActiveBackground:bt.opacity(To,.5),overviewRulerBorder:To,ansi:en.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=dt(e.foreground,To),t.background=dt(e.background,Nc),t.cursor=bt.blend(t.background,dt(e.cursor,BC)),t.cursorAccent=bt.blend(t.background,dt(e.cursorAccent,PC)),t.selectionBackgroundTransparent=dt(e.selectionBackground,yc),t.selectionBackgroundOpaque=bt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=dt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=bt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?dt(e.selectionForeground,DC):void 0,t.selectionForeground===DC&&(t.selectionForeground=void 0),bt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=bt.opacity(t.selectionBackgroundTransparent,.3)),bt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=bt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=dt(e.scrollbarSliderBackground,bt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=dt(e.scrollbarSliderHoverBackground,bt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=dt(e.scrollbarSliderActiveBackground,bt.opacity(t.foreground,.5)),t.overviewRulerBorder=dt(e.overviewRulerBorder,ZF),t.ansi=en.slice(),t.ansi[0]=dt(e.black,en[0]),t.ansi[1]=dt(e.red,en[1]),t.ansi[2]=dt(e.green,en[2]),t.ansi[3]=dt(e.yellow,en[3]),t.ansi[4]=dt(e.blue,en[4]),t.ansi[5]=dt(e.magenta,en[5]),t.ansi[6]=dt(e.cyan,en[6]),t.ansi[7]=dt(e.white,en[7]),t.ansi[8]=dt(e.brightBlack,en[8]),t.ansi[9]=dt(e.brightRed,en[9]),t.ansi[10]=dt(e.brightGreen,en[10]),t.ansi[11]=dt(e.brightYellow,en[11]),t.ansi[12]=dt(e.brightBlue,en[12]),t.ansi[13]=dt(e.brightMagenta,en[13]),t.ansi[14]=dt(e.brightCyan,en[14]),t.ansi[15]=dt(e.brightWhite,en[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=dt(e.extendedAnsi[r],en[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};__=Dt([_e(0,Hn)],__);function dt(e,t){if(e!==void 0)try{return kt.toColor(e)}catch{}return t}var QF=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},JF=class{constructor(){this._services=new QF,this._services.set(nb,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=V7(e).sort((a,l)=>a.index-l.index),r=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},eU={trace:0,debug:1,info:2,warn:3,error:4,off:5},tU="xterm.js: ",y_=class extends We{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=eU[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":tU)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};y_=Dt([_e(0,Hn)],y_);var IC=class extends We{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ve),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ve),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ve),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ue=3,Kt=Object.freeze(new ku),hd=0,Ug=2,Oc=class eA{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ue);let s=n||Hr.fromCharData([0,yT,1,0]);for(let a=0;a<t;++a)this.setCell(a,s);this.length=t}get(t){let n=this._data[t*Ue+0],r=n&2097151;return[this._data[t*Ue+1],n&2097152?this._combined[t]:r?Fs(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Ue+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ue+0]=t|2097152|n[2]<<22):this._data[t*Ue+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ue+0]>>22}hasWidth(t){return this._data[t*Ue+0]&12582912}getFg(t){return this._data[t*Ue+1]}getBg(t){return this._data[t*Ue+2]}hasContent(t){return this._data[t*Ue+0]&4194303}getCodePoint(t){let n=this._data[t*Ue+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ue+0]&2097152}getString(t){let n=this._data[t*Ue+0];return n&2097152?this._combined[t]:n&2097151?Fs(n&2097151):""}isProtected(t){return this._data[t*Ue+2]&536870912}loadCell(t,n){return hd=t*Ue,n.content=this._data[hd+0],n.fg=this._data[hd+1],n.bg=this._data[hd+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Ue+0]=n.content,this._data[t*Ue+1]=n.fg,this._data[t*Ue+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ue+0]=n|r<<22,this._data[t*Ue+1]=s.fg,this._data[t*Ue+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*Ue+0];s&2097152?this._combined[t]+=Fs(n):s&2097151?(this._combined[t]=Fs(s&2097151)+Fs(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*Ue+0]=s}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let s=new Hr;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,s));for(let a=0;a<n;++a)this.setCell(t+a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new Hr;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,s));for(let a=this.length-n;a<this.length;++a)this.setCell(a,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*Ug<this._data.buffer.byteLength;let r=t*Ue;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Ug<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Ug<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new eA(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ue+0]&4194303)return t+(this._data[t*Ue+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ue+0]&4194303||this._data[t*Ue+2]&50331648)return t+(this._data[t*Ue+0]>>22);return 0}copyCellsFrom(t,n,r,s,a){let l=t._data;if(a)for(let d=s-1;d>=0;d--){for(let h=0;h<Ue;h++)this._data[(r+d)*Ue+h]=l[(n+d)*Ue+h];l[(n+d)*Ue+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}else for(let d=0;d<s;d++){for(let h=0;h<Ue;h++)this._data[(r+d)*Ue+h]=l[(n+d)*Ue+h];l[(n+d)*Ue+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}let u=Object.keys(t._combined);for(let d=0;d<u.length;d++){let h=parseInt(u[d],10);h>=n&&(this._combined[h-n+r]=t._combined[h])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let a="";for(;n<r;){let l=this._data[n*Ue+0],u=l&2097151,d=l&2097152?this._combined[n]:u?Fs(u):Ws;if(a+=d,s)for(let h=0;h<d.length;++h)s.push(n);n+=l>>22||1}return s&&s.push(n),a}};function nU(e,t,n,r,s,a){let l=[];for(let u=0;u<e.length-1;u++){let d=u,h=e.get(++d);if(!h.isWrapped)continue;let p=[e.get(u)];for(;d<e.length&&h.isWrapped;)p.push(h),h=e.get(++d);if(!a&&r>=u&&r<d){u+=p.length-1;continue}let m=0,_=su(p,m,t),b=1,S=0;for(;b<p.length;){let C=su(p,b,t),k=C-S,T=n-_,R=Math.min(k,T);p[m].copyCellsFrom(p[b],S,_,R,!1),_+=R,_===n&&(m++,_=0),S+=R,S===C&&(b++,S=0),_===0&&m!==0&&p[m-1].getWidth(n-1)===2&&(p[m].copyCellsFrom(p[m-1],n-1,_++,1,!1),p[m-1].setCell(n-1,s))}p[m].replaceCells(_,n,s);let w=0;for(let C=p.length-1;C>0&&(C>m||p[C].getTrimmedLength()===0);C--)w++;w>0&&(l.push(u+p.length-w),l.push(w)),u+=p.length-1}return l}function rU(e,t){let n=[],r=0,s=t[r],a=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:a}}function iU(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function sU(e,t,n){let r=[],s=e.map((d,h)=>su(e,h,t)).reduce((d,h)=>d+h),a=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}a+=n;let d=su(e,l,t);a>d&&(a-=d,l++);let h=e[l].getWidth(a-1)===2;h&&a--;let p=h?n-1:n;r.push(p),u+=p}return r}function su(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return r&&s?n-1:n}var tA=class nA{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=nA._nextId++,this._onDispose=this.register(new ve),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ho(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};tA._nextId=1;var oU=tA,rn={},Ao=rn.B;rn[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:"≥","{":"π","|":"≠","}":"£","~":"·"};rn.A={"#":"£"};rn.B=void 0;rn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};rn.C=rn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};rn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};rn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};rn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};rn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};rn.E=rn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};rn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};rn.H=rn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};rn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var HC=4294967295,FC=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Kt.clone(),this.savedCharset=Ao,this.markers=[],this._nullCell=Hr.fromCharData([0,yT,1,0]),this._whitespaceCell=Hr.fromCharData([0,Ws,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new sf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new IC(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new ef),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new ef),this._whitespaceCell}getBlankLine(e,t){return new Oc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>HC?HC:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Kt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new IC(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Kt),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Oc(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new Oc(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=nU(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Kt),n);if(r.length>0){let s=rU(this.lines,r);iU(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Kt),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Oc(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Kt),s=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let d=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),d.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=l&&R<l+d.length)continue}let h=d[d.length-1].getTrimmedLength(),p=sU(d,this._cols,e),m=p.length-d.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+m):_=Math.max(0,this.lines.length-this.lines.maxLength+m);let b=[];for(let R=0;R<m;R++){let D=this.getBlankLine(Kt,!0);b.push(D)}b.length>0&&(s.push({start:l+d.length+a,newLines:b}),a+=b.length),d.push(...b);let S=p.length-1,w=p[S];w===0&&(S--,w=p[S]);let C=d.length-m-1,k=h;for(;C>=0;){let R=Math.min(k,w);if(d[S]===void 0)break;if(d[S].copyCellsFrom(d[C],k-R,w-R,R,!0),w-=R,w===0&&(S--,w=p[S]),k-=R,k===0){C--;let D=Math.max(C,0);k=su(d,D,this._cols)}}for(let R=0;R<d.length;R++)p[R]<e&&d[R].setCell(p[R],r);let T=m-_;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let d=this.lines.length,h=d-1,p=0,m=s[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let _=0;for(let w=Math.min(this.lines.maxLength-1,d+a-1);w>=0;w--)if(m&&m.start>h+_){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(w--,m.newLines[C]);w++,l.push({index:h+1,amount:m.newLines.length}),_+=m.newLines.length,m=s[++p]}else this.lines.set(w,u[h--]);let b=0;for(let w=l.length-1;w>=0;w--)l[w].index+=b,this.lines.onInsertEmitter.fire(l[w]),b+=l[w].amount;let S=Math.max(0,d+a-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new oU(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},aU=class extends We{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ve),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 FC(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new FC(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},rA=2,iA=1,b_=class extends We{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ve),this.onResize=this._onResize.event,this._onScroll=this._register(new ve),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,rA),this.rows=Math.max(e.rawOptions.rows||0,iA),this.buffers=this._register(new aU(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};b_=Dt([_e(0,Hn)],b_);var Fa={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:rf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},lU=["normal","bold","100","200","300","400","500","600","700","800","900"],cU=class extends We{constructor(e){super(),this._onOptionChange=this._register(new ve),this.onOptionChange=this._onOptionChange.event;let t={...Fa};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(St(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Fa))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Fa))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Fa[e]),!uU(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Fa[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=lU.includes(t)?t:Fa[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function uU(e){return e==="block"||e==="underline"||e==="bar"}function Lc(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&Lc(e[r],t-1);return n}var UC=Object.freeze({insertMode:!1}),$C=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),x_=class extends We{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ve),this.onData=this._onData.event,this._onUserInput=this._register(new ve),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ve),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ve),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Lc(UC),this.decPrivateModes=Lc($C)}reset(){this.modes=Lc(UC),this.decPrivateModes=Lc($C)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};x_=Dt([_e(0,In),_e(1,CT),_e(2,Hn)],x_);var WC={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function $g(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Wg=String.fromCharCode,qC={DEFAULT:e=>{let t=[$g(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Wg(t[0])}${Wg(t[1])}${Wg(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${$g(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${$g(e,!0)};${e.x};${e.y}${t}`}},S_=class extends We{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ve),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(WC))this.addProtocol(r,WC[r]);for(let r of Object.keys(qC))this.addEncoding(r,qC[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=r+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};S_=Dt([_e(0,In),_e(1,Go),_e(2,Hn)],S_);var qg=[[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]],hU=[[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]],tn;function dU(e,t){let n=0,r=t.length-1,s;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(s=n+r>>1,e>t[s][1])n=s+1;else if(e<t[s][0])r=s-1;else return!0;return!1}var fU=class{constructor(){if(this.version="6",!tn){tn=new Uint8Array(65536),tn.fill(1),tn[0]=0,tn.fill(0,1,32),tn.fill(0,127,160),tn.fill(2,4352,4448),tn[9001]=2,tn[9002]=2,tn.fill(2,11904,42192),tn[12351]=1,tn.fill(2,44032,55204),tn.fill(2,63744,64256),tn.fill(2,65040,65050),tn.fill(2,65072,65136),tn.fill(2,65280,65377),tn.fill(2,65504,65511);for(let e=0;e<qg.length;++e)tn.fill(0,qg[e][0],qg[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?tn[e]:dU(e,hU)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let s=No.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return No.createPropertyValue(0,n,r)}},No=class jd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ve,this.onChange=this._onChange.event;let t=new fU;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,s=t.length;for(let a=0;a<s;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=s)return n+this.wcwidth(l);let h=t.charCodeAt(a);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let u=this.charProperties(l,r),d=jd.extractWidth(u);jd.extractShouldJoin(u)&&(d-=jd.extractWidth(r)),n+=d,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},pU=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function VC(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var bc=2147483647,mU=256,sA=class w_{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>mU)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new w_;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let a=0;a<s.length;++a)n.addSubParam(s[a]);else n.addParam(s)}return n}clone(){let t=new w_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>bc?bc:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>bc?bc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&(t[n]=this._subParams.slice(r,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,s=r[n-1];r[n-1]=~s?Math.min(s*10+t,bc):t}},xc=[],gU=class{constructor(){this._state=0,this._active=xc,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=xc}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=xc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||xc,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",Pf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=xc,this._id=-1,this._state=0}}},pr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Pf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},Sc=[],vU=class{constructor(){this._handlers=Object.create(null),this._active=Sc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Sc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Sc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Sc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",Pf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Sc,this._ident=0}},zc=new sA;zc.addParam(0);var KC=class{constructor(e){this._handler=e,this._data="",this._params=zc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():zc,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Pf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=zc,this._data="",this._hitLimit=!1,n));return this._params=zc,this._data="",this._hitLimit=!1,t}},_U=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|r}},Br=160,yU=(function(){let e=new _U(4095),t=Array.apply(null,Array(256)).map((u,d)=>d),n=(u,d)=>t.slice(u,d),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let a=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Br,0,2,0),e.add(Br,8,5,8),e.add(Br,6,0,6),e.add(Br,11,0,11),e.add(Br,13,13,13),e})(),bU=class extends We{constructor(e=yU){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new sA,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(St(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new gU),this._dcsParser=this._register(new vU),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let a=e.intermediates.charCodeAt(s);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Br)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Br){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Br){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Br){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Br){this._printHandler(e,u,_),u=_-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|r],h=d?d.length-1:-1;for(;h>=0&&(l=d[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._preserveStack(3,d,h,s,u),l;h<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let p=this._escHandlers[this._collect<<8|r],m=p?p.length-1:-1;for(;m>=0&&(l=p[m](),l!==!0);m--)if(l instanceof Promise)return this._preserveStack(4,p,m,s,u),l;m<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let _=u+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Br){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,u),l;r===27&&(s|=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 _=u+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Br){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},xU=/^([\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})$/,SU=/^[\da-f]+$/;function GC(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=xU.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),SU.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let a=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return r}}function Vg(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function wU(e,t=16){let[n,r,s]=e;return`rgb:${Vg(n,t)}/${Vg(r,t)}/${Vg(s,t)}`}var CU={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Bs=131072,YC=10;function XC(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ZC=5e3,QC=0,kU=class extends We{constructor(e,t,n,r,s,a,l,u,d=new bU){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new W7,this._utf8Decoder=new q7,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Kt.clone(),this._eraseAttrDataInternal=Kt.clone(),this._onRequestBell=this._register(new ve),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ve),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ve),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ve),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ve),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ve),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ve),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ve),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ve),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ve),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ve),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ve),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ve),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 C_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:p.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:p,data:m})}),this._parser.setDcsHandlerFallback((h,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:p,payload:m})}),this._parser.setPrintHandler((h,p,m)=>this.print(h,p,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(ue.BEL,()=>this.bell()),this._parser.setExecuteHandler(ue.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ue.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ue.BS,()=>this.backspace()),this._parser.setExecuteHandler(ue.HT,()=>this.tab()),this._parser.setExecuteHandler(ue.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ue.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ld.IND,()=>this.index()),this._parser.setExecuteHandler(Ld.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ld.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new pr(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new pr(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new pr(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new pr(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new pr(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new pr(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new pr(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new pr(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new pr(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new pr(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new pr(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new pr(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in rn)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new KC((h,p)=>this.requestStatusString(h,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),ZC))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ZC} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Bs&&(a=this._parseStack.position+Bs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Bs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Bs))),l||this._dirtyRowTracker.clearRange(),e.length>Bs)for(let h=a;h<e.length;h+=Bs){let p=h+Bs<e.length?h+Bs:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(h,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,s,m,h),this._logSlowResolvingAsync(n),n}else if(!l){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,h))return this._preserveStack(r,s,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let b=t;b<n;++b){if(r=e[b],r<127&&a){let k=a[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=No.extractWidth(S);let w=No.extractShouldJoin(S),C=w?No.extractWidth(_):0;if(_=S,l&&this._onA11yChar.fire(Fs(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(d){let k=m,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&m instanceof Oc&&m.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=u-1,s===2)continue}if(w&&this._activeBuffer.x){let k=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let T=s-C;--T>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(h&&(m.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(p)),m.getWidth(u-1)===2&&m.setCellFromCodepoint(u-1,0,1,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,s,p),s>0)for(;--s;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>XC(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new KC(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new pr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,s=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Kt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=No.extractWidth(t),s=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(a.length*n),u=0;for(let h=0;h<a.length;){let p=a.codePointAt(h)||0;l[u++]=p,h+=p>65535?2:1}let d=u;for(let h=1;h<n;++h)l.copyWithin(d,0,u),d+=u;return this.print(l,0,d),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ue.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ue.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ue.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ue.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ue.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Ao),this._charsetService.setgCharset(1,Ao),this._charsetService.setgCharset(2,Ao),this._charsetService.setgCharset(3,Ao);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:h,alt:p}=u,m=this._optionsService.rawOptions,_=(w,C)=>(l.triggerDataEvent(`${ue.ESC}[${t?"":"?"}${w};${C}$y`),!0),b=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,b(l.modes.insertMode)):S===12?_(S,3):S===20?_(S,b(m.convertEol)):_(S,0):S===1?_(S,b(r.applicationCursorKeys)):S===3?_(S,m.windowOptions.setWinLines?d===80?2:d===132?1:0:0):S===6?_(S,b(r.origin)):S===7?_(S,b(r.wraparound)):S===8?_(S,3):S===9?_(S,b(s==="X10")):S===12?_(S,b(m.cursorBlink)):S===25?_(S,b(!l.isCursorHidden)):S===45?_(S,b(r.reverseWraparound)):S===66?_(S,b(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,b(s==="VT200")):S===1002?_(S,b(s==="DRAG")):S===1003?_(S,b(s==="ANY")):S===1004?_(S,b(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,b(a==="SGR")):S===1015?_(S,4):S===1016?_(S,b(a==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,b(h===p)):S===2004?_(S,b(r.bracketedPasteMode)):S===2026?_(S,b(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=ku.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,a=0;do{if(r[a+s]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do r[1]===5&&(s=1),r[a+u+1+s]=l[u];while(++u<l.length&&u+a+1+s<r.length);break}if(r[1]===5&&a+s>=2||r[1]===2&&a+s>=5)break;r[1]&&(s=1)}while(++a+t<e.length&&a+s<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Kt.fg,e.bg=Kt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Kt.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Kt.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Kt.fg&16777215,r.bg&=-67108864,r.bg|=Kt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ue.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ue.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Kt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!XC(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ue.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>YC&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>YC&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(JC(a))if(s==="?")t.push({type:0,index:a});else{let l=GC(s);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(a=>a.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=GC(n[r]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let s=parseInt(n[r]);JC(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Ao),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(CU[e[0]],rn[e[1]]||Ao),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Kt.clone(),this._eraseAttrDataInternal=Kt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Hr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${ue.ESC}${l}${ue.ESC}\\`),!0),r=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},C_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(QC=e,e=t,t=QC),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};C_=Dt([_e(0,In)],C_);function JC(e){return 0<=e&&e<256}var EU=5e7,e2=12,RU=50,MU=class extends We{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ve),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>EU)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let l=u=>performance.now()-n>=e2?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=e2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>RU&&(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()}},k_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),d={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(d,u)),this._dataByLinkId.set(d.id,d),d.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};k_=Dt([_e(0,In)],k_);var t2=!1,TU=class extends We{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ll),this._onBinary=this._register(new ve),this.onBinary=this._onBinary.event,this._onData=this._register(new ve),this.onData=this._onData.event,this._onLineFeed=this._register(new ve),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ve),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ve),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ve),this._instantiationService=new JF,this.optionsService=this._register(new cU(e)),this._instantiationService.setService(Hn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(b_)),this._instantiationService.setService(In,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(y_)),this._instantiationService.setService(CT,this._logService),this.coreService=this._register(this._instantiationService.createInstance(x_)),this._instantiationService.setService(Go,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(S_)),this._instantiationService.setService(wT,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(No)),this._instantiationService.setService(Y7,this.unicodeService),this._charsetService=this._instantiationService.createInstance(pU),this._instantiationService.setService(G7,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k_),this._instantiationService.setService(kT,this._oscLinkService),this._inputHandler=this._register(new kU(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(kn.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(kn.forward(this._bufferService.onResize,this._onResize)),this._register(kn.forward(this.coreService.onData,this._onData)),this._register(kn.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new MU((t,n)=>this._inputHandler.parse(t,n))),this._register(kn.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ve),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!t2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),t2=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,rA),t=Math.max(t,iA),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(VC.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(VC(this._bufferService),!1))),this._windowsWrappingHeuristics.value=St(()=>{for(let t of e)t.dispose()})}}},AU={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function DU(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=ue.ESC+"OA":s.key=ue.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ue.ESC+"OD":s.key=ue.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ue.ESC+"OC":s.key=ue.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ue.ESC+"OB":s.key=ue.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ue.DEL,e.altKey&&(s.key=ue.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ue.ESC+"[Z";break}s.key=ue.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ue.ESC+ue.CR:ue.CR,s.cancel=!0;break;case 27:s.key=ue.ESC,e.altKey&&(s.key=ue.ESC+ue.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"D":t?s.key=ue.ESC+"OD":s.key=ue.ESC+"[D";break;case 39:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"C":t?s.key=ue.ESC+"OC":s.key=ue.ESC+"[C";break;case 38:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"A":t?s.key=ue.ESC+"OA":s.key=ue.ESC+"[A";break;case 40:if(e.metaKey)break;a?s.key=ue.ESC+"[1;"+(a+1)+"B":t?s.key=ue.ESC+"OB":s.key=ue.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ue.ESC+"[2~");break;case 46:a?s.key=ue.ESC+"[3;"+(a+1)+"~":s.key=ue.ESC+"[3~";break;case 36:a?s.key=ue.ESC+"[1;"+(a+1)+"H":t?s.key=ue.ESC+"OH":s.key=ue.ESC+"[H";break;case 35:a?s.key=ue.ESC+"[1;"+(a+1)+"F":t?s.key=ue.ESC+"OF":s.key=ue.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ue.ESC+"[5;"+(a+1)+"~":s.key=ue.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ue.ESC+"[6;"+(a+1)+"~":s.key=ue.ESC+"[6~";break;case 112:a?s.key=ue.ESC+"[1;"+(a+1)+"P":s.key=ue.ESC+"OP";break;case 113:a?s.key=ue.ESC+"[1;"+(a+1)+"Q":s.key=ue.ESC+"OQ";break;case 114:a?s.key=ue.ESC+"[1;"+(a+1)+"R":s.key=ue.ESC+"OR";break;case 115:a?s.key=ue.ESC+"[1;"+(a+1)+"S":s.key=ue.ESC+"OS";break;case 116:a?s.key=ue.ESC+"[15;"+(a+1)+"~":s.key=ue.ESC+"[15~";break;case 117:a?s.key=ue.ESC+"[17;"+(a+1)+"~":s.key=ue.ESC+"[17~";break;case 118:a?s.key=ue.ESC+"[18;"+(a+1)+"~":s.key=ue.ESC+"[18~";break;case 119:a?s.key=ue.ESC+"[19;"+(a+1)+"~":s.key=ue.ESC+"[19~";break;case 120:a?s.key=ue.ESC+"[20;"+(a+1)+"~":s.key=ue.ESC+"[20~";break;case 121:a?s.key=ue.ESC+"[21;"+(a+1)+"~":s.key=ue.ESC+"[21~";break;case 122:a?s.key=ue.ESC+"[23;"+(a+1)+"~":s.key=ue.ESC+"[23~";break;case 123:a?s.key=ue.ESC+"[24;"+(a+1)+"~":s.key=ue.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=ue.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ue.DEL:e.keyCode===219?s.key=ue.ESC:e.keyCode===220?s.key=ue.FS:e.keyCode===221&&(s.key=ue.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=AU[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ue.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let d=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(d);e.shiftKey&&(h=h.toUpperCase()),s.key=ue.ESC+h}else if(e.keyCode===32)s.key=ue.ESC+(e.ctrlKey?ue.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),s.key=ue.ESC+d,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=ue.US),e.key==="@"&&(s.key=ue.NUL));break}return s}var Bt=0,NU=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new sf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new sf,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,a)=>this._getKey(s)-this._getKey(a)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Bt=this._search(t),Bt===-1)||this._getKey(this._array[Bt])!==t)return!1;do if(this._array[Bt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Bt),!0;while(++Bt<this._array.length&&this._getKey(this._array[Bt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,a)=>s-a),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Bt=this._search(e),!(Bt<0||Bt>=this._array.length)&&this._getKey(this._array[Bt])===e))do yield this._array[Bt];while(++Bt<this._array.length&&this._getKey(this._array[Bt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Bt=this._search(e),!(Bt<0||Bt>=this._array.length)&&this._getKey(this._array[Bt])===e))do t(this._array[Bt]);while(++Bt<this._array.length&&this._getKey(this._array[Bt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Kg=0,n2=0,OU=class extends We{constructor(){super(),this._decorations=new NU(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ve),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ve),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(St(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new LU(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,s=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,s=r+(a.options.width??1),e>=r&&e<s&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{Kg=s.options.x??0,n2=Kg+(s.options.width??1),e>=Kg&&e<n2&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},LU=class extends Vs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ve),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ve),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=kt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=kt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},zU=1e3,jU=class{constructor(e,t=zU){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,a=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},r2=20,of=class extends We{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new jU(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
465
+ `))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Oe(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(St(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<r2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
466
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===r2+1&&(this._liveRegion.textContent+=qv.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let a=n.lines.get(n.ydisp+s),l=[],u=(a==null?void 0:a.translateToString(!0,void 0,void 0,l))||"",d=(n.ydisp+s+1).toString(),h=this._rowElements[s];h&&(u.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=u,this._rowColumns.set(h,l)),h.setAttribute("aria-posinset",d),h.setAttribute("aria-setsize",r),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===a||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let s=({node:d,offset:h})=>{let p=d instanceof Text?d.parentNode:d,m=parseInt(p==null?void 0:p.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(p);if(!_)return console.warn("columns is null. Race condition?"),null;let b=h<_.length?_[h]:_.slice(-1)[0]+1;return b>=this._terminal.cols&&(++m,b=0),{row:m,column:b}},a=s(t),l=s(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var s,a;e.style.transform="";let t=e.getBoundingClientRect().width,n=(a=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:a[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};of=Dt([_e(1,nb),_e(2,os),_e(3,as)],of);var E_=class extends We{constructor(e,t,n,r,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ve),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ve),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(St(()=>{var a;Ho(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Oe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Oe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Oe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Oe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[a,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):l.provideLinks(e.y,u=>{var h,p;if(this._isMouseOut)return;let d=u==null?void 0:u.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(a,d),n=this._checkLinkProviderResult(a,e,n),((p=this._activeProviderReplies)==null?void 0:p.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let a=0;a<s.length;a++){let l=s[a],u=l.link.range.start.y<e?0:l.link.range.start.x,d=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let h=u;h<=d;h++){if(n.has(h)){s.splice(a--,1);break}n.add(h)}}}}_checkLinkProviderResult(e,t,n){var a;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(s=!0);if(!s&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(a=this._activeProviderReplies.get(l))==null?void 0:a.find(d=>this._linkAtPosition(d.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&BU(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ho(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,a;(r=this._currentLink)!=null&&r.state&&((a=(s=this._currentLink)==null?void 0:s.state)==null?void 0:a.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};E_=Dt([_e(1,rb),_e(2,as),_e(3,In),_e(4,RT)],E_);function BU(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var PU=class extends TU{constructor(e={}){super(e),this._linkifier=this._register(new ll),this.browser=VT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ll),this._onCursorMove=this._register(new ve),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ve),this.onKey=this._onKey.event,this._onRender=this._register(new ve),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ve),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ve),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ve),this.onBell=this._onBell.event,this._onFocus=this._register(new ve),this._onBlur=this._register(new ve),this._onA11yCharEmitter=this._register(new ve),this._onA11yTabEmitter=this._register(new ve),this._onWillOpen=this._register(new ve),this._setup(),this._decorationService=this._instantiationService.createInstance(OU),this._instantiationService.setService(Eu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(RF),this._instantiationService.setService(RT,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Kv)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(kn.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(kn.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(kn.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(kn.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(St(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=bt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ue.ESC}]${r};${wU(s)}${WT.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=Gt.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=Gt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(of,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ue.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Oe(this.element,"copy",t=>{this.hasSelection()&&U7(t,this._selectionService)}));let e=t=>$7(t,this.textarea,this.coreService,this.optionsService);this._register(Oe(this.textarea,"paste",e)),this._register(Oe(this.element,"paste",e)),KT?this._register(Oe(this.element,"mousedown",t=>{t.button===2&&fC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Oe(this.element,"contextmenu",t=>{fC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),hb&&this._register(Oe(this.element,"auxclick",t=>{t.button===1&&_T(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Oe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Oe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Oe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Oe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Oe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Oe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Oe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((s=this.element)==null?void 0:s.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Oe(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Wv.get()),XT||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(kF,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(os,this._coreBrowserService),this._register(Oe(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Oe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p_,this._document,this._helperContainer),this._instantiationService.setService(If,this._charSizeService),this._themeService=this._instantiationService.createInstance(__),this._instantiationService.setService(_l,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(nf),this._instantiationService.setService(ET,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(g_,this.rows,this.screenElement)),this._instantiationService.setService(as,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(m_),this._instantiationService.setService(rb,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(E_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(c_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(v_,this.element,this.screenElement,r)),this._instantiationService.setService(Z7,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(kn.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(u_,this.screenElement)),this._register(Oe(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(of,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(tf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(tf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){var h,p,m,_,b;let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,d;switch(a.overrideType||a.type){case"mousemove":d=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":d=0,u=a.button<3?a.button:3;break;case"mousedown":d=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let S=a.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(a,(_=(m=(p=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:p.device)==null?void 0:m.cell)==null?void 0:_.height,(b=e._coreBrowserService)==null?void 0:b.dpr)===0)return!1;d=S<0?0:1,u=4;break;default:return!1}return d===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:d,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Oe(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Oe(t,"wheel",a=>{var l,u,d,h,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(h=(d=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:d.cell)==null?void 0:h.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(a,!0);let m=ue.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){vT(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=DU(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ue.ETX||n.key===ue.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(IU(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Kt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ue.ESC+"[I"):this.coreService.triggerDataEvent(ue.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ue.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function IU(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var HU=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},FU=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Hr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},i2=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new FU(t)}getNullCell(){return new Hr}},UU=class extends We{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ve),this.onBufferChange=this._onBufferChange.event,this._normal=new i2(this._core.buffers.normal,"normal"),this._alternate=new i2(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)}},$U=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},WU=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},qU=["cols","rows"],ui=0,VU=class extends We{constructor(e){super(),this._core=this._register(new PU(e)),this._addonManager=this._register(new HU),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,s)=>{this._checkReadonlyOptions(r),this._core.options[r]=s};for(let r in this._core.options){let s={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,s)}}_checkReadonlyOptions(e){if(qU.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new $U(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new WU(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 UU(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
467
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Wv.get()},set promptLabel(e){Wv.set(e)},get tooMuchOutput(){return qv.get()},set tooMuchOutput(e){qv.set(e)}}}_verifyIntegers(...e){for(ui of e)if(ui===1/0||isNaN(ui)||ui%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ui of e)if(ui&&(ui===1/0||isNaN(ui)||ui%1!==0||ui<0))throw new Error("This API only accepts positive integers")}};const oA="lever-theme",aA=x.createContext(void 0),KU=e=>e==="light"||e==="dark"||e==="system",lA=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s2=e=>{if(typeof document>"u")return;const t=e==="system"?lA():e;document.documentElement.classList.toggle("dark",t==="dark")},GU=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(oA);return KU(e)?e:"system"};function YU({children:e}){const[t,n]=x.useState(GU);x.useEffect(()=>{s2(t),typeof window<"u"&&window.localStorage.setItem(oA,t)},[t]),x.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>s2("system");return s.addEventListener?(s.addEventListener("change",a),()=>s.removeEventListener("change",a)):(s.addListener(a),()=>s.removeListener(a))},[t]);const r=x.useMemo(()=>{const s=t==="system"?lA():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return v.jsx(aA.Provider,{value:r,children:e})}function cA(){const e=x.useContext(aA);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const XU={foreground:"#0f172a",background:"transparent",cursor:"#000000",cursorAccent:"#ffffff",selectionBackground:"rgba(221,228,236,0.55)",selectionInactiveBackground:"rgba(221,228,236,0.38)",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#94a3b8",brightBlack:"#475569",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#e2e8f0"},ZU={foreground:"#f8fafc",background:"transparent",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"rgba(248,250,252,0.28)",selectionInactiveBackground:"rgba(248,250,252,0.18)",black:"#0f172a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#cbd5e1",brightBlack:"#64748b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f8fafc"};function uA(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function hA(e,t){var S,w,C,k,T;const n=e.element,r=(k=(C=(w=(S=e._core)==null?void 0:S._renderService)==null?void 0:w.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,a=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(a)||s<=0||a<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),d=window.getComputedStyle(n),h=e.options.scrollback===0?0:((T=e.options.overviewRuler)==null?void 0:T.width)??14,p=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(d.paddingLeft)+parseFloat(d.paddingRight),m=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(d.paddingTop)+parseFloat(d.paddingBottom),_=Math.max(0,l.width-p-h-1),b=Math.max(0,l.height-m);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(b/a))}}function dd(e){e.refresh(0,Math.max(0,e.rows-1))}function fd(e,t,n,r,s){const a=hA(e,t)??uA(e);return n.current&&n.current.cols===a.cols&&n.current.rows===a.rows||(e.resize(a.cols,a.rows),n.current=a,r&&s(a.cols,a.rows)),a}function QU({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:a=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:d}=cA(),h=x.useRef(null),p=x.useRef(null),m=x.useRef(null),_=x.useRef(!1),b=x.useRef(0),S=x.useRef(null),w=x.useRef(null),[C,k]=x.useState(null),[T,R]=x.useState(null),D=d==="dark"?ZU:XU,z=(j,I)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:I}).catch(()=>{})},L=()=>{const j=()=>{const I=p.current,Z=h.current;!I||!Z||!_.current||fd(I,Z,w,!0,z)};requestAnimationFrame(()=>{j(),setTimeout(j,0)})};return x.useEffect(()=>{const j=new VU({scrollback:r,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,lineHeight:1.1,convertEol:!1,allowTransparency:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,theme:D}),I=new A7;j.loadAddon(I),j.loadAddon(new B7),p.current=j;const Z=h.current;Z&&(j.open(Z),m.current&&j.write(m.current),fd(j,Z,w,!1,()=>{}),dd(j),L());const P=j.onData(F=>{n.command({type:"terminal.input",terminalId:t,data:F}).catch(V=>{R(V instanceof Error?V.message:String(V))})}),W=j.onResize(({cols:F,rows:V})=>{if(!_.current)return;const U={cols:F,rows:V};w.current&&w.current.cols===F&&w.current.rows===V||(w.current=U,z(F,V))}),H=new ResizeObserver(()=>{const F=p.current,V=h.current;!F||!V||fd(F,V,w,_.current,(U,O)=>{n.command({type:"terminal.resize",terminalId:t,cols:U,rows:O}).catch(()=>{})})});return Z&&H.observe(Z),()=>{H.disconnect(),W.dispose(),P.dispose(),m.current=I.serialize(),j.dispose(),p.current=null}},[r,n,t,D]),x.useEffect(()=>{const j=p.current;j&&(j.options.scrollback=r)},[r]),x.useEffect(()=>{const j=p.current;j&&(j.options.theme=D,dd(j))},[D]),x.useEffect(()=>{if(l===0)return;const j=p.current;j&&requestAnimationFrame(()=>{j.focus()})},[l]),x.useEffect(()=>{if(a===0)return;const j=p.current;j&&(_.current=!1,b.current+=1,S.current=null,m.current=null,k(null),R(null),j.reset(),dd(j),n.command({type:"terminal.close",terminalId:t}).catch(I=>{R(I instanceof Error?I.message:String(I))}))},[a,n,t]),x.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),x.useEffect(()=>{const j=P=>{const W=p.current;if(!W)return;const H=JSON.stringify({cwd:P.cwd,shell:P.shell,cols:P.cols,rows:P.rows,scrollback:P.scrollback,status:P.status,exitCode:P.exitCode,serializedState:P.serializedState});if(S.current===H){k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),m.current=P.serializedState||null;return}S.current=H,k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),m.current=P.serializedState||null,W.options.scrollback=P.scrollback,W.reset(),P.serializedState&&W.write(P.serializedState),dd(W)},I=()=>{const P=p.current,W=h.current;if(!P||!W)return;const H=hA(P,W)??uA(P);P.resize(H.cols,H.rows),w.current=H,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:H.cols,rows:H.rows,scrollback:r}).then(F=>{_.current=!0,R(null),F&&j(F),L()}).catch(F=>{R(F instanceof Error?F.message:String(F))})},Z=()=>{const P=++b.current,W=()=>{if(b.current!==P)return;const H=p.current,F=h.current;if(!H||!F)return;fd(H,F,w,!1,()=>{});const V=F.getBoundingClientRect();if(V.width<=0||V.height<=0){requestAnimationFrame(W);return}I()};requestAnimationFrame(()=>{requestAnimationFrame(W)})};return Z(),n.subscribeTerminal(t,{onSnapshot:P=>{if(!P){_.current=!1,S.current=null,s==="connected"&&Z();return}_.current=!0,R(null),j(P),L()},onEvent:P=>{const W=p.current;if(W){if(P.type==="terminal.output"){W.write(P.data);return}P.type==="terminal.exit"&&k(H=>({cwd:(H==null?void 0:H.cwd)??"",shell:(H==null?void 0:H.shell)??"",status:"exited",exitCode:P.exitCode}))}}})},[s,e,r,n,t]),v.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[v.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:v.jsx("div",{ref:h,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),T?v.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",T]}):null]})}const JU=24;function dA(e){return e+JU}function e$(e,t){return Math.max(1,e)*dA(t)}function t$({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:a,focusRequestVersion:l=0,onAddTerminal:u,onRemoveTerminal:d,onTerminalLayout:h}){const p=x.useRef(null),m=x.useRef({}),_=x.useRef([]),[b,S]=x.useState(0),[w,C]=x.useState({}),[k,T]=x.useState({});x.useLayoutEffect(()=>{const I=p.current;if(!I)return;const Z=()=>{S(I.getBoundingClientRect().width)},P=new ResizeObserver(Z);return P.observe(I),Z(),()=>P.disconnect()},[]);const R=t.terminals.length,D=dA(a),z=e$(R,a),L=Math.max(b,z),j=x.useMemo(()=>t.terminals.map(I=>I.id).join(":"),[t.terminals]);return x.useLayoutEffect(()=>{const I=_.current,Z=t.terminals.map(H=>H.id),P=Z.find(H=>!I.includes(H));if(_.current=Z,!P||I.length===0)return;const W=m.current[P];W&&W.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),v.jsx("div",{className:"flex h-full min-h-0 flex-col",children:v.jsx("div",{ref:p,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:v.jsx("div",{className:"h-full min-h-0",style:{width:L||"100%"},children:v.jsx(hT,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:I=>h(e,t.terminals.map(Z=>I[Z.id]??Z.size)),children:t.terminals.map((I,Z)=>v.jsxs(x.Fragment,{children:[v.jsx($v,{id:I.id,defaultSize:`${I.size}%`,minSize:`${D}px`,className:"min-h-0 overflow-hidden",style:{minWidth:D},children:v.jsxs("div",{ref:P=>{m.current[I.id]=P},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:D},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[v.jsx("div",{className:"min-w-0 flex-1 text-left",children:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),v.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:w[I.id]??""})]})}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>T(P=>({...P,[I.id]:(P[I.id]??0)+1})),children:v.jsx(Hz,{className:"size-3.5"})}),v.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>u(e,I.id),children:v.jsx(cy,{className:"size-3.5"})}),v.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,I.id),children:v.jsx(fu,{className:"size-3.5"})})]})]}),v.jsx(QU,{projectId:e,terminalId:I.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:k[I.id]??0,focusRequestVersion:Z===0?l:0,onPathChange:P=>C(W=>W[I.id]===P?W:{...W,[I.id]:P})})]})}),Z<t.terminals.length-1?v.jsx(dT,{withHandle:!0,orientation:"horizontal"}):null]},I.id))},j)})})})}function o2(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function n$(e){var r;if(!e)return null;const t=e.trim();if(!t||/^(https?:|mailto:|ftp:|file:)/i.test(t)||!t.startsWith("/"))return null;const n=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(t);return(r=n==null?void 0:n.groups)!=null&&r.path?{path:n.groups.path,line:o2(n.groups.line),column:o2(n.groups.column)}:{path:t}}function Gg(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}const R_={Task:Fd,TaskOutput:Fd,Bash:hy,Glob:kg,Grep:kg,ExitPlanMode:fw,Read:Vz,Edit:Uz,Write:Wz,NotebookEdit:OE,WebFetch:cz,TodoWrite:Sz,WebSearch:kg,KillShell:D6,AskUserQuestion:DE,Skill:tl,EnterPlanMode:fw},fA=j6;function pA(e){return R_[e]?R_[e]:fA}function to({children:e,className:t}){return v.jsx("div",{className:ye("flex gap-3 justify-start items-center",t),children:e})}function r$({children:e,className:t}){return v.jsx("div",{className:ye("flex items-center gap-1.5 text-xs",t),children:e})}function Xs({children:e,className:t}){return v.jsx("span",{className:ye("font-medium text-foreground/80",t),children:e})}function i$({children:e}){return v.jsx("span",{className:"text-muted-foreground",children:e})}function Uf({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=x.useState(n);return v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsxs("button",{onClick:()=>s(!r),className:`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${r?"":"hover:opacity-60 transition-opacity"}`,children:[v.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),v.jsx(ts,{className:`h-4.5 w-4.5 text-muted-icon translate-y-[0.5px] transition-all duration-200 opacity-0 group-hover/expandable-row:opacity-100 ${r?"rotate-90 opacity-100":""}`})]}),r&&t]})}function a2({label:e,children:t,copyText:n}){const[r,s]=x.useState(!1),a=n??af(t),l=x.useCallback(async()=>{await navigator.clipboard.writeText(a),s(!0),setTimeout(()=>s(!1),2e3)},[a]);return v.jsxs("div",{children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:e}),v.jsxs("div",{className:"relative group/codeblock",children:[v.jsx("pre",{className:"my-1 text-xs font-mono whitespace-no-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto w-full",children:t}),v.jsx(et,{variant:"ghost",size:"icon",className:ye("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:r?v.jsx(zo,{className:"h-3.5 w-3.5 text-green-400"}):v.jsx(wf,{className:"h-4 w-4"})})]})]})}function mA({children:e,icon:t,className:n}){return v.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&v.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function $f({children:e,className:t}){return v.jsxs("div",{className:ye("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[v.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:v.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),v.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function af(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(af).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return af(t.children)}return""}function l2(e,t){return x.isValidElement(e)?x.cloneElement(e,{className:ye(e.props.className,t)}):e}const s$={h1:({children:e})=>v.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>v.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>v.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>v.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>v.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>v.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),pre:({children:e,...t})=>{const[n,r]=x.useState(!1),s=af(e),a=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return v.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[v.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),v.jsx(et,{variant:"ghost",size:"icon",className:ye("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:a,children:n?v.jsx(zo,{className:"h-4 w-4 text-green-400"}):v.jsx(wf,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?v.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):v.jsx("code",{className:"break-all px-1 bg-border/60 dark:[.no-pre-highlight_&]:bg-background dark:[.text-pretty_&]:bg-neutral [.no-code-highlight_&]:!bg-transparent py-0.5 rounded text-sm whitespace-wrap",...n,children:e}),table:({children:e,...t})=>v.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:v.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>v.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>v.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",...t,children:e}),td:({children:e,...t})=>v.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>v.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=x.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=l2(r,"mt-0"));const s=n.length-1,a=n[s];return a!==void 0&&(n[s]=l2(a,"mb-0")),v.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",...t,children:n})})(),a:({children:e,...t})=>v.jsx("a",{className:"transition-all underline decoration-2 text-orange-500 decoration-orange-500/50 hover:text-orange-500/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",target:"_blank",rel:"noopener noreferrer",...t,children:e})};function Wf(e){return{...s$,a:({children:t,href:n,onClick:r,...s})=>{const a=n$(n);return v.jsx("a",{className:"transition-all underline decoration-2 text-orange-500 decoration-orange-500/50 hover:text-orange-500/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",href:n,target:a?void 0:"_blank",rel:a?void 0:"noopener noreferrer",onClick:l=>{r==null||r(l),!(l.defaultPrevented||!a||!(e!=null&&e.onOpenLocalLink))&&(l.preventDefault(),e.onOpenLocalLink(a))},...s,children:t})}}}const o$={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function a$({status:e}){const t=(e?o$[e]:void 0)||"Processing...",n=e==="failed";return v.jsx(to,{className:"ml-[1px]",children:v.jsxs(r$,{children:[n?v.jsx(fu,{className:"size-4.5 text-red-500"}):v.jsx(Js,{className:"size-4.5 animate-spin text-muted-icon"}),v.jsx(Df,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const gA=x.forwardRef(({className:e,children:t,...n},r)=>v.jsx("div",{ref:r,className:ye("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));gA.displayName="ScrollArea";const vA=[68,32];function l$(){return{isVisible:!1,mainSizes:[...vA],terminals:[],nextTerminalIndex:0}}function c$(e,t){return e[t]??l$()}function Yg(e){if(e.length===0)return[];const t=e.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(n=>Math.max(n,0)/t*100)}function u$(e){let t=e,n="";do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function h$(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function wc(e,t,n){return{...e,[t]:n(c$(e,t))}}const Do=Su()(wu(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:wc(r.projects,t,s=>{var d,h;const a=h$(s.terminals),l={id:((h=(d=globalThis.crypto)==null?void 0:d.randomUUID)==null?void 0:h.call(d))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:u$(s.nextTerminalIndex),size:100/(a.length+1)},u=n?Math.max(a.findIndex(p=>p.id===n)+1,0):a.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...a.slice(0,u),l,...a.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:wc(r.projects,t,s=>{const a=s.terminals.filter(u=>u.id!==n);if(a.length===0)return{...s,isVisible:!1,terminals:[]};const l=Yg(a.map(u=>u.size));return{...s,terminals:a.map((u,d)=>({...u,size:l[d]??100/a.length}))}})})),toggleVisibility:t=>e(n=>({projects:wc(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=Yg(n);return{projects:wc(r.projects,t,a=>({...a,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:wc(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const a=Yg(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:a[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),d$={isVisible:!1,mainSizes:[...vA],terminals:[],nextTerminalIndex:0},lf=1e3,M_=500,T_=5e3,cf=450,A_=250,D_=900,N_="cursor";function O_(e){switch(e){case"vscode":return"code {path}";case"windsurf":return"windsurf {path}";case"custom":return"cursor {path}";case"cursor":default:return"cursor {path}"}}function f$(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function c2(e){return Number.isFinite(e)?Math.min(T_,Math.max(M_,Math.round(e))):lf}function u2(e){return Number.isFinite(e)?Math.min(D_,Math.max(A_,Math.round(e))):cf}function h2(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return N_}}function Xg(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:O_(t)}const zr=Su()(wu(e=>({scrollbackLines:lf,minColumnWidth:cf,editorPreset:N_,editorCommandTemplate:O_(N_),setScrollbackLines:t=>e({scrollbackLines:c2(t)}),setMinColumnWidth:t=>e({minColumnWidth:u2(t)}),setEditorPreset:t=>e(n=>{const r=h2(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?Xg(n.editorCommandTemplate,r):O_(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:Xg(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=h2(t==null?void 0:t.editorPreset);return{scrollbackLines:c2((t==null?void 0:t.scrollbackLines)??lf),minColumnWidth:u2((t==null?void 0:t.minColumnWidth)??cf),editorPreset:n,editorCommandTemplate:Xg(t==null?void 0:t.editorCommandTemplate,n)}}})),d2=350,p$=[.4,0,.2,1],m$=8,f2=1e-6;function g$(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function v$(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function _$(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function y$(e,t,n){let r=e;for(let s=0;s<m$;s+=1){const a=g$(r,t,n)-e;if(Math.abs(a)<f2)return r;const l=_$(r,t,n);if(Math.abs(l)<f2)break;r-=a/l}return r}function b$(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=p$,a=y$(e,t,r);return v$(a,n,s)}function x$(e,t,n){const r=b$(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function S$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const w$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k$={};function p2(e,t){return(k$.jsx?C$:w$).test(e)}const E$=/[ \t\n\f\r]/g;function R$(e){return typeof e=="object"?e.type==="text"?m2(e.value):!1:m2(e)}function m2(e){return e.replace(E$,"")===""}class Tu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Tu.prototype.normal={};Tu.prototype.property={};Tu.prototype.space=void 0;function _A(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Tu(n,r,t)}function L_(e){return e.toLowerCase()}class rr{constructor(t,n){this.attribute=n,this.property=t}}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 M$=0;const He=Yo(),Vt=Yo(),z_=Yo(),fe=Yo(),gt=Yo(),Ja=Yo(),mr=Yo();function Yo(){return 2**++M$}const j_=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Vt,commaOrSpaceSeparated:mr,commaSeparated:Ja,number:fe,overloadedBoolean:z_,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Zg=Object.keys(j_);class db extends rr{constructor(t,n,r,s){let a=-1;if(super(t,n),g2(this,"space",s),typeof r=="number")for(;++a<Zg.length;){const l=Zg[a];g2(this,Zg[a],(r&j_[l])===j_[l])}}}db.prototype.defined=!0;function g2(e,t,n){n&&(e[t]=n)}function bl(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new db(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[L_(r)]=r,n[L_(a.attribute)]=r}return new Tu(t,n,e.space)}const yA=bl({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:gt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:fe,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:gt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Vt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bA(e,t){return t in e?e[t]:t}function xA(e,t){return bA(e,t.toLowerCase())}const T$=bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ja,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:gt,autoFocus:He,autoPlay:He,blocking:gt,capture:null,charSet:null,checked:He,cite:null,className:gt,cols:fe,colSpan:null,content:null,contentEditable:Vt,controls:He,controlsList:gt,coords:fe|Ja,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:z_,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:gt,height:fe,hidden:z_,high:fe,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:gt,itemRef:gt,itemScope:He,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,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:He,optimum:fe,pattern:null,ping:gt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:gt,required:He,reversed:He,rows:fe,rowSpan:fe,sandbox:gt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Vt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:xA}),A$=bl({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:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:gt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:Ja,g2:Ja,glyphName:Ja,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,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:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bA}),SA=bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wA=bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xA}),CA=bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),D$={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"},N$=/[A-Z]/g,v2=/-[a-z]/g,O$=/^data[-\w.:]+$/i;function L$(e,t){const n=L_(t);let r=t,s=rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&O$.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(v2,j$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!v2.test(a)){let l=a.replace(N$,z$);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=db}return new s(r,t)}function z$(e){return"-"+e.toLowerCase()}function j$(e){return e.charAt(1).toUpperCase()}const B$=_A([yA,T$,SA,wA,CA],"html"),fb=_A([yA,A$,SA,wA,CA],"svg");function P$(e){return e.join(" ").trim()}var Ua={},Qg,_2;function I$(){if(_2)return Qg;_2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
468
+ `,h="/",p="*",m="",_="comment",b="declaration";function S(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var T=1,R=1;function D(V){var U=V.match(t);U&&(T+=U.length);var O=V.lastIndexOf(d);R=~O?V.length-O:R+V.length}function z(){var V={line:T,column:R};return function(U){return U.position=new L(V),Z(),U}}function L(V){this.start=V,this.end={line:T,column:R},this.source=k.source}L.prototype.content=C;function j(V){var U=new Error(k.source+":"+T+":"+R+": "+V);if(U.reason=V,U.filename=k.source,U.line=T,U.column=R,U.source=C,!k.silent)throw U}function I(V){var U=V.exec(C);if(U){var O=U[0];return D(O),C=C.slice(O.length),U}}function Z(){I(n)}function P(V){var U;for(V=V||[];U=W();)U!==!1&&V.push(U);return V}function W(){var V=z();if(!(h!=C.charAt(0)||p!=C.charAt(1))){for(var U=2;m!=C.charAt(U)&&(p!=C.charAt(U)||h!=C.charAt(U+1));)++U;if(U+=2,m===C.charAt(U-1))return j("End of comment missing");var O=C.slice(2,U-2);return R+=2,D(O),C=C.slice(U),R+=2,V({type:_,comment:O})}}function H(){var V=z(),U=I(r);if(U){if(W(),!I(s))return j("property missing ':'");var O=I(a),K=V({type:b,property:w(U[0].replace(e,m)),value:O?w(O[0].replace(e,m)):m});return I(l),K}}function F(){var V=[];P(V);for(var U;U=H();)U!==!1&&(V.push(U),P(V));return V}return Z(),F()}function w(C){return C?C.replace(u,m):m}return Qg=S,Qg}var y2;function H$(){if(y2)return Ua;y2=1;var e=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.default=n;const t=e(I$());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;u?s(h,p,d):p&&(a=a||{},a[h]=p)}),a}return Ua}var Cc={},b2;function F$(){if(b2)return Cc;b2=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},u=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),a(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return Cc.camelCase=d,Cc}var kc,x2;function U$(){if(x2)return kc;x2=1;var e=kc&&kc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(H$()),n=F$();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,kc=r,kc}var $$=U$();const W$=mf($$),kA=EA("end"),pb=EA("start");function EA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 q$(e){const t=pb(e),n=kA(e);if(t&&n)return{start:t,end:n}}function Uc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?S2(e.position):"start"in e||"end"in e?S2(e):"line"in e||"column"in e?B_(e):""}function B_(e){return w2(e&&e.line)+":"+w2(e&&e.column)}function S2(e){return B_(e&&e.start)+"-"+B_(e&&e.end)}function w2(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Uc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const mb={}.hasOwnProperty,V$=new Map,K$=/[A-Z]/g,G$=new Set(["table","tbody","thead","tfoot","tr"]),Y$=new Set(["td","th"]),RA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X$(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=iW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=rW(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fb:B$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=MA(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function MA(e,t,n){if(t.type==="element")return Z$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Q$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eW(e,t,n);if(t.type==="mdxjsEsm")return J$(e,t);if(t.type==="root")return tW(e,t,n);if(t.type==="text")return nW(e,t)}function Z$(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=fb,e.schema=s),e.ancestors.push(t);const a=AA(e,t.tagName,!1),l=sW(e,t);let u=vb(e,t);return G$.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!R$(d):!0})),TA(e,l,a,t),gb(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Q$(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ou(e,t.position)}function J$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ou(e,t.position)}function eW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=fb,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:AA(e,t.name,!0),l=oW(e,t),u=vb(e,t);return TA(e,l,a,t),gb(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function tW(e,t,n){const r={};return gb(r,vb(e,t)),e.create(t,e.Fragment,r,n)}function nW(e,t){return t.value}function TA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rW(e,t,n){return r;function r(s,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function iW(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),d=pb(r);return t(s,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function sW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&mb.call(t.properties,s)){const a=aW(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&Y$.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oW(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else ou(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else ou(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function vb(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:V$;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const u=MA(e,a,l);u!==void 0&&n.push(u)}return n}function aW(e,t,n){const r=L$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?S$(n):P$(n)),r.property==="style"){let s=typeof n=="object"?n:lW(e,String(n));return e.stylePropertyNameCase==="css"&&(s=cW(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?D$[r.property]||r.property:r.attribute,n]}}function lW(e,t){try{return W$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=RA+"#cannot-parse-style-attribute",s}}function AA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=p2(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=p2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return mb.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ou(e)}function ou(e,t){const n=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=RA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cW(e){const t={};let n;for(n in e)mb.call(e,n)&&(t[uW(n)]=e[n]);return t}function uW(e){let t=e.replace(K$,hW);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function hW(e){return"-"+e.toLowerCase()}const Jg={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"]},dW={};function _b(e,t){const n=dW,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DA(e,r,s)}function DA(e,t,n){if(fW(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return C2(e.children,t,n)}return Array.isArray(e)?C2(e,t,n):""}function C2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=DA(e[s],t,n);return r.join("")}function fW(e){return!!(e&&typeof e=="object")}const k2=document.createElement("i");function yb(e){const t="&"+e+";";k2.innerHTML=t;const n=k2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _r(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Pr(e,t){return e.length>0?(_r(e,e.length,0,t),e):t}const E2={}.hasOwnProperty;function NA(e){const t={};let n=-1;for(;++n<e.length;)pW(t,e[n]);return t}function pW(e,t){let n;for(n in t){const s=(E2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){E2.call(s,l)||(s[l]=[]);const u=a[l];mW(s[l],Array.isArray(u)?u:u?[u]:[])}}}function mW(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_r(e,0,0,r)}function OA(e,t){const n=Number.parseInt(e,t);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 Zr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=no(/[A-Za-z]/),An=no(/[\dA-Za-z]/),gW=no(/[#-'*+\--9=?A-Z^-~]/);function uf(e){return e!==null&&(e<32||e===127)}const P_=no(/\d/),vW=no(/[\dA-Fa-f]/),_W=no(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function mt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const qf=no(new RegExp("\\p{P}|\\p{S}","u")),Uo=no(/\s/);function no(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xl(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&An(e.charCodeAt(n+1))&&An(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function tt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ye(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ye(d)&&a++<s?(e.consume(d),u):(e.exit(n),t(d))}}const yW={tokenize:bW};function bW(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),tt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ae(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const xW={tokenize:SW},R2={tokenize:wW};function SW(e){const t=this,n=[];let r=0,s,a,l;return u;function u(R){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,d,h)(R)}return h(R)}function d(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const D=t.events.length;let z=D,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){L=t.events[z][1].end;break}k(r);let j=D;for(;j<t.events.length;)t.events[j][1].end={...L},j++;return _r(t.events,z+1,0,t.events.slice(D)),t.events.length=j,h(R)}return u(R)}function h(R){if(r===n.length){if(!s)return _(R);if(s.currentConstruct&&s.currentConstruct.concrete)return S(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(R2,p,m)(R)}function p(R){return s&&T(),k(r),_(R)}function m(R){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(R2,b,S)(R)}function b(R){return r++,n.push([t.currentConstruct,t.containerState]),_(R)}function S(R){if(R===null){s&&T(),k(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return Ae(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(R),w)}function C(R,D){const z=t.sliceStream(R);if(D&&z.push(null),R.previous=a,a&&(a.next=R),a=R,s.defineSkip(R.start),s.write(z),t.parser.lazy[R.start.line]){let L=s.events.length;for(;L--;)if(s.events[L][1].start.offset<l&&(!s.events[L][1].end||s.events[L][1].end.offset>l))return;const j=t.events.length;let I=j,Z,P;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(Z){P=t.events[I][1].end;break}Z=!0}for(k(r),L=j;L<t.events.length;)t.events[L][1].end={...P},L++;_r(t.events,I+1,0,t.events.slice(j)),t.events.length=L}}function k(R){let D=n.length;for(;D-- >R;){const z=n[D];t.containerState=z[1],z[0].exit.call(t,e)}n.length=R}function T(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function wW(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cl(e){if(e===null||mt(e)||Uo(e))return 1;if(qf(e))return 2}function Vf(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const I_={name:"attention",resolveAll:CW,tokenize:kW};function CW(e,t){let n=-1,r,s,a,l,u,d,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},_={...e[n][1].start};M2(m,-d),M2(_,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Pr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Pr(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=Pr(h,Vf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Pr(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Pr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,_r(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kW(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=cl(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),p=cl(d),m=!p||p===2&&s||n.includes(d),_=!s||s===2&&p||n.includes(r);return h._open=!!(a===42?m:m&&(s||!_)),h._close=!!(a===42?_:_&&(p||!m)),t(d)}}function M2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const EW={name:"autolink",tokenize:RW};function RW(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(b){return Bn(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||An(b)?(r=1,u(b)):h(b)}function u(b){return b===58?(e.consume(b),r=0,d):(b===43||b===45||b===46||An(b))&&r++<32?(e.consume(b),u):(r=0,h(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||uf(b)?n(b):(e.consume(b),d)}function h(b){return b===64?(e.consume(b),p):gW(b)?(e.consume(b),h):n(b)}function p(b){return An(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),r=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):_(b)}function _(b){if((b===45||An(b))&&r++<63){const S=b===45?_:m;return e.consume(b),S}return n(b)}}const Au={partial:!0,tokenize:MW};function MW(e,t,n){return r;function r(a){return Ye(a)?tt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ae(a)?t(a):n(a)}}const LA={continuation:{tokenize:AW},exit:DW,name:"blockQuote",tokenize:TW};function TW(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Ye(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function AW(e,t,n){const r=this;return s;function s(l){return Ye(l)?tt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(LA,t,n)(l)}}function DW(e){e.exit("blockQuote")}const zA={name:"characterEscape",tokenize:NW};function NW(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return _W(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const jA={name:"characterReference",tokenize:OW};function OW(e,t,n){const r=this;let s=0,a,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=An,p(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=vW,p):(e.enter("characterReferenceValue"),a=7,l=P_,p(m))}function p(m){if(m===59&&s){const _=e.exit("characterReferenceValue");return l===An&&!yb(r.sliceSerialize(_))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<a?(e.consume(m),p):n(m)}}const T2={partial:!0,tokenize:zW},A2={concrete:!0,name:"codeFenced",tokenize:LW};function LW(e,t,n){const r=this,s={partial:!0,tokenize:z};let a=0,l=0,u;return d;function d(L){return h(L)}function h(L){const j=r.events[r.events.length-1];return a=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(L)}function p(L){return L===u?(l++,e.consume(L),p):l<3?n(L):(e.exit("codeFencedFenceSequence"),Ye(L)?tt(e,m,"whitespace")(L):m(L))}function m(L){return L===null||Ae(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(T2,w,D)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(L))}function _(L){return L===null||Ae(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(L)):Ye(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,b,"whitespace")(L)):L===96&&L===u?n(L):(e.consume(L),_)}function b(L){return L===null||Ae(L)?m(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(L))}function S(L){return L===null||Ae(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(L)):L===96&&L===u?n(L):(e.consume(L),S)}function w(L){return e.attempt(s,D,C)(L)}function C(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),k}function k(L){return a>0&&Ye(L)?tt(e,T,"linePrefix",a+1)(L):T(L)}function T(L){return L===null||Ae(L)?e.check(T2,w,D)(L):(e.enter("codeFlowValue"),R(L))}function R(L){return L===null||Ae(L)?(e.exit("codeFlowValue"),T(L)):(e.consume(L),R)}function D(L){return e.exit("codeFenced"),t(L)}function z(L,j,I){let Z=0;return P;function P(U){return L.enter("lineEnding"),L.consume(U),L.exit("lineEnding"),W}function W(U){return L.enter("codeFencedFence"),Ye(U)?tt(L,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):H(U)}function H(U){return U===u?(L.enter("codeFencedFenceSequence"),F(U)):I(U)}function F(U){return U===u?(Z++,L.consume(U),F):Z>=l?(L.exit("codeFencedFenceSequence"),Ye(U)?tt(L,V,"whitespace")(U):V(U)):I(U)}function V(U){return U===null||Ae(U)?(L.exit("codeFencedFence"),j(U)):I(U)}}}function zW(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const ev={name:"codeIndented",tokenize:BW},jW={partial:!0,tokenize:PW};function BW(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),tt(e,a,"linePrefix",5)(h)}function a(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Ae(h)?e.attempt(jW,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Ae(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function PW(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):Ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):tt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Ae(l)?s(l):n(l)}}const IW={name:"codeText",previous:FW,resolve:HW,tokenize:UW};function HW(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function FW(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function UW(e,t,n){let r=0,s,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),s=0,p(m)):Ae(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Ae(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",h(m))}}class $W{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ec(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ec(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ec(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ec(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ec(this.left,n.reverse())}}}function Ec(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function BA(e){const t={};let n=-1,r,s,a,l,u,d,h;const p=new $W(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WW(p,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},u=p.slice(s,n),u.unshift(r),p.splice(s,n-s+1,u))}}return _r(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function WW(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let p,m,_=-1,b=n,S=0,w=0;const C=[w];for(;b;){for(;e.get(++s)[1]!==b;);a.push(s),b._tokenizer||(p=r.sliceStream(b),b.next||p.push(null),m&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(w=_+1,C.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=a.pop();d.push([T,T+k.length-1]),e.splice(T,2,k)}for(d.reverse(),_=-1;++_<d.length;)h[S+d[_][0]]=S+d[_][1],S+=d[_][1]-d[_][0]-1;return h}const qW={resolve:KW,tokenize:GW},VW={partial:!0,tokenize:YW};function KW(e){return BA(e),e}function GW(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):Ae(u)?e.check(VW,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function YW(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),tt(e,a,"linePrefix")}function a(l){if(l===null||Ae(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function PA(e,t,n,r,s,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(k),e.exit(a),_):k===null||k===32||k===41||uf(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||Ae(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function w(k){return!p&&(k===null||k===41||mt(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):p<h&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||uf(k)?n(k):(e.consume(k),k===92?C:w)}function C(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function IA(e,t,n,r,s,a){const l=this;let u=0,d;return h;function h(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(a),p}function p(b){return u>999||b===null||b===91||b===93&&!d||b===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(a),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Ae(b)||u++>999?(e.exit("chunkString"),p(b)):(e.consume(b),d||(d=!Ye(b)),b===92?_:m)}function _(b){return b===91||b===92||b===93?(e.consume(b),u++,m):m(b)}}function HA(e,t,n,r,s,a){let l;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),l=_===40?41:_,d):n(_)}function d(_){return _===l?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(a),h(_))}function h(_){return _===l?(e.exit(a),d(l)):_===null?n(_):Ae(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===l||_===null||Ae(_)?(e.exit("chunkString"),h(_)):(e.consume(_),_===92?m:p)}function m(_){return _===l||_===92?(e.consume(_),p):p(_)}}function $c(e,t){let n;return r;function r(s){return Ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ye(s)?tt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const XW={name:"definition",tokenize:QW},ZW={partial:!0,tokenize:JW};function QW(e,t,n){const r=this;let s;return a;function a(b){return e.enter("definition"),l(b)}function l(b){return IA.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return s=Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return mt(b)?$c(e,h)(b):h(b)}function h(b){return PA(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(ZW,m,m)(b)}function m(b){return Ye(b)?tt(e,_,"whitespace")(b):_(b)}function _(b){return b===null||Ae(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function JW(e,t,n){return r;function r(u){return mt(u)?$c(e,s)(u):n(u)}function s(u){return HA(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ye(u)?tt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Ae(u)?t(u):n(u)}}const eq={name:"hardBreakEscape",tokenize:tq};function tq(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ae(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const nq={name:"headingAtx",resolve:rq,tokenize:iq};function rq(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_r(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function iq(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||mt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ae(p)?(e.exit("atxHeading"),t(p)):Ye(p)?tt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function h(p){return p===null||p===35||mt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),h)}}const sq=["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"],D2=["pre","script","style","textarea"],oq={concrete:!0,name:"htmlFlow",resolveTo:cq,tokenize:uq},aq={partial:!0,tokenize:dq},lq={partial:!0,tokenize:hq};function cq(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function uq(e,t,n){const r=this;let s,a,l,u,d;return h;function h(M){return p(M)}function p(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),_):M===47?(e.consume(M),a=!0,w):M===63?(e.consume(M),s=3,r.interrupt?t:A):Bn(M)?(e.consume(M),l=String.fromCharCode(M),C):n(M)}function _(M){return M===45?(e.consume(M),s=2,b):M===91?(e.consume(M),s=5,u=0,S):Bn(M)?(e.consume(M),s=4,r.interrupt?t:A):n(M)}function b(M){return M===45?(e.consume(M),r.interrupt?t:A):n(M)}function S(M){const X="CDATA[";return M===X.charCodeAt(u++)?(e.consume(M),u===X.length?r.interrupt?t:H:S):n(M)}function w(M){return Bn(M)?(e.consume(M),l=String.fromCharCode(M),C):n(M)}function C(M){if(M===null||M===47||M===62||mt(M)){const X=M===47,se=l.toLowerCase();return!X&&!a&&D2.includes(se)?(s=1,r.interrupt?t(M):H(M)):sq.includes(l.toLowerCase())?(s=6,X?(e.consume(M),k):r.interrupt?t(M):H(M)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?T(M):R(M))}return M===45||An(M)?(e.consume(M),l+=String.fromCharCode(M),C):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:H):n(M)}function T(M){return Ye(M)?(e.consume(M),T):P(M)}function R(M){return M===47?(e.consume(M),P):M===58||M===95||Bn(M)?(e.consume(M),D):Ye(M)?(e.consume(M),R):P(M)}function D(M){return M===45||M===46||M===58||M===95||An(M)?(e.consume(M),D):z(M)}function z(M){return M===61?(e.consume(M),L):Ye(M)?(e.consume(M),z):R(M)}function L(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,j):Ye(M)?(e.consume(M),L):I(M)}function j(M){return M===d?(e.consume(M),d=null,Z):M===null||Ae(M)?n(M):(e.consume(M),j)}function I(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?z(M):(e.consume(M),I)}function Z(M){return M===47||M===62||Ye(M)?R(M):n(M)}function P(M){return M===62?(e.consume(M),W):n(M)}function W(M){return M===null||Ae(M)?H(M):Ye(M)?(e.consume(M),W):n(M)}function H(M){return M===45&&s===2?(e.consume(M),O):M===60&&s===1?(e.consume(M),K):M===62&&s===4?(e.consume(M),B):M===63&&s===3?(e.consume(M),A):M===93&&s===5?(e.consume(M),J):Ae(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(aq,Y,F)(M)):M===null||Ae(M)?(e.exit("htmlFlowData"),F(M)):(e.consume(M),H)}function F(M){return e.check(lq,V,Y)(M)}function V(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return M===null||Ae(M)?F(M):(e.enter("htmlFlowData"),H(M))}function O(M){return M===45?(e.consume(M),A):H(M)}function K(M){return M===47?(e.consume(M),l="",$):H(M)}function $(M){if(M===62){const X=l.toLowerCase();return D2.includes(X)?(e.consume(M),B):H(M)}return Bn(M)&&l.length<8?(e.consume(M),l+=String.fromCharCode(M),$):H(M)}function J(M){return M===93?(e.consume(M),A):H(M)}function A(M){return M===62?(e.consume(M),B):M===45&&s===2?(e.consume(M),A):H(M)}function B(M){return M===null||Ae(M)?(e.exit("htmlFlowData"),Y(M)):(e.consume(M),B)}function Y(M){return e.exit("htmlFlow"),t(M)}}function hq(e,t,n){const r=this;return s;function s(l){return Ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function dq(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Au,t,n)}}const fq={name:"htmlText",tokenize:pq};function pq(e,t,n){const r=this;let s,a,l;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),z):A===63?(e.consume(A),R):Bn(A)?(e.consume(A),I):n(A)}function h(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),a=0,S):Bn(A)?(e.consume(A),T):n(A)}function p(A){return A===45?(e.consume(A),b):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),_):Ae(A)?(l=m,K(A)):(e.consume(A),m)}function _(A){return A===45?(e.consume(A),b):m(A)}function b(A){return A===62?O(A):A===45?_(A):m(A)}function S(A){const B="CDATA[";return A===B.charCodeAt(a++)?(e.consume(A),a===B.length?w:S):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),C):Ae(A)?(l=w,K(A)):(e.consume(A),w)}function C(A){return A===93?(e.consume(A),k):w(A)}function k(A){return A===62?O(A):A===93?(e.consume(A),k):w(A)}function T(A){return A===null||A===62?O(A):Ae(A)?(l=T,K(A)):(e.consume(A),T)}function R(A){return A===null?n(A):A===63?(e.consume(A),D):Ae(A)?(l=R,K(A)):(e.consume(A),R)}function D(A){return A===62?O(A):R(A)}function z(A){return Bn(A)?(e.consume(A),L):n(A)}function L(A){return A===45||An(A)?(e.consume(A),L):j(A)}function j(A){return Ae(A)?(l=j,K(A)):Ye(A)?(e.consume(A),j):O(A)}function I(A){return A===45||An(A)?(e.consume(A),I):A===47||A===62||mt(A)?Z(A):n(A)}function Z(A){return A===47?(e.consume(A),O):A===58||A===95||Bn(A)?(e.consume(A),P):Ae(A)?(l=Z,K(A)):Ye(A)?(e.consume(A),Z):O(A)}function P(A){return A===45||A===46||A===58||A===95||An(A)?(e.consume(A),P):W(A)}function W(A){return A===61?(e.consume(A),H):Ae(A)?(l=W,K(A)):Ye(A)?(e.consume(A),W):Z(A)}function H(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,F):Ae(A)?(l=H,K(A)):Ye(A)?(e.consume(A),H):(e.consume(A),V)}function F(A){return A===s?(e.consume(A),s=void 0,U):A===null?n(A):Ae(A)?(l=F,K(A)):(e.consume(A),F)}function V(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||mt(A)?Z(A):(e.consume(A),V)}function U(A){return A===47||A===62||mt(A)?Z(A):n(A)}function O(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function K(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),$}function $(A){return Ye(A)?tt(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):J(A)}function J(A){return e.enter("htmlTextData"),l(A)}}const bb={name:"labelEnd",resolveAll:_q,resolveTo:yq,tokenize:bq},mq={tokenize:xq},gq={tokenize:Sq},vq={tokenize:wq};function _q(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&_r(e,0,e.length,n),e}function yq(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=Pr(u,e.slice(a+1,a+r+3)),u=Pr(u,[["enter",p,t]]),u=Pr(u,Vf(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=Pr(u,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),u=Pr(u,e.slice(l+1)),u=Pr(u,[["exit",d,t]]),_r(e,a,e.length,u),e}function bq(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(_){return a?a._inactive?m(_):(l=r.parser.defined.includes(Zr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),d):n(_)}function d(_){return _===40?e.attempt(mq,p,l?p:m)(_):_===91?e.attempt(gq,p,l?h:m)(_):l?p(_):m(_)}function h(_){return e.attempt(vq,p,m)(_)}function p(_){return t(_)}function m(_){return a._balanced=!0,n(_)}}function xq(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return mt(m)?$c(e,a)(m):a(m)}function a(m){return m===41?p(m):PA(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return mt(m)?$c(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?HA(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function h(m){return mt(m)?$c(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function Sq(e,t,n){const r=this;return s;function s(u){return IA.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Zr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function wq(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Cq={name:"labelStartImage",resolveAll:bb.resolveAll,tokenize:kq};function kq(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Eq={name:"labelStartLink",resolveAll:bb.resolveAll,tokenize:Rq};function Rq(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const tv={name:"lineEnding",tokenize:Mq};function Mq(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const Bd={name:"thematicBreak",tokenize:Tq};function Tq(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Ae(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Ye(h)?tt(e,u,"whitespace")(h):u(h))}}const er={continuation:{tokenize:Oq},exit:zq,name:"list",tokenize:Nq},Aq={partial:!0,tokenize:jq},Dq={partial:!0,tokenize:Lq};function Nq(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:P_(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Bd,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return P_(b)&&++l<10?(e.consume(b),d):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Au,r.interrupt?n:p,e.attempt(Aq,_,m))}function p(b){return r.containerState.initialBlankLine=!0,a++,_(b)}function m(b){return Ye(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),_):n(b)}function _(b){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Oq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Au,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Ye(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Dq,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(er,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Lq(e,t,n){const r=this;return tt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function zq(e){e.exit(this.containerState.type)}function jq(e,t,n){const r=this;return tt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!Ye(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const N2={name:"setextUnderline",resolveTo:Bq,tokenize:Pq};function Bq(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Pq(e,t,n){const r=this;let s;return a;function a(h){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),Ye(h)?tt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ae(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const Iq={tokenize:Hq};function Hq(e){const t=this,n=e.attempt(Au,r,e.attempt(this.parser.constructs.flowInitial,s,tt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(qW,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fq={resolveAll:UA()},Uq=FA("string"),$q=FA("text");function FA(e){return{resolveAll:UA(e==="text"?Wq:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(p){return h(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const m=s[p];let _=-1;if(m)for(;++_<m.length;){const b=m[_];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function UA(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function Wq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const qq={42:er,43:er,45:er,48:er,49:er,50:er,51:er,52:er,53:er,54:er,55:er,56:er,57:er,62:LA},Vq={91:XW},Kq={[-2]:ev,[-1]:ev,32:ev},Gq={35:nq,42:Bd,45:[N2,Bd],60:oq,61:N2,95:Bd,96:A2,126:A2},Yq={38:jA,92:zA},Xq={[-5]:tv,[-4]:tv,[-3]:tv,33:Cq,38:jA,42:I_,60:[EW,fq],91:Eq,92:[eq,zA],93:bb,95:I_,96:IW},Zq={null:[I_,Fq]},Qq={null:[42,95]},Jq={null:[]},eV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qq,contentInitial:Vq,disable:Jq,document:qq,flow:Gq,flowInitial:Kq,insideSpan:Zq,string:Yq,text:Xq},Symbol.toStringTag,{value:"Module"}));function tV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const d={attempt:j(z),check:j(L),consume:T,enter:R,exit:D,interrupt:j(L,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:b,write:m};let p=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function m(W){return l=Pr(l,W),C(),l[l.length-1]!==null?[]:(I(t,0),h.events=Vf(a,h.events,h),h.events)}function _(W,H){return rV(b(W),H)}function b(W){return nV(l,W)}function S(){const{_bufferIndex:W,_index:H,line:F,column:V,offset:U}=r;return{_bufferIndex:W,_index:H,line:F,column:V,offset:U}}function w(W){s[W.line]=W.column,P()}function C(){let W;for(;r._index<l.length;){const H=l[r._index];if(typeof H=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<H.length;)k(H.charCodeAt(r._bufferIndex));else k(H)}}function k(W){p=p(W)}function T(W){Ae(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,P()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=W}function R(W,H){const F=H||{};return F.type=W,F.start=S(),h.events.push(["enter",F,h]),u.push(F),F}function D(W){const H=u.pop();return H.end=S(),h.events.push(["exit",H,h]),H}function z(W,H){I(W,H.from)}function L(W,H){H.restore()}function j(W,H){return F;function F(V,U,O){let K,$,J,A;return Array.isArray(V)?Y(V):"tokenize"in V?Y([V]):B(V);function B(re){return me;function me(Ce){const pe=Ce!==null&&re[Ce],ke=Ce!==null&&re.null,Je=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Y(Je)(Ce)}}function Y(re){return K=re,$=0,re.length===0?O:M(re[$])}function M(re){return me;function me(Ce){return A=Z(),J=re,re.partial||(h.currentConstruct=re),re.name&&h.parser.constructs.disable.null.includes(re.name)?se():re.tokenize.call(H?Object.assign(Object.create(h),H):h,d,X,se)(Ce)}}function X(re){return W(J,A),U}function se(re){return A.restore(),++$<K.length?M(K[$]):O}}}function I(W,H){W.resolveAll&&!a.includes(W)&&a.push(W),W.resolve&&_r(h.events,H,h.events.length-H,W.resolve(h.events.slice(H),h)),W.resolveTo&&(h.events=W.resolveTo(h.events,h))}function Z(){const W=S(),H=h.previous,F=h.currentConstruct,V=h.events.length,U=Array.from(u);return{from:V,restore:O};function O(){r=W,h.previous=H,h.currentConstruct=F,h.events.length=V,u=U,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function nV(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function rV(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
469
+ `;break}case-3:{l=`\r
470
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function iV(e){const r={constructs:NA([eV,...(e||{}).extensions||[]]),content:s(yW),defined:[],document:s(xW),flow:s(Iq),lazy:{},string:s(Uq),text:s($q)};return r;function s(a){return l;function l(u){return tV(r,a,u)}}}function sV(e){for(;!BA(e););return e}const O2=/[\0\t\n\r]/g;function oV(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const d=[];let h,p,m,_,b;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(O2.lastIndex=m,h=O2.exec(a),_=h&&h.index!==void 0?h.index:a.length,b=a.charCodeAt(_),!h){t=a.slice(m);break}if(b===10&&m===_&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<_&&(d.push(a.slice(m,_)),e+=_-m),b){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=_+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const aV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lV(e){return e.replace(aV,cV)}function cV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return OA(n.slice(a?2:1),a?16:10)}return yb(n)||e}const $A={}.hasOwnProperty;function uV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),hV(n)(sV(iV(n).document().write(oV()(e,t,!0))))}function hV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ht),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:a(Nt),blockQuote:a(ke),characterEscape:Z,characterReference:Z,codeFenced:a(Je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Je,l),codeText:a(qe,l),codeTextData:Z,data:Z,codeFlowValue:Z,definition:a(Me),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Ve),hardBreakEscape:a(It),hardBreakTrailing:a(It),htmlFlow:a(ir,l),htmlFlowData:Z,htmlText:a(ir,l),htmlTextData:Z,image:a(Fn),label:l,link:a(Ht),listItem:a(yr),listItemValue:_,listOrdered:a(vn,m),listUnordered:a(vn),paragraph:a(ri),reference:M,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Nt),strong:a(Mi),thematicBreak:a(ro)},exit:{atxHeading:d(),atxHeadingSequence:z,autolink:d(),autolinkEmail:pe,autolinkProtocol:Ce,blockQuote:d(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:re,characterReference:me,codeFenced:d(C),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:d(k),codeText:d(U),codeTextData:P,data:P,definition:d(),definitionDestinationString:D,definitionLabelString:T,definitionTitleString:R,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(F),htmlFlowData:P,htmlText:d(V),htmlTextData:P,image:d(K),label:J,labelText:$,lineEnding:W,link:d(O),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:X,resourceDestinationString:A,resourceTitleString:B,resource:Y,setextHeading:d(I),setextHeadingLineSequence:j,setextHeadingText:L,strong:d(),thematicBreak:d()}};WA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ae){let de={type:"root",children:[]};const Ee={stack:[de],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:p,data:n},Le=[];let he=-1;for(;++he<ae.length;)if(ae[he][1].type==="listOrdered"||ae[he][1].type==="listUnordered")if(ae[he][0]==="enter")Le.push(he);else{const ge=Le.pop();he=s(ae,ge,he)}for(he=-1;++he<ae.length;){const ge=t[ae[he][0]];$A.call(ge,ae[he][1].type)&&ge[ae[he][1].type].call(Object.assign({sliceSerialize:ae[he][2].sliceSerialize},Ee),ae[he][1])}if(Ee.tokenStack.length>0){const ge=Ee.tokenStack[Ee.tokenStack.length-1];(ge[1]||L2).call(Ee,void 0,ge[0])}for(de.position={start:Ps(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Ps(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)de=t.transforms[he](de)||de;return de}function s(ae,de,Ee){let Le=de-1,he=-1,ge=!1,je,Be,Fe,Yt;for(;++Le<=Ee;){const ot=ae[Le];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?he++:he--,Yt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(je&&!Yt&&!he&&!Fe&&(Fe=Le),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!he&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||he===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(je){let ii=Le;for(Be=void 0;ii--;){const Un=ae[ii];if(Un[1].type==="lineEnding"||Un[1].type==="lineEndingBlank"){if(Un[0]==="exit")continue;Be&&(ae[Be][1].type="lineEndingBlank",ge=!0),Un[1].type="lineEnding",Be=ii}else if(!(Un[1].type==="linePrefix"||Un[1].type==="blockQuotePrefix"||Un[1].type==="blockQuotePrefixWhitespace"||Un[1].type==="blockQuoteMarker"||Un[1].type==="listItemIndent"))break}Fe&&(!Be||Fe<Be)&&(je._spread=!0),je.end=Object.assign({},Be?ae[Be][1].start:ot[1].end),ae.splice(Be||Le,0,["exit",je,ot[2]]),Le++,Ee++}if(ot[1].type==="listItemPrefix"){const ii={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};je=ii,ae.splice(Le,0,["enter",ii,ot[2]]),Le++,Ee++,Fe=void 0,Yt=!0}}}return ae[de][1]._spread=ge,Ee}function a(ae,de){return Ee;function Ee(Le){u.call(this,ae(Le),Le),de&&de.call(this,Le)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ae,de,Ee){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([de,Ee||void 0]),ae.position={start:Ps(de.start),end:void 0}}function d(ae){return de;function de(Ee){ae&&ae.call(this,Ee),h.call(this,Ee)}}function h(ae,de){const Ee=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==ae.type&&(de?de.call(this,ae,Le[0]):(Le[1]||L2).call(this,ae,Le[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Uc({start:ae.start,end:ae.end})+"): it’s not open");Ee.position.end=Ps(ae.end)}function p(){return _b(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function _(ae){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.lang=ae}function S(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.meta=ae}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.value=ae.replace(/(\r?\n|\r)$/g,"")}function T(ae){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=Zr(this.sliceSerialize(ae)).toLowerCase()}function R(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.title=ae}function D(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.url=ae}function z(ae){const de=this.stack[this.stack.length-1];if(!de.depth){const Ee=this.sliceSerialize(ae).length;de.depth=Ee}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function j(ae){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(ae){const Ee=this.stack[this.stack.length-1].children;let Le=Ee[Ee.length-1];(!Le||Le.type!=="text")&&(Le=Ft(),Le.position={start:Ps(ae.start),end:void 0},Ee.push(Le)),this.stack.push(Le)}function P(ae){const de=this.stack.pop();de.value+=this.sliceSerialize(ae),de.position.end=Ps(ae.end)}function W(ae){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=de.children[de.children.length-1];Ee.position.end=Ps(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(Z.call(this,ae),P.call(this,ae))}function H(){this.data.atHardBreak=!0}function F(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.value=ae}function V(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.value=ae}function U(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.value=ae}function O(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=de,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function K(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=de,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function $(ae){const de=this.sliceSerialize(ae),Ee=this.stack[this.stack.length-2];Ee.label=lV(de),Ee.identifier=Zr(de).toLowerCase()}function J(){const ae=this.stack[this.stack.length-1],de=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Le=ae.children;Ee.children=Le}else Ee.alt=de}function A(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.url=ae}function B(){const ae=this.resume(),de=this.stack[this.stack.length-1];de.title=ae}function Y(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function X(ae){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=Zr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function se(ae){this.data.characterReferenceType=ae.type}function re(ae){const de=this.sliceSerialize(ae),Ee=this.data.characterReferenceType;let Le;Ee?(Le=OA(de,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=yb(de);const he=this.stack[this.stack.length-1];he.value+=Le}function me(ae){const de=this.stack.pop();de.position.end=Ps(ae.end)}function Ce(ae){P.call(this,ae);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ae)}function pe(ae){P.call(this,ae);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ae)}function ke(){return{type:"blockquote",children:[]}}function Je(){return{type:"code",lang:null,meta:null,value:""}}function qe(){return{type:"inlineCode",value:""}}function Me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function It(){return{type:"break"}}function ir(){return{type:"html",value:""}}function Fn(){return{type:"image",title:null,url:"",alt:null}}function Ht(){return{type:"link",title:null,url:"",children:[]}}function vn(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function yr(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function ri(){return{type:"paragraph",children:[]}}function Mi(){return{type:"strong",children:[]}}function Ft(){return{type:"text",value:""}}function ro(){return{type:"thematicBreak"}}}function Ps(e){return{line:e.line,column:e.column,offset:e.offset}}function WA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?WA(e,r):dV(e,r)}}function dV(e,t){let n;for(n in t)if($A.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function L2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Uc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Uc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Uc({start:t.start,end:t.end})+") is still open")}function fV(e){const t=this;t.parser=n;function n(r){return uV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
471
+ `}]}function gV(e,t){const n=t.value?t.value+`
472
+ `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function vV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _V(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=xl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function bV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function SV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qA(e,t);const s={src:xl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function wV(e,t){const n={src:xl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function CV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qA(e,t);const s={href:xl(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function EV(e,t){const n={href:xl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function RV(e,t,n){const r=e.all(t),s=n?MV(n):VA(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
473
+ `}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
474
+ `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function MV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=VA(n[r])}return t}function VA(e){const t=e.spread;return t??e.children.length>1}function TV(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function AV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function NV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OV(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=pb(t.children[1]),d=kA(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function LV(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const m=t.children[d],_={},b=l?l[d]:void 0;b&&(_.align=b);let S={type:"element",tagName:a,properties:_,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),h.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function zV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const z2=9,j2=32;function jV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(B2(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(B2(t.slice(s),s>0,!1)),a.join("")}function B2(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===z2||a===j2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===z2||a===j2;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function BV(e,t){const n={type:"text",value:jV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const IV={blockquote:pV,break:mV,code:gV,delete:vV,emphasis:_V,footnoteReference:yV,heading:bV,html:xV,imageReference:SV,image:wV,inlineCode:CV,linkReference:kV,link:EV,listItem:RV,list:TV,paragraph:AV,root:DV,strong:NV,table:OV,tableCell:zV,tableRow:LV,text:BV,thematicBreak:PV,toml:pd,yaml:pd,definition:pd,footnoteDefinition:pd};function pd(){}const KA=-1,Kf=0,Wc=1,hf=2,xb=3,Sb=4,wb=5,Cb=6,GA=7,YA=8,P2=typeof self=="object"?self:globalThis,HV=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Kf:case KA:return n(l,s);case Wc:{const u=n([],s);for(const d of l)u.push(r(d));return u}case hf:{const u=n({},s);for(const[d,h]of l)u[r(d)]=r(h);return u}case xb:return n(new Date(l),s);case Sb:{const{source:u,flags:d}=l;return n(new RegExp(u,d),s)}case wb:{const u=n(new Map,s);for(const[d,h]of l)u.set(r(d),r(h));return u}case Cb:{const u=n(new Set,s);for(const d of l)u.add(r(d));return u}case GA:{const{name:u,message:d}=l;return n(new P2[u](d),s)}case YA:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new P2[a](l),s)};return r},I2=e=>HV(new Map,e)(0),$a="",{toString:FV}={},{keys:UV}=Object,Rc=e=>{const t=typeof e;if(t!=="object"||!e)return[Kf,t];const n=FV.call(e).slice(8,-1);switch(n){case"Array":return[Wc,$a];case"Object":return[hf,$a];case"Date":return[xb,$a];case"RegExp":return[Sb,$a];case"Map":return[wb,$a];case"Set":return[Cb,$a];case"DataView":return[Wc,n]}return n.includes("Array")?[Wc,n]:n.includes("Error")?[GA,n]:[hf,n]},md=([e,t])=>e===Kf&&(t==="function"||t==="symbol"),$V=(e,t,n,r)=>{const s=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Rc(l);switch(u){case Kf:{let p=l;switch(d){case"bigint":u=YA,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([KA],l)}return s([u,p],l)}case Wc:{if(d){let _=l;return d==="DataView"?_=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(_=new Uint8Array(l)),s([d,[..._]],l)}const p=[],m=s([u,p],l);for(const _ of l)p.push(a(_));return m}case hf:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=s([u,p],l);for(const _ of UV(l))(e||!md(Rc(l[_])))&&p.push([a(_),a(l[_])]);return m}case xb:return s([u,l.toISOString()],l);case Sb:{const{source:p,flags:m}=l;return s([u,{source:p,flags:m}],l)}case wb:{const p=[],m=s([u,p],l);for(const[_,b]of l)(e||!(md(Rc(_))||md(Rc(b))))&&p.push([a(_),a(b)]);return m}case Cb:{const p=[],m=s([u,p],l);for(const _ of l)(e||!md(Rc(_)))&&p.push(a(_));return m}}const{message:h}=l;return s([u,{name:d,message:h}],l)};return a},H2=(e,{json:t,lossy:n}={})=>{const r=[];return $V(!(t||n),!!t,new Map,r)(e),r},df=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?I2(H2(e,t)):structuredClone(e):(e,t)=>I2(H2(e,t));function WV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function qV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function VV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||WV,r=e.options.footnoteBackLabel||qV,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),m=String(h.identifier).toUpperCase(),_=xl(m.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(d,b);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,b),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const T=C.children[C.children.length-1];T&&T.type==="text"?T.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else p.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(h,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...df(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
475
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
476
+ `}]}}const Gf=(function(e){if(e==null)return XV;if(typeof e=="function")return Yf(e);if(typeof e=="object")return Array.isArray(e)?KV(e):GV(e);if(typeof e=="string")return YV(e);throw new Error("Expected function, string, or object as test")});function KV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Gf(e[n]);return Yf(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function GV(e){const t=e;return Yf(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function YV(e){return Yf(t);function t(n){return n&&n.type===e}}function Yf(e){return t;function t(n,r,s){return!!(ZV(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function XV(){return!0}function ZV(e){return e!==null&&typeof e=="object"&&"type"in e}const XA=[],QV=!0,H_=!1,JV="skip";function ZA(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Gf(s),l=r?-1:1;u(e,void 0,[])();function u(d,h,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return _;function _(){let b=XA,S,w,C;if((!t||a(d,h,p[p.length-1]||void 0))&&(b=eK(n(d,p)),b[0]===H_))return b;if("children"in d&&d.children){const k=d;if(k.children&&b[0]!==JV)for(w=(r?k.children.length:-1)+l,C=p.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===H_)return S;w=typeof S[1]=="number"?S[1]:w+l}}return b}}}function eK(e){return Array.isArray(e)?e:typeof e=="number"?[QV,e]:e==null?XA:[e]}function kb(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),ZA(e,a,u,s);function u(d,h){const p=h[h.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const F_={}.hasOwnProperty,tK={};function nK(e,t){const n=t||tK,r=new Map,s=new Map,a=new Map,l={...IV,...n.handlers},u={all:h,applyData:iK,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:rK,wrap:oK};return kb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,_=String(p.identifier).toUpperCase();m.has(_)||m.set(_,p)}}),u;function d(p,m){const _=p.type,b=u.handlers[_];if(F_.call(u.handlers,_)&&b)return b(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in p){const{children:w,...C}=p,k=df(C);return k.children=u.all(p),k}return df(p)}return(u.options.unknownHandler||sK)(u,p,m)}function h(p){const m=[];if("children"in p){const _=p.children;let b=-1;for(;++b<_.length;){const S=u.one(_[b],p);if(S){if(b&&_[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=F2(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=F2(w.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function rK(e,t){e.position&&(t.position=q$(e))}function iK(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,df(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function sK(e,t){const n=t.data||{},r="value"in t&&!(F_.call(n,"hProperties")||F_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oK(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
477
+ `});++r<e.length;)r&&n.push({type:"text",value:`
478
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
479
+ `}),n}function F2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function U2(e,t){const n=nK(e,t),r=n.one(e,void 0),s=VV(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
480
+ `},s),a}function aK(e,t){return e&&"run"in e?async function(n,r){const s=U2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return U2(n,{file:r,...e||t})}}function $2(e){if(e)throw e}var nv,W2;function lK(){if(W2)return nv;W2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!m)return!1;var _;for(_ in h);return typeof _>"u"||e.call(h,_)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},u=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return nv=function d(){var h,p,m,_,b,S,w=arguments[0],C=1,k=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<k;++C)if(h=arguments[C],h!=null)for(p in h)m=u(w,p),_=u(h,p),w!==_&&(T&&_&&(a(_)||(b=s(_)))?(b?(b=!1,S=m&&s(m)?m:[]):S=m&&a(m)?m:{},l(w,{name:p,newValue:d(T,S,_)})):typeof _<"u"&&l(w,{name:p,newValue:_}));return w},nv}var cK=lK();const rv=mf(cK);function U_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uK(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(d,...h){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<s.length;)(h[m]===null||h[m]===void 0)&&(h[m]=s[m]);s=h,p?hK(p,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function hK(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(s);try{d=e.apply(this,l)}catch(h){const p=h;if(u&&n)throw p;return s(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const di={basename:dK,dirname:fK,extname:pK,join:mK,sep:"/"};function dK(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Du(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function fK(e){if(Du(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pK(e){Du(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function mK(...e){let t=-1,n;for(;++t<e.length;)Du(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gK(n)}function gK(e){Du(e);const t=e.codePointAt(0)===47;let n=vK(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vK(e,t){let n="",r=0,s=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Du(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _K={cwd:yK};function yK(){return"/"}function $_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bK(e){if(typeof e=="string")e=new URL(e);else if(!$_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xK(e)}function xK(e){if(e.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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const iv=["history","path","basename","stem","extname","dirname"];class QA{constructor(t){let n;t?$_(t)?n={path:t}:typeof t=="string"||SK(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_K.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<iv.length;){const a=iv[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)iv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(t){ov(t,"basename"),sv(t,"basename"),this.path=di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(t){q2(this.basename,"dirname"),this.path=di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(t){if(sv(t,"extname"),q2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){$_(t)&&(t=bK(t)),ov(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(t){ov(t,"stem"),sv(t,"stem"),this.path=di.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Dn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sv(e,t){if(e&&e.includes(di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+di.sep+"`")}function ov(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function q2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wK=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),CK={}.hasOwnProperty;class Eb extends wK{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=uK()}copy(){const t=new Eb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(rv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(cv("data",this.frozen),this.namespace[t]=n,this):CK.call(this.namespace,t)&&this.namespace[t]||void 0:t?(cv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=gd(t),r=this.parser||this.Parser;return av("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),av("process",this.parser||this.Parser),lv("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=gd(t),d=r.parse(u);r.run(d,u,function(p,m,_){if(p||!m||!_)return h(p);const b=m,S=r.stringify(b,_);RK(S)?_.value=S:_.result=S,h(p,_)});function h(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),av("processSync",this.parser||this.Parser),lv("processSync",this.compiler||this.Compiler),this.process(t,s),K2("processSync","process",n),r;function s(a,l){n=!0,$2(a),r=l}}run(t,n,r){V2(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=gd(n);s.run(t,d,h);function h(p,m,_){const b=m||t;p?u(p):l?l(b):r(void 0,b,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),K2("runSync","run",r),s;function a(l,u){$2(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=gd(n),s=this.compiler||this.Compiler;return lv("stringify",s),V2(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(cv("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...m]=h;d(p,m)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");u(h.plugins),h.settings&&(s.settings=rv(!0,s.settings,h.settings))}function u(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const m=h[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,p){let m=-1,_=-1;for(;++m<r.length;)if(r[m][0]===h){_=m;break}if(_===-1)r.push([h,...p]);else if(p.length>0){let[b,...S]=p;const w=r[_][1];U_(w)&&U_(b)&&(b=rv(!0,w,b)),r[_]=[h,b,...S]}}}}const kK=new Eb().freeze();function av(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function V2(e){if(!U_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function K2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gd(e){return EK(e)?e:new QA(e)}function EK(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RK(e){return typeof e=="string"||MK(e)}function MK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TK="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",G2=[],Y2={allowDangerousHtml:!0},AK=/^(https?|ircs?|mailto|xmpp)$/i,DK=[{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 Xf(e){const t=NK(e),n=OK(e);return LK(t.runSync(t.parse(n),n),e)}function NK(e){const t=e.rehypePlugins||G2,n=e.remarkPlugins||G2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Y2}:Y2;return kK().use(fV).use(n).use(aK,r).use(t)}function OK(e){const t=e.children||"",n=new QA;return typeof t=="string"&&(n.value=t),n}function LK(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||zK;for(const p of DK)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+TK+p.id,void 0);return kb(e,h),X$(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function h(p,m,_){if(p.type==="raw"&&_&&typeof m=="number")return l?_.children.splice(m,1):_.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let b;for(b in Jg)if(Object.hasOwn(Jg,b)&&Object.hasOwn(p.properties,b)){const S=p.properties[b],w=Jg[b];(w===null||w.includes(p.tagName))&&(p.properties[b]=d(String(S||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(p,m,_)),b&&_&&typeof m=="number")return u&&p.children?_.children.splice(m,1,...p.children):_.children.splice(m,1),m}}}function zK(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||AK.test(e.slice(0,t))?e:""}function X2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function jK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function BK(e,t,n){const s=Gf((n||{}).ignore||[]),a=PK(t);let l=-1;for(;++l<a.length;)ZA(e,"text",u);function u(h,p){let m=-1,_;for(;++m<p.length;){const b=p[m],S=_?_.children:void 0;if(s(b,S?S.indexOf(b):void 0,_))return;_=b}if(_)return d(h,p)}function d(h,p){const m=p[p.length-1],_=a[l][0],b=a[l][1];let S=0;const C=m.children.indexOf(h);let k=!1,T=[];_.lastIndex=0;let R=_.exec(h.value);for(;R;){const D=R.index,z={index:R.index,input:R.input,stack:[...p,h]};let L=b(...R,z);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?_.lastIndex=D+1:(S!==D&&T.push({type:"text",value:h.value.slice(S,D)}),Array.isArray(L)?T.push(...L):L&&T.push(L),S=D+R[0].length,k=!0),!_.global)break;R=_.exec(h.value)}return k?(S<h.value.length&&T.push({type:"text",value:h.value.slice(S)}),m.children.splice(C,1,...T)):T=[h],C+T.length}}function PK(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([IK(s[0]),HK(s[1])])}return t}function IK(e){return typeof e=="string"?new RegExp(jK(e),"g"):e}function HK(e){return typeof e=="function"?e:function(){return e}}const uv="phrasing",hv=["autolink","link","image","label"];function FK(){return{transforms:[GK],enter:{literalAutolink:$K,literalAutolinkEmail:dv,literalAutolinkHttp:dv,literalAutolinkWww:dv},exit:{literalAutolink:KK,literalAutolinkEmail:VK,literalAutolinkHttp:WK,literalAutolinkWww:qK}}}function UK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uv,notInConstruct:hv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uv,notInConstruct:hv},{character:":",before:"[ps]",after:"\\/",inConstruct:uv,notInConstruct:hv}]}}function $K(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function dv(e){this.config.enter.autolinkProtocol.call(this,e)}function WK(e){this.config.exit.autolinkProtocol.call(this,e)}function qK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function VK(e){this.config.exit.autolinkEmail.call(this,e)}function KK(e){this.exit(e)}function GK(e){BK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,YK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),XK]],{ignore:["link","linkReference"]})}function YK(e,t,n,r,s){let a="";if(!JA(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!ZK(n)))return!1;const l=QK(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function XK(e,t,n,r){return!JA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ZK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function QK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=X2(e,"(");let a=X2(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function JA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Uo(n)||qf(n))&&(!t||n!==47)}e5.peek=aG;function JK(){this.buffer()}function eG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tG(){this.buffer()}function nG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iG(e){this.exit(e)}function sG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oG(e){this.exit(e)}function aG(){return"["}function e5(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function lG(){return{enter:{gfmFootnoteCallString:JK,gfmFootnoteCall:eG,gfmFootnoteDefinitionLabelString:tG,gfmFootnoteDefinition:nG},exit:{gfmFootnoteCallString:rG,gfmFootnoteCall:iG,gfmFootnoteDefinitionLabelString:sG,gfmFootnoteDefinition:oG}}}function cG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:e5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),p=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
481
+ `:" ")+a.indentLines(a.containerFlow(r,u.current()),t?t5:uG))),h(),d}}function uG(e,t,n){return t===0?e:t5(e,t,n)}function t5(e,t,n){return(n?"":" ")+e}const hG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];n5.peek=gG;function dG(){return{canContainEols:["delete"],enter:{strikethrough:pG},exit:{strikethrough:mG}}}function fG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hG}],handlers:{delete:n5}}}function pG(e){this.enter({type:"delete",children:[]},e)}function mG(e){this.exit(e)}function n5(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function gG(){return"~"}function vG(e){return e.length}function _G(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||vG,a=[],l=[],u=[],d=[];let h=0,p=-1;for(;++p<e.length;){const w=[],C=[];let k=-1;for(e[p].length>h&&(h=e[p].length);++k<e[p].length;){const T=yG(e[p][k]);if(n.alignDelimiters!==!1){const R=s(T);C[k]=R,(d[k]===void 0||R>d[k])&&(d[k]=R)}w.push(T)}l[p]=w,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)a[m]=Z2(r[m]);else{const w=Z2(r);for(;++m<h;)a[m]=w}m=-1;const _=[],b=[];for(;++m<h;){const w=a[m];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>d[m]&&(d[m]=T),b[m]=T),_[m]=R}l.splice(1,0,_),u.splice(1,0,b),p=-1;const S=[];for(;++p<l.length;){const w=l[p],C=u[p];m=-1;const k=[];for(;++m<h;){const T=w[m]||"";let R="",D="";if(n.alignDelimiters!==!1){const z=d[m]-(C[m]||0),L=a[m];L===114?R=" ".repeat(z):L===99?z%2?(R=" ".repeat(z/2+.5),D=" ".repeat(z/2-.5)):(R=" ".repeat(z/2),D=R):D=" ".repeat(z)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(R),k.push(T),n.alignDelimiters!==!1&&k.push(D),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
482
+ `)}function yG(e){return e==null?"":String(e)}function Z2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function bG(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),xG);return s(),l}function xG(e,t,n){return">"+(n?"":" ")+e}function SG(e,t){return Q2(e,t.inConstruct,!0)&&!Q2(e,t.notInConstruct,!1)}function Q2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function J2(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
483
+ `&&SG(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
484
+ `}function wG(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function CG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function kG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function EG(e,t,n,r){const s=kG(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(CG(e,n)){const m=n.enter("codeIndented"),_=n.indentLines(a,RG);return m(),_}const u=n.createTracker(r),d=s.repeat(Math.max(wG(a,s)+1,3)),h=n.enter("codeFenced");let p=u.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
485
+ `,encode:["`"],...u.current()})),m()}return p+=u.move(`
486
+ `),a&&(p+=u.move(a+`
487
+ `)),p+=u.move(d),h(),p}function RG(e,t,n){return(n?"":" ")+e}function Rb(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function MG(e,t,n,r){const s=Rb(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
488
+ `,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),l(),h}function TG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function au(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ff(e,t,n){const r=cl(e),s=cl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}r5.peek=AG;function r5(e,t,n,r){const s=TG(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=ff(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=au(h)+d.slice(1));const m=d.charCodeAt(d.length-1),_=ff(r.after.charCodeAt(0),m,s);_.inside&&(d=d.slice(0,-1)+au(m));const b=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+d+b}function AG(e,t,n){return n.options.emphasis||"*"}function DG(e,t){let n=!1;return kb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,H_}),!!((!e.depth||e.depth<3)&&_b(e)&&(t.options.setext||n))}function NG(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(DG(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),_=n.containerPhrasing(e,{...a.current(),before:`
489
+ `,after:`
490
+ `});return m(),p(),_+`
491
+ `+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
492
+ `))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
493
+ `,...a.current()});return/^[\t ]/.test(h)&&(h=au(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}i5.peek=OG;function i5(e){return e.value||""}function OG(){return"<"}s5.peek=LG;function s5(e,t,n,r){const s=Rb(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),h+=d.move(")"),l(),h}function LG(){return"!"}o5.peek=zG;function o5(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function zG(){return"!"}a5.peek=jG;function a5(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function jG(){return"`"}function l5(e,t){const n=_b(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}c5.peek=BG;function c5(e,t,n,r){const s=Rb(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if(l5(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),u(),h}function BG(e,t,n){return l5(e,n)?"<":"["}u5.peek=PG;function u5(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=p,a(),s==="full"||!h||h!==m?d+=u.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function PG(){return"["}function Mb(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function IG(e){const t=Mb(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function HG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function h5(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function FG(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?HG(n):Mb(n);const u=e.ordered?l==="."?")":".":IG(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&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&&(d=!0),h5(n)===l&&p){let m=-1;for(;++m<e.children.length;){const _=e.children[m];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function UG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $G(e,t,n,r){const s=UG(n);let a=n.bulletCurrent||Mb(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),p);return d(),h;function p(m,_,b){return _?(b?"":" ".repeat(l))+m:(b?a:a+" ".repeat(l-a.length))+m}}function WG(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const qG=Gf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function VG(e,t,n,r){return(e.children.some(function(l){return qG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function KG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}d5.peek=GG;function d5(e,t,n,r){const s=KG(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),p=ff(r.before.charCodeAt(r.before.length-1),h,s);p.inside&&(d=au(h)+d.slice(1));const m=d.charCodeAt(d.length-1),_=ff(r.after.charCodeAt(0),m,s);_.inside&&(d=d.slice(0,-1)+au(m));const b=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+d+b}function GG(e,t,n){return n.options.strong||"*"}function YG(e,t,n,r){return n.safe(e.value,r)}function XG(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ZG(e,t,n){const r=(h5(n)+(n.options.ruleSpaces?" ":"")).repeat(XG(n));return n.options.ruleSpaces?r.slice(0,-1):r}const f5={blockquote:bG,break:J2,code:EG,definition:MG,emphasis:r5,hardBreak:J2,heading:NG,html:i5,image:s5,imageReference:o5,inlineCode:a5,link:c5,linkReference:u5,list:FG,listItem:$G,paragraph:WG,root:VG,strong:d5,text:YG,thematicBreak:ZG};function QG(){return{enter:{table:JG,tableData:ek,tableHeader:ek,tableRow:tY},exit:{codeText:nY,table:eY,tableData:fv,tableHeader:fv,tableRow:fv}}}function JG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function eY(e){this.exit(e),this.data.inTable=void 0}function tY(e){this.enter({type:"tableRow",children:[]},e)}function fv(e){this.exit(e)}function ek(e){this.enter({type:"tableCell",children:[]},e)}function nY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rY));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rY(e,t){return t==="|"?t:e}function iY(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
494
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:l,tableCell:d,tableRow:u}};function l(b,S,w,C){return h(p(b,w,C),b.align)}function u(b,S,w,C){const k=m(b,w,C),T=h([k]);return T.slice(0,T.indexOf(`
495
+ `))}function d(b,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(b,{...C,before:a,after:a});return T(),k(),R}function h(b,S){return _G(b,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function p(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("table");for(;++k<C.length;)T[k]=m(C[k],S,w);return R(),T}function m(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=d(C[k],b,S,w);return R(),T}function _(b,S,w){let C=f5.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function sY(){return{exit:{taskListCheckValueChecked:tk,taskListCheckValueUnchecked:tk,paragraph:aY}}}function oY(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lY}}}function tk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function aY(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===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(e)}function lY(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=f5.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(p){return p+l}}function cY(){return[FK(),lG(),dG(),QG(),sY()]}function uY(e){return{extensions:[UK(),cG(e),fG(),iY(e),oY()]}}const hY={tokenize:vY,partial:!0},p5={tokenize:_Y,partial:!0},m5={tokenize:yY,partial:!0},g5={tokenize:bY,partial:!0},dY={tokenize:xY,partial:!0},v5={name:"wwwAutolink",tokenize:mY,previous:y5},_5={name:"protocolAutolink",tokenize:gY,previous:b5},ls={name:"emailAutolink",tokenize:pY,previous:x5},Ri={};function fY(){return{text:Ri}}let Mo=48;for(;Mo<123;)Ri[Mo]=ls,Mo++,Mo===58?Mo=65:Mo===91&&(Mo=97);Ri[43]=ls;Ri[45]=ls;Ri[46]=ls;Ri[95]=ls;Ri[72]=[ls,_5];Ri[104]=[ls,_5];Ri[87]=[ls,v5];Ri[119]=[ls,v5];function pY(e,t,n){const r=this;let s,a;return l;function l(m){return!W_(m)||!x5.call(r,r.previous)||Tb(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return W_(m)?(e.consume(m),u):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(dY,p,h)(m):m===45||m===95||An(m)?(a=!0,e.consume(m),d):p(m)}function h(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&Bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function mY(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!y5.call(r,r.previous)||Tb(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hY,e.attempt(p5,e.attempt(m5,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function gY(e,t,n){const r=this;let s="",a=!1;return l;function l(m){return(m===72||m===104)&&b5.call(r,r.previous)&&!Tb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(Bn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?h:(a=!0,d)):n(m)}function h(m){return m===null||uf(m)||mt(m)||Uo(m)||qf(m)?n(m):e.attempt(p5,e.attempt(m5,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function vY(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function _Y(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(g5,d,u)(h):h===null||mt(h)||Uo(h)||h!==45&&qf(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function yY(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(g5,t,a)(l):l===null||mt(l)||Uo(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function bY(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||mt(u)||Uo(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||mt(u)||Uo(u)?t(u):r(u)}function a(u){return Bn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):Bn(u)?(e.consume(u),l):n(u)}}function xY(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return An(a)?n(a):t(a)}}function y5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||mt(e)}function b5(e){return!Bn(e)}function x5(e){return!(e===47||W_(e))}function W_(e){return e===43||e===45||e===46||e===95||An(e)}function Tb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const SY={tokenize:AY,partial:!0};function wY(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:RY,continuation:{tokenize:MY},exit:TY}},text:{91:{name:"gfmFootnoteCall",tokenize:EY},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CY,resolveTo:kY}}}}function CY(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const h=Zr(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function kY(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function EY(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(a>999||m===93&&!l||m===null||m===91||mt(m))return n(m);if(m===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(Zr(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return mt(m)||(l=!0),a++,e.consume(m),m===92?p:h}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function RY(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(l>999||S===93&&!u||S===null||S===91||mt(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Zr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return mt(S)||(u=!0),l++,e.consume(S),S===92?m:p}function m(S){return S===91||S===92||S===93?(e.consume(S),l++,p):p(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(a)||s.push(a),tt(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function MY(e,t,n){return e.check(Au,t,e.attempt(SY,t,n))}function TY(e){e.exit("gfmFootnoteDefinition")}function AY(e,t,n){const r=this;return tt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function DY(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},_=[["enter",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",m,u]],b=u.parser.constructs.insideSpan.null;b&&_r(_,_.length,0,Vf(b,l.slice(h+1,d),u)),_r(_,_.length,0,[["exit",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",p,u]]),_r(l,h-1,d-h+3,_),d=h+_.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,u,d){const h=this.previous,p=this.events;let m=0;return _;function _(S){return h===126&&p[p.length-1][1].type!=="characterEscape"?d(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=cl(h);if(S===126)return m>1?d(S):(l.consume(S),m++,b);if(m<2&&!n)return d(S);const C=l.exit("strikethroughSequenceTemporary"),k=cl(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class NY{constructor(){this.map=[]}add(t,n,r){OY(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function OY(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function LY(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function zY(){return{flow:{null:{name:"table",tokenize:jY,resolveAll:BY}}}}function jY(e,t,n){const r=this;let s=0,a=0,l;return u;function u(P){let W=r.events.length-1;for(;W>-1;){const V=r.events[W][1].type;if(V==="lineEnding"||V==="linePrefix")W--;else break}const H=W>-1?r.events[W][1].type:null,F=H==="tableHead"||H==="tableRow"?L:d;return F===L&&r.parser.lazy[r.now().line]?n(P):F(P)}function d(P){return e.enter("tableHead"),e.enter("tableRow"),h(P)}function h(P){return P===124||(l=!0,a+=1),p(P)}function p(P){return P===null?n(P):Ae(P)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):n(P):Ye(P)?tt(e,p,"whitespace")(P):(a+=1,l&&(l=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(P)))}function m(P){return P===null||P===124||mt(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?_:m)}function _(P){return P===92||P===124?(e.consume(P),m):m(P)}function b(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,Ye(P)?tt(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?C(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):z(P)}function w(P){return Ye(P)?tt(e,C,"whitespace")(P):C(P)}function C(P){return P===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):P===45?(a+=1,k(P)):P===null||Ae(P)?D(P):z(P)}function k(P){return P===45?(e.enter("tableDelimiterFiller"),T(P)):z(P)}function T(P){return P===45?(e.consume(P),T):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(P))}function R(P){return Ye(P)?tt(e,D,"whitespace")(P):D(P)}function D(P){return P===124?S(P):P===null||Ae(P)?!l||s!==a?z(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):z(P)}function z(P){return n(P)}function L(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||Ae(P)?(e.exit("tableRow"),t(P)):Ye(P)?tt(e,j,"whitespace")(P):(e.enter("data"),I(P))}function I(P){return P===null||P===124||mt(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?Z:I)}function Z(P){return P===92||P===124?(e.consume(P),I):I(P)}}function BY(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,p,m;const _=new NY;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(u=!1,d!==0&&(nk(_,t,d,h,p),p=void 0,d=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=vd(_,t,a,s,void 0,m),a=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=vd(_,t,a,s,void 0,m)),a=l,l=[a[1],n,0,0])):S.type==="tableHead"?(u=!0,d=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=vd(_,t,a,s,n,m)):l[1]!==0&&(m=vd(_,t,l,s,n,m)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&nk(_,t,d,h,p),_.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=LY(t.events,n))}return e}function vd(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Wa(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Wa(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=Wa(t.events,n[2]),p=Wa(t.events,n[3]),m={type:u,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const _=t.events[n[2]],b=t.events[n[3]];if(_[1].end=Object.assign({},b[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},Wa(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function nk(e,t,n,r,s){const a=[],l=Wa(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Wa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const PY={name:"tasklistCheck",tokenize:HY};function IY(){return{text:{91:PY}}}function HY(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return mt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return Ae(d)?t(d):Ye(d)?e.check({tokenize:FY},t,n)(d):n(d)}}function FY(e,t,n){return tt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function UY(e){return NA([fY(),wY(),DY(e),zY(),IY()])}const $Y={};function Zf(e){const t=this,n=e||$Y,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(UY(n)),a.push(cY()),l.push(uY(n))}function WY({content:e,onOpenLocalLink:t}){return v.jsx("div",{className:"flex gap-2 justify-end",children:v.jsx("div",{className:"max-w-[85%] sm:max-w-[80%] rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert [&_p]:whitespace-pre-line",children:v.jsx(Xf,{remarkPlugins:[Zf],components:Wf({onOpenLocalLink:t}),children:e})})})}function qY({json:e}){return v.jsx("div",{className:"flex gap-3 justify-start",children:v.jsx("div",{className:"flex-1 max-w-[90%]",children:v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words bg-muted rounded-lg p-3 overflow-auto max-h-96",children:e})})})}function S5({title:e,count:t,children:n,badge:r}){const[s,a]=x.useState(!1);return t===0?null:v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[v.jsx(ts,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),v.jsx("span",{className:"text-muted-foreground font-medium",children:e}),v.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&v.jsx("div",{className:"ml-5",children:n})]})}function pv({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:v.jsx(S5,{title:e,count:t.length,children:v.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>v.jsx(mA,{icon:r?r(s):n,children:s},s))})})}function VY(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function w5({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return v.jsx("span",{className:ye("inline-block h-2 w-2 rounded-full shrink-0",t)})}function KY(e){switch(e){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return e}}function rk({server:e}){const[t,n]=x.useState(!1),r=e.status==="connected";return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:ye("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&v.jsx(ts,{className:ye("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),v.jsx(w5,{status:e.status}),v.jsx("span",{className:"text-muted-foreground font-medium",children:Dv(e.name)}),r?v.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):v.jsx("span",{className:"text-muted-foreground/50",children:KY(e.status)})]}),!r&&e.error&&v.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>v.jsx(mA,{icon:pA(`mcp__${e.name}__${s}`),children:s},s))})]})}function GY({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"),n=e.filter(s=>s.status!=="connected"),r=n.length>0?v.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[v.jsx(w5,{status:"failed"}),v.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return v.jsx(S5,{title:"MCP Servers",count:e.length,badge:r,children:v.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>v.jsx(rk,{server:s},s.name)),n.map(s=>v.jsx(rk,{server:s},s.name))]})})}function YY({rawJson:e}){const[t,n]=x.useState(!1);return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[v.jsx(ts,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),v.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&v.jsx("pre",{className:"ml-5 text-xs whitespace-pre-wrap break-all border border-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto",children:e})]})}function XY({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=x.useMemo(()=>{const s=new Map,a=[];for(const u of e.tools){const d=VY(u);if(d){const h=s.get(d.server)||[];h.push(d.tool),s.set(d.server,h)}else a.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:a,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return v.jsx(to,{children:v.jsxs(Uf,{expandedContent:v.jsx($f,{className:"my-4 text-xs",children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(i$,{children:e.model}),v.jsx(pv,{title:"Tools",items:n,getIcon:s=>R_[s]??fA}),v.jsx(pv,{title:"Agents",items:e.agents,icon:dy}),v.jsx(pv,{title:"Commands",items:e.slashCommands,icon:k6}),v.jsx(GY,{servers:r}),t&&v.jsx(YY,{rawJson:t})]})}),children:[v.jsx(vz,{className:"h-5 w-5 text-logo"}),v.jsx(Xs,{children:"Session Started"})]})})}function ZY({message:e}){return v.jsx(to,{className:"hidden",children:v.jsxs(Uf,{expandedContent:v.jsx($f,{className:"my-4 text-xs",children:v.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto",children:JSON.stringify(e.accountInfo,null,2)})}),children:[v.jsx("div",{className:"size-5 flex justify-center items-center ",children:v.jsx(dy,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(Xs,{children:"Account"})]})})}function QY({message:e,onOpenLocalLink:t}){return v.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:v.jsx(Xf,{remarkPlugins:[Zf],components:Wf({onOpenLocalLink:t}),children:e.text})})}function JY({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const a=r&&t>0;return v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("div",{className:"relative",children:[v.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border text-foreground flex flex-row items-center gap-2",children:[a?v.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:v.jsx(Rz,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?v.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&v.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:v.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function ik({label:e,description:t}){return v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-foreground text-sm",children:e}),t&&v.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function C5({selected:e,multiSelect:t,onClick:n}){return v.jsx("button",{type:"button",onClick:n,className:ye("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",t?"rounded":"rounded-full",e?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",n&&e&&"cursor-pointer"),children:e&&v.jsx(zo,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function eX({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const a="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?v.jsx("button",{onClick:r,className:ye(a,l,"transition-all cursor-pointer"),children:v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsx("div",{className:"flex-1 min-w-0",children:v.jsx(ik,{label:e.label,description:e.description})}),v.jsx(C5,{selected:t,multiSelect:n})]})}):v.jsx("div",{className:ye(a,l),children:v.jsx(ik,{label:e.label,description:e.description})})}function tX(e){return e==null?void 0:e.answers}function Gr(e){return e.id||e.question}function nX({message:e,onSubmit:t,isLatest:n}){var O,K;const r=e.input.questions,s=!!e.result,a=tX(e.result),l=((O=e.result)==null?void 0:O.discarded)===!0,[u,d]=x.useState(0),[h,p]=x.useState({}),[m,_]=x.useState({}),[b,S]=x.useState(a??null),[w,C]=x.useState(s),k=($,J)=>{var X;const A=(X=m[$])==null?void 0:X.trim(),B=h[$]||"",Y=J||r.find(se=>Gr(se)===$);if(Y!=null&&Y.multiSelect)return[B,A].filter(Boolean).flatMap(se=>se.split(", ").filter(Boolean));const M=A||B;return M?[M]:[]},T=$=>{const J=h[Gr($)]||"";return $.multiSelect?J.split(", ").filter(Boolean):[J]},R=($,J)=>{const A=Gr($);if($.multiSelect){const B=h[A]?h[A].split(", ").filter(Boolean):[],Y=B.includes(J)?B.filter(M=>M!==J):[...B,J];p({...h,[A]:Y.join(", ")})}else p({...h,[A]:J}),_({...m,[A]:""}),u<r.length-1&&setTimeout(()=>d(u+1),150)},D=($,J)=>{const A=Gr($);_({...m,[A]:J}),J&&!$.multiSelect&&p({...h,[A]:""})},z=$=>{const J=Gr($);$.multiSelect&&m[J]&&_({...m,[J]:""})},L=r.every($=>k(Gr($),$).length>0),j=r[u],I=u===r.length-1,Z=j&&k(Gr(j),j).length>0,P=()=>{u<r.length-1&&d(u+1)},W=()=>{u>0&&d(u-1)},H=()=>{if(!L)return;const $={};for(const J of r){const A=Gr(J);$[A]=k(A,J)}S($),C(!0),t(e.toolId,r,$)},F=$=>{if($.key==="Enter"&&!(!j||!Z)){if($.preventDefault(),I){H();return}P()}};if(w||s){const $=a||b||{};return v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("div",{className:"font-medium text-sm p-3 px-4 pr-5 bg-muted border-b border-border flex flex-row items-center justify-between",children:[v.jsxs("p",{children:["Question",r.length!==1?"s":""]}),v.jsx("p",{className:"",children:l?"Discarded":"Answers"})]}),r.map((J,A)=>{const B=$[Gr(J)]||$[J.question]||[],Y=A===r.length-1;return v.jsxs("div",{className:ye("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Y&&"border-b border-border"),children:[v.jsx("div",{className:"text-sm text-pretty",children:J.question}),B.length>0&&v.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:B.join(", ")}),B.length===0&&v.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},Gr(J))})]})})}if(!n)return v.jsx("div",{className:"w-full py-2",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(DE,{className:"h-4 w-4 text-muted-foreground"}),v.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!j)return null;const V=T(j),U=m[Gr(j)]||"";return v.jsxs("div",{className:"w-full space-y-3",children:[v.jsxs(JY,{question:j.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?W:void 0,children:[(K=j.options)==null?void 0:K.map($=>v.jsx(eX,{option:$,selected:V.includes($.label),multiSelect:j.multiSelect,onClick:()=>R(j,$.label)},$.label)),v.jsx("div",{className:"transition-all bg-background",children:v.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[v.jsx("input",{type:"text",value:U,onChange:$=>D(j,$.target.value),onKeyDown:F,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),v.jsx(C5,{selected:!!U,multiSelect:j.multiSelect,onClick:j.multiSelect&&U?()=>z(j):void 0})]})})]}),v.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!I&&Z&&(j.multiSelect||!!U)&&v.jsx(et,{size:"sm",onClick:P,children:"Next"}),I&&v.jsx(et,{size:"sm",onClick:H,disabled:!L,className:ye(!L&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function rX({message:e,onConfirm:t,isLatest:n,onOpenLocalLink:r}){const s=!!e.result,[a,l]=x.useState(!1),[u,d]=x.useState(!1),[h,p]=x.useState(!1),[m,_]=x.useState(""),b=x.useRef(null),S=e.input;x.useEffect(()=>{h&&b.current&&b.current.focus()},[h]);const w=async()=>{S!=null&&S.plan&&(await navigator.clipboard.writeText(S.plan),d(!0),setTimeout(()=>d(!1),2e3))},C=s?e.result:null,k=(C==null?void 0:C.discarded)===!0;return v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(S==null?void 0:S.plan)&&v.jsx(et,{variant:"ghost",size:"icon",className:ye("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-0 group-hover/plan:opacity-100 transition-opacity",!u&&"hover:text-foreground",u&&"hover:!bg-transparent hover:!border-transparent"),onClick:w,children:u?v.jsx(zo,{className:"h-4 w-4 text-green-400"}):v.jsx(wf,{className:"h-4 w-4"})}),v.jsxs("div",{className:ye("!pt-5 !pb-0 px-4 md:py-4.5 md:px-5.5 bg-muted dark:bg-card overflow-scroll no-pre-highlight transition-all",s&&!a?"max-h-[min(400px,40vh)] ":"",s?"hover:!pb-[32px]":""),children:[s&&v.jsxs(et,{variant:"ghost",className:"absolute z-10 bottom-2 pr-2.5 !pl-3.5 h-[34px] inline-flex gap-1 text-sm left-[50%] -translate-x-[50%] text-muted-foreground backdrop-blur-sm hover:text-foreground opacity-0 group-hover/plan:opacity-100 transition-all rounded-full border border-border",onClick:()=>l(!a),children:[a?"Show Less":"Show More",v.jsx(kz,{className:`size-3.5 transition-transform ${a?"rotate-180":""}`})]}),S!=null&&S.plan?v.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[v.jsx(Xf,{remarkPlugins:[Zf],components:Wf({onOpenLocalLink:r}),children:S.plan}),v.jsx("div",{className:"mt-5"})]}):v.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),s?v.jsx("div",{className:"flex justify-end mx-2",children:v.jsxs("span",{className:"pl-4 inline text-sm font-medium bg-background text-foreground/60 border border-border py-1.5 px-3 rounded-[20px] leading-relaxed max-w-[85%] sm:max-w-[80%]",children:[v.jsx("em",{children:k?"Discarded":C!=null&&C.clearContext?"Approved & Cleared Context":C!=null&&C.confirmed?"Approved":C!=null&&C.message?`Adjusted: "${C.message}"`:"Adjusted Plan"}),v.jsx(Pz,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?v.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&v.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[v.jsxs(et,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[v.jsx(bz,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),v.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[v.jsxs(et,{size:"sm",variant:"outline",onClick:()=>p(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[v.jsx(OE,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),v.jsxs(et,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[v.jsx(zo,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),h&&v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx("textarea",{ref:b,value:m,onChange:T=>_(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&m.trim()&&(T.preventDefault(),t(e.toolId,!1,void 0,m.trim())),T.key==="Escape"&&(p(!1),_(""))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full rounded-2xl border border-border bg-muted dark:bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),v.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[v.jsx(et,{size:"sm",variant:"ghost",onClick:()=>{p(!1),_("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),v.jsxs(et,{size:"sm",disabled:!m.trim(),onClick:()=>t(e.toolId,!1,void 0,m.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[v.jsx(y6,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):v.jsx("div",{className:"flex justify-end mx-2",children:v.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const iX={completed:{Icon:zo,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Js,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:Nz,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function sX({message:e}){const t=e.input.todos;return t.length?v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border flex items-center gap-2",children:[v.jsx(r6,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),v.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:a,iconClass:l,textClass:u}=iX[n.status];return v.jsxs("div",{className:ye("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[v.jsx(a,{className:ye("h-4 w-4 flex-shrink-0",l)}),v.jsx("span",{className:ye("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function oX(e){const t=e.split(`
496
+ `),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const s=r.match(n);return s?{lineNumber:parseInt(s[1],10),content:s[2]}:{lineNumber:null,content:r}})}function aX(e){return e.replace(/<[^>]+>/g,"")}function lX(e,t){const n=e.split(`
497
+ `),r=t.split(`
498
+ `),s=cX(n,r),a=uX(n,r,s);return hX(a)}function cX(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=1;a<=n;a++)for(let l=1;l<=r;l++)s[a][l]=e[a-1]===t[l-1]?s[a-1][l-1]+1:Math.max(s[a-1][l],s[a][l-1]);return s}function uX(e,t,n){const r=[];let s=e.length,a=t.length;for(;s>0||a>0;)s>0&&a>0&&e[s-1]===t[a-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:a}),s--,a--):a>0&&(s===0||n[s][a-1]>=n[s-1][a])?(r.push({type:"added",text:t[a-1],oldIdx:s,newIdx:a}),a--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:a}),s--);return r.reverse()}function hX(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function mv({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=x.useMemo(()=>t&&n!==void 0&&r!==void 0?lX(n,r):[],[t,n,r]),a=x.useMemo(()=>t?[]:oX(e),[e,t]),l=x.useMemo(()=>a.some(u=>u.lineNumber!==null),[a]);return t&&s.length>0?v.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:v.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:v.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:v.jsx("tbody",{children:s.map((u,d)=>{const h=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",p=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return v.jsxs("tr",{className:h,children:[v.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${u.type==="removed"?"text-red-500/50":u.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:u.type==="removed"?"-":u.type==="added"?"+":" "}),v.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${p}`,children:u.content.slice(1)})]},d)})})})})}):v.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:v.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:v.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:v.jsx("tbody",{children:a.map((u,d)=>v.jsxs("tr",{children:[l&&v.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:u.lineNumber!==null?u.lineNumber:""}),v.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:aX(u.content)})]},d))})})})})}function k5({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,a=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill;if(e.toolKind==="glob")return`Search files ${e.input.pattern==="**/*"?"in all directories":`matching ${e.input.pattern}`}`;if(e.toolKind==="grep"){const w=e.input.pattern,C=e.input.outputMode;return C==="count"?`Count \`${w}\` occurrences`:C==="content"?`Find \`${w}\` in text`:`Find \`${w}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?FB(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${Gg(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${Gg(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${Gg(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${Dv(e.input.tool)} from ${Dv(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),l=x.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),d=e.toolKind==="bash",h=e.toolKind==="write_file",p=e.toolKind==="edit_file",m=e.toolKind==="read_file",_=x.useMemo(()=>{if(typeof e.result=="string")return e.result;if(!e.result)return"";if(typeof e.result=="object"&&e.result!==null&&"content"in e.result){const w=e.result.content;if(typeof w=="string")return w}return JSON.stringify(e.result,null,2)},[e.result]),b=x.useMemo(()=>{switch(e.toolKind){case"bash":return e.input.command;case"write_file":return e.input.content;default:return JSON.stringify(e.input,null,2)}},[e]);return v.jsx(to,{className:"w-full",children:v.jsxs(Uf,{expandedContent:v.jsx($f,{className:"my-4 text-sm",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[p?v.jsx(mv,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!m&&!h&&v.jsx(a2,{label:d?v.jsxs("span",{className:"flex items-center gap-2 w-full",children:[v.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&v.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&v.jsx("span",{className:"text-muted-foreground",children:"background"})]}):h?"Contents":"Input",copyText:b,children:b}),r&&m&&!e.isError&&v.jsx(mv,{content:_}),h&&!e.isError&&v.jsx(mv,{content:e.input.content}),r&&!m&&!(h&&!e.isError)&&!(p&&!e.isError)&&v.jsx(a2,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return v.jsx(fu,{className:"size-4 text-destructive"});if(l)return v.jsx(dy,{className:"size-4 text-muted-icon"});const w=pA(e.toolName);return v.jsx(w,{className:"size-4 text-muted-icon"})})()}),v.jsx(Xs,{className:"text-left transition-opacity duration-200 truncate",children:v.jsx(Df,{animate:s,shimmerWidth:Math.max(20,(((S=u||a)==null?void 0:S.length)??33)*3),children:u||a})})]})})}function dX({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${a>0?` ${a}m`:""}`:a>0?`${a}m${l>0?` ${l}s`:""}`:`${l}s`};return v.jsxs(to,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[v.jsx("div",{className:"w-full h-[1px] bg-border"}),v.jsxs(Xs,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),v.jsx("div",{className:"w-full h-[1px] bg-border"})]})}function fX({message:e}){return v.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:v.jsxs("div",{className:"inline-flex gap-1.5 items-center justify-center whitespace-nowrap text-sm font-medium bg-background text-foreground/60 border border-border h-9 pl-1 pr-4 rounded-full",children:[v.jsx(Az,{className:"h-4 w-4 ml-1.5"}),v.jsx("em",{children:"Interrupted"})]})})}function pf({size:e=4}){return v.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[v.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:v.jsx("path",{d:`M0 ${e} L${e/2} 0 L${e} ${e}`,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:{stroke:"currentColor"}})}),v.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function pX(){return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(pf,{}),v.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),v.jsx(pf,{})]})}function mX(){return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(pf,{}),v.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),v.jsx(pf,{})]})}function gX({message:e,onOpenLocalLink:t}){return v.jsx(to,{children:v.jsxs(Uf,{expandedContent:v.jsx($f,{className:"my-4 text-xs",children:v.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:v.jsx(Xf,{remarkPlugins:[Zf],components:Wf({onOpenLocalLink:t}),children:e.summary})})}),children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(NE,{className:"h-4.5 w-4.5 text-muted-foreground"})}),v.jsx(Xs,{children:"Summarized"})]})})}const vX={compacting:"Compacting..."};function _X({message:e}){const t=vX[e.status]||e.status;return v.jsxs(to,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(NE,{className:"h-4.5 w-4.5 text-muted-foreground"})}),v.jsx(Xs,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const yX={read_file:{key:"read",singular:"read",plural:"reads"},edit_file:{key:"edit",singular:"edit",plural:"edits"},write_file:{key:"write",singular:"write",plural:"writes"},bash:{key:"bash",singular:"command",plural:"commands"},grep:{key:"grep",singular:"search",plural:"searches"},glob:{key:"glob",singular:"glob",plural:"globs"},subagent_task:{key:"task",singular:"agent",plural:"agents"},web_search:{key:"websearch",singular:"web search",plural:"web searches"},skill:{key:"skill",singular:"skill",plural:"skills"},todo_write:{key:"todo",singular:"todo update",plural:"todo updates"}},bX={key:"other",singular:"tool call",plural:"tool calls"};function xX(e){return yX[e]??bX}function SX(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,a=xX(s),l=t.get(a.key);l?l.count++:(t.set(a.key,{category:a,count:1}),n.push(a.key))}return n.map(r=>{const{category:s,count:a}=t.get(r);return`${a} ${a===1?s.singular:s.plural}`}).join(", ")}function wX({messages:e,isLoading:t,localPath:n}){const[r,s]=x.useState(!1),a=x.useMemo(()=>SX(e),[e]),u=e.some(d=>d.result===void 0)&&t;return v.jsx(to,{className:"w-full",children:v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsx("button",{onClick:()=>s(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!u?"hover:opacity-60 transition-opacity":""}`,children:v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(ts,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),v.jsx(Xs,{className:"text-left",children:v.jsx(Df,{animate:u,children:a})})]})}),r&&v.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(d=>v.jsx(k5,{message:d,isLoading:t,localPath:n},d.id)),e.length>5&&v.jsx("button",{onClick:()=>s(!1),className:"cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-xs hover:opacity-80 transition-opacity",children:v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(ts,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),v.jsx(Xs,{className:"text-left",children:"Collapse"})]})})]})]})})}const CX=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function sk(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!CX.has(t)}function kX(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(sk(r)){const s=[r],a=n;for(n+=1;n<e.length&&sk(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:a}):t.push({type:"single",message:r,index:a});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function EX({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:a,onExitPlanModeConfirm:l}){const u=x.useMemo(()=>kX(e),[e]);function d(h,p){if(h.kind==="user_prompt")return v.jsx(WY,{content:h.content,onOpenLocalLink:s},h.id);switch(h.kind){case"unknown":return v.jsx(qY,{json:h.json},h.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===p?v.jsx(XY,{message:h,rawJson:h.debugRaw},h.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===p?v.jsx(ZY,{message:h},h.id):null;case"assistant_text":return v.jsx(QY,{message:h,onOpenLocalLink:s},h.id);case"tool":return h.toolKind==="ask_user_question"?v.jsx(nX,{message:h,onSubmit:a,isLatest:h.id===r.AskUserQuestion},h.id):h.toolKind==="exit_plan_mode"?v.jsx(rX,{message:h,onConfirm:l,isLatest:h.id===r.ExitPlanMode,onOpenLocalLink:s},h.id):h.toolKind==="todo_write"?h.id!==r.TodoWrite?null:v.jsx(sX,{message:h},h.id):v.jsx(k5,{message:h,isLoading:t,localPath:n},h.id);case"result":{const m=e[p+1],_=e[p-1];return(m==null?void 0:m.kind)==="context_cleared"||(_==null?void 0:_.kind)==="context_cleared"?null:v.jsx(dX,{message:h},h.id)}case"interrupted":return v.jsx(fX,{message:h},h.id);case"compact_boundary":return v.jsx(pX,{},h.id);case"context_cleared":return v.jsx(mX,{},h.id);case"compact_summary":return v.jsx(gX,{message:h,onOpenLocalLink:s},h.id);case"status":return p===e.length-1?v.jsx(_X,{message:h},h.id):null}}return v.jsx(v.Fragment,{children:u.map(h=>{if(h.type==="tool-group")return v.jsx("div",{className:"group relative",[kv]:"",children:v.jsx(wX,{messages:h.messages,isLoading:t,localPath:n})},`group-${h.startIndex}`);const p=d(h.message,h.index);return p?v.jsx("div",{id:`msg-${h.message.id}`,className:"group relative",[kv]:"",children:p},h.message.id):null})})}function RX({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){x.useEffect(()=>{if(!n)return;let s=0,a=null;const l=m=>{const _=m instanceof Element?m:null,b=e.current,S=t.current;if(!K6({activeElement:document.activeElement,pointerStartTarget:a,pointerEndTarget:_,root:b,fallback:S,hasActiveOverlay:pw(document),hasActiveSelection:W6(window.getSelection())})){a=null;return}S==null||S.focus({preventScroll:!0}),a=null},u=m=>{cancelAnimationFrame(s),a=m.target instanceof Element?m.target:null},d=m=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(m.target)})},h=()=>{a=null;const m=t.current;!m||m.disabled||m.focus({preventScroll:!0})},p=m=>{if(m.key!=="Escape")return;const _=t.current;V6({activeElement:document.activeElement,fallback:_,hasActiveOverlay:pw(document),canCancel:r,defaultPrevented:m.defaultPrevented})&&(m.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("keydown",p,!0),window.addEventListener($d,h),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener($d,h)}},[r,n,t,e])}const _d="What are we building?",MX=19,TX=72;function AX(){var U,O,K,$,J,A;const e=Y_(),t=x.useRef(null),n=x.useRef(null),r=x.useRef(null),s=x.useRef(null),a=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useRef(!1),h=x.useRef(null),p=x.useRef(!1),m=x.useRef(!1),_=x.useRef(!1),[b,S]=x.useState(""),[w,C]=x.useState(0),k=((U=e.runtime)==null?void 0:U.projectId)??null,R=Do(B=>k?B.projects[k]:void 0)??d$,D=Do(B=>B.addTerminal),z=Do(B=>B.removeTerminal),L=Do(B=>B.toggleVisibility),j=Do(B=>B.setMainSizes),I=Do(B=>B.setTerminalSizes),Z=zr(B=>B.scrollbackLines),P=zr(B=>B.minColumnWidth),W=R.terminals.length>0,H=!!(k&&R.isVisible&&W),F=!!(k&&W);RX({rootRef:t,fallbackRef:n,enabled:e.hasSelectedProject&&((O=e.runtime)==null?void 0:O.status)!=="waiting_for_user",canCancel:e.canCancel}),x.useEffect(()=>{if(e.messages.length!==0)return;S("");let B=0;const Y=window.setInterval(()=>{B+=1,S(_d.slice(0,B)),B>=_d.length&&window.clearInterval(Y)},MX);return()=>window.clearInterval(Y)},[e.activeChatId,e.messages.length]),x.useEffect(()=>{function B(Y){if(k&&!(!Y.metaKey||Y.key.toLowerCase()!=="j")){if(Y.preventDefault(),W){L(k);return}D(k)}}return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[D,W,k,L]),x.useEffect(()=>{if(e.messages.length===0)return;const B=window.requestAnimationFrame(()=>{const Y=e.scrollRef.current;Y&&Y.scrollTo({top:Y.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(B)},[e.messages.length,e.scrollRef]),x.useEffect(()=>{var X;const B=h.current,Y=B!==null&&B!==k,M=_.current;!Y&&H&&!M&&C(se=>se+1),!Y&&!H&&M&&((X=n.current)==null||X.focus({preventScroll:!0})),_.current=H,h.current=k},[k,H]),x.useEffect(()=>()=>{l.current!==null&&window.cancelAnimationFrame(l.current),u.current!==null&&window.clearTimeout(u.current)},[]),x.useLayoutEffect(()=>{var Je,qe,Me,Ve,Nt,It;if(!F){l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),d.current=!1;return}const B=r.current;if(!B)return;l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null);const Y=h.current,M=Y!==null&&Y!==k,X=H&&!m.current,se=!p.current,re=H?R.mainSizes:[100,0],me=M||se&&H,Ce=X||se?[100,0]:[B.getLayout().chat??R.mainSizes[0],B.getLayout().terminal??R.mainSizes[1]];if(p.current=F,m.current=H,me||Math.abs(Ce[0]-re[0])<.1&&Math.abs(Ce[1]-re[1])<.1){B.setLayout({chat:re[0],terminal:re[1]}),(Je=s.current)==null||Je.setAttribute("data-terminal-open",H?"true":"false"),(qe=a.current)==null||qe.setAttribute("data-terminal-open",H?"true":"false"),(Me=a.current)==null||Me.setAttribute("data-terminal-animated","false");return}d.current=!0,(Ve=s.current)==null||Ve.setAttribute("data-terminal-open",H?"true":"false"),(Nt=a.current)==null||Nt.setAttribute("data-terminal-open",H?"true":"false"),(It=a.current)==null||It.setAttribute("data-terminal-animated","true"),B.setLayout({chat:Ce[0],terminal:Ce[1]});const pe=performance.now(),ke=ir=>{const Fn=Math.min(1,(ir-pe)/d2),Ht=x$(Ce,re,Fn);if(B.setLayout({chat:Ht[0],terminal:Ht[1]}),Fn<1){l.current=window.requestAnimationFrame(ke);return}B.setLayout({chat:re[0],terminal:re[1]}),l.current=null,u.current=window.setTimeout(()=>{d.current=!1,u.current=null},0)};l.current=window.requestAnimationFrame(ke)},[F,H,R.mainSizes]),x.useEffect(()=>{F||(p.current=!1,m.current=!1)},[F]);const V=v.jsxs(qM,{ref:t,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[v.jsxs(KM,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[v.jsx(V9,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:H,onToggleEmbeddedTerminal:k?()=>{if(W){L(k);return}D(k)}:void 0,onOpenExternal:B=>{e.handleOpenExternal(B)},editorLabel:e.editorLabel}),v.jsxs(gA,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?v.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[v.jsx(EX,{messages:e.messages,isLoading:e.isProcessing,localPath:(K=e.runtime)==null?void 0:K.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?v.jsx(a$,{status:($=e.runtime)==null?void 0:$.status}):null,e.commandError?v.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),v.jsx("div",{style:{height:e.transcriptPaddingBottom+96},"aria-hidden":"true"})]}):null]}),e.messages.length===0?v.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:TX,bottom:e.transcriptPaddingBottom},children:v.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:v.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[v.jsx(jc,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),v.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":_d,children:v.jsxs("span",{className:"relative inline-grid place-items-start",children:[v.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[v.jsx("span",{children:_d}),v.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),v.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[v.jsx("span",{children:b}),v.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:v.jsx("span",{className:"kanna-typewriter-cursor"})})]})]})})]})})},e.activeChatId??"new-chat"):null,v.jsx("div",{style:{bottom:e.transcriptPaddingBottom-36},className:ye("absolute left-1/2 -translate-x-1/2 z-10 transition-all",e.showScrollButton?"scale-100 duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]":"scale-60 duration-300 ease-out pointer-events-none blur-sm opacity-0"),children:v.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-white hover:bg-muted border border-border rounded-full aspect-square cursor-pointer text-sm text-primary hover:text-foreground dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-100 dark:border-slate-600",children:v.jsx(hz,{className:"h-5 w-5"})})})]}),v.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:v.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:v.jsx(U9,{ref:n,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((J=e.runtime)==null?void 0:J.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((A=e.runtime)==null?void 0:A.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return v.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:F&&k?v.jsxs(hT,{groupRef:r,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:B=>{!H||d.current||j(k,[B.chat,B.terminal])},children:[v.jsx($v,{id:"chat",defaultSize:`${R.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:V}),v.jsx(dT,{withHandle:!0,orientation:"vertical",className:ye(!H&&"pointer-events-none opacity-0")}),v.jsx($v,{id:"terminal",defaultSize:`${R.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:s,children:v.jsx("div",{ref:a,className:"h-full min-h-0 overflow-hidden","data-terminal-open":H?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${d2}ms`},children:v.jsx(t$,{projectId:k,layout:R,onAddTerminal:D,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:Z,minColumnWidth:P,focusRequestVersion:w,onRemoveTerminal:(B,Y)=>{e.socket.command({type:"terminal.close",terminalId:Y}).catch(()=>{}),z(B,Y)},onTerminalLayout:I})})})]},k):V})}function ok({narrow:e=!1,title:t,subtitle:n,icon:r=ly}){return v.jsxs("div",{className:ye("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[v.jsxs("div",{className:ye("flex items-center gap-1 mb-2",e&&"justify-center"),children:[v.jsx("div",{className:"p-2 pl-0 rounded-lg",children:v.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),v.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&v.jsx("p",{className:ye("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const DX={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function E5({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:a}){return v.jsx("div",{className:ye("inline-flex items-center rounded-full border border-border p-0.5 ",s),children:n.map(l=>{const u=l.value===e,d=l.icon,h=d?x.isValidElement(d)?d:(()=>{const m=d;return v.jsx(m,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,p=v.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:ye("rounded-full border transition-colors",d?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",DX[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",l.disabled&&"opacity-50 pointer-events-none",a),children:[h,v.jsx("span",{children:l.label})]},l.value);return l.tooltip?v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:p}),v.jsx(sl,{children:l.tooltip})]},l.value):p})})}function NX(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function OX({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=x.useState("new"),[a,l]=x.useState(""),[u,d]=x.useState(""),h=x.useRef(null),p=x.useRef(null);x.useEffect(()=>{e&&(s("new"),l(""),d(""),setTimeout(()=>{var C;return(C=h.current)==null?void 0:C.focus()},0))},[e]),x.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=h.current)==null||C.focus():(k=p.current)==null||k.focus()},0)},[r,e]);const m=NX(a),_=m?`${IB}/${m}`:"",b=u.trim(),S=r==="new"?!!m:!!b,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:a.trim()});else{const C=b.split("/").pop()||b;n({mode:"existing",localPath:b,title:C})}t(!1)}};return v.jsx(jE,{open:e,onOpenChange:t,children:v.jsxs(py,{size:"sm",children:[v.jsxs(IE,{className:"space-y-4",children:[v.jsx(PE,{children:"Add Project"}),v.jsx(E5,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full",optionClassName:"flex-1 justify-center"}),r==="new"?v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{ref:h,type:"text",value:a,onChange:C=>l(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"Project name"}),_&&v.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{ref:p,type:"text",value:u,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"~/Projects/my-app"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),v.jsxs(HE,{children:[v.jsx(et,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),v.jsx(et,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function LX({text:e}){const[t,n]=x.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return v.jsx(et,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?v.jsx(zo,{className:"h-4 w-4 text-green-400"}):v.jsx(wf,{className:"h-4 w-4"})})}function ak({children:e}){return v.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[v.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[v.jsx(ts,{className:"inline h-4 w-4 opacity-40"}),v.jsx("code",{children:e})]}),v.jsx(LX,{text:e})]})}function yd({children:e}){return v.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function gv({children:e}){return v.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function vv({icon:e,title:t,subtitle:n,iconClassName:r}){return v.jsxs("div",{className:"flex flex-col items-center gap-0",children:[v.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:v.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),v.jsx("span",{className:"text-sm font-medium",children:t}),v.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function lk(){return v.jsx(fz,{className:"h-4 w-4 text-muted-foreground"})}function ck({number:e,title:t,children:n}){return v.jsx("div",{className:"flex gap-4",children:v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[v.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),v.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),v.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function zX({localPath:e,loading:t,onClick:n}){return v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsxs("button",{className:ye("border border-border hover:border-primary/30 group rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",t&&"opacity-50 cursor-not-allowed"),disabled:t,onClick:n,children:[v.jsx(Qz,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),v.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:bR(e)}),t?v.jsx(Js,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):v.jsx(uy,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),v.jsx(sl,{children:v.jsx("p",{children:e})})]})}function jX({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:a,onCreateProject:l}){const[u,d]=x.useState(!1),h=x.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),p=e==="connecting"||!t,m=e==="connected"&&t;return v.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[m?v.jsxs(v.Fragment,{children:[v.jsx(ok,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${zn} is connected, choose a project below to get started.`}),v.jsxs("div",{className:"w-full px-6 mb-10",children:[v.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[v.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),v.jsxs(et,{variant:"default",size:"sm",onClick:()=>d(!0),children:[v.jsx(cy,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),h.length>0?v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:h.map(_=>v.jsx(zX,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{a(_.localPath)}},_.localPath))}):v.jsx(yd,{children:v.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),s?v.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:s}):null]})]}):v.jsxs(v.Fragment,{children:[v.jsx(ok,{narrow:!0,icon:hw,title:p?`Connecting ${zn}`:`Connect ${zn}`,subtitle:p?`${zn} is starting up and loading your local projects.`:`Run ${zn} directly on your machine with full access to your local files and agent project history.`}),v.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[v.jsx(gv,{children:"Status"}),v.jsx("div",{className:"mb-8",children:v.jsx(yd,{children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Js,{className:"h-4 w-4 text-muted-foreground animate-spin"}),v.jsx("span",{className:"text-sm text-muted-foreground",children:p?`Connecting to your local ${zn} server...`:v.jsxs(v.Fragment,{children:["Not connected. Run ",v.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:ed()})," from any terminal on this machine."]})})]})})}),p?null:v.jsxs("div",{className:"mb-10",children:[v.jsx(gv,{children:"How it works"}),v.jsx(yd,{children:v.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[v.jsx(vv,{icon:hy,title:`${zn} CLI`,subtitle:"On Your Machine"}),v.jsx(lk,{}),v.jsx(vv,{icon:ly,title:`${zn} Server`,subtitle:"Local WebSocket"}),v.jsx(lk,{}),v.jsx(vv,{icon:hw,title:`${zn} UI`,subtitle:"Project Chat"})]})})]}),p?null:v.jsxs("div",{className:"mb-10",children:[v.jsx(gv,{children:"Setup"}),v.jsx(yd,{children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs(ck,{number:1,title:`Start ${zn}`,children:[v.jsx("p",{children:"Run this command in your terminal:"}),v.jsx(ak,{children:ed()})]}),v.jsxs(ck,{number:2,title:"Open the local UI",children:[v.jsxs("p",{children:[zn," serves the app locally and opens the Local Projects page in an app-style browser window."]}),v.jsx(ak,{children:"http://localhost:3210/local"})]}),v.jsxs("div",{className:"mt-8",children:[v.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),v.jsxs("div",{className:"space-y-3 text-sm",children:[v.jsxs("div",{className:"flex gap-4",children:[v.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:ed("").trim()}),v.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:ed("--no-open")}),v.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),v.jsx(OX,{open:u,onOpenChange:d,onConfirm:_=>{l(_)}}),v.jsx("div",{className:"py-4 text-center",children:v.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",yR.split("/")[1]]})})]})}function BX(){const e=Y_();return v.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:v.jsx(jX,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}const _v=[{id:"general",label:"General",icon:w6,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"page-1",label:"Page 1",icon:tl,subtitle:"Placeholder content for a future settings section."},{id:"page-2",label:"Page 2",icon:T6,subtitle:"Placeholder content for a future settings section."},{id:"page-3",label:"Page 3",icon:Yz,subtitle:"Placeholder content for a future settings section."}],PX=[{value:"light",label:"Light",icon:O6},{value:"dark",label:"Dark",icon:f6},{value:"system",label:"System",icon:ly}],IX=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}];function bd({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return v.jsx("div",{className:r?"border-t border-border":void 0,children:v.jsxs("div",{className:`flex justify-between gap-8 py-5 ${s?"items-start":"items-center"}`,children:[v.jsxs("div",{className:"min-w-0 max-w-xl",children:[v.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),v.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),v.jsx("div",{className:"flex shrink-0 items-center justify-end",children:n})]})})}function HX(){var V,U;const e=Y_(),{theme:t,setTheme:n}=cA(),[r,s]=x.useState("general"),a=e.connectionStatus==="connecting"||!e.localProjectsReady,l=((V=e.localProjects)==null?void 0:V.machine.displayName)??"Unavailable",u=((U=e.localProjects)==null?void 0:U.projects.length)??0,d=yR.split("/")[1]??"unknown",h=zr(O=>O.scrollbackLines),p=zr(O=>O.minColumnWidth),m=zr(O=>O.editorPreset),_=zr(O=>O.editorCommandTemplate),b=zr(O=>O.setScrollbackLines),S=zr(O=>O.setMinColumnWidth),w=zr(O=>O.setEditorPreset),C=zr(O=>O.setEditorCommandTemplate),[k,T]=x.useState(String(h)),[R,D]=x.useState(String(p)),[z,L]=x.useState(_);x.useEffect(()=>{T(String(h))},[h]),x.useEffect(()=>{D(String(p))},[p]),x.useEffect(()=>{L(_)},[_]);function j(){const O=Number(k);if(!Number.isFinite(O)){T(String(h));return}b(O)}function I(){const O=Number(R);if(!Number.isFinite(O)){D(String(p));return}S(O)}function Z(O,K){O.key==="Enter"&&(K(),O.currentTarget.blur())}function P(O,K){O.key==="Enter"&&(K(),O.currentTarget.blur())}function W(){C(z)}const H=z.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),F=_v.find(O=>O.id===r)??_v[0];return v.jsxs("div",{className:"flex h-full flex-1 min-w-0 bg-background",children:[v.jsx("aside",{className:"hidden w-[200px] shrink-0 md:block",children:v.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[v.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),_v.map(O=>v.jsx("button",{type:"button",onClick:()=>s(O.id),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${O.id===r?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsx(O.icon,{className:"h-4 w-4 shrink-0"}),v.jsx("span",{children:O.label})]})},O.label))]})}),v.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:v.jsxs("div",{className:"w-full px-6 pt-16 pb-10",children:[a?v.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Js,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{children:"Loading machine settings…"})]})}):v.jsxs("div",{className:"mx-auto max-w-4xl",children:[v.jsxs("div",{className:"pb-6",children:[v.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:F.label}),v.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:F.subtitle})]}),r==="general"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"border-b border-border",children:[v.jsx(bd,{title:"Theme",description:"Choose between light, dark, or system appearance",bordered:!1,children:v.jsx(E5,{value:t,onValueChange:n,options:PX,size:"sm"})}),v.jsx(bd,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:v.jsx("select",{value:m,onChange:O=>w(O.target.value),className:"min-w-[180px] rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none",children:IX.map(O=>v.jsx("option",{value:O.value,children:O.label},O.value))})}),m==="custom"?v.jsx("div",{className:"border-t border-border",children:v.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[v.jsxs("div",{className:"min-w-0 max-w-xl",children:[v.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),v.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),v.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[v.jsx("input",{type:"text",value:z,onChange:O=>L(O.target.value),onBlur:W,onKeyDown:O=>P(O,W),className:"w-full rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none"}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",v.jsx("span",{className:"font-mono",children:H})]})]})]})}):null,v.jsx(bd,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"number",min:M_,max:T_,step:100,value:k,onChange:O=>T(O.target.value),onBlur:j,onKeyDown:O=>Z(O,j),className:"w-28 rounded-lg border border-border bg-background px-3 py-2 text-right font-mono text-sm text-foreground outline-none"}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:[M_,"-",T_," lines",h===lf?" (default)":""]})]})}),v.jsx(bd,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"number",min:A_,max:D_,step:10,value:R,onChange:O=>D(O.target.value),onBlur:I,onKeyDown:O=>Z(O,I),className:"w-28 rounded-lg border border-border bg-background px-3 py-2 text-right font-mono text-sm text-foreground outline-none"}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:[A_,"-",D_," px",p===cf?" (default)":""]})]})})]}),v.jsx("div",{className:"mt-8 border-t border-border pt-5",children:v.jsxs("div",{className:"grid gap-3 text-xs text-muted-foreground sm:grid-cols-2 lg:grid-cols-4",children:[v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Machine"}),v.jsx("div",{className:"text-foreground/80",children:l})]}),v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Connection"}),v.jsx("div",{className:"text-foreground/80",children:e.connectionStatus})]}),v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Projects Indexed"}),v.jsx("div",{className:"text-foreground/80",children:u})]}),v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"App Version"}),v.jsx("div",{className:"text-foreground/80",children:d})]})]})})]}):v.jsxs("div",{className:"rounded-2xl border border-border bg-card/30 px-6 py-8",children:[v.jsx("div",{className:"text-sm font-medium text-foreground",children:F.label}),v.jsx("div",{className:"mt-2 max-w-xl text-sm text-muted-foreground",children:"This page is a placeholder for future settings. The sidebar navigation is now active, but only General has live controls."})]})]}),e.commandError?v.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[v.jsx(t6,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),v.jsx("span",{children:e.commandError})]}):null]})})]})}function xd(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function FX(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function UX(e,t){const n=FX(t);switch(e.toolKind){case"ask_user_question":{const s=xd(n),a=xd(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(a).map(([l,u])=>Array.isArray(u)?[l,u.map(d=>String(d))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[l,u.answers.map(d=>String(d))]:u==null||u===""?[l,[]]:[l,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=xd(n);return{confirmed:typeof(s==null?void 0:s.confirmed)=="boolean"?s.confirmed:void 0,clearContext:typeof(s==null?void 0:s.clearContext)=="boolean"?s.clearContext:void 0,message:typeof(s==null?void 0:s.message)=="string"?s.message:void 0,...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=xd(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function R5(e){return new Date(e).toISOString()}function Yr(e){return{id:e._id,messageId:e.messageId,timestamp:R5(e.createdAt),hidden:e.hidden}}function $X(e){return{id:e._id,messageId:e.messageId,hidden:e.hidden,kind:"tool",toolKind:e.tool.toolKind,toolName:e.tool.toolName,toolId:e.tool.toolId,input:e.tool.input,timestamp:R5(e.createdAt)}}function WX(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function qX(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...Yr(r),kind:"user_prompt",content:r.content});break;case"system_init":n.push({...Yr(r),kind:"system_init",provider:r.provider,model:r.model,tools:r.tools,agents:r.agents,slashCommands:r.slashCommands,mcpServers:r.mcpServers,debugRaw:r.debugRaw});break;case"account_info":n.push({...Yr(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...Yr(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=$X(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const a=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?WX(r)??r.content:r.content;s.hydrated.result=UX(s.normalized,a),s.hydrated.rawResult=a,s.hydrated.isError=r.isError}break}case"result":n.push({...Yr(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Yr(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Yr(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Yr(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Yr(r),kind:"context_cleared"});break;case"interrupted":n.push({...Yr(r),kind:"interrupted"});break;default:n.push({...Yr(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const VX=["AskUserQuestion","ExitPlanMode","TodoWrite"],KX=new Set(["TodoWrite"]);function GX(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t&&!s.result)return s.id}return null}function YX(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t)return s.id}return null}function XX(e){const t={};for(const n of VX)t[n]=KX.has(n)?YX(e,n):GX(e,n);return t}function ZX(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function QX(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const JX=25e3,eZ=15e3,tZ=4e3;class nZ{constructor(t){Qt(this,"url");Qt(this,"ws",null);Qt(this,"started",!1);Qt(this,"reconnectTimer",null);Qt(this,"reconnectDelayMs",750);Qt(this,"subscriptions",new Map);Qt(this,"pending",new Map);Qt(this,"outboundQueue",[]);Qt(this,"statusListeners",new Set);Qt(this,"heartbeatTimer",null);Qt(this,"pingTimeoutTimer",null);Qt(this,"pingPromise",null);Qt(this,"lastOpenAt",0);Qt(this,"lastMessageAt",0);Qt(this,"reconnectImmediatelyOnClose",!1);Qt(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});Qt(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});Qt(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=t}start(){this.started||(this.started=!0,window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("online",this.handleOnline),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.connect())}dispose(){var t;this.started=!1,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(t=this.ws)==null||t.close(),this.ws=null;for(const n of this.pending.values())n.reject(new Error("Socket disposed"));this.pending.clear()}onStatus(t){return this.statusListeners.add(t),t(this.getStatus()),()=>{this.statusListeners.delete(t)}}subscribe(t,n){const r=crypto.randomUUID();return this.subscriptions.set(r,{topic:t,listener:n}),this.enqueue({v:1,type:"subscribe",id:r,topic:t}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}subscribeTerminal(t,n){const r=crypto.randomUUID(),s={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:s,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:s}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=crypto.randomUUID(),r={v:1,type:"command",id:n,command:t};return new Promise((s,a)=>{this.pending.set(n,{resolve:s,reject:a}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(PB,n.message);return}const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.reject(new Error(n.message))}}),this.ws.addEventListener("close",()=>{if(!this.started)return;const t=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const n of this.pending.values())n.reject(new Error("Disconnected"));if(this.pending.clear(),t){this.connect();return}this.scheduleReconnect()}))}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},this.reconnectDelayMs))}getStatus(){var t,n;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(t){for(const n of this.statusListeners)n(t)}isConnectionStale(){const t=Math.max(this.lastMessageAt,this.lastOpenAt);return t>0&&Date.now()-t>=JX}sendPing(){if(this.pingPromise)return this.pingPromise;const t=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=window.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},tZ),this.pingPromise=t,t}reconnectNow(){if(this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!this.ws||this.ws.readyState===WebSocket.CLOSED){this.connect();return}this.ws.readyState!==WebSocket.CONNECTING&&(this.reconnectImmediatelyOnClose=!0,this.ws.close())}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=window.setInterval(()=>{var t;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},eZ))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(window.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}enqueue(t){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(t);return}this.outboundQueue.push(t)}sendNow(t){var n;(n=this.ws)==null||n.send(JSON.stringify(t))}}function rZ(e,t){var r;const n=e.find(s=>s.chats.some(a=>a.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function iZ(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function sZ(){const e=x.useRef(null);return e.current||(e.current=new nZ(iZ())),x.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function oZ(e){var de,Ee,Le;const t=G_(),n=sZ(),r=Q6(),[s,a]=x.useState({projectGroups:[]}),[l,u]=x.useState(null),[d,h]=x.useState(null),[p,m]=x.useState("connecting"),[_,b]=x.useState(!1),[S,w]=x.useState(!1),[C,k]=x.useState(!1),[T,R]=x.useState(null),[D,z]=x.useState(!1),[L,j]=x.useState(!1),[I,Z]=x.useState(148),[P,W]=x.useState(!0),[H,F]=x.useState(null),[V,U]=x.useState(null),[O,K]=x.useState(null),$=f$(zr(he=>he.editorPreset)),J=x.useRef(null),A=x.useRef(null);x.useEffect(()=>n.onStatus(m),[n]),x.useEffect(()=>n.subscribe({type:"sidebar"},he=>{a(he),b(!0),F(null)}),[n]),x.useEffect(()=>n.subscribe({type:"local-projects"},he=>{u(he),w(!0),F(null)}),[n]),x.useEffect(()=>{if(!e){h(null),k(!0);return}return k(!1),n.subscribe({type:"chat",chatId:e},he=>{h(he),k(!0),F(null)})},[e,n]),x.useEffect(()=>{if(T)return;const he=s.projectGroups[0];he&&R(he.groupKey)},[T,s.projectGroups]),x.useEffect(()=>{if(!e||!_||!C)return;if(s.projectGroups.some(ge=>ge.chats.some(je=>je.chatId===e))){O===e&&K(null);return}O!==e&&t("/")},[e,C,t,O,s.projectGroups,_]),x.useEffect(()=>{d&&(R(d.runtime.projectId),O===d.runtime.chatId&&K(null))},[d,O]),x.useLayoutEffect(()=>{const he=A.current;if(!he)return;const ge=new ResizeObserver(()=>{Z(he.getBoundingClientRect().height)});return ge.observe(he),Z(he.getBoundingClientRect().height),()=>ge.disconnect()},[]);const B=x.useMemo(()=>qX((d==null?void 0:d.messages)??[]),[d==null?void 0:d.messages]),Y=x.useMemo(()=>XX(B),[B]),M=(d==null?void 0:d.runtime)??null,X=(d==null?void 0:d.availableProviders)??_9,se=QX(M==null?void 0:M.status),re=ZX(M==null?void 0:M.status),me=I+48,Ce=!P&&B.length>0,pe=((de=l==null?void 0:l.projects[0])==null?void 0:de.localPath)??null,ke=(M==null?void 0:M.localPath)??pe??((Ee=s.projectGroups[0])==null?void 0:Ee.localPath),Je=!!(T??(M==null?void 0:M.projectId)??((Le=s.projectGroups[0])==null?void 0:Le.groupKey)??pe);x.useEffect(()=>{const he=J.current;if(!he)return;he.scrollHeight-he.scrollTop-he.clientHeight<120&&he.scrollTo({top:he.scrollHeight,behavior:"smooth"})},[e,B.length,M==null?void 0:M.status]);function qe(){const he=J.current;if(!he)return;const ge=he.scrollHeight-he.scrollTop-he.clientHeight;W(ge<24)}function Me(){const he=J.current;he&&he.scrollTo({top:he.scrollHeight,behavior:"smooth"})}async function Ve(he){try{const ge=await n.command({type:"chat.create",projectId:he});R(he),K(ge.chatId),t(`/chat/${ge.chatId}`),z(!1)}catch(ge){F(ge instanceof Error?ge.message:String(ge))}}async function Nt(he){try{U(he);const ge=await n.command({type:"project.open",localPath:he});R(ge.projectId);const je=await n.command({type:"chat.create",projectId:ge.projectId});K(je.chatId),t(`/chat/${je.chatId}`),z(!1),F(null)}catch(ge){F(ge instanceof Error?ge.message:String(ge))}finally{U(null)}}async function It(he){try{U(he.localPath);const ge=await n.command(he.mode==="new"?{type:"project.create",localPath:he.localPath,title:he.title}:{type:"project.open",localPath:he.localPath});R(ge.projectId);const je=await n.command({type:"chat.create",projectId:ge.projectId});K(je.chatId),t(`/chat/${je.chatId}`),z(!1),F(null)}catch(ge){F(ge instanceof Error?ge.message:String(ge))}finally{U(null)}}async function ir(he,ge){var je;try{let Be=T??((je=s.projectGroups[0])==null?void 0:je.groupKey)??null;if(!e&&!Be&&pe&&(Be=(await n.command({type:"project.open",localPath:pe})).projectId,R(Be)),!e&&!Be)throw new Error("Open a project first");const Fe=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Be??void 0,provider:ge==null?void 0:ge.provider,content:he,model:ge==null?void 0:ge.model,modelOptions:ge==null?void 0:ge.modelOptions,planMode:ge==null?void 0:ge.planMode});!e&&Fe.chatId&&(K(Fe.chatId),t(`/chat/${Fe.chatId}`)),F(null)}catch(Be){throw F(Be instanceof Error?Be.message:String(Be)),Be}}async function Fn(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(he){F(he instanceof Error?he.message:String(he))}}async function Ht(he){if(await r.confirm({title:"Delete Chat",description:`Delete "${he.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:he.chatId}),he.chatId===e){const je=rZ(s.projectGroups,he.chatId);t(je?`/chat/${je}`:"/")}}catch(je){F(je instanceof Error?je.message:String(je))}}async function vn(he){const ge=s.projectGroups.find(Fe=>Fe.groupKey===he);if(!ge)return;const je=ge.localPath.split("/").filter(Boolean).pop()??ge.localPath;if(await r.confirm({title:"Remove",description:`Remove "${je}" from the sidebar? Existing chats will be removed from ${zn}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:he}),Do.getState().clearProject(he),(M==null?void 0:M.projectId)===he&&t("/"),F(null)}catch(Fe){F(Fe instanceof Error?Fe.message:String(Fe))}}async function yr(he){var je,Be;const ge=(M==null?void 0:M.localPath)??((je=l==null?void 0:l.projects[0])==null?void 0:je.localPath)??((Be=s.projectGroups[0])==null?void 0:Be.localPath);if(ge)try{await Mi({action:he,localPath:ge})}catch(Fe){F(Fe instanceof Error?Fe.message:String(Fe))}}async function ri(he){try{await Mi({action:"open_editor",localPath:he.path,line:he.line,column:he.column})}catch(ge){F(ge instanceof Error?ge.message:String(ge))}}async function Mi(he){const ge=zr.getState();F(null),await n.command({type:"system.openExternal",...he,editor:he.action==="open_editor"?{preset:ge.editorPreset,commandTemplate:ge.editorCommandTemplate}:void 0})}function Ft(){var je,Be;const he=T??((je=s.projectGroups[0])==null?void 0:je.groupKey);if(he){Ve(he);return}const ge=(Be=l==null?void 0:l.projects[0])==null?void 0:Be.localPath;if(ge){Nt(ge);return}t("/")}async function ro(he,ge,je){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:he,result:{questions:ge,answers:je}})}catch(Be){F(Be instanceof Error?Be.message:String(Be))}}async function ae(he,ge,je,Be){if(e){ge&&WM.getState().setPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:he,result:{confirmed:ge,...je?{clearContext:!0}:{},...Be?{message:Be}:{}}})}catch(Fe){F(Fe instanceof Error?Fe.message:String(Fe))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:l,chatSnapshot:d,connectionStatus:p,sidebarReady:_,localProjectsReady:S,commandError:H,startingLocalPath:V,sidebarOpen:D,sidebarCollapsed:L,scrollRef:J,inputRef:A,messages:B,latestToolIds:Y,runtime:M,availableProviders:X,isProcessing:se,canCancel:re,transcriptPaddingBottom:me,showScrollButton:Ce,navbarLocalPath:ke,editorLabel:$,hasSelectedProject:Je,openSidebar:()=>z(!0),closeSidebar:()=>z(!1),collapseSidebar:()=>j(!0),expandSidebar:()=>j(!1),updateScrollState:qe,scrollToBottom:Me,handleCreateChat:Ve,handleOpenLocalProject:Nt,handleCreateProject:It,handleSend:ir,handleCancel:Fn,handleDeleteChat:Ht,handleRemoveProject:vn,handleOpenExternal:yr,handleOpenLocalLink:ri,handleCompose:Ft,handleAskUserQuestion:ro,handleExitPlanMode:ae}}function aZ(){const e=ki(),t=z3(),n=oZ(t.chatId??null),r=e.pathname==="/"||e.pathname==="/settings";return v.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[v.jsx(v9,{data:n.sidebarData,activeChatId:n.activeChatId,connectionStatus:n.connectionStatus,ready:n.sidebarReady,open:n.sidebarOpen,collapsed:n.sidebarCollapsed,showMobileOpenButton:r,onOpen:n.openSidebar,onClose:n.closeSidebar,onCollapse:n.collapseSidebar,onExpand:n.expandSidebar,onCreateChat:s=>{n.handleCreateChat(s)},onDeleteChat:s=>{n.handleDeleteChat(s)},onRemoveProject:s=>{n.handleRemoveProject(s)}}),v.jsx(Y3,{context:n})]})}function lZ(){return v.jsx(zB,{children:v.jsx(Z6,{children:v.jsx(Z3,{children:v.jsxs(Mc,{element:v.jsx(aZ,{}),children:[v.jsx(Mc,{path:"/",element:v.jsx(BX,{})}),v.jsx(Mc,{path:"/settings",element:v.jsx(HX,{})}),v.jsx(Mc,{path:"/chat/:chatId",element:v.jsx(AX,{})})]})})})})}const M5=document.getElementById("root");if(!M5)throw new Error("Missing #root");ZN.createRoot(M5).render(v.jsx(x.StrictMode,{children:v.jsx(x4,{children:v.jsx(YU,{children:v.jsx(lZ,{})})})}));