kanna-code 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-BvhI1JYs.css +32 -0
- package/dist/client/assets/index-CLqK0AWC.js +606 -0
- package/dist/client/index.html +2 -2
- package/package.json +2 -1
- package/src/server/agent.test.ts +64 -2
- package/src/server/agent.ts +45 -3
- package/src/server/paths.ts +4 -0
- package/src/server/server.ts +178 -1
- package/src/server/uploads.test.ts +282 -0
- package/src/server/uploads.ts +127 -0
- package/src/shared/protocol.ts +2 -0
- package/src/shared/tools.test.ts +65 -0
- package/src/shared/tools.ts +76 -0
- package/src/shared/types.ts +33 -1
- package/dist/client/assets/index-CtKZIZdD.js +0 -533
- package/dist/client/assets/index-Cwex1U8S.css +0 -32
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
var GO=Object.defineProperty;var Rw=e=>{throw TypeError(e)};var YO=(e,t,n)=>t in e?GO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var on=(e,t,n)=>YO(e,typeof t!="symbol"?t+"":t,n),Tw=(e,t,n)=>t.has(e)||Rw("Cannot "+n);var Pc=(e,t,n)=>(Tw(e,t,"read from private field"),n?n.call(e):t.get(e)),Mw=(e,t,n)=>t.has(e)?Rw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Nw=(e,t,n,r)=>(Tw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function XO(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 l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{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 l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Jf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xg={exports:{}},Bc={};/**
|
|
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 Aw;function ZO(){if(Aw)return Bc;Aw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var a=null;if(l!==void 0&&(a=""+l),s.key!==void 0&&(a=""+s.key),"key"in s){l={};for(var u in s)u!=="key"&&(l[u]=s[u])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:l}}return Bc.Fragment=t,Bc.jsx=n,Bc.jsxs=n,Bc}var Dw;function QO(){return Dw||(Dw=1,Xg.exports=ZO()),Xg.exports}var g=QO(),Zg={exports:{}},Fe={};/**
|
|
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 Ow;function JO(){if(Ow)return Fe;Ow=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"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=_&&I[_]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(I,q,A){this.props=I,this.context=q,this.refs=C,this.updater=A||S}k.prototype.isReactComponent={},k.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(I,q,A){this.props=I,this.context=q,this.refs=C,this.updater=A||S}var M=R.prototype=new T;M.constructor=R,w(M,k.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function D(){}var j={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Y(I,q,A){var ae=A.ref;return{$$typeof:e,type:I,key:q,ref:ae!==void 0?ae:null,props:A}}function z(I,q){return Y(I.type,q,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function P(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(A){return q[A]})}var U=/\/+/g;function V(I,q){return typeof I=="object"&&I!==null&&I.key!=null?P(""+I.key):q.toString(36)}function $(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function(q){I.status==="pending"&&(I.status="fulfilled",I.value=q)},function(q){I.status==="pending"&&(I.status="rejected",I.reason=q)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function B(I,q,A,ae,fe){var oe=typeof I;(oe==="undefined"||oe==="boolean")&&(I=null);var J=!1;if(I===null)J=!0;else switch(oe){case"bigint":case"string":case"number":J=!0;break;case"object":switch(I.$$typeof){case e:case t:J=!0;break;case p:return J=I._init,B(J(I._payload),q,A,ae,fe)}}if(J)return fe=fe(I),J=ae===""?"."+V(I,0):ae,L(fe)?(A="",J!=null&&(A=J.replace(U,"$&/")+"/"),B(fe,q,A,"",function(ce){return ce})):fe!=null&&(H(fe)&&(fe=z(fe,A+(fe.key==null||I&&I.key===fe.key?"":(""+fe.key).replace(U,"$&/")+"/")+J)),q.push(fe)),1;J=0;var ge=ae===""?".":ae+":";if(L(I))for(var ie=0;ie<I.length;ie++)ae=I[ie],oe=ge+V(ae,ie),J+=B(ae,q,A,oe,fe);else if(ie=y(I),typeof ie=="function")for(I=ie.call(I),ie=0;!(ae=I.next()).done;)ae=ae.value,oe=ge+V(ae,ie++),J+=B(ae,q,A,oe,fe);else if(oe==="object"){if(typeof I.then=="function")return B($(I),q,A,ae,fe);throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return J}function K(I,q,A){if(I==null)return I;var ae=[],fe=0;return B(I,ae,"","",function(oe){return q.call(A,oe,fe++)}),ae}function W(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(A){(I._status===0||I._status===-1)&&(I._status=1,I._result=A)},function(A){(I._status===0||I._status===-1)&&(I._status=2,I._result=A)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Z=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},N={map:K,forEach:function(I,q,A){K(I,function(){q.apply(this,arguments)},A)},count:function(I){var q=0;return K(I,function(){q++}),q},toArray:function(I){return K(I,function(q){return q})||[]},only:function(I){if(!H(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Fe.Activity=m,Fe.Children=N,Fe.Component=k,Fe.Fragment=n,Fe.Profiler=s,Fe.PureComponent=R,Fe.StrictMode=r,Fe.Suspense=h,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Fe.cache=function(I){return function(){return I.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(I,q,A){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ae=w({},I.props),fe=I.key;if(q!=null)for(oe in q.key!==void 0&&(fe=""+q.key),q)!F.call(q,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&q.ref===void 0||(ae[oe]=q[oe]);var oe=arguments.length-2;if(oe===1)ae.children=A;else if(1<oe){for(var J=Array(oe),ge=0;ge<oe;ge++)J[ge]=arguments[ge+2];ae.children=J}return Y(I.type,fe,ae)},Fe.createContext=function(I){return I={$$typeof:a,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},Fe.createElement=function(I,q,A){var ae,fe={},oe=null;if(q!=null)for(ae in q.key!==void 0&&(oe=""+q.key),q)F.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(fe[ae]=q[ae]);var J=arguments.length-2;if(J===1)fe.children=A;else if(1<J){for(var ge=Array(J),ie=0;ie<J;ie++)ge[ie]=arguments[ie+2];fe.children=ge}if(I&&I.defaultProps)for(ae in J=I.defaultProps,J)fe[ae]===void 0&&(fe[ae]=J[ae]);return Y(I,oe,fe)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(I){return{$$typeof:u,render:I}},Fe.isValidElement=H,Fe.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:W}},Fe.memo=function(I,q){return{$$typeof:d,type:I,compare:q===void 0?null:q}},Fe.startTransition=function(I){var q=j.T,A={};j.T=A;try{var ae=I(),fe=j.S;fe!==null&&fe(A,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(D,Z)}catch(oe){Z(oe)}finally{q!==null&&A.types!==null&&(q.types=A.types),j.T=q}},Fe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Fe.use=function(I){return j.H.use(I)},Fe.useActionState=function(I,q,A){return j.H.useActionState(I,q,A)},Fe.useCallback=function(I,q){return j.H.useCallback(I,q)},Fe.useContext=function(I){return j.H.useContext(I)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(I,q){return j.H.useDeferredValue(I,q)},Fe.useEffect=function(I,q){return j.H.useEffect(I,q)},Fe.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Fe.useId=function(){return j.H.useId()},Fe.useImperativeHandle=function(I,q,A){return j.H.useImperativeHandle(I,q,A)},Fe.useInsertionEffect=function(I,q){return j.H.useInsertionEffect(I,q)},Fe.useLayoutEffect=function(I,q){return j.H.useLayoutEffect(I,q)},Fe.useMemo=function(I,q){return j.H.useMemo(I,q)},Fe.useOptimistic=function(I,q){return j.H.useOptimistic(I,q)},Fe.useReducer=function(I,q,A){return j.H.useReducer(I,q,A)},Fe.useRef=function(I){return j.H.useRef(I)},Fe.useState=function(I){return j.H.useState(I)},Fe.useSyncExternalStore=function(I,q,A){return j.H.useSyncExternalStore(I,q,A)},Fe.useTransition=function(){return j.H.useTransition()},Fe.version="19.2.1",Fe}var Lw;function Ky(){return Lw||(Lw=1,Zg.exports=JO()),Zg.exports}var b=Ky();const Et=Jf(b),zE=XO({__proto__:null,default:Et},[b]);var Qg={exports:{}},Ic={},Jg={exports:{}},ev={};/**
|
|
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 jw;function e4(){return jw||(jw=1,(function(e){function t(B,K){var W=B.length;B.push(K);e:for(;0<W;){var Z=W-1>>>1,N=B[Z];if(0<s(N,K))B[Z]=K,B[W]=N,W=Z;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var K=B[0],W=B.pop();if(W!==K){B[0]=W;e:for(var Z=0,N=B.length,I=N>>>1;Z<I;){var q=2*(Z+1)-1,A=B[q],ae=q+1,fe=B[ae];if(0>s(A,W))ae<N&&0>s(fe,A)?(B[Z]=fe,B[ae]=W,Z=ae):(B[Z]=A,B[q]=W,Z=q);else if(ae<N&&0>s(fe,W))B[Z]=fe,B[ae]=W,Z=ae;else break e}}return K}function s(B,K){var W=B.sortIndex-K.sortIndex;return W!==0?W:B.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var h=[],d=[],p=1,m=null,_=3,y=!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 M(B){for(var K=n(d);K!==null;){if(K.callback===null)r(d);else if(K.startTime<=B)r(d),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(d)}}function L(B){if(w=!1,M(B),!S)if(n(h)!==null)S=!0,D||(D=!0,P());else{var K=n(d);K!==null&&$(L,K.startTime-B)}}var D=!1,j=-1,F=5,Y=-1;function z(){return C?!0:!(e.unstable_now()-Y<F)}function H(){if(C=!1,D){var B=e.unstable_now();Y=B;var K=!0;try{e:{S=!1,w&&(w=!1,T(j),j=-1),y=!0;var W=_;try{t:{for(M(B),m=n(h);m!==null&&!(m.expirationTime>B&&z());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,_=m.priorityLevel;var N=Z(m.expirationTime<=B);if(B=e.unstable_now(),typeof N=="function"){m.callback=N,M(B),K=!0;break t}m===n(h)&&r(h),M(B)}else r(h);m=n(h)}if(m!==null)K=!0;else{var I=n(d);I!==null&&$(L,I.startTime-B),K=!1}}break e}finally{m=null,_=W,y=!1}K=void 0}}finally{K?P():D=!1}}}var P;if(typeof R=="function")P=function(){R(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=H,P=function(){V.postMessage(null)}}else P=function(){k(H,0)};function $(B,K){j=k(function(){B(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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(B){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var W=_;_=K;try{return B()}finally{_=W}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,K){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var W=_;_=B;try{return K()}finally{_=W}},e.unstable_scheduleCallback=function(B,K,W){var Z=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Z+W:Z):W=Z,B){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=W+N,B={id:p++,callback:K,priorityLevel:B,startTime:W,expirationTime:N,sortIndex:-1},W>Z?(B.sortIndex=W,t(d,B),n(h)===null&&B===n(d)&&(w?(T(j),j=-1):w=!0,$(L,W-Z))):(B.sortIndex=N,t(h,B),S||y||(S=!0,D||(D=!0,P()))),B},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(B){var K=_;return function(){var W=_;_=K;try{return B.apply(this,arguments)}finally{_=W}}}})(ev)),ev}var zw;function t4(){return zw||(zw=1,Jg.exports=e4()),Jg.exports}var tv={exports:{}},On={};/**
|
|
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 Pw;function n4(){if(Pw)return On;Pw=1;var e=Ky();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(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 l(h,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:p}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,On.createPortal=function(h,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,p)},On.flushSync=function(h){var d=a.T,p=r.p;try{if(a.T=null,r.p=2,h)return h()}finally{a.T=d,r.p=p,r.d.f()}},On.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},On.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},On.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:y}):p==="script"&&r.d.X(h,{crossOrigin:m,integrity:_,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},On.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},On.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);r.d.L(h,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},On.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},On.requestFormReset=function(h){r.d.r(h)},On.unstable_batchedUpdates=function(h,d){return h(d)},On.useFormState=function(h,d,p){return a.H.useFormState(h,d,p)},On.useFormStatus=function(){return a.H.useHostTransitionStatus()},On.version="19.2.1",On}var Bw;function PE(){if(Bw)return tv.exports;Bw=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(),tv.exports=n4(),tv.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 Iw;function r4(){if(Iw)return Ic;Iw=1;var e=t4(),t=Ky(),n=PE();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 l(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 a(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 h(i){if(l(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=l(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var v=c.return;if(v===null)break;var x=v.alternate;if(x===null){if(f=v.return,f!==null){c=f;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===c)return h(v),i;if(x===f)return h(v),o;x=x.sibling}throw Error(r(188))}if(c.return!==f.return)c=v,f=x;else{for(var E=!1,O=v.child;O;){if(O===c){E=!0,c=v,f=x;break}if(O===f){E=!0,f=v,c=x;break}O=O.sibling}if(!E){for(O=x.child;O;){if(O===c){E=!0,c=x,f=v;break}if(O===f){E=!0,f=x,c=v;break}O=O.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"),y=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"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=H&&i[H]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?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 L:return"Suspense";case D:return"SuspenseList";case Y: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 M: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 F:o=i._payload,i=i._init;try{return V(i(o))}catch{}}return null}var $=Array.isArray,B=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,W={pending:!1,data:null,method:null,action:null},Z=[],N=-1;function I(i){return{current:i}}function q(i){0>N||(i.current=Z[N],Z[N]=null,N--)}function A(i,o){N++,Z[N]=i.current,i.current=o}var ae=I(null),fe=I(null),oe=I(null),J=I(null);function ge(i,o){switch(A(oe,o),A(fe,i),A(ae,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?XS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=XS(o),i=ZS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(ae),A(ae,i)}function ie(){q(ae),q(fe),q(oe)}function ce(i){i.memoizedState!==null&&A(J,i);var o=ae.current,c=ZS(o,i.type);o!==c&&(A(fe,i),A(ae,c))}function we(i){fe.current===i&&(q(ae),q(fe)),J.current===i&&(q(J),Oc._currentValue=W)}var Se,ke;function Be(i){if(Se===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Se=o&&o[1]||"",ke=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Se+i+ke}var Ce=!1;function Oe(i,o){if(!i||Ce)return"";Ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(le){var ne=le}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(le){ne=le}i.call(pe.prototype)}}else{try{throw Error()}catch(le){ne=le}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(le){if(le&&ne&&typeof le.stack=="string")return[le.stack,ne.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),E=x[0],O=x[1];if(E&&O){var G=E.split(`
|
|
44
|
-
`),te=O.split(`
|
|
45
|
-
`);for(v=f=0;f<G.length&&!G[f].includes("DetermineComponentFrameRoot");)f++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(f===G.length||v===te.length)for(f=G.length-1,v=te.length-1;1<=f&&0<=v&&G[f]!==te[v];)v--;for(;1<=f&&0<=v;f--,v--)if(G[f]!==te[v]){if(f!==1||v!==1)do if(f--,v--,0>v||G[f]!==te[v]){var de=`
|
|
46
|
-
`+G[f].replace(" at new "," at ");return i.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",i.displayName)),de}while(1<=f&&0<=v);break}}}finally{Ce=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Be(c):""}function bt(i,o){switch(i.tag){case 26:case 27:case 5:return Be(i.type);case 16:return Be("Lazy");case 13:return i.child!==o&&o!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Oe(i.type,!1);case 11:return Oe(i.type.render,!1);case 1:return Oe(i.type,!0);case 31:return Be("Activity");default:return""}}function hn(i){try{var o="",c=null;do o+=bt(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var xt=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,In=e.unstable_cancelCallback,cr=e.unstable_shouldYield,Gr=e.unstable_requestPaint,se=e.unstable_now,Rt=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ie=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Ct=e.log,Yn=e.unstable_setDisableYieldValue,nn=null,Pt=null;function Gt(i){if(typeof Ct=="function"&&Yn(i),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(nn,i)}catch{}}var ot=Math.clz32?Math.clz32:Ka,Xn=Math.log,Dn=Math.LN2;function Ka(i){return i>>>=0,i===0?32:31-(Xn(i)/Dn|0)|0}var bs=256,Li=262144,At=4194304;function Dt(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 re(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var v=0,x=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var O=f&134217727;return O!==0?(f=O&~x,f!==0?v=Dt(f):(E&=O,E!==0?v=Dt(E):c||(c=O&~i,c!==0&&(v=Dt(c))))):(O=f&~x,O!==0?v=Dt(O):E!==0?v=Dt(E):c||(c=f&~i,c!==0&&(v=Dt(c)))),v===0?0:o!==0&&o!==v&&(o&x)===0&&(x=v&-v,c=o&-o,x>=c||x===32&&(c&4194048)!==0)?o:v}function _e(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ue(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 Ye(){var i=At;return At<<=1,(At&62914560)===0&&(At=4194304),i}function lt(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function ur(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function rn(i,o,c,f,v,x){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 O=i.entanglements,G=i.expirationTimes,te=i.hiddenUpdates;for(c=E&~c;0<c;){var de=31-ot(c),pe=1<<de;O[de]=0,G[de]=-1;var ne=te[de];if(ne!==null)for(te[de]=null,de=0;de<ne.length;de++){var le=ne[de];le!==null&&(le.lane&=-536870913)}c&=~pe}f!==0&&Yr(i,f,0),x!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=x&~(E&~o))}function Yr(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 dr(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-ot(c),v=1<<f;v&o|i[f]&o&&(i[f]|=o),c&=~v}}function Er(i,o){var c=o&-o;return c=(c&42)!==0?1:ji(c),(c&(i.suspendedLanes|o))!==0?0:c}function ji(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 zi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Xr(){var i=K.p;return i!==0?i:(i=window.event,i===void 0?32:bw(i.type))}function xs(i,o){var c=K.p;try{return K.p=i,o()}finally{K.p=c}}var Rr=Math.random().toString(36).slice(2),Cn="__reactFiber$"+Rr,Zn="__reactProps$"+Rr,pl="__reactContainer$"+Rr,Fp="__reactEvents$"+Rr,PD="__reactListeners$"+Rr,BD="__reactHandles$"+Rr,P0="__reactResources$"+Rr,Ga="__reactMarker$"+Rr;function Up(i){delete i[Cn],delete i[Zn],delete i[Fp],delete i[PD],delete i[BD]}function ml(i){var o=i[Cn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[pl]||c[Cn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=iw(i);i!==null;){if(c=i[Cn])return c;i=iw(i)}return o}i=c,c=i.parentNode}return null}function gl(i){if(i=i[Cn]||i[pl]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Ya(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function vl(i){var o=i[P0];return o||(o=i[P0]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function fn(i){i[Ga]=!0}var B0=new Set,I0={};function yo(i,o){_l(i,o),_l(i+"Capture",o)}function _l(i,o){for(I0[i]=o,i=0;i<o.length;i++)B0.add(o[i])}var ID=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]*$"),H0={},F0={};function HD(i){return xt.call(F0,i)?!0:xt.call(H0,i)?!1:ID.test(i)?F0[i]=!0:(H0[i]=!0,!1)}function cd(i,o,c){if(HD(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 ud(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 Pi(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 Tr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function U0(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function FD(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 v=f.get,x=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(E){c=""+E,x.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 $p(i){if(!i._valueTracker){var o=U0(i)?"checked":"value";i._valueTracker=FD(i,o,""+i[o])}}function $0(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=U0(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function dd(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 UD=/[\n"\\]/g;function Mr(i){return i.replace(UD,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Wp(i,o,c,f,v,x,E,O){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=""+Tr(o)):i.value!==""+Tr(o)&&(i.value=""+Tr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?Vp(i,E,Tr(o)):c!=null?Vp(i,E,Tr(c)):f!=null&&i.removeAttribute("value"),v==null&&x!=null&&(i.defaultChecked=!!x),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.name=""+Tr(O):i.removeAttribute("name")}function W0(i,o,c,f,v,x,E,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),o!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||o!=null)){$p(i);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(o):c,O||o===i.value||(i.value=o),i.defaultValue=o}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=O?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),$p(i)}function Vp(i,o,c){o==="number"&&dd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function yl(i,o,c,f){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&f&&(i[c].defaultSelected=!0)}else{for(c=""+Tr(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,f&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function V0(i,o,c){if(o!=null&&(o=""+Tr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Tr(c):""}function q0(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if($(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=Tr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),$p(i)}function bl(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var $D=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 K0(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||$D.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function G0(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 v in o)f=o[v],o.hasOwnProperty(v)&&c[v]!==f&&K0(i,v,f)}else for(var x in o)o.hasOwnProperty(x)&&K0(i,x,o[x])}function qp(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 WD=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"]]),VD=/^[\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 hd(i){return VD.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Bi(){}var Kp=null;function Gp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xl=null,Sl=null;function Y0(i){var o=gl(i);if(o&&(i=o.stateNode)){var c=i[Zn]||null;e:switch(i=o.stateNode,o.type){case"input":if(Wp(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="'+Mr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var v=f[Zn]||null;if(!v)throw Error(r(90));Wp(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&$0(f)}break e;case"textarea":V0(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&yl(i,!!c.multiple,o,!1)}}}var Yp=!1;function X0(i,o,c){if(Yp)return i(o,c);Yp=!0;try{var f=i(o);return f}finally{if(Yp=!1,(xl!==null||Sl!==null)&&(Jd(),xl&&(o=xl,i=Sl,Sl=xl=null,Y0(o),i)))for(o=0;o<i.length;o++)Y0(i[o])}}function Xa(i,o){var c=i.stateNode;if(c===null)return null;var f=c[Zn]||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 Ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xp=!1;if(Ii)try{var Za={};Object.defineProperty(Za,"passive",{get:function(){Xp=!0}}),window.addEventListener("test",Za,Za),window.removeEventListener("test",Za,Za)}catch{Xp=!1}var Ss=null,Zp=null,fd=null;function Z0(){if(fd)return fd;var i,o=Zp,c=o.length,f,v="value"in Ss?Ss.value:Ss.textContent,x=v.length;for(i=0;i<c&&o[i]===v[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===v[x-f];f++);return fd=v.slice(i,1<f?1-f:void 0)}function pd(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 md(){return!0}function Q0(){return!1}function Qn(i){function o(c,f,v,x,E){this._reactName=c,this._targetInst=v,this.type=f,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(c=i[O],this[O]=c?c(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?md:Q0,this.isPropagationStopped=Q0,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=md)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){},isPersistent:md}),o}var bo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gd=Qn(bo),Qa=m({},bo,{view:0,detail:0}),qD=Qn(Qa),Qp,Jp,Ja,vd=m({},Qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tm,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!==Ja&&(Ja&&i.type==="mousemove"?(Qp=i.screenX-Ja.screenX,Jp=i.screenY-Ja.screenY):Jp=Qp=0,Ja=i),Qp)},movementY:function(i){return"movementY"in i?i.movementY:Jp}}),J0=Qn(vd),KD=m({},vd,{dataTransfer:0}),GD=Qn(KD),YD=m({},Qa,{relatedTarget:0}),em=Qn(YD),XD=m({},bo,{animationName:0,elapsedTime:0,pseudoElement:0}),ZD=Qn(XD),QD=m({},bo,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),JD=Qn(QD),e3=m({},bo,{data:0}),ex=Qn(e3),t3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n3={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"},r3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function i3(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=r3[i])?!!o[i]:!1}function tm(){return i3}var s3=m({},Qa,{key:function(i){if(i.key){var o=t3[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=pd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?n3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tm,charCode:function(i){return i.type==="keypress"?pd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?pd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),o3=Qn(s3),l3=m({},vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tx=Qn(l3),a3=m({},Qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tm}),c3=Qn(a3),u3=m({},bo,{propertyName:0,elapsedTime:0,pseudoElement:0}),d3=Qn(u3),h3=m({},vd,{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}),f3=Qn(h3),p3=m({},bo,{newState:0,oldState:0}),m3=Qn(p3),g3=[9,13,27,32],nm=Ii&&"CompositionEvent"in window,ec=null;Ii&&"documentMode"in document&&(ec=document.documentMode);var v3=Ii&&"TextEvent"in window&&!ec,nx=Ii&&(!nm||ec&&8<ec&&11>=ec),rx=" ",ix=!1;function sx(i,o){switch(i){case"keyup":return g3.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ox(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var wl=!1;function _3(i,o){switch(i){case"compositionend":return ox(o);case"keypress":return o.which!==32?null:(ix=!0,rx);case"textInput":return i=o.data,i===rx&&ix?null:i;default:return null}}function y3(i,o){if(wl)return i==="compositionend"||!nm&&sx(i,o)?(i=Z0(),fd=Zp=Ss=null,wl=!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 nx&&o.locale!=="ko"?null:o.data;default:return null}}var b3={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 lx(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!b3[i.type]:o==="textarea"}function ax(i,o,c,f){xl?Sl?Sl.push(f):Sl=[f]:xl=f,o=oh(o,"onChange"),0<o.length&&(c=new gd("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var tc=null,nc=null;function x3(i){WS(i,0)}function _d(i){var o=Ya(i);if($0(o))return i}function cx(i,o){if(i==="change")return o}var ux=!1;if(Ii){var rm;if(Ii){var im="oninput"in document;if(!im){var dx=document.createElement("div");dx.setAttribute("oninput","return;"),im=typeof dx.oninput=="function"}rm=im}else rm=!1;ux=rm&&(!document.documentMode||9<document.documentMode)}function hx(){tc&&(tc.detachEvent("onpropertychange",fx),nc=tc=null)}function fx(i){if(i.propertyName==="value"&&_d(nc)){var o=[];ax(o,nc,i,Gp(i)),X0(x3,o)}}function S3(i,o,c){i==="focusin"?(hx(),tc=o,nc=c,tc.attachEvent("onpropertychange",fx)):i==="focusout"&&hx()}function w3(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return _d(nc)}function C3(i,o){if(i==="click")return _d(o)}function k3(i,o){if(i==="input"||i==="change")return _d(o)}function E3(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var hr=typeof Object.is=="function"?Object.is:E3;function rc(i,o){if(hr(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 v=c[f];if(!xt.call(o,v)||!hr(i[v],o[v]))return!1}return!0}function px(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function mx(i,o){var c=px(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=px(c)}}function gx(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?gx(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function vx(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=dd(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=dd(i.document)}return o}function sm(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 R3=Ii&&"documentMode"in document&&11>=document.documentMode,Cl=null,om=null,ic=null,lm=!1;function _x(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;lm||Cl==null||Cl!==dd(f)||(f=Cl,"selectionStart"in f&&sm(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}),ic&&rc(ic,f)||(ic=f,f=oh(om,"onSelect"),0<f.length&&(o=new gd("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=Cl)))}function xo(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var kl={animationend:xo("Animation","AnimationEnd"),animationiteration:xo("Animation","AnimationIteration"),animationstart:xo("Animation","AnimationStart"),transitionrun:xo("Transition","TransitionRun"),transitionstart:xo("Transition","TransitionStart"),transitioncancel:xo("Transition","TransitionCancel"),transitionend:xo("Transition","TransitionEnd")},am={},yx={};Ii&&(yx=document.createElement("div").style,"AnimationEvent"in window||(delete kl.animationend.animation,delete kl.animationiteration.animation,delete kl.animationstart.animation),"TransitionEvent"in window||delete kl.transitionend.transition);function So(i){if(am[i])return am[i];if(!kl[i])return i;var o=kl[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in yx)return am[i]=o[c];return i}var bx=So("animationend"),xx=So("animationiteration"),Sx=So("animationstart"),T3=So("transitionrun"),M3=So("transitionstart"),N3=So("transitioncancel"),wx=So("transitionend"),Cx=new Map,cm="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(" ");cm.push("scrollEnd");function Zr(i,o){Cx.set(i,o),yo(o,[i])}var yd=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)},Nr=[],El=0,um=0;function bd(){for(var i=El,o=um=El=0;o<i;){var c=Nr[o];Nr[o++]=null;var f=Nr[o];Nr[o++]=null;var v=Nr[o];Nr[o++]=null;var x=Nr[o];if(Nr[o++]=null,f!==null&&v!==null){var E=f.pending;E===null?v.next=v:(v.next=E.next,E.next=v),f.pending=v}x!==0&&kx(c,v,x)}}function xd(i,o,c,f){Nr[El++]=i,Nr[El++]=o,Nr[El++]=c,Nr[El++]=f,um|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function dm(i,o,c,f){return xd(i,o,c,f),Sd(i)}function wo(i,o){return xd(i,null,null,o),Sd(i)}function kx(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var v=!1,x=i.return;x!==null;)x.childLanes|=c,f=x.alternate,f!==null&&(f.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(v=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,v&&o!==null&&(v=31-ot(c),i=x.hiddenUpdates,f=i[v],f===null?i[v]=[o]:f.push(o),o.lane=c|536870912),x):null}function Sd(i){if(50<Ec)throw Ec=0,bg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Rl={};function A3(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 fr(i,o,c,f){return new A3(i,o,c,f)}function hm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Hi(i,o){var c=i.alternate;return c===null?(c=fr(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 Ex(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 wd(i,o,c,f,v,x){var E=0;if(f=i,typeof i=="function")hm(i)&&(E=1);else if(typeof i=="string")E=zO(i,c,ae.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Y:return i=fr(31,c,o,v),i.elementType=Y,i.lanes=x,i;case w:return Co(c.children,v,x,o);case C:E=8,v|=24;break;case k:return i=fr(12,c,o,v|2),i.elementType=k,i.lanes=x,i;case L:return i=fr(13,c,o,v),i.elementType=L,i.lanes=x,i;case D:return i=fr(19,c,o,v),i.elementType=D,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case T:E=9;break e;case M:E=11;break e;case j:E=14;break e;case F:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=fr(E,c,o,v),o.elementType=i,o.type=f,o.lanes=x,o}function Co(i,o,c,f){return i=fr(7,i,f,o),i.lanes=c,i}function fm(i,o,c){return i=fr(6,i,null,o),i.lanes=c,i}function Rx(i){var o=fr(18,null,null,0);return o.stateNode=i,o}function pm(i,o,c){return o=fr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Tx=new WeakMap;function Ar(i,o){if(typeof i=="object"&&i!==null){var c=Tx.get(i);return c!==void 0?c:(o={value:i,source:o,stack:hn(o)},Tx.set(i,o),o)}return{value:i,source:o,stack:hn(o)}}var Tl=[],Ml=0,Cd=null,sc=0,Dr=[],Or=0,ws=null,hi=1,fi="";function Fi(i,o){Tl[Ml++]=sc,Tl[Ml++]=Cd,Cd=i,sc=o}function Mx(i,o,c){Dr[Or++]=hi,Dr[Or++]=fi,Dr[Or++]=ws,ws=i;var f=hi;i=fi;var v=32-ot(f)-1;f&=~(1<<v),c+=1;var x=32-ot(o)+v;if(30<x){var E=v-v%5;x=(f&(1<<E)-1).toString(32),f>>=E,v-=E,hi=1<<32-ot(o)+v|c<<v|f,fi=x+i}else hi=1<<x|c<<v|f,fi=i}function mm(i){i.return!==null&&(Fi(i,1),Mx(i,1,0))}function gm(i){for(;i===Cd;)Cd=Tl[--Ml],Tl[Ml]=null,sc=Tl[--Ml],Tl[Ml]=null;for(;i===ws;)ws=Dr[--Or],Dr[Or]=null,fi=Dr[--Or],Dr[Or]=null,hi=Dr[--Or],Dr[Or]=null}function Nx(i,o){Dr[Or++]=hi,Dr[Or++]=fi,Dr[Or++]=ws,hi=o.id,fi=o.overflow,ws=i}var kn=null,Tt=null,it=!1,Cs=null,Lr=!1,vm=Error(r(519));function ks(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oc(Ar(o,i)),vm}function Ax(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[Cn]=i,o[Zn]=f,c){case"dialog":Qe("cancel",o),Qe("close",o);break;case"iframe":case"object":case"embed":Qe("load",o);break;case"video":case"audio":for(c=0;c<Tc.length;c++)Qe(Tc[c],o);break;case"source":Qe("error",o);break;case"img":case"image":case"link":Qe("error",o),Qe("load",o);break;case"details":Qe("toggle",o);break;case"input":Qe("invalid",o),W0(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Qe("invalid",o);break;case"textarea":Qe("invalid",o),q0(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||GS(o.textContent,c)?(f.popover!=null&&(Qe("beforetoggle",o),Qe("toggle",o)),f.onScroll!=null&&Qe("scroll",o),f.onScrollEnd!=null&&Qe("scrollend",o),f.onClick!=null&&(o.onclick=Bi),o=!0):o=!1,o||ks(i,!0)}function Dx(i){for(kn=i.return;kn;)switch(kn.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:kn=kn.return}}function Nl(i){if(i!==kn)return!1;if(!it)return Dx(i),it=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||jg(i.type,i.memoizedProps)),c=!c),c&&Tt&&ks(i),Dx(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tt=rw(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Tt=rw(i)}else o===27?(o=Tt,Is(i.type)?(i=Hg,Hg=null,Tt=i):Tt=o):Tt=kn?zr(i.stateNode.nextSibling):null;return!0}function ko(){Tt=kn=null,it=!1}function _m(){var i=Cs;return i!==null&&(nr===null?nr=i:nr.push.apply(nr,i),Cs=null),i}function oc(i){Cs===null?Cs=[i]:Cs.push(i)}var ym=I(null),Eo=null,Ui=null;function Es(i,o,c){A(ym,o._currentValue),o._currentValue=c}function $i(i){i._currentValue=ym.current,q(ym)}function bm(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 xm(i,o,c,f){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var x=v.dependencies;if(x!==null){var E=v.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=v;for(var G=0;G<o.length;G++)if(O.context===o[G]){x.lanes|=c,O=x.alternate,O!==null&&(O.lanes|=c),bm(x.return,c,i),f||(E=null);break e}x=O.next}}else if(v.tag===18){if(E=v.return,E===null)throw Error(r(341));E.lanes|=c,x=E.alternate,x!==null&&(x.lanes|=c),bm(E,c,i),E=null}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===i){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}}function Al(i,o,c,f){i=null;for(var v=o,x=!1;v!==null;){if(!x){if((v.flags&524288)!==0)x=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var E=v.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var O=v.type;hr(v.pendingProps.value,E.value)||(i!==null?i.push(O):i=[O])}}else if(v===J.current){if(E=v.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(Oc):i=[Oc])}v=v.return}i!==null&&xm(o,i,c,f),o.flags|=262144}function kd(i){for(i=i.firstContext;i!==null;){if(!hr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ro(i){Eo=i,Ui=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function En(i){return Ox(Eo,i)}function Ed(i,o){return Eo===null&&Ro(i),Ox(i,o)}function Ox(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Ui===null){if(i===null)throw Error(r(308));Ui=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else Ui=Ui.next=o;return c}var D3=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()})}},O3=e.unstable_scheduleCallback,L3=e.unstable_NormalPriority,Yt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sm(){return{controller:new D3,data:new Map,refCount:0}}function lc(i){i.refCount--,i.refCount===0&&O3(L3,function(){i.controller.abort()})}var ac=null,wm=0,Dl=0,Ol=null;function j3(i,o){if(ac===null){var c=ac=[];wm=0,Dl=Eg(),Ol={status:"pending",value:void 0,then:function(f){c.push(f)}}}return wm++,o.then(Lx,Lx),o}function Lx(){if(--wm===0&&ac!==null){Ol!==null&&(Ol.status="fulfilled");var i=ac;ac=null,Dl=0,Ol=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function z3(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(f.status="rejected",f.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),f}var jx=B.S;B.S=function(i,o){_S=se(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&j3(i,o),jx!==null&&jx(i,o)};var To=I(null);function Cm(){var i=To.current;return i!==null?i:St.pooledCache}function Rd(i,o){o===null?A(To,To.current):A(To,o.pool)}function zx(){var i=Cm();return i===null?null:{parent:Yt._currentValue,pool:i}}var Ll=Error(r(460)),km=Error(r(474)),Td=Error(r(542)),Md={then:function(){}};function Px(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Bx(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Bi,Bi),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Hx(i),i;default:if(typeof o.status=="string")o.then(Bi,Bi);else{if(i=St,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=f}},function(f){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Hx(i),i}throw No=o,Ll}}function Mo(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(No=c,Ll):c}}var No=null;function Ix(){if(No===null)throw Error(r(459));var i=No;return No=null,i}function Hx(i){if(i===Ll||i===Td)throw Error(r(483))}var jl=null,cc=0;function Nd(i){var o=cc;return cc+=1,jl===null&&(jl=[]),Bx(jl,i,o)}function uc(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Ad(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 Fx(i){function o(Q,X){if(i){var ee=Q.deletions;ee===null?(Q.deletions=[X],Q.flags|=16):ee.push(X)}}function c(Q,X){if(!i)return null;for(;X!==null;)o(Q,X),X=X.sibling;return null}function f(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function v(Q,X){return Q=Hi(Q,X),Q.index=0,Q.sibling=null,Q}function x(Q,X,ee){return Q.index=ee,i?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<X?(Q.flags|=67108866,X):ee):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function E(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function O(Q,X,ee,he){return X===null||X.tag!==6?(X=fm(ee,Q.mode,he),X.return=Q,X):(X=v(X,ee),X.return=Q,X)}function G(Q,X,ee,he){var je=ee.type;return je===w?de(Q,X,ee.props.children,he,ee.key):X!==null&&(X.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===F&&Mo(je)===X.type)?(X=v(X,ee.props),uc(X,ee),X.return=Q,X):(X=wd(ee.type,ee.key,ee.props,null,Q.mode,he),uc(X,ee),X.return=Q,X)}function te(Q,X,ee,he){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=pm(ee,Q.mode,he),X.return=Q,X):(X=v(X,ee.children||[]),X.return=Q,X)}function de(Q,X,ee,he,je){return X===null||X.tag!==7?(X=Co(ee,Q.mode,he,je),X.return=Q,X):(X=v(X,ee),X.return=Q,X)}function pe(Q,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=fm(""+X,Q.mode,ee),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case y:return ee=wd(X.type,X.key,X.props,null,Q.mode,ee),uc(ee,X),ee.return=Q,ee;case S:return X=pm(X,Q.mode,ee),X.return=Q,X;case F:return X=Mo(X),pe(Q,X,ee)}if($(X)||P(X))return X=Co(X,Q.mode,ee,null),X.return=Q,X;if(typeof X.then=="function")return pe(Q,Nd(X),ee);if(X.$$typeof===R)return pe(Q,Ed(Q,X),ee);Ad(Q,X)}return null}function ne(Q,X,ee,he){var je=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return je!==null?null:O(Q,X,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ee.key===je?G(Q,X,ee,he):null;case S:return ee.key===je?te(Q,X,ee,he):null;case F:return ee=Mo(ee),ne(Q,X,ee,he)}if($(ee)||P(ee))return je!==null?null:de(Q,X,ee,he,null);if(typeof ee.then=="function")return ne(Q,X,Nd(ee),he);if(ee.$$typeof===R)return ne(Q,X,Ed(Q,ee),he);Ad(Q,ee)}return null}function le(Q,X,ee,he,je){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ee)||null,O(X,Q,""+he,je);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return Q=Q.get(he.key===null?ee:he.key)||null,G(X,Q,he,je);case S:return Q=Q.get(he.key===null?ee:he.key)||null,te(X,Q,he,je);case F:return he=Mo(he),le(Q,X,ee,he,je)}if($(he)||P(he))return Q=Q.get(ee)||null,de(X,Q,he,je,null);if(typeof he.then=="function")return le(Q,X,ee,Nd(he),je);if(he.$$typeof===R)return le(Q,X,ee,Ed(X,he),je);Ad(X,he)}return null}function Te(Q,X,ee,he){for(var je=null,at=null,De=X,We=X=0,nt=null;De!==null&&We<ee.length;We++){De.index>We?(nt=De,De=null):nt=De.sibling;var ct=ne(Q,De,ee[We],he);if(ct===null){De===null&&(De=nt);break}i&&De&&ct.alternate===null&&o(Q,De),X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct,De=nt}if(We===ee.length)return c(Q,De),it&&Fi(Q,We),je;if(De===null){for(;We<ee.length;We++)De=pe(Q,ee[We],he),De!==null&&(X=x(De,X,We),at===null?je=De:at.sibling=De,at=De);return it&&Fi(Q,We),je}for(De=f(De);We<ee.length;We++)nt=le(De,Q,We,ee[We],he),nt!==null&&(i&&nt.alternate!==null&&De.delete(nt.key===null?We:nt.key),X=x(nt,X,We),at===null?je=nt:at.sibling=nt,at=nt);return i&&De.forEach(function(Ws){return o(Q,Ws)}),it&&Fi(Q,We),je}function Pe(Q,X,ee,he){if(ee==null)throw Error(r(151));for(var je=null,at=null,De=X,We=X=0,nt=null,ct=ee.next();De!==null&&!ct.done;We++,ct=ee.next()){De.index>We?(nt=De,De=null):nt=De.sibling;var Ws=ne(Q,De,ct.value,he);if(Ws===null){De===null&&(De=nt);break}i&&De&&Ws.alternate===null&&o(Q,De),X=x(Ws,X,We),at===null?je=Ws:at.sibling=Ws,at=Ws,De=nt}if(ct.done)return c(Q,De),it&&Fi(Q,We),je;if(De===null){for(;!ct.done;We++,ct=ee.next())ct=pe(Q,ct.value,he),ct!==null&&(X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct);return it&&Fi(Q,We),je}for(De=f(De);!ct.done;We++,ct=ee.next())ct=le(De,Q,We,ct.value,he),ct!==null&&(i&&ct.alternate!==null&&De.delete(ct.key===null?We:ct.key),X=x(ct,X,We),at===null?je=ct:at.sibling=ct,at=ct);return i&&De.forEach(function(KO){return o(Q,KO)}),it&&Fi(Q,We),je}function vt(Q,X,ee,he){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 y:e:{for(var je=ee.key;X!==null;){if(X.key===je){if(je=ee.type,je===w){if(X.tag===7){c(Q,X.sibling),he=v(X,ee.props.children),he.return=Q,Q=he;break e}}else if(X.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===F&&Mo(je)===X.type){c(Q,X.sibling),he=v(X,ee.props),uc(he,ee),he.return=Q,Q=he;break e}c(Q,X);break}else o(Q,X);X=X.sibling}ee.type===w?(he=Co(ee.props.children,Q.mode,he,ee.key),he.return=Q,Q=he):(he=wd(ee.type,ee.key,ee.props,null,Q.mode,he),uc(he,ee),he.return=Q,Q=he)}return E(Q);case S:e:{for(je=ee.key;X!==null;){if(X.key===je)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){c(Q,X.sibling),he=v(X,ee.children||[]),he.return=Q,Q=he;break e}else{c(Q,X);break}else o(Q,X);X=X.sibling}he=pm(ee,Q.mode,he),he.return=Q,Q=he}return E(Q);case F:return ee=Mo(ee),vt(Q,X,ee,he)}if($(ee))return Te(Q,X,ee,he);if(P(ee)){if(je=P(ee),typeof je!="function")throw Error(r(150));return ee=je.call(ee),Pe(Q,X,ee,he)}if(typeof ee.then=="function")return vt(Q,X,Nd(ee),he);if(ee.$$typeof===R)return vt(Q,X,Ed(Q,ee),he);Ad(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(c(Q,X.sibling),he=v(X,ee),he.return=Q,Q=he):(c(Q,X),he=fm(ee,Q.mode,he),he.return=Q,Q=he),E(Q)):c(Q,X)}return function(Q,X,ee,he){try{cc=0;var je=vt(Q,X,ee,he);return jl=null,je}catch(De){if(De===Ll||De===Td)throw De;var at=fr(29,De,null,Q.mode);return at.lanes=he,at.return=Q,at}finally{}}}var Ao=Fx(!0),Ux=Fx(!1),Rs=!1;function Em(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rm(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 Ts(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ms(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(ut&2)!==0){var v=f.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),f.pending=o,o=Sd(i),kx(i,null,c),o}return xd(i,f,o,c),Sd(i)}function dc(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,dr(i,c)}}function Tm(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var v=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?v=x=E:x=x.next=E,c=c.next}while(c!==null);x===null?v=x=o:x=x.next=o}else v=x=o;c={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:x,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 Mm=!1;function hc(){if(Mm){var i=Ol;if(i!==null)throw i}}function fc(i,o,c,f){Mm=!1;var v=i.updateQueue;Rs=!1;var x=v.firstBaseUpdate,E=v.lastBaseUpdate,O=v.shared.pending;if(O!==null){v.shared.pending=null;var G=O,te=G.next;G.next=null,E===null?x=te:E.next=te,E=G;var de=i.alternate;de!==null&&(de=de.updateQueue,O=de.lastBaseUpdate,O!==E&&(O===null?de.firstBaseUpdate=te:O.next=te,de.lastBaseUpdate=G))}if(x!==null){var pe=v.baseState;E=0,de=te=G=null,O=x;do{var ne=O.lane&-536870913,le=ne!==O.lane;if(le?(tt&ne)===ne:(f&ne)===ne){ne!==0&&ne===Dl&&(Mm=!0),de!==null&&(de=de.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Te=i,Pe=O;ne=o;var vt=c;switch(Pe.tag){case 1:if(Te=Pe.payload,typeof Te=="function"){pe=Te.call(vt,pe,ne);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Pe.payload,ne=typeof Te=="function"?Te.call(vt,pe,ne):Te,ne==null)break e;pe=m({},pe,ne);break e;case 2:Rs=!0}}ne=O.callback,ne!==null&&(i.flags|=64,le&&(i.flags|=8192),le=v.callbacks,le===null?v.callbacks=[ne]:le.push(ne))}else le={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},de===null?(te=de=le,G=pe):de=de.next=le,E|=ne;if(O=O.next,O===null){if(O=v.shared.pending,O===null)break;le=O,O=le.next,le.next=null,v.lastBaseUpdate=le,v.shared.pending=null}}while(!0);de===null&&(G=pe),v.baseState=G,v.firstBaseUpdate=te,v.lastBaseUpdate=de,x===null&&(v.shared.lanes=0),Ls|=E,i.lanes=E,i.memoizedState=pe}}function $x(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function Wx(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)$x(c[i],o)}var zl=I(null),Dd=I(0);function Vx(i,o){i=Qi,A(Dd,i),A(zl,o),Qi=i|o.baseLanes}function Nm(){A(Dd,Qi),A(zl,zl.current)}function Am(){Qi=Dd.current,q(zl),q(Dd)}var pr=I(null),jr=null;function Ns(i){var o=i.alternate;A(Vt,Vt.current&1),A(pr,i),jr===null&&(o===null||zl.current!==null||o.memoizedState!==null)&&(jr=i)}function Dm(i){A(Vt,Vt.current),A(pr,i),jr===null&&(jr=i)}function qx(i){i.tag===22?(A(Vt,Vt.current),A(pr,i),jr===null&&(jr=i)):As()}function As(){A(Vt,Vt.current),A(pr,pr.current)}function mr(i){q(pr),jr===i&&(jr=null),q(Vt)}var Vt=I(0);function Od(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Bg(c)||Ig(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 Wi=0,$e=null,mt=null,Xt=null,Ld=!1,Pl=!1,Do=!1,jd=0,pc=0,Bl=null,P3=0;function Ht(){throw Error(r(321))}function Om(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!hr(i[c],o[c]))return!1;return!0}function Lm(i,o,c,f,v,x){return Wi=x,$e=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=i===null||i.memoizedState===null?M1:Ym,Do=!1,x=c(f,v),Do=!1,Pl&&(x=Gx(o,c,f,v)),Kx(i),x}function Kx(i){B.H=vc;var o=mt!==null&&mt.next!==null;if(Wi=0,Xt=mt=$e=null,Ld=!1,pc=0,Bl=null,o)throw Error(r(300));i===null||Zt||(i=i.dependencies,i!==null&&kd(i)&&(Zt=!0))}function Gx(i,o,c,f){$e=i;var v=0;do{if(Pl&&(Bl=null),pc=0,Pl=!1,25<=v)throw Error(r(301));if(v+=1,Xt=mt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}B.H=N1,x=o(c,f)}while(Pl);return x}function B3(){var i=B.H,o=i.useState()[0];return o=typeof o.then=="function"?mc(o):o,i=i.useState()[0],(mt!==null?mt.memoizedState:null)!==i&&($e.flags|=1024),o}function jm(){var i=jd!==0;return jd=0,i}function zm(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Pm(i){if(Ld){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Ld=!1}Wi=0,Xt=mt=$e=null,Pl=!1,pc=jd=0,Bl=null}function Hn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?$e.memoizedState=Xt=i:Xt=Xt.next=i,Xt}function qt(){if(mt===null){var i=$e.alternate;i=i!==null?i.memoizedState:null}else i=mt.next;var o=Xt===null?$e.memoizedState:Xt.next;if(o!==null)Xt=o,mt=i;else{if(i===null)throw $e.alternate===null?Error(r(467)):Error(r(310));mt=i,i={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Xt===null?$e.memoizedState=Xt=i:Xt=Xt.next=i}return Xt}function zd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mc(i){var o=pc;return pc+=1,Bl===null&&(Bl=[]),i=Bx(Bl,i,o),o=$e,(Xt===null?o.memoizedState:Xt.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?M1:Ym),i}function Pd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return mc(i);if(i.$$typeof===R)return En(i)}throw Error(r(438,String(i)))}function Bm(i){var o=null,c=$e.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=$e.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=zd(),$e.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]=z;return o.index++,c}function Vi(i,o){return typeof o=="function"?o(i):o}function Bd(i){var o=qt();return Im(o,mt,i)}function Im(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var v=i.baseQueue,x=f.pending;if(x!==null){if(v!==null){var E=v.next;v.next=x.next,x.next=E}o.baseQueue=v=x,f.pending=null}if(x=i.baseState,v===null)i.memoizedState=x;else{o=v.next;var O=E=null,G=null,te=o,de=!1;do{var pe=te.lane&-536870913;if(pe!==te.lane?(tt&pe)===pe:(Wi&pe)===pe){var ne=te.revertLane;if(ne===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),pe===Dl&&(de=!0);else if((Wi&ne)===ne){te=te.next,ne===Dl&&(de=!0);continue}else pe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},G===null?(O=G=pe,E=x):G=G.next=pe,$e.lanes|=ne,Ls|=ne;pe=te.action,Do&&c(x,pe),x=te.hasEagerState?te.eagerState:c(x,pe)}else ne={lane:pe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},G===null?(O=G=ne,E=x):G=G.next=ne,$e.lanes|=pe,Ls|=pe;te=te.next}while(te!==null&&te!==o);if(G===null?E=x:G.next=O,!hr(x,i.memoizedState)&&(Zt=!0,de&&(c=Ol,c!==null)))throw c;i.memoizedState=x,i.baseState=E,i.baseQueue=G,f.lastRenderedState=x}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Hm(i){var o=qt(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,v=c.pending,x=o.memoizedState;if(v!==null){c.pending=null;var E=v=v.next;do x=i(x,E.action),E=E.next;while(E!==v);hr(x,o.memoizedState)||(Zt=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),c.lastRenderedState=x}return[x,f]}function Yx(i,o,c){var f=$e,v=qt(),x=it;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!hr((mt||v).memoizedState,c);if(E&&(v.memoizedState=c,Zt=!0),v=v.queue,$m(Qx.bind(null,f,v,i),[i]),v.getSnapshot!==o||E||Xt!==null&&Xt.memoizedState.tag&1){if(f.flags|=2048,Il(9,{destroy:void 0},Zx.bind(null,f,v,c,o),null),St===null)throw Error(r(349));x||(Wi&127)!==0||Xx(f,o,c)}return c}function Xx(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=$e.updateQueue,o===null?(o=zd(),$e.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function Zx(i,o,c,f){o.value=c,o.getSnapshot=f,Jx(o)&&e1(i)}function Qx(i,o,c){return c(function(){Jx(o)&&e1(i)})}function Jx(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!hr(i,c)}catch{return!0}}function e1(i){var o=wo(i,2);o!==null&&rr(o,i,2)}function Fm(i){var o=Hn();if(typeof i=="function"){var c=i;if(i=c(),Do){Gt(!0);try{c()}finally{Gt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:i},o}function t1(i,o,c,f){return i.baseState=c,Im(i,mt,typeof f=="function"?f:Vi)}function I3(i,o,c,f,v){if(Fd(i))throw Error(r(485));if(i=o.action,i!==null){var x={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};B.T!==null?c(!0):x.isTransition=!1,f(x),c=o.pending,c===null?(x.next=o.pending=x,n1(o,x)):(x.next=c.next,o.pending=c.next=x)}}function n1(i,o){var c=o.action,f=o.payload,v=i.state;if(o.isTransition){var x=B.T,E={};B.T=E;try{var O=c(v,f),G=B.S;G!==null&&G(E,O),r1(i,o,O)}catch(te){Um(i,o,te)}finally{x!==null&&E.types!==null&&(x.types=E.types),B.T=x}}else try{x=c(v,f),r1(i,o,x)}catch(te){Um(i,o,te)}}function r1(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){i1(i,o,f)},function(f){return Um(i,o,f)}):i1(i,o,c)}function i1(i,o,c){o.status="fulfilled",o.value=c,s1(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,n1(i,c)))}function Um(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,s1(o),o=o.next;while(o!==f)}i.action=null}function s1(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function o1(i,o){return o}function l1(i,o){if(it){var c=St.formState;if(c!==null){e:{var f=$e;if(it){if(Tt){t:{for(var v=Tt,x=Lr;v.nodeType!==8;){if(!x){v=null;break t}if(v=zr(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){Tt=zr(v.nextSibling),f=v.data==="F!";break e}}ks(f)}f=!1}f&&(o=c[0])}}return c=Hn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o1,lastRenderedState:o},c.queue=f,c=E1.bind(null,$e,f),f.dispatch=c,f=Fm(!1),x=Gm.bind(null,$e,!1,f.queue),f=Hn(),v={state:o,dispatch:null,action:i,pending:null},f.queue=v,c=I3.bind(null,$e,v,x,c),v.dispatch=c,f.memoizedState=i,[o,c,!1]}function a1(i){var o=qt();return c1(o,mt,i)}function c1(i,o,c){if(o=Im(i,o,o1)[0],i=Bd(Vi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=mc(o)}catch(E){throw E===Ll?Td:E}else f=o;o=qt();var v=o.queue,x=v.dispatch;return c!==o.memoizedState&&($e.flags|=2048,Il(9,{destroy:void 0},H3.bind(null,v,c),null)),[f,x,i]}function H3(i,o){i.action=o}function u1(i){var o=qt(),c=mt;if(c!==null)return c1(o,c,i);qt(),o=o.memoizedState,c=qt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function Il(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=$e.updateQueue,o===null&&(o=zd(),$e.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 d1(){return qt().memoizedState}function Id(i,o,c,f){var v=Hn();$e.flags|=i,v.memoizedState=Il(1|o,{destroy:void 0},c,f===void 0?null:f)}function Hd(i,o,c,f){var v=qt();f=f===void 0?null:f;var x=v.memoizedState.inst;mt!==null&&f!==null&&Om(f,mt.memoizedState.deps)?v.memoizedState=Il(o,x,c,f):($e.flags|=i,v.memoizedState=Il(1|o,x,c,f))}function h1(i,o){Id(8390656,8,i,o)}function $m(i,o){Hd(2048,8,i,o)}function F3(i){$e.flags|=4;var o=$e.updateQueue;if(o===null)o=zd(),$e.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function f1(i){var o=qt().memoizedState;return F3({ref:o,nextImpl:i}),function(){if((ut&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function p1(i,o){return Hd(4,2,i,o)}function m1(i,o){return Hd(4,4,i,o)}function g1(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 v1(i,o,c){c=c!=null?c.concat([i]):null,Hd(4,4,g1.bind(null,o,i),c)}function Wm(){}function _1(i,o){var c=qt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&Om(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function y1(i,o){var c=qt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&Om(o,f[1]))return f[0];if(f=i(),Do){Gt(!0);try{i()}finally{Gt(!1)}}return c.memoizedState=[f,o],f}function Vm(i,o,c){return c===void 0||(Wi&1073741824)!==0&&(tt&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=bS(),$e.lanes|=i,Ls|=i,c)}function b1(i,o,c,f){return hr(c,o)?c:zl.current!==null?(i=Vm(i,c,f),hr(i,o)||(Zt=!0),i):(Wi&42)===0||(Wi&1073741824)!==0&&(tt&261930)===0?(Zt=!0,i.memoizedState=c):(i=bS(),$e.lanes|=i,Ls|=i,o)}function x1(i,o,c,f,v){var x=K.p;K.p=x!==0&&8>x?x:8;var E=B.T,O={};B.T=O,Gm(i,!1,o,c);try{var G=v(),te=B.S;if(te!==null&&te(O,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var de=z3(G,f);gc(i,o,de,_r(i))}else gc(i,o,f,_r(i))}catch(pe){gc(i,o,{then:function(){},status:"rejected",reason:pe},_r())}finally{K.p=x,E!==null&&O.types!==null&&(E.types=O.types),B.T=E}}function U3(){}function qm(i,o,c,f){if(i.tag!==5)throw Error(r(476));var v=S1(i).queue;x1(i,v,o,W,c===null?U3:function(){return w1(i),c(f)})}function S1(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:W},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function w1(i){var o=S1(i);o.next===null&&(o=i.alternate.memoizedState),gc(i,o.next.queue,{},_r())}function Km(){return En(Oc)}function C1(){return qt().memoizedState}function k1(){return qt().memoizedState}function $3(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=_r();i=Ts(c);var f=Ms(o,i,c);f!==null&&(rr(f,o,c),dc(f,o,c)),o={cache:Sm()},i.payload=o;return}o=o.return}}function W3(i,o,c){var f=_r();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Fd(i)?R1(o,c):(c=dm(i,o,c,f),c!==null&&(rr(c,i,f),T1(c,o,f)))}function E1(i,o,c){var f=_r();gc(i,o,c,f)}function gc(i,o,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Fd(i))R1(o,v);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=o.lastRenderedReducer,x!==null))try{var E=o.lastRenderedState,O=x(E,c);if(v.hasEagerState=!0,v.eagerState=O,hr(O,E))return xd(i,o,v,0),St===null&&bd(),!1}catch{}finally{}if(c=dm(i,o,v,f),c!==null)return rr(c,i,f),T1(c,o,f),!0}return!1}function Gm(i,o,c,f){if(f={lane:2,revertLane:Eg(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Fd(i)){if(o)throw Error(r(479))}else o=dm(i,c,f,2),o!==null&&rr(o,i,2)}function Fd(i){var o=i.alternate;return i===$e||o!==null&&o===$e}function R1(i,o){Pl=Ld=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function T1(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,dr(i,c)}}var vc={readContext:En,use:Pd,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};vc.useEffectEvent=Ht;var M1={readContext:En,use:Pd,useCallback:function(i,o){return Hn().memoizedState=[i,o===void 0?null:o],i},useContext:En,useEffect:h1,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,Id(4194308,4,g1.bind(null,o,i),c)},useLayoutEffect:function(i,o){return Id(4194308,4,i,o)},useInsertionEffect:function(i,o){Id(4,2,i,o)},useMemo:function(i,o){var c=Hn();o=o===void 0?null:o;var f=i();if(Do){Gt(!0);try{i()}finally{Gt(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Hn();if(c!==void 0){var v=c(o);if(Do){Gt(!0);try{c(o)}finally{Gt(!1)}}}else v=o;return f.memoizedState=f.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},f.queue=i,i=i.dispatch=W3.bind(null,$e,i),[f.memoizedState,i]},useRef:function(i){var o=Hn();return i={current:i},o.memoizedState=i},useState:function(i){i=Fm(i);var o=i.queue,c=E1.bind(null,$e,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:Wm,useDeferredValue:function(i,o){var c=Hn();return Vm(c,i,o)},useTransition:function(){var i=Fm(!1);return i=x1.bind(null,$e,i.queue,!0,!1),Hn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=$e,v=Hn();if(it){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),St===null)throw Error(r(349));(tt&127)!==0||Xx(f,o,c)}v.memoizedState=c;var x={value:c,getSnapshot:o};return v.queue=x,h1(Qx.bind(null,f,x,i),[i]),f.flags|=2048,Il(9,{destroy:void 0},Zx.bind(null,f,x,c,o),null),c},useId:function(){var i=Hn(),o=St.identifierPrefix;if(it){var c=fi,f=hi;c=(f&~(1<<32-ot(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=jd++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=P3++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Km,useFormState:l1,useActionState:l1,useOptimistic:function(i){var o=Hn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Gm.bind(null,$e,!0,c),c.dispatch=o,[i,o]},useMemoCache:Bm,useCacheRefresh:function(){return Hn().memoizedState=$3.bind(null,$e)},useEffectEvent:function(i){var o=Hn(),c={impl:i};return o.memoizedState=c,function(){if((ut&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Ym={readContext:En,use:Pd,useCallback:_1,useContext:En,useEffect:$m,useImperativeHandle:v1,useInsertionEffect:p1,useLayoutEffect:m1,useMemo:y1,useReducer:Bd,useRef:d1,useState:function(){return Bd(Vi)},useDebugValue:Wm,useDeferredValue:function(i,o){var c=qt();return b1(c,mt.memoizedState,i,o)},useTransition:function(){var i=Bd(Vi)[0],o=qt().memoizedState;return[typeof i=="boolean"?i:mc(i),o]},useSyncExternalStore:Yx,useId:C1,useHostTransitionStatus:Km,useFormState:a1,useActionState:a1,useOptimistic:function(i,o){var c=qt();return t1(c,mt,i,o)},useMemoCache:Bm,useCacheRefresh:k1};Ym.useEffectEvent=f1;var N1={readContext:En,use:Pd,useCallback:_1,useContext:En,useEffect:$m,useImperativeHandle:v1,useInsertionEffect:p1,useLayoutEffect:m1,useMemo:y1,useReducer:Hm,useRef:d1,useState:function(){return Hm(Vi)},useDebugValue:Wm,useDeferredValue:function(i,o){var c=qt();return mt===null?Vm(c,i,o):b1(c,mt.memoizedState,i,o)},useTransition:function(){var i=Hm(Vi)[0],o=qt().memoizedState;return[typeof i=="boolean"?i:mc(i),o]},useSyncExternalStore:Yx,useId:C1,useHostTransitionStatus:Km,useFormState:u1,useActionState:u1,useOptimistic:function(i,o){var c=qt();return mt!==null?t1(c,mt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Bm,useCacheRefresh:k1};N1.useEffectEvent=f1;function Xm(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 Zm={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=_r(),v=Ts(f);v.payload=o,c!=null&&(v.callback=c),o=Ms(i,v,f),o!==null&&(rr(o,i,f),dc(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=_r(),v=Ts(f);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Ms(i,v,f),o!==null&&(rr(o,i,f),dc(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=_r(),f=Ts(c);f.tag=2,o!=null&&(f.callback=o),o=Ms(i,f,c),o!==null&&(rr(o,i,c),dc(o,i,c))}};function A1(i,o,c,f,v,x,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,x,E):o.prototype&&o.prototype.isPureReactComponent?!rc(c,f)||!rc(v,x):!0}function D1(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&&Zm.enqueueReplaceState(o,o.state,null)}function Oo(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 v in i)c[v]===void 0&&(c[v]=i[v])}return c}function O1(i){yd(i)}function L1(i){console.error(i)}function j1(i){yd(i)}function Ud(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function z1(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Qm(i,o,c){return c=Ts(c),c.tag=3,c.payload={element:null},c.callback=function(){Ud(i,o)},c}function P1(i){return i=Ts(i),i.tag=3,i}function B1(i,o,c,f){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var x=f.value;i.payload=function(){return v(x)},i.callback=function(){z1(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){z1(o,c,f),typeof v!="function"&&(js===null?js=new Set([this]):js.add(this));var O=f.stack;this.componentDidCatch(f.value,{componentStack:O!==null?O:""})})}function V3(i,o,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&Al(o,c,v,!0),c=pr.current,c!==null){switch(c.tag){case 31:case 13:return jr===null?eh():c.alternate===null&&Ft===0&&(Ft=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===Md?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),wg(i,f,v)),!1;case 22:return c.flags|=65536,f===Md?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)),wg(i,f,v)),!1}throw Error(r(435,c.tag))}return wg(i,f,v),eh(),!1}if(it)return o=pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,f!==vm&&(i=Error(r(422),{cause:f}),oc(Ar(i,c)))):(f!==vm&&(o=Error(r(423),{cause:f}),oc(Ar(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=Ar(f,c),v=Qm(i.stateNode,f,v),Tm(i,v),Ft!==4&&(Ft=2)),!1;var x=Error(r(520),{cause:f});if(x=Ar(x,c),kc===null?kc=[x]:kc.push(x),Ft!==4&&(Ft=2),o===null)return!0;f=Ar(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=Qm(c.stateNode,f,i),Tm(c,i),!1;case 1:if(o=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(js===null||!js.has(x))))return c.flags|=65536,v&=-v,c.lanes|=v,v=P1(v),B1(v,i,c,f),Tm(c,v),!1}c=c.return}while(c!==null);return!1}var Jm=Error(r(461)),Zt=!1;function Rn(i,o,c,f){o.child=i===null?Ux(o,null,c,f):Ao(o,i.child,c,f)}function I1(i,o,c,f,v){c=c.render;var x=o.ref;if("ref"in f){var E={};for(var O in f)O!=="ref"&&(E[O]=f[O])}else E=f;return Ro(o),f=Lm(i,o,c,E,x,v),O=jm(),i!==null&&!Zt?(zm(i,o,v),qi(i,o,v)):(it&&O&&mm(o),o.flags|=1,Rn(i,o,f,v),o.child)}function H1(i,o,c,f,v){if(i===null){var x=c.type;return typeof x=="function"&&!hm(x)&&x.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=x,F1(i,o,x,f,v)):(i=wd(c.type,null,f,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(x=i.child,!lg(i,v)){var E=x.memoizedProps;if(c=c.compare,c=c!==null?c:rc,c(E,f)&&i.ref===o.ref)return qi(i,o,v)}return o.flags|=1,i=Hi(x,f),i.ref=o.ref,i.return=o,o.child=i}function F1(i,o,c,f,v){if(i!==null){var x=i.memoizedProps;if(rc(x,f)&&i.ref===o.ref)if(Zt=!1,o.pendingProps=f=x,lg(i,v))(i.flags&131072)!==0&&(Zt=!0);else return o.lanes=i.lanes,qi(i,o,v)}return eg(i,o,c,f,v)}function U1(i,o,c,f){var v=f.children,x=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(x=x!==null?x.baseLanes|c:c,i!==null){for(f=o.child=i.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~x}else f=0,o.child=null;return $1(i,o,x,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Rd(o,x!==null?x.cachePool:null),x!==null?Vx(o,x):Nm(),qx(o);else return f=o.lanes=536870912,$1(i,o,x!==null?x.baseLanes|c:c,c,f)}else x!==null?(Rd(o,x.cachePool),Vx(o,x),As(),o.memoizedState=null):(i!==null&&Rd(o,null),Nm(),As());return Rn(i,o,v,c),o.child}function _c(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function $1(i,o,c,f,v){var x=Cm();return x=x===null?null:{parent:Yt._currentValue,pool:x},o.memoizedState={baseLanes:c,cachePool:x},i!==null&&Rd(o,null),Nm(),qx(o),i!==null&&Al(i,o,f,!0),o.childLanes=v,null}function $d(i,o){return o=Vd({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function W1(i,o,c){return Ao(o,i.child,null,c),i=$d(o,o.pendingProps),i.flags|=2,mr(o),o.memoizedState=null,i}function q3(i,o,c){var f=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(it){if(f.mode==="hidden")return i=$d(o,f),o.lanes=536870912,_c(null,i);if(Dm(o),(i=Tt)?(i=nw(i,Lr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ws!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Rx(i),c.return=o,o.child=c,kn=o,Tt=null)):i=null,i===null)throw ks(o);return o.lanes=536870912,null}return $d(o,f)}var x=i.memoizedState;if(x!==null){var E=x.dehydrated;if(Dm(o),v)if(o.flags&256)o.flags&=-257,o=W1(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(Zt||Al(i,o,c,!1),v=(c&i.childLanes)!==0,Zt||v){if(f=St,f!==null&&(E=Er(f,c),E!==0&&E!==x.retryLane))throw x.retryLane=E,wo(i,E),rr(f,i,E),Jm;eh(),o=W1(i,o,c)}else i=x.treeContext,Tt=zr(E.nextSibling),kn=o,it=!0,Cs=null,Lr=!1,i!==null&&Nx(o,i),o=$d(o,f),o.flags|=4096;return o}return i=Hi(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Wd(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 eg(i,o,c,f,v){return Ro(o),c=Lm(i,o,c,f,void 0,v),f=jm(),i!==null&&!Zt?(zm(i,o,v),qi(i,o,v)):(it&&f&&mm(o),o.flags|=1,Rn(i,o,c,v),o.child)}function V1(i,o,c,f,v,x){return Ro(o),o.updateQueue=null,c=Gx(o,f,c,v),Kx(i),f=jm(),i!==null&&!Zt?(zm(i,o,x),qi(i,o,x)):(it&&f&&mm(o),o.flags|=1,Rn(i,o,c,x),o.child)}function q1(i,o,c,f,v){if(Ro(o),o.stateNode===null){var x=Rl,E=c.contextType;typeof E=="object"&&E!==null&&(x=En(E)),x=new c(f,x),o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Zm,o.stateNode=x,x._reactInternals=o,x=o.stateNode,x.props=f,x.state=o.memoizedState,x.refs={},Em(o),E=c.contextType,x.context=typeof E=="object"&&E!==null?En(E):Rl,x.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Xm(o,c,E,f),x.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&Zm.enqueueReplaceState(x,x.state,null),fc(o,f,x,v),hc(),x.state=o.memoizedState),typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){x=o.stateNode;var O=o.memoizedProps,G=Oo(c,O);x.props=G;var te=x.context,de=c.contextType;E=Rl,typeof de=="object"&&de!==null&&(E=En(de));var pe=c.getDerivedStateFromProps;de=typeof pe=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||te!==E)&&D1(o,x,f,E),Rs=!1;var ne=o.memoizedState;x.state=ne,fc(o,f,x,v),hc(),te=o.memoizedState,O||ne!==te||Rs?(typeof pe=="function"&&(Xm(o,c,pe,f),te=o.memoizedState),(G=Rs||A1(o,c,G,f,ne,te,E))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(o.flags|=4194308)):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=te),x.props=f,x.state=te,x.context=E,f=G):(typeof x.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{x=o.stateNode,Rm(i,o),E=o.memoizedProps,de=Oo(c,E),x.props=de,pe=o.pendingProps,ne=x.context,te=c.contextType,G=Rl,typeof te=="object"&&te!==null&&(G=En(te)),O=c.getDerivedStateFromProps,(te=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==pe||ne!==G)&&D1(o,x,f,G),Rs=!1,ne=o.memoizedState,x.state=ne,fc(o,f,x,v),hc();var le=o.memoizedState;E!==pe||ne!==le||Rs||i!==null&&i.dependencies!==null&&kd(i.dependencies)?(typeof O=="function"&&(Xm(o,c,O,f),le=o.memoizedState),(de=Rs||A1(o,c,de,f,ne,le,G)||i!==null&&i.dependencies!==null&&kd(i.dependencies))?(te||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,le,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,le,G)),typeof x.componentDidUpdate=="function"&&(o.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=le),x.props=f,x.state=le,x.context=G,f=de):(typeof x.componentDidUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&ne===i.memoizedState||(o.flags|=1024),f=!1)}return x=f,Wd(i,o),f=(o.flags&128)!==0,x||f?(x=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:x.render(),o.flags|=1,i!==null&&f?(o.child=Ao(o,i.child,null,v),o.child=Ao(o,null,c,v)):Rn(i,o,c,v),o.memoizedState=x.state,i=o.child):i=qi(i,o,v),i}function K1(i,o,c,f){return ko(),o.flags|=256,Rn(i,o,c,f),o.child}var tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ng(i){return{baseLanes:i,cachePool:zx()}}function rg(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=vr),i}function G1(i,o,c){var f=o.pendingProps,v=!1,x=(o.flags&128)!==0,E;if((E=x)||(E=i!==null&&i.memoizedState===null?!1:(Vt.current&2)!==0),E&&(v=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(it){if(v?Ns(o):As(),(i=Tt)?(i=nw(i,Lr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:ws!==null?{id:hi,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},c=Rx(i),c.return=o,o.child=c,kn=o,Tt=null)):i=null,i===null)throw ks(o);return Ig(i)?o.lanes=32:o.lanes=536870912,null}var O=f.children;return f=f.fallback,v?(As(),v=o.mode,O=Vd({mode:"hidden",children:O},v),f=Co(f,v,c,null),O.return=o,f.return=o,O.sibling=f,o.child=O,f=o.child,f.memoizedState=ng(c),f.childLanes=rg(i,E,c),o.memoizedState=tg,_c(null,f)):(Ns(o),ig(o,O))}var G=i.memoizedState;if(G!==null&&(O=G.dehydrated,O!==null)){if(x)o.flags&256?(Ns(o),o.flags&=-257,o=sg(i,o,c)):o.memoizedState!==null?(As(),o.child=i.child,o.flags|=128,o=null):(As(),O=f.fallback,v=o.mode,f=Vd({mode:"visible",children:f.children},v),O=Co(O,v,c,null),O.flags|=2,f.return=o,O.return=o,f.sibling=O,o.child=f,Ao(o,i.child,null,c),f=o.child,f.memoizedState=ng(c),f.childLanes=rg(i,E,c),o.memoizedState=tg,o=_c(null,f));else if(Ns(o),Ig(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var te=E.dgst;E=te,f=Error(r(419)),f.stack="",f.digest=E,oc({value:f,source:null,stack:null}),o=sg(i,o,c)}else if(Zt||Al(i,o,c,!1),E=(c&i.childLanes)!==0,Zt||E){if(E=St,E!==null&&(f=Er(E,c),f!==0&&f!==G.retryLane))throw G.retryLane=f,wo(i,f),rr(E,i,f),Jm;Bg(O)||eh(),o=sg(i,o,c)}else Bg(O)?(o.flags|=192,o.child=i.child,o=null):(i=G.treeContext,Tt=zr(O.nextSibling),kn=o,it=!0,Cs=null,Lr=!1,i!==null&&Nx(o,i),o=ig(o,f.children),o.flags|=4096);return o}return v?(As(),O=f.fallback,v=o.mode,G=i.child,te=G.sibling,f=Hi(G,{mode:"hidden",children:f.children}),f.subtreeFlags=G.subtreeFlags&65011712,te!==null?O=Hi(te,O):(O=Co(O,v,c,null),O.flags|=2),O.return=o,f.return=o,f.sibling=O,o.child=f,_c(null,f),f=o.child,O=i.child.memoizedState,O===null?O=ng(c):(v=O.cachePool,v!==null?(G=Yt._currentValue,v=v.parent!==G?{parent:G,pool:G}:v):v=zx(),O={baseLanes:O.baseLanes|c,cachePool:v}),f.memoizedState=O,f.childLanes=rg(i,E,c),o.memoizedState=tg,_c(i.child,f)):(Ns(o),c=i.child,i=c.sibling,c=Hi(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 ig(i,o){return o=Vd({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Vd(i,o){return i=fr(22,i,null,o),i.lanes=0,i}function sg(i,o,c){return Ao(o,i.child,null,c),i=ig(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function Y1(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),bm(i.return,o,c)}function og(i,o,c,f,v,x){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:v,treeForkCount:x}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=v,E.treeForkCount=x)}function X1(i,o,c){var f=o.pendingProps,v=f.revealOrder,x=f.tail;f=f.children;var E=Vt.current,O=(E&2)!==0;if(O?(E=E&1|2,o.flags|=128):E&=1,A(Vt,E),Rn(i,o,f,c),f=it?sc:0,!O&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Y1(i,c,o);else if(i.tag===19)Y1(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(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&Od(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),og(o,!1,v,c,x,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&Od(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}og(o,!0,c,null,x,f);break;case"together":og(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function qi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Ls|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(Al(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=Hi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Hi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function lg(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&kd(i)))}function K3(i,o,c){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),Es(o,Yt,i.memoizedState.cache),ko();break;case 27:case 5:ce(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:Es(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Dm(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(Ns(o),o.flags|=128,null):(c&o.child.childLanes)!==0?G1(i,o,c):(Ns(o),i=qi(i,o,c),i!==null?i.sibling:null);Ns(o);break;case 19:var v=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(Al(i,o,c,!1),f=(c&o.childLanes)!==0),v){if(f)return X1(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),A(Vt,Vt.current),f)break;return null;case 22:return o.lanes=0,U1(i,o,c,o.pendingProps);case 24:Es(o,Yt,i.memoizedState.cache)}return qi(i,o,c)}function Z1(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)Zt=!0;else{if(!lg(i,c)&&(o.flags&128)===0)return Zt=!1,K3(i,o,c);Zt=(i.flags&131072)!==0}else Zt=!1,it&&(o.flags&1048576)!==0&&Mx(o,sc,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")hm(i)?(f=Oo(i,f),o.tag=1,o=q1(null,o,i,f,c)):(o.tag=0,o=eg(null,o,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===M){o.tag=11,o=I1(null,o,i,f,c);break e}else if(v===j){o.tag=14,o=H1(null,o,i,f,c);break e}}throw o=V(i)||i,Error(r(306,o,""))}}return o;case 0:return eg(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,v=Oo(f,o.pendingProps),q1(i,o,f,v,c);case 3:e:{if(ge(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var x=o.memoizedState;v=x.element,Rm(i,o),fc(o,f,null,c);var E=o.memoizedState;if(f=E.cache,Es(o,Yt,f),f!==x.cache&&xm(o,[Yt],c,!0),hc(),f=E.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=K1(i,o,f,c);break e}else if(f!==v){v=Ar(Error(r(424)),o),oc(v),o=K1(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(Tt=zr(i.firstChild),kn=o,it=!0,Cs=null,Lr=!0,c=Ux(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ko(),f===v){o=qi(i,o,c);break e}Rn(i,o,f,c)}o=o.child}return o;case 26:return Wd(i,o),i===null?(c=aw(o.type,null,o.pendingProps,null))?o.memoizedState=c:it||(c=o.type,i=o.pendingProps,f=lh(oe.current).createElement(c),f[Cn]=o,f[Zn]=i,Tn(f,c,i),fn(f),o.stateNode=f):o.memoizedState=aw(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return ce(o),i===null&&it&&(f=o.stateNode=sw(o.type,o.pendingProps,oe.current),kn=o,Lr=!0,v=Tt,Is(o.type)?(Hg=v,Tt=zr(f.firstChild)):Tt=v),Rn(i,o,o.pendingProps.children,c),Wd(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&it&&((v=f=Tt)&&(f=wO(f,o.type,o.pendingProps,Lr),f!==null?(o.stateNode=f,kn=o,Tt=zr(f.firstChild),Lr=!1,v=!0):v=!1),v||ks(o)),ce(o),v=o.type,x=o.pendingProps,E=i!==null?i.memoizedProps:null,f=x.children,jg(v,x)?f=null:E!==null&&jg(v,E)&&(o.flags|=32),o.memoizedState!==null&&(v=Lm(i,o,B3,null,null,c),Oc._currentValue=v),Wd(i,o),Rn(i,o,f,c),o.child;case 6:return i===null&&it&&((i=c=Tt)&&(c=CO(c,o.pendingProps,Lr),c!==null?(o.stateNode=c,kn=o,Tt=null,i=!0):i=!1),i||ks(o)),null;case 13:return G1(i,o,c);case 4:return ge(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=Ao(o,null,f,c):Rn(i,o,f,c),o.child;case 11:return I1(i,o,o.type,o.pendingProps,c);case 7:return Rn(i,o,o.pendingProps,c),o.child;case 8:return Rn(i,o,o.pendingProps.children,c),o.child;case 12:return Rn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,Es(o,o.type,f.value),Rn(i,o,f.children,c),o.child;case 9:return v=o.type._context,f=o.pendingProps.children,Ro(o),v=En(v),f=f(v),o.flags|=1,Rn(i,o,f,c),o.child;case 14:return H1(i,o,o.type,o.pendingProps,c);case 15:return F1(i,o,o.type,o.pendingProps,c);case 19:return X1(i,o,c);case 31:return q3(i,o,c);case 22:return U1(i,o,c,o.pendingProps);case 24:return Ro(o),f=En(Yt),i===null?(v=Cm(),v===null&&(v=St,x=Sm(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=c),v=x),o.memoizedState={parent:f,cache:v},Em(o),Es(o,Yt,v)):((i.lanes&c)!==0&&(Rm(i,o),fc(o,null,null,c),hc()),v=i.memoizedState,x=o.memoizedState,v.parent!==f?(v={parent:f,cache:f},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Es(o,Yt,f)):(f=x.cache,Es(o,Yt,f),f!==v.cache&&xm(o,[Yt],c,!0))),Rn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ki(i){i.flags|=4}function ag(i,o,c,f,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(CS())i.flags|=8192;else throw No=Md,km}else i.flags&=-16777217}function Q1(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!fw(o))if(CS())i.flags|=8192;else throw No=Md,km}function qd(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Ye():536870912,i.lanes|=o,$l|=o)}function yc(i,o){if(!it)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 Mt(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function G3(i,o,c){var f=o.pendingProps;switch(gm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(o),null;case 1:return Mt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),$i(Yt),ie(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Nl(o)?Ki(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,_m())),Mt(o),null;case 26:var v=o.type,x=o.memoizedState;return i===null?(Ki(o),x!==null?(Mt(o),Q1(o,x)):(Mt(o),ag(o,v,null,f,c))):x?x!==i.memoizedState?(Ki(o),Mt(o),Q1(o,x)):(Mt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Ki(o),Mt(o),ag(o,v,i,f,c)),null;case 27:if(we(o),c=oe.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}i=ae.current,Nl(o)?Ax(o):(i=sw(v,f,c),o.stateNode=i,Ki(o))}return Mt(o),null;case 5:if(we(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}if(x=ae.current,Nl(o))Ax(o);else{var E=lh(oe.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?x.multiple=!0:f.size&&(x.size=f.size);break;default:x=typeof f.is=="string"?E.createElement(v,{is:f.is}):E.createElement(v)}}x[Cn]=o,x[Zn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)x.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=x;e:switch(Tn(x,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Ki(o)}}return Mt(o),ag(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Ki(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=oe.current,Nl(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,v=kn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[Cn]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||GS(i.nodeValue,c)),i||ks(o,!0)}else i=lh(i).createTextNode(f),i[Cn]=o,o.stateNode=i}return Mt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=Nl(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[Cn]=o}else ko(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),i=!1}else c=_m(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(mr(o),o):(mr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Mt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=Nl(o),f!==null&&f.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Cn]=o}else ko(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),v=!1}else v=_m(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(mr(o),o):(mr(o),null)}return mr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==v&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),qd(o,o.updateQueue),Mt(o),null);case 4:return ie(),i===null&&Ng(o.stateNode.containerInfo),Mt(o),null;case 10:return $i(o.type),Mt(o),null;case 19:if(q(Vt),f=o.memoizedState,f===null)return Mt(o),null;if(v=(o.flags&128)!==0,x=f.rendering,x===null)if(v)yc(f,!1);else{if(Ft!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(x=Od(i),x!==null){for(o.flags|=128,yc(f,!1),i=x.updateQueue,o.updateQueue=i,qd(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)Ex(c,i),c=c.sibling;return A(Vt,Vt.current&1|2),it&&Fi(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&se()>Zd&&(o.flags|=128,v=!0,yc(f,!1),o.lanes=4194304)}else{if(!v)if(i=Od(x),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,qd(o,i),yc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!it)return Mt(o),null}else 2*se()-f.renderingStartTime>Zd&&c!==536870912&&(o.flags|=128,v=!0,yc(f,!1),o.lanes=4194304);f.isBackwards?(x.sibling=o.child,o.child=x):(i=f.last,i!==null?i.sibling=x:o.child=x,f.last=x)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=se(),i.sibling=null,c=Vt.current,A(Vt,v?c&1|2:c&1),it&&Fi(o,f.treeForkCount),i):(Mt(o),null);case 22:case 23:return mr(o),Am(),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&&(Mt(o),o.subtreeFlags&6&&(o.flags|=8192)):Mt(o),c=o.updateQueue,c!==null&&qd(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&&q(To),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),$i(Yt),Mt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function Y3(i,o){switch(gm(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return $i(Yt),ie(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return we(o),null;case 31:if(o.memoizedState!==null){if(mr(o),o.alternate===null)throw Error(r(340));ko()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(mr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ko()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return q(Vt),null;case 4:return ie(),null;case 10:return $i(o.type),null;case 22:case 23:return mr(o),Am(),i!==null&&q(To),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return $i(Yt),null;case 25:return null;default:return null}}function J1(i,o){switch(gm(o),o.tag){case 3:$i(Yt),ie();break;case 26:case 27:case 5:we(o);break;case 4:ie();break;case 31:o.memoizedState!==null&&mr(o);break;case 13:mr(o);break;case 19:q(Vt);break;case 10:$i(o.type);break;case 22:case 23:mr(o),Am(),i!==null&&q(To);break;case 24:$i(Yt)}}function bc(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var v=f.next;c=v;do{if((c.tag&i)===i){f=void 0;var x=c.create,E=c.inst;f=x(),E.destroy=f}c=c.next}while(c!==v)}}catch(O){pt(o,o.return,O)}}function Ds(i,o,c){try{var f=o.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var x=v.next;f=x;do{if((f.tag&i)===i){var E=f.inst,O=E.destroy;if(O!==void 0){E.destroy=void 0,v=o;var G=c,te=O;try{te()}catch(de){pt(v,G,de)}}}f=f.next}while(f!==x)}}catch(de){pt(o,o.return,de)}}function eS(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{Wx(o,c)}catch(f){pt(i,i.return,f)}}}function tS(i,o,c){c.props=Oo(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){pt(i,o,f)}}function xc(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(v){pt(i,o,v)}}function pi(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){pt(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){pt(i,o,v)}else c.current=null}function nS(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(v){pt(i,i.return,v)}}function cg(i,o,c){try{var f=i.stateNode;vO(f,i.type,c,o),f[Zn]=o}catch(v){pt(i,i.return,v)}}function rS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Is(i.type)||i.tag===4}function ug(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||rS(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&&Is(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 dg(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=Bi));else if(f!==4&&(f===27&&Is(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(dg(i,o,c),i=i.sibling;i!==null;)dg(i,o,c),i=i.sibling}function Kd(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&&Is(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Kd(i,o,c),i=i.sibling;i!==null;)Kd(i,o,c),i=i.sibling}function iS(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);Tn(o,f,c),o[Cn]=i,o[Zn]=c}catch(x){pt(i,i.return,x)}}var Gi=!1,Qt=!1,hg=!1,sS=typeof WeakSet=="function"?WeakSet:Set,pn=null;function X3(i,o){if(i=i.containerInfo,Og=ph,i=vx(i),sm(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 v=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var E=0,O=-1,G=-1,te=0,de=0,pe=i,ne=null;t:for(;;){for(var le;pe!==c||v!==0&&pe.nodeType!==3||(O=E+v),pe!==x||f!==0&&pe.nodeType!==3||(G=E+f),pe.nodeType===3&&(E+=pe.nodeValue.length),(le=pe.firstChild)!==null;)ne=pe,pe=le;for(;;){if(pe===i)break t;if(ne===c&&++te===v&&(O=E),ne===x&&++de===f&&(G=E),(le=pe.nextSibling)!==null)break;pe=ne,ne=pe.parentNode}pe=le}c=O===-1||G===-1?null:{start:O,end:G}}else c=null}c=c||{start:0,end:0}}else c=null;for(Lg={focusedElem:i,selectionRange:c},ph=!1,pn=o;pn!==null;)if(o=pn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,pn=i;else for(;pn!==null;){switch(o=pn,x=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++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=o,v=x.memoizedProps,x=x.memoizedState,f=c.stateNode;try{var Te=Oo(c.type,v);i=f.getSnapshotBeforeUpdate(Te,x),f.__reactInternalSnapshotBeforeUpdate=i}catch(Pe){pt(c,c.return,Pe)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Pg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Pg(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,pn=i;break}pn=o.return}}function oS(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Xi(i,c),f&4&&bc(5,c);break;case 1:if(Xi(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){pt(c,c.return,E)}else{var v=Oo(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){pt(c,c.return,E)}}f&64&&eS(c),f&512&&xc(c,c.return);break;case 3:if(Xi(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{Wx(i,o)}catch(E){pt(c,c.return,E)}}break;case 27:o===null&&f&4&&iS(c);case 26:case 5:Xi(i,c),o===null&&f&4&&nS(c),f&512&&xc(c,c.return);break;case 12:Xi(i,c);break;case 31:Xi(i,c),f&4&&cS(i,c);break;case 13:Xi(i,c),f&4&&uS(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=sO.bind(null,c),kO(i,c))));break;case 22:if(f=c.memoizedState!==null||Gi,!f){o=o!==null&&o.memoizedState!==null||Qt,v=Gi;var x=Qt;Gi=f,(Qt=o)&&!x?Zi(i,c,(c.subtreeFlags&8772)!==0):Xi(i,c),Gi=v,Qt=x}break;case 30:break;default:Xi(i,c)}}function lS(i){var o=i.alternate;o!==null&&(i.alternate=null,lS(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Up(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 Ot=null,Jn=!1;function Yi(i,o,c){for(c=c.child;c!==null;)aS(i,o,c),c=c.sibling}function aS(i,o,c){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(nn,c)}catch{}switch(c.tag){case 26:Qt||pi(c,o),Yi(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Qt||pi(c,o);var f=Ot,v=Jn;Is(c.type)&&(Ot=c.stateNode,Jn=!1),Yi(i,o,c),Nc(c.stateNode),Ot=f,Jn=v;break;case 5:Qt||pi(c,o);case 6:if(f=Ot,v=Jn,Ot=null,Yi(i,o,c),Ot=f,Jn=v,Ot!==null)if(Jn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(c.stateNode)}catch(x){pt(c,o,x)}else try{Ot.removeChild(c.stateNode)}catch(x){pt(c,o,x)}break;case 18:Ot!==null&&(Jn?(i=Ot,ew(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Zl(i)):ew(Ot,c.stateNode));break;case 4:f=Ot,v=Jn,Ot=c.stateNode.containerInfo,Jn=!0,Yi(i,o,c),Ot=f,Jn=v;break;case 0:case 11:case 14:case 15:Ds(2,c,o),Qt||Ds(4,c,o),Yi(i,o,c);break;case 1:Qt||(pi(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&tS(c,o,f)),Yi(i,o,c);break;case 21:Yi(i,o,c);break;case 22:Qt=(f=Qt)||c.memoizedState!==null,Yi(i,o,c),Qt=f;break;default:Yi(i,o,c)}}function cS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Zl(i)}catch(c){pt(o,o.return,c)}}}function uS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Zl(i)}catch(c){pt(o,o.return,c)}}function Z3(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new sS),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new sS),o;default:throw Error(r(435,i.tag))}}function Gd(i,o){var c=Z3(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var v=oO.bind(null,i,f);f.then(v,v)}})}function er(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var v=c[f],x=i,E=o,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(Is(O.type)){Ot=O.stateNode,Jn=!1;break e}break;case 5:Ot=O.stateNode,Jn=!1;break e;case 3:case 4:Ot=O.stateNode.containerInfo,Jn=!0;break e}O=O.return}if(Ot===null)throw Error(r(160));aS(x,E,v),Ot=null,Jn=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)dS(o,i),o=o.sibling}var Qr=null;function dS(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:er(o,i),tr(i),f&4&&(Ds(3,i,i.return),bc(3,i),Ds(5,i,i.return));break;case 1:er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),f&64&&Gi&&(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 v=Qr;if(er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),f&4){var x=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,v=v.ownerDocument||v;t:switch(f){case"title":x=v.getElementsByTagName("title")[0],(!x||x[Ga]||x[Cn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(f),v.head.insertBefore(x,v.querySelector("head > title"))),Tn(x,f,c),x[Cn]=i,fn(x),f=x;break e;case"link":var E=dw("link","href",v).get(f+(c.href||""));if(E){for(var O=0;O<E.length;O++)if(x=E[O],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(O,1);break t}}x=v.createElement(f),Tn(x,f,c),v.head.appendChild(x);break;case"meta":if(E=dw("meta","content",v).get(f+(c.content||""))){for(O=0;O<E.length;O++)if(x=E[O],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(O,1);break t}}x=v.createElement(f),Tn(x,f,c),v.head.appendChild(x);break;default:throw Error(r(468,f))}x[Cn]=i,fn(x),f=x}i.stateNode=f}else hw(v,i.type,i.stateNode);else i.stateNode=uw(v,f,i.memoizedProps);else x!==f?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,f===null?hw(v,i.type,i.stateNode):uw(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&cg(i,i.memoizedProps,c.memoizedProps)}break;case 27:er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),c!==null&&f&4&&cg(i,i.memoizedProps,c.memoizedProps);break;case 5:if(er(o,i),tr(i),f&512&&(Qt||c===null||pi(c,c.return)),i.flags&32){v=i.stateNode;try{bl(v,"")}catch(Te){pt(i,i.return,Te)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,cg(i,v,c!==null?c.memoizedProps:v)),f&1024&&(hg=!0);break;case 6:if(er(o,i),tr(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(Te){pt(i,i.return,Te)}}break;case 3:if(uh=null,v=Qr,Qr=ah(o.containerInfo),er(o,i),Qr=v,tr(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Zl(o.containerInfo)}catch(Te){pt(i,i.return,Te)}hg&&(hg=!1,hS(i));break;case 4:f=Qr,Qr=ah(i.stateNode.containerInfo),er(o,i),tr(i),Qr=f;break;case 12:er(o,i),tr(i);break;case 31:er(o,i),tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 13:er(o,i),tr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Xd=se()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 22:v=i.memoizedState!==null;var G=c!==null&&c.memoizedState!==null,te=Gi,de=Qt;if(Gi=te||v,Qt=de||G,er(o,i),Qt=de,Gi=te,tr(i),f&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||G||Gi||Qt||Lo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){G=c=o;try{if(x=G.stateNode,v)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=G.stateNode;var pe=G.memoizedProps.style,ne=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Te){pt(G,G.return,Te)}}}else if(o.tag===6){if(c===null){G=o;try{G.stateNode.nodeValue=v?"":G.memoizedProps}catch(Te){pt(G,G.return,Te)}}}else if(o.tag===18){if(c===null){G=o;try{var le=G.stateNode;v?tw(le,!0):tw(G.stateNode,!1)}catch(Te){pt(G,G.return,Te)}}}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,Gd(i,c))));break;case 19:er(o,i),tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Gd(i,f)));break;case 30:break;case 21:break;default:er(o,i),tr(i)}}function tr(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(rS(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,x=ug(i);Kd(i,x,v);break;case 5:var E=c.stateNode;c.flags&32&&(bl(E,""),c.flags&=-33);var O=ug(i);Kd(i,O,E);break;case 3:case 4:var G=c.stateNode.containerInfo,te=ug(i);dg(i,te,G);break;default:throw Error(r(161))}}catch(de){pt(i,i.return,de)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function hS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;hS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function Xi(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)oS(i,o.alternate,o),o=o.sibling}function Lo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Ds(4,o,o.return),Lo(o);break;case 1:pi(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&tS(o,o.return,c),Lo(o);break;case 27:Nc(o.stateNode);case 26:case 5:pi(o,o.return),Lo(o);break;case 22:o.memoizedState===null&&Lo(o);break;case 30:Lo(o);break;default:Lo(o)}i=i.sibling}}function Zi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,v=i,x=o,E=x.flags;switch(x.tag){case 0:case 11:case 15:Zi(v,x,c),bc(4,x);break;case 1:if(Zi(v,x,c),f=x,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){pt(f,f.return,te)}if(f=x,v=f.updateQueue,v!==null){var O=f.stateNode;try{var G=v.shared.hiddenCallbacks;if(G!==null)for(v.shared.hiddenCallbacks=null,v=0;v<G.length;v++)$x(G[v],O)}catch(te){pt(f,f.return,te)}}c&&E&64&&eS(x),xc(x,x.return);break;case 27:iS(x);case 26:case 5:Zi(v,x,c),c&&f===null&&E&4&&nS(x),xc(x,x.return);break;case 12:Zi(v,x,c);break;case 31:Zi(v,x,c),c&&E&4&&cS(v,x);break;case 13:Zi(v,x,c),c&&E&4&&uS(v,x);break;case 22:x.memoizedState===null&&Zi(v,x,c),xc(x,x.return);break;case 30:break;default:Zi(v,x,c)}o=o.sibling}}function fg(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&&lc(c))}function pg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&lc(i))}function Jr(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)fS(i,o,c,f),o=o.sibling}function fS(i,o,c,f){var v=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(i,o,c,f),v&2048&&bc(9,o);break;case 1:Jr(i,o,c,f);break;case 3:Jr(i,o,c,f),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&lc(i)));break;case 12:if(v&2048){Jr(i,o,c,f),i=o.stateNode;try{var x=o.memoizedProps,E=x.id,O=x.onPostCommit;typeof O=="function"&&O(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(G){pt(o,o.return,G)}}else Jr(i,o,c,f);break;case 31:Jr(i,o,c,f);break;case 13:Jr(i,o,c,f);break;case 23:break;case 22:x=o.stateNode,E=o.alternate,o.memoizedState!==null?x._visibility&2?Jr(i,o,c,f):Sc(i,o):x._visibility&2?Jr(i,o,c,f):(x._visibility|=2,Hl(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),v&2048&&fg(E,o);break;case 24:Jr(i,o,c,f),v&2048&&pg(o.alternate,o);break;default:Jr(i,o,c,f)}}function Hl(i,o,c,f,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var x=i,E=o,O=c,G=f,te=E.flags;switch(E.tag){case 0:case 11:case 15:Hl(x,E,O,G,v),bc(8,E);break;case 23:break;case 22:var de=E.stateNode;E.memoizedState!==null?de._visibility&2?Hl(x,E,O,G,v):Sc(x,E):(de._visibility|=2,Hl(x,E,O,G,v)),v&&te&2048&&fg(E.alternate,E);break;case 24:Hl(x,E,O,G,v),v&&te&2048&&pg(E.alternate,E);break;default:Hl(x,E,O,G,v)}o=o.sibling}}function Sc(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,v=f.flags;switch(f.tag){case 22:Sc(c,f),v&2048&&fg(f.alternate,f);break;case 24:Sc(c,f),v&2048&&pg(f.alternate,f);break;default:Sc(c,f)}o=o.sibling}}var wc=8192;function Fl(i,o,c){if(i.subtreeFlags&wc)for(i=i.child;i!==null;)pS(i,o,c),i=i.sibling}function pS(i,o,c){switch(i.tag){case 26:Fl(i,o,c),i.flags&wc&&i.memoizedState!==null&&PO(c,Qr,i.memoizedState,i.memoizedProps);break;case 5:Fl(i,o,c);break;case 3:case 4:var f=Qr;Qr=ah(i.stateNode.containerInfo),Fl(i,o,c),Qr=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=wc,wc=16777216,Fl(i,o,c),wc=f):Fl(i,o,c));break;default:Fl(i,o,c)}}function mS(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 Cc(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];pn=f,vS(f,i)}mS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)gS(i),i=i.sibling}function gS(i){switch(i.tag){case 0:case 11:case 15:Cc(i),i.flags&2048&&Ds(9,i,i.return);break;case 3:Cc(i);break;case 12:Cc(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Yd(i)):Cc(i);break;default:Cc(i)}}function Yd(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];pn=f,vS(f,i)}mS(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ds(8,o,o.return),Yd(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Yd(o));break;default:Yd(o)}i=i.sibling}}function vS(i,o){for(;pn!==null;){var c=pn;switch(c.tag){case 0:case 11:case 15:Ds(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:lc(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,pn=f;else e:for(c=i;pn!==null;){f=pn;var v=f.sibling,x=f.return;if(lS(f),f===c){pn=null;break e}if(v!==null){v.return=x,pn=v;break e}pn=x}}}var Q3={getCacheForType:function(i){var o=En(Yt),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return En(Yt).controller.signal}},J3=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Ze=null,tt=0,ft=0,gr=null,Os=!1,Ul=!1,mg=!1,Qi=0,Ft=0,Ls=0,jo=0,gg=0,vr=0,$l=0,kc=null,nr=null,vg=!1,Xd=0,_S=0,Zd=1/0,Qd=null,js=null,sn=0,zs=null,Wl=null,Ji=0,_g=0,yg=null,yS=null,Ec=0,bg=null;function _r(){return(ut&2)!==0&&tt!==0?tt&-tt:B.T!==null?Eg():Xr()}function bS(){if(vr===0)if((tt&536870912)===0||it){var i=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),vr=i}else vr=536870912;return i=pr.current,i!==null&&(i.flags|=32),vr}function rr(i,o,c){(i===St&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vl(i,0),Ps(i,tt,vr,!1)),ur(i,c),((ut&2)===0||i!==St)&&(i===St&&((ut&2)===0&&(jo|=c),Ft===4&&Ps(i,tt,vr,!1)),mi(i))}function xS(i,o,c){if((ut&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||_e(i,o),v=f?nO(i,o):Sg(i,o,!0),x=f;do{if(v===0){Ul&&!f&&Ps(i,o,0,!1);break}else{if(c=i.current.alternate,x&&!eO(c)){v=Sg(i,o,!1),x=!1;continue}if(v===2){if(x=o,i.errorRecoveryDisabledLanes&x)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var O=i;v=kc;var G=O.current.memoizedState.isDehydrated;if(G&&(Vl(O,E).flags|=256),E=Sg(O,E,!1),E!==2){if(mg&&!G){O.errorRecoveryDisabledLanes|=x,jo|=x,v=4;break e}x=nr,nr=v,x!==null&&(nr===null?nr=x:nr.push.apply(nr,x))}v=E}if(x=!1,v!==2)continue}}if(v===1){Vl(i,0),Ps(i,o,0,!0);break}e:{switch(f=i,x=v,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Ps(f,o,vr,!Os);break e;case 2:nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Xd+300-se(),10<v)){if(Ps(f,o,vr,!Os),re(f,0,!0)!==0)break e;Ji=o,f.timeoutHandle=QS(SS.bind(null,f,c,nr,Qd,vg,o,vr,jo,$l,Os,x,"Throttled",-0,0),v);break e}SS(f,c,nr,Qd,vg,o,vr,jo,$l,Os,x,null,-0,0)}}break}while(!0);mi(i)}function SS(i,o,c,f,v,x,E,O,G,te,de,pe,ne,le){if(i.timeoutHandle=-1,pe=o.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bi},pS(o,x,pe);var Te=(x&62914560)===x?Xd-se():(x&4194048)===x?_S-se():0;if(Te=BO(pe,Te),Te!==null){Ji=x,i.cancelPendingCommit=Te(NS.bind(null,i,o,x,c,f,v,E,O,G,de,pe,null,ne,le)),Ps(i,x,E,!te);return}}NS(i,o,x,c,f,v,E,O,G)}function eO(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 v=c[f],x=v.getSnapshot;v=v.value;try{if(!hr(x(),v))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 Ps(i,o,c,f){o&=~gg,o&=~jo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var v=o;0<v;){var x=31-ot(v),E=1<<x;f[x]=-1,v&=~E}c!==0&&Yr(i,c,o)}function Jd(){return(ut&6)===0?(Rc(0),!1):!0}function xg(){if(Ze!==null){if(ft===0)var i=Ze.return;else i=Ze,Ui=Eo=null,Pm(i),jl=null,cc=0,i=Ze;for(;i!==null;)J1(i.alternate,i),i=i.return;Ze=null}}function Vl(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,bO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Ji=0,xg(),St=i,Ze=c=Hi(i.current,null),tt=o,ft=0,gr=null,Os=!1,Ul=_e(i,o),mg=!1,$l=vr=gg=jo=Ls=Ft=0,nr=kc=null,vg=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var v=31-ot(f),x=1<<v;o|=i[v],f&=~x}return Qi=o,bd(),c}function wS(i,o){$e=null,B.H=vc,o===Ll||o===Td?(o=Ix(),ft=3):o===km?(o=Ix(),ft=4):ft=o===Jm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,gr=o,Ze===null&&(Ft=1,Ud(i,Ar(o,i.current)))}function CS(){var i=pr.current;return i===null?!0:(tt&4194048)===tt?jr===null:(tt&62914560)===tt||(tt&536870912)!==0?i===jr:!1}function kS(){var i=B.H;return B.H=vc,i===null?vc:i}function ES(){var i=B.A;return B.A=Q3,i}function eh(){Ft=4,Os||(tt&4194048)!==tt&&pr.current!==null||(Ul=!0),(Ls&134217727)===0&&(jo&134217727)===0||St===null||Ps(St,tt,vr,!1)}function Sg(i,o,c){var f=ut;ut|=2;var v=kS(),x=ES();(St!==i||tt!==o)&&(Qd=null,Vl(i,o)),o=!1;var E=Ft;e:do try{if(ft!==0&&Ze!==null){var O=Ze,G=gr;switch(ft){case 8:xg(),E=6;break e;case 3:case 2:case 9:case 6:pr.current===null&&(o=!0);var te=ft;if(ft=0,gr=null,ql(i,O,G,te),c&&Ul){E=0;break e}break;default:te=ft,ft=0,gr=null,ql(i,O,G,te)}}tO(),E=Ft;break}catch(de){wS(i,de)}while(!0);return o&&i.shellSuspendCounter++,Ui=Eo=null,ut=f,B.H=v,B.A=x,Ze===null&&(St=null,tt=0,bd()),E}function tO(){for(;Ze!==null;)RS(Ze)}function nO(i,o){var c=ut;ut|=2;var f=kS(),v=ES();St!==i||tt!==o?(Qd=null,Zd=se()+500,Vl(i,o)):Ul=_e(i,o);e:do try{if(ft!==0&&Ze!==null){o=Ze;var x=gr;t:switch(ft){case 1:ft=0,gr=null,ql(i,o,x,1);break;case 2:case 9:if(Px(x)){ft=0,gr=null,TS(o);break}o=function(){ft!==2&&ft!==9||St!==i||(ft=7),mi(i)},x.then(o,o);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Px(x)?(ft=0,gr=null,TS(o)):(ft=0,gr=null,ql(i,o,x,7));break;case 5:var E=null;switch(Ze.tag){case 26:E=Ze.memoizedState;case 5:case 27:var O=Ze;if(E?fw(E):O.stateNode.complete){ft=0,gr=null;var G=O.sibling;if(G!==null)Ze=G;else{var te=O.return;te!==null?(Ze=te,th(te)):Ze=null}break t}}ft=0,gr=null,ql(i,o,x,5);break;case 6:ft=0,gr=null,ql(i,o,x,6);break;case 8:xg(),Ft=6;break e;default:throw Error(r(462))}}rO();break}catch(de){wS(i,de)}while(!0);return Ui=Eo=null,B.H=f,B.A=v,ut=c,Ze!==null?0:(St=null,tt=0,bd(),Ft)}function rO(){for(;Ze!==null&&!cr();)RS(Ze)}function RS(i){var o=Z1(i.alternate,i,Qi);i.memoizedProps=i.pendingProps,o===null?th(i):Ze=o}function TS(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=V1(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=V1(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Pm(o);default:J1(c,o),o=Ze=Ex(o,Qi),o=Z1(c,o,Qi)}i.memoizedProps=i.pendingProps,o===null?th(i):Ze=o}function ql(i,o,c,f){Ui=Eo=null,Pm(o),jl=null,cc=0;var v=o.return;try{if(V3(i,v,o,c,tt)){Ft=1,Ud(i,Ar(c,i.current)),Ze=null;return}}catch(x){if(v!==null)throw Ze=v,x;Ft=1,Ud(i,Ar(c,i.current)),Ze=null;return}o.flags&32768?(it||f===1?i=!0:Ul||(tt&536870912)!==0?i=!1:(Os=i=!0,(f===2||f===9||f===3||f===6)&&(f=pr.current,f!==null&&f.tag===13&&(f.flags|=16384))),MS(o,i)):th(o)}function th(i){var o=i;do{if((o.flags&32768)!==0){MS(o,Os);return}i=o.return;var c=G3(o.alternate,o,Qi);if(c!==null){Ze=c;return}if(o=o.sibling,o!==null){Ze=o;return}Ze=o=i}while(o!==null);Ft===0&&(Ft=5)}function MS(i,o){do{var c=Y3(i.alternate,i);if(c!==null){c.flags&=32767,Ze=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Ze=i;return}Ze=i=c}while(i!==null);Ft=6,Ze=null}function NS(i,o,c,f,v,x,E,O,G){i.cancelPendingCommit=null;do nh();while(sn!==0);if((ut&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(x=o.lanes|o.childLanes,x|=um,rn(i,c,x,E,O,G),i===St&&(Ze=St=null,tt=0),Wl=o,zs=i,Ji=c,_g=x,yg=v,yS=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,lO(Le,function(){return jS(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=B.T,B.T=null,v=K.p,K.p=2,E=ut,ut|=4;try{X3(i,o,c)}finally{ut=E,K.p=v,B.T=f}}sn=1,AS(),DS(),OS()}}function AS(){if(sn===1){sn=0;var i=zs,o=Wl,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=B.T,B.T=null;var f=K.p;K.p=2;var v=ut;ut|=4;try{dS(o,i);var x=Lg,E=vx(i.containerInfo),O=x.focusedElem,G=x.selectionRange;if(E!==O&&O&&O.ownerDocument&&gx(O.ownerDocument.documentElement,O)){if(G!==null&&sm(O)){var te=G.start,de=G.end;if(de===void 0&&(de=te),"selectionStart"in O)O.selectionStart=te,O.selectionEnd=Math.min(de,O.value.length);else{var pe=O.ownerDocument||document,ne=pe&&pe.defaultView||window;if(ne.getSelection){var le=ne.getSelection(),Te=O.textContent.length,Pe=Math.min(G.start,Te),vt=G.end===void 0?Pe:Math.min(G.end,Te);!le.extend&&Pe>vt&&(E=vt,vt=Pe,Pe=E);var Q=mx(O,Pe),X=mx(O,vt);if(Q&&X&&(le.rangeCount!==1||le.anchorNode!==Q.node||le.anchorOffset!==Q.offset||le.focusNode!==X.node||le.focusOffset!==X.offset)){var ee=pe.createRange();ee.setStart(Q.node,Q.offset),le.removeAllRanges(),Pe>vt?(le.addRange(ee),le.extend(X.node,X.offset)):(ee.setEnd(X.node,X.offset),le.addRange(ee))}}}}for(pe=[],le=O;le=le.parentNode;)le.nodeType===1&&pe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<pe.length;O++){var he=pe[O];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}ph=!!Og,Lg=Og=null}finally{ut=v,K.p=f,B.T=c}}i.current=o,sn=2}}function DS(){if(sn===2){sn=0;var i=zs,o=Wl,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=B.T,B.T=null;var f=K.p;K.p=2;var v=ut;ut|=4;try{oS(i,o.alternate,o)}finally{ut=v,K.p=f,B.T=c}}sn=3}}function OS(){if(sn===4||sn===3){sn=0,Gr();var i=zs,o=Wl,c=Ji,f=yS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?sn=5:(sn=0,Wl=zs=null,LS(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(js=null),zi(c),o=o.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(nn,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=B.T,v=K.p,K.p=2,B.T=null;try{for(var x=i.onRecoverableError,E=0;E<f.length;E++){var O=f[E];x(O.value,{componentStack:O.stack})}}finally{B.T=o,K.p=v}}(Ji&3)!==0&&nh(),mi(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===bg?Ec++:(Ec=0,bg=i):Ec=0,Rc(0)}}function LS(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,lc(o)))}function nh(){return AS(),DS(),OS(),jS()}function jS(){if(sn!==5)return!1;var i=zs,o=_g;_g=0;var c=zi(Ji),f=B.T,v=K.p;try{K.p=32>c?32:c,B.T=null,c=yg,yg=null;var x=zs,E=Ji;if(sn=0,Wl=zs=null,Ji=0,(ut&6)!==0)throw Error(r(331));var O=ut;if(ut|=4,gS(x.current),fS(x,x.current,E,c),ut=O,Rc(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(nn,x)}catch{}return!0}finally{K.p=v,B.T=f,LS(i,o)}}function zS(i,o,c){o=Ar(c,o),o=Qm(i.stateNode,o,2),i=Ms(i,o,2),i!==null&&(ur(i,2),mi(i))}function pt(i,o,c){if(i.tag===3)zS(i,i,c);else for(;o!==null;){if(o.tag===3){zS(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(js===null||!js.has(f))){i=Ar(c,i),c=P1(2),f=Ms(o,c,2),f!==null&&(B1(c,f,o,i),ur(f,2),mi(f));break}}o=o.return}}function wg(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new J3;var v=new Set;f.set(o,v)}else v=f.get(o),v===void 0&&(v=new Set,f.set(o,v));v.has(c)||(mg=!0,v.add(c),i=iO.bind(null,i,o,c),o.then(i,i))}function iO(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,St===i&&(tt&c)===c&&(Ft===4||Ft===3&&(tt&62914560)===tt&&300>se()-Xd?(ut&2)===0&&Vl(i,0):gg|=c,$l===tt&&($l=0)),mi(i)}function PS(i,o){o===0&&(o=Ye()),i=wo(i,o),i!==null&&(ur(i,o),mi(i))}function sO(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),PS(i,c)}function oO(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,v=i.memoizedState;v!==null&&(c=v.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),PS(i,c)}function lO(i,o){return zt(i,o)}var rh=null,Kl=null,Cg=!1,ih=!1,kg=!1,Bs=0;function mi(i){i!==Kl&&i.next===null&&(Kl===null?rh=Kl=i:Kl=Kl.next=i),ih=!0,Cg||(Cg=!0,cO())}function Rc(i,o){if(!kg&&ih){kg=!0;do for(var c=!1,f=rh;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var x=0;else{var E=f.suspendedLanes,O=f.pingedLanes;x=(1<<31-ot(42|i)+1)-1,x&=v&~(E&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,FS(f,x))}else x=tt,x=re(f,f===St?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||_e(f,x)||(c=!0,FS(f,x));f=f.next}while(c);kg=!1}}function aO(){BS()}function BS(){ih=Cg=!1;var i=0;Bs!==0&&yO()&&(i=Bs);for(var o=se(),c=null,f=rh;f!==null;){var v=f.next,x=IS(f,o);x===0?(f.next=null,c===null?rh=v:c.next=v,v===null&&(Kl=c)):(c=f,(i!==0||(x&3)!==0)&&(ih=!0)),f=v}sn!==0&&sn!==5||Rc(i),Bs!==0&&(Bs=0)}function IS(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var E=31-ot(x),O=1<<E,G=v[E];G===-1?((O&c)===0||(O&f)!==0)&&(v[E]=Ue(O,o)):G<=o&&(i.expiredLanes|=O),x&=~O}if(o=St,c=tt,c=re(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&In(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||_e(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&In(f),zi(c)){case 2:case 8:c=ve;break;case 32:c=Le;break;case 268435456:c=Xe;break;default:c=Le}return f=HS.bind(null,i),c=zt(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&In(f),i.callbackPriority=2,i.callbackNode=null,2}function HS(i,o){if(sn!==0&&sn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(nh()&&i.callbackNode!==c)return null;var f=tt;return f=re(i,i===St?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(xS(i,f,o),IS(i,se()),i.callbackNode!=null&&i.callbackNode===c?HS.bind(null,i):null)}function FS(i,o){if(nh())return null;xS(i,o,!0)}function cO(){xO(function(){(ut&6)!==0?zt(ue,aO):BS()})}function Eg(){if(Bs===0){var i=Dl;i===0&&(i=bs,bs<<=1,(bs&261888)===0&&(bs=256)),Bs=i}return Bs}function US(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:hd(""+i)}function $S(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 uO(i,o,c,f,v){if(o==="submit"&&c&&c.stateNode===v){var x=US((v[Zn]||null).action),E=f.submitter;E&&(o=(o=E[Zn]||null)?US(o.formAction):E.getAttribute("formAction"),o!==null&&(x=o,E=null));var O=new gd("action","action",null,f,v);i.push({event:O,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Bs!==0){var G=E?$S(v,E):new FormData(v);qm(c,{pending:!0,data:G,method:v.method,action:x},null,G)}}else typeof x=="function"&&(O.preventDefault(),G=E?$S(v,E):new FormData(v),qm(c,{pending:!0,data:G,method:v.method,action:x},x,G))},currentTarget:v}]})}}for(var Rg=0;Rg<cm.length;Rg++){var Tg=cm[Rg],dO=Tg.toLowerCase(),hO=Tg[0].toUpperCase()+Tg.slice(1);Zr(dO,"on"+hO)}Zr(bx,"onAnimationEnd"),Zr(xx,"onAnimationIteration"),Zr(Sx,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(T3,"onTransitionRun"),Zr(M3,"onTransitionStart"),Zr(N3,"onTransitionCancel"),Zr(wx,"onTransitionEnd"),_l("onMouseEnter",["mouseout","mouseover"]),_l("onMouseLeave",["mouseout","mouseover"]),_l("onPointerEnter",["pointerout","pointerover"]),_l("onPointerLeave",["pointerout","pointerover"]),yo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yo("onBeforeInput",["compositionend","keypress","textInput","paste"]),yo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tc="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(" "),fO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tc));function WS(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],v=f.event;f=f.listeners;e:{var x=void 0;if(o)for(var E=f.length-1;0<=E;E--){var O=f[E],G=O.instance,te=O.currentTarget;if(O=O.listener,G!==x&&v.isPropagationStopped())break e;x=O,v.currentTarget=te;try{x(v)}catch(de){yd(de)}v.currentTarget=null,x=G}else for(E=0;E<f.length;E++){if(O=f[E],G=O.instance,te=O.currentTarget,O=O.listener,G!==x&&v.isPropagationStopped())break e;x=O,v.currentTarget=te;try{x(v)}catch(de){yd(de)}v.currentTarget=null,x=G}}}}function Qe(i,o){var c=o[Fp];c===void 0&&(c=o[Fp]=new Set);var f=i+"__bubble";c.has(f)||(VS(o,i,2,!1),c.add(f))}function Mg(i,o,c){var f=0;o&&(f|=4),VS(c,i,f,o)}var sh="_reactListening"+Math.random().toString(36).slice(2);function Ng(i){if(!i[sh]){i[sh]=!0,B0.forEach(function(c){c!=="selectionchange"&&(fO.has(c)||Mg(c,!1,i),Mg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[sh]||(o[sh]=!0,Mg("selectionchange",!1,o))}}function VS(i,o,c,f){switch(bw(o)){case 2:var v=FO;break;case 8:v=UO;break;default:v=Vg}c=v.bind(null,o,c,i),v=void 0,!Xp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),f?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function Ag(i,o,c,f,v){var x=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 O=f.stateNode.containerInfo;if(O===v)break;if(E===4)for(E=f.return;E!==null;){var G=E.tag;if((G===3||G===4)&&E.stateNode.containerInfo===v)return;E=E.return}for(;O!==null;){if(E=ml(O),E===null)return;if(G=E.tag,G===5||G===6||G===26||G===27){f=x=E;continue e}O=O.parentNode}}f=f.return}X0(function(){var te=x,de=Gp(c),pe=[];e:{var ne=Cx.get(i);if(ne!==void 0){var le=gd,Te=i;switch(i){case"keypress":if(pd(c)===0)break e;case"keydown":case"keyup":le=o3;break;case"focusin":Te="focus",le=em;break;case"focusout":Te="blur",le=em;break;case"beforeblur":case"afterblur":le=em;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":le=J0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=GD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=c3;break;case bx:case xx:case Sx:le=ZD;break;case wx:le=d3;break;case"scroll":case"scrollend":le=qD;break;case"wheel":le=f3;break;case"copy":case"cut":case"paste":le=JD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=tx;break;case"toggle":case"beforetoggle":le=m3}var Pe=(o&4)!==0,vt=!Pe&&(i==="scroll"||i==="scrollend"),Q=Pe?ne!==null?ne+"Capture":null:ne;Pe=[];for(var X=te,ee;X!==null;){var he=X;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||Q===null||(he=Xa(X,Q),he!=null&&Pe.push(Mc(X,he,ee))),vt)break;X=X.return}0<Pe.length&&(ne=new le(ne,Te,null,c,de),pe.push({event:ne,listeners:Pe}))}}if((o&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",ne&&c!==Kp&&(Te=c.relatedTarget||c.fromElement)&&(ml(Te)||Te[pl]))break e;if((le||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,le?(Te=c.relatedTarget||c.toElement,le=te,Te=Te?ml(Te):null,Te!==null&&(vt=l(Te),Pe=Te.tag,Te!==vt||Pe!==5&&Pe!==27&&Pe!==6)&&(Te=null)):(le=null,Te=te),le!==Te)){if(Pe=J0,he="onMouseLeave",Q="onMouseEnter",X="mouse",(i==="pointerout"||i==="pointerover")&&(Pe=tx,he="onPointerLeave",Q="onPointerEnter",X="pointer"),vt=le==null?ne:Ya(le),ee=Te==null?ne:Ya(Te),ne=new Pe(he,X+"leave",le,c,de),ne.target=vt,ne.relatedTarget=ee,he=null,ml(de)===te&&(Pe=new Pe(Q,X+"enter",Te,c,de),Pe.target=ee,Pe.relatedTarget=vt,he=Pe),vt=he,le&&Te)t:{for(Pe=pO,Q=le,X=Te,ee=0,he=Q;he;he=Pe(he))ee++;he=0;for(var je=X;je;je=Pe(je))he++;for(;0<ee-he;)Q=Pe(Q),ee--;for(;0<he-ee;)X=Pe(X),he--;for(;ee--;){if(Q===X||X!==null&&Q===X.alternate){Pe=Q;break t}Q=Pe(Q),X=Pe(X)}Pe=null}else Pe=null;le!==null&&qS(pe,ne,le,Pe,!1),Te!==null&&vt!==null&&qS(pe,vt,Te,Pe,!0)}}e:{if(ne=te?Ya(te):window,le=ne.nodeName&&ne.nodeName.toLowerCase(),le==="select"||le==="input"&&ne.type==="file")var at=cx;else if(lx(ne))if(ux)at=k3;else{at=w3;var De=S3}else le=ne.nodeName,!le||le.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&qp(te.elementType)&&(at=cx):at=C3;if(at&&(at=at(i,te))){ax(pe,at,c,de);break e}De&&De(i,ne,te),i==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Vp(ne,"number",ne.value)}switch(De=te?Ya(te):window,i){case"focusin":(lx(De)||De.contentEditable==="true")&&(Cl=De,om=te,ic=null);break;case"focusout":ic=om=Cl=null;break;case"mousedown":lm=!0;break;case"contextmenu":case"mouseup":case"dragend":lm=!1,_x(pe,c,de);break;case"selectionchange":if(R3)break;case"keydown":case"keyup":_x(pe,c,de)}var We;if(nm)e:{switch(i){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else wl?sx(i,c)&&(nt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(nx&&c.locale!=="ko"&&(wl||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&wl&&(We=Z0()):(Ss=de,Zp="value"in Ss?Ss.value:Ss.textContent,wl=!0)),De=oh(te,nt),0<De.length&&(nt=new ex(nt,i,null,c,de),pe.push({event:nt,listeners:De}),We?nt.data=We:(We=ox(c),We!==null&&(nt.data=We)))),(We=v3?_3(i,c):y3(i,c))&&(nt=oh(te,"onBeforeInput"),0<nt.length&&(De=new ex("onBeforeInput","beforeinput",null,c,de),pe.push({event:De,listeners:nt}),De.data=We)),uO(pe,i,te,c,de)}WS(pe,o)})}function Mc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function oh(i,o){for(var c=o+"Capture",f=[];i!==null;){var v=i,x=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||x===null||(v=Xa(i,c),v!=null&&f.unshift(Mc(i,v,x)),v=Xa(i,o),v!=null&&f.push(Mc(i,v,x))),i.tag===3)return f;i=i.return}return[]}function pO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function qS(i,o,c,f,v){for(var x=o._reactName,E=[];c!==null&&c!==f;){var O=c,G=O.alternate,te=O.stateNode;if(O=O.tag,G!==null&&G===f)break;O!==5&&O!==26&&O!==27||te===null||(G=te,v?(te=Xa(c,x),te!=null&&E.unshift(Mc(c,te,G))):v||(te=Xa(c,x),te!=null&&E.push(Mc(c,te,G)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var mO=/\r\n?/g,gO=/\u0000|\uFFFD/g;function KS(i){return(typeof i=="string"?i:""+i).replace(mO,`
|
|
49
|
-
`).replace(gO,"")}function GS(i,o){return o=KS(o),KS(i)===o}function gt(i,o,c,f,v,x){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||bl(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&bl(i,""+f);break;case"className":ud(i,"class",f);break;case"tabIndex":ud(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":ud(i,c,f);break;case"style":G0(i,f,x);break;case"data":if(o!=="object"){ud(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=hd(""+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 x=="function"&&(c==="formAction"?(o!=="input"&>(i,o,"name",v.name,v,null),gt(i,o,"formEncType",v.formEncType,v,null),gt(i,o,"formMethod",v.formMethod,v,null),gt(i,o,"formTarget",v.formTarget,v,null)):(gt(i,o,"encType",v.encType,v,null),gt(i,o,"method",v.method,v,null),gt(i,o,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=hd(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Bi);break;case"onScroll":f!=null&&Qe("scroll",i);break;case"onScrollEnd":f!=null&&Qe("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(v.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=hd(""+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":Qe("beforetoggle",i),Qe("toggle",i),cd(i,"popover",f);break;case"xlinkActuate":Pi(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Pi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Pi(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Pi(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Pi(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Pi(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Pi(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":cd(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=WD.get(c)||c,cd(i,c,f))}}function Dg(i,o,c,f,v,x){switch(c){case"style":G0(i,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?bl(i,f):(typeof f=="number"||typeof f=="bigint")&&bl(i,""+f);break;case"onScroll":f!=null&&Qe("scroll",i);break;case"onScrollEnd":f!=null&&Qe("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!I0.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),x=i[Zn]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(o,x,v),typeof f=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,v);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):cd(i,c,f)}}}function Tn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var f=!1,v=!1,x;for(x in c)if(c.hasOwnProperty(x)){var E=c[x];if(E!=null)switch(x){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:gt(i,o,x,E,c,null)}}v&>(i,o,"srcSet",c.srcSet,c,null),f&>(i,o,"src",c.src,c,null);return;case"input":Qe("invalid",i);var O=x=E=v=null,G=null,te=null;for(f in c)if(c.hasOwnProperty(f)){var de=c[f];if(de!=null)switch(f){case"name":v=de;break;case"type":E=de;break;case"checked":G=de;break;case"defaultChecked":te=de;break;case"value":x=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,o));break;default:gt(i,o,f,de,c,null)}}W0(i,x,O,G,te,E,v,!1);return;case"select":Qe("invalid",i),f=E=x=null;for(v in c)if(c.hasOwnProperty(v)&&(O=c[v],O!=null))switch(v){case"value":x=O;break;case"defaultValue":E=O;break;case"multiple":f=O;default:gt(i,o,v,O,c,null)}o=x,c=E,i.multiple=!!f,o!=null?yl(i,!!f,o,!1):c!=null&&yl(i,!!f,c,!0);return;case"textarea":Qe("invalid",i),x=v=f=null;for(E in c)if(c.hasOwnProperty(E)&&(O=c[E],O!=null))switch(E){case"value":f=O;break;case"defaultValue":v=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:gt(i,o,E,O,c,null)}q0(i,f,v,x);return;case"option":for(G in c)if(c.hasOwnProperty(G)&&(f=c[G],f!=null))switch(G){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:gt(i,o,G,f,c,null)}return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(f=0;f<Tc.length;f++)Qe(Tc[f],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("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:gt(i,o,te,f,c,null)}return;default:if(qp(o)){for(de in c)c.hasOwnProperty(de)&&(f=c[de],f!==void 0&&Dg(i,o,de,f,c,void 0));return}}for(O in c)c.hasOwnProperty(O)&&(f=c[O],f!=null&>(i,o,O,f,c,null))}function vO(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 v=null,x=null,E=null,O=null,G=null,te=null,de=null;for(le in c){var pe=c[le];if(c.hasOwnProperty(le)&&pe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":G=pe;default:f.hasOwnProperty(le)||gt(i,o,le,null,f,pe)}}for(var ne in f){var le=f[ne];if(pe=c[ne],f.hasOwnProperty(ne)&&(le!=null||pe!=null))switch(ne){case"type":x=le;break;case"name":v=le;break;case"checked":te=le;break;case"defaultChecked":de=le;break;case"value":E=le;break;case"defaultValue":O=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,o));break;default:le!==pe&>(i,o,ne,le,f,pe)}}Wp(i,E,O,G,te,de,x,v);return;case"select":le=E=O=ne=null;for(x in c)if(G=c[x],c.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":le=G;default:f.hasOwnProperty(x)||gt(i,o,x,null,f,G)}for(v in f)if(x=f[v],G=c[v],f.hasOwnProperty(v)&&(x!=null||G!=null))switch(v){case"value":ne=x;break;case"defaultValue":O=x;break;case"multiple":E=x;default:x!==G&>(i,o,v,x,f,G)}o=O,c=E,f=le,ne!=null?yl(i,!!c,ne,!1):!!f!=!!c&&(o!=null?yl(i,!!c,o,!0):yl(i,!!c,c?[]:"",!1));return;case"textarea":le=ne=null;for(O in c)if(v=c[O],c.hasOwnProperty(O)&&v!=null&&!f.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:gt(i,o,O,null,f,v)}for(E in f)if(v=f[E],x=c[E],f.hasOwnProperty(E)&&(v!=null||x!=null))switch(E){case"value":ne=v;break;case"defaultValue":le=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==x&>(i,o,E,v,f,x)}V0(i,ne,le);return;case"option":for(var Te in c)if(ne=c[Te],c.hasOwnProperty(Te)&&ne!=null&&!f.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,o,Te,null,f,ne)}for(G in f)if(ne=f[G],le=c[G],f.hasOwnProperty(G)&&ne!==le&&(ne!=null||le!=null))switch(G){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:gt(i,o,G,ne,f,le)}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 Pe in c)ne=c[Pe],c.hasOwnProperty(Pe)&&ne!=null&&!f.hasOwnProperty(Pe)&>(i,o,Pe,null,f,ne);for(te in f)if(ne=f[te],le=c[te],f.hasOwnProperty(te)&&ne!==le&&(ne!=null||le!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,o));break;default:gt(i,o,te,ne,f,le)}return;default:if(qp(o)){for(var vt in c)ne=c[vt],c.hasOwnProperty(vt)&&ne!==void 0&&!f.hasOwnProperty(vt)&&Dg(i,o,vt,void 0,f,ne);for(de in f)ne=f[de],le=c[de],!f.hasOwnProperty(de)||ne===le||ne===void 0&&le===void 0||Dg(i,o,de,ne,f,le);return}}for(var Q in c)ne=c[Q],c.hasOwnProperty(Q)&&ne!=null&&!f.hasOwnProperty(Q)&>(i,o,Q,null,f,ne);for(pe in f)ne=f[pe],le=c[pe],!f.hasOwnProperty(pe)||ne===le||ne==null&&le==null||gt(i,o,pe,ne,f,le)}function YS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _O(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var v=c[f],x=v.transferSize,E=v.initiatorType,O=v.duration;if(x&&O&&YS(E)){for(E=0,O=v.responseEnd,f+=1;f<c.length;f++){var G=c[f],te=G.startTime;if(te>O)break;var de=G.transferSize,pe=G.initiatorType;de&&YS(pe)&&(G=G.responseEnd,E+=de*(G<O?1:(O-te)/(G-te)))}if(--f,o+=8*(x+E)/(v.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 Og=null,Lg=null;function lh(i){return i.nodeType===9?i:i.ownerDocument}function XS(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 ZS(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 jg(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 zg=null;function yO(){var i=window.event;return i&&i.type==="popstate"?i===zg?!1:(zg=i,!0):(zg=null,!1)}var QS=typeof setTimeout=="function"?setTimeout:void 0,bO=typeof clearTimeout=="function"?clearTimeout:void 0,JS=typeof Promise=="function"?Promise:void 0,xO=typeof queueMicrotask=="function"?queueMicrotask:typeof JS<"u"?function(i){return JS.resolve(null).then(i).catch(SO)}:QS;function SO(i){setTimeout(function(){throw i})}function Is(i){return i==="head"}function ew(i,o){var c=o,f=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(v),Zl(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Nc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Nc(c);for(var x=c.firstChild;x;){var E=x.nextSibling,O=x.nodeName;x[Ga]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=E}}else c==="body"&&Nc(i.ownerDocument.body);c=v}while(c);Zl(o)}function tw(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 Pg(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":Pg(c),Up(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function wO(i,o,c,f){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Ga])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var x=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=zr(i.nextSibling),i===null)break}return null}function CO(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=zr(i.nextSibling),i===null))return null;return i}function nw(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=zr(i.nextSibling),i===null))return null;return i}function Bg(i){return i.data==="$?"||i.data==="$~"}function Ig(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function kO(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 zr(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 Hg=null;function rw(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return zr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function iw(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 sw(i,o,c){switch(o=lh(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 Nc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Up(i)}var Pr=new Map,ow=new Set;function ah(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var es=K.d;K.d={f:EO,r:RO,D:TO,C:MO,L:NO,m:AO,X:OO,S:DO,M:LO};function EO(){var i=es.f(),o=Jd();return i||o}function RO(i){var o=gl(i);o!==null&&o.tag===5&&o.type==="form"?w1(o):es.r(i)}var Gl=typeof document>"u"?null:document;function lw(i,o,c){var f=Gl;if(f&&typeof o=="string"&&o){var v=Mr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),ow.has(v)||(ow.add(v),i={rel:i,crossOrigin:c,href:o},f.querySelector(v)===null&&(o=f.createElement("link"),Tn(o,"link",i),fn(o),f.head.appendChild(o)))}}function TO(i){es.D(i),lw("dns-prefetch",i,null)}function MO(i,o){es.C(i,o),lw("preconnect",i,o)}function NO(i,o,c){es.L(i,o,c);var f=Gl;if(f&&i&&o){var v='link[rel="preload"][as="'+Mr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Mr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Mr(c.imageSizes)+'"]')):v+='[href="'+Mr(i)+'"]';var x=v;switch(o){case"style":x=Yl(i);break;case"script":x=Xl(i)}Pr.has(x)||(i=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),Pr.set(x,i),f.querySelector(v)!==null||o==="style"&&f.querySelector(Ac(x))||o==="script"&&f.querySelector(Dc(x))||(o=f.createElement("link"),Tn(o,"link",i),fn(o),f.head.appendChild(o)))}}function AO(i,o){es.m(i,o);var c=Gl;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Mr(f)+'"][href="'+Mr(i)+'"]',x=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Xl(i)}if(!Pr.has(x)&&(i=m({rel:"modulepreload",href:i},o),Pr.set(x,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Dc(x)))return}f=c.createElement("link"),Tn(f,"link",i),fn(f),c.head.appendChild(f)}}}function DO(i,o,c){es.S(i,o,c);var f=Gl;if(f&&i){var v=vl(f).hoistableStyles,x=Yl(i);o=o||"default";var E=v.get(x);if(!E){var O={loading:0,preload:null};if(E=f.querySelector(Ac(x)))O.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},c),(c=Pr.get(x))&&Fg(i,c);var G=E=f.createElement("link");fn(G),Tn(G,"link",i),G._p=new Promise(function(te,de){G.onload=te,G.onerror=de}),G.addEventListener("load",function(){O.loading|=1}),G.addEventListener("error",function(){O.loading|=2}),O.loading|=4,ch(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:O},v.set(x,E)}}}function OO(i,o){es.X(i,o);var c=Gl;if(c&&i){var f=vl(c).hoistableScripts,v=Xl(i),x=f.get(v);x||(x=c.querySelector(Dc(v)),x||(i=m({src:i,async:!0},o),(o=Pr.get(v))&&Ug(i,o),x=c.createElement("script"),fn(x),Tn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function LO(i,o){es.M(i,o);var c=Gl;if(c&&i){var f=vl(c).hoistableScripts,v=Xl(i),x=f.get(v);x||(x=c.querySelector(Dc(v)),x||(i=m({src:i,async:!0,type:"module"},o),(o=Pr.get(v))&&Ug(i,o),x=c.createElement("script"),fn(x),Tn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function aw(i,o,c,f){var v=(v=oe.current)?ah(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Yl(c.href),c=vl(v).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=Yl(c.href);var x=vl(v).hoistableStyles,E=x.get(i);if(E||(v=v.ownerDocument||v,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,E),(x=v.querySelector(Ac(i)))&&!x._p&&(E.instance=x,E.state.loading=5),Pr.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},Pr.set(i,c),x||jO(v,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=Xl(c),c=vl(v).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 Yl(i){return'href="'+Mr(i)+'"'}function Ac(i){return'link[rel="stylesheet"]['+i+"]"}function cw(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function jO(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}),Tn(o,"link",c),fn(o),i.head.appendChild(o))}function Xl(i){return'[src="'+Mr(i)+'"]'}function Dc(i){return"script[async]"+i}function uw(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Mr(c.href)+'"]');if(f)return o.instance=f,fn(f),f;var v=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),fn(f),Tn(f,"style",v),ch(f,c.precedence,i),o.instance=f;case"stylesheet":v=Yl(c.href);var x=i.querySelector(Ac(v));if(x)return o.state.loading|=4,o.instance=x,fn(x),x;f=cw(c),(v=Pr.get(v))&&Fg(f,v),x=(i.ownerDocument||i).createElement("link"),fn(x);var E=x;return E._p=new Promise(function(O,G){E.onload=O,E.onerror=G}),Tn(x,"link",f),o.state.loading|=4,ch(x,c.precedence,i),o.instance=x;case"script":return x=Xl(c.src),(v=i.querySelector(Dc(x)))?(o.instance=v,fn(v),v):(f=c,(v=Pr.get(x))&&(f=m({},c),Ug(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),fn(v),Tn(v,"link",f),i.head.appendChild(v),o.instance=v);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,ch(f,c.precedence,i));return o.instance}function ch(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,x=v,E=0;E<f.length;E++){var O=f[E];if(O.dataset.precedence===o)x=O;else if(x!==v)break}x?x.parentNode.insertBefore(i,x.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Fg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Ug(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var uh=null;function dw(i,o,c){if(uh===null){var f=new Map,v=uh=new Map;v.set(c,f)}else v=uh,f=v.get(c),f||(f=new Map,v.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var x=c[v];if(!(x[Ga]||x[Cn]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(o)||"";E=i+E;var O=f.get(E);O?O.push(x):f.set(E,[x])}}return f}function hw(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function zO(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 fw(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function PO(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 v=Yl(f.href),x=o.querySelector(Ac(v));if(x){o=x._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=dh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=x,fn(x);return}x=o.ownerDocument||o,f=cw(f),(v=Pr.get(v))&&Fg(f,v),x=x.createElement("link"),fn(x);var E=x;E._p=new Promise(function(O,G){E.onload=O,E.onerror=G}),Tn(x,"link",f),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=dh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var $g=0;function BO(i,o){return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+o);0<i.imgBytes&&$g===0&&($g=62500*_O());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>$g?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function dh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var hh=null;function fh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,hh=new Map,o.forEach(IO,i),hh=null,dh.call(i))}function IO(i,o){if(!(o.state.loading&4)){var c=hh.get(i);if(c)var f=c.get(null);else{c=new Map,hh.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<v.length;x++){var E=v[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}v=o.instance,E=v.getAttribute("data-precedence"),x=c.get(E)||f,x===f&&c.set(null,v),c.set(E,v),this.count++,f=dh.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),x?x.parentNode.insertBefore(v,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var Oc={$$typeof:R,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function HO(i,o,c,f,v,x,E,O,G){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=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function pw(i,o,c,f,v,x,E,O,G,te,de,pe){return i=new HO(i,o,c,E,G,te,de,pe,O),o=1,x===!0&&(o|=24),x=fr(3,null,null,o),i.current=x,x.stateNode=i,o=Sm(),o.refCount++,i.pooledCache=o,o.refCount++,x.memoizedState={element:f,isDehydrated:c,cache:o},Em(x),i}function mw(i){return i?(i=Rl,i):Rl}function gw(i,o,c,f,v,x){v=mw(v),f.context===null?f.context=v:f.pendingContext=v,f=Ts(o),f.payload={element:c},x=x===void 0?null:x,x!==null&&(f.callback=x),c=Ms(i,f,o),c!==null&&(rr(c,i,o),dc(c,i,o))}function vw(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function Wg(i,o){vw(i,o),(i=i.alternate)&&vw(i,o)}function _w(i){if(i.tag===13||i.tag===31){var o=wo(i,67108864);o!==null&&rr(o,i,67108864),Wg(i,67108864)}}function yw(i){if(i.tag===13||i.tag===31){var o=_r();o=ji(o);var c=wo(i,o);c!==null&&rr(c,i,o),Wg(i,o)}}var ph=!0;function FO(i,o,c,f){var v=B.T;B.T=null;var x=K.p;try{K.p=2,Vg(i,o,c,f)}finally{K.p=x,B.T=v}}function UO(i,o,c,f){var v=B.T;B.T=null;var x=K.p;try{K.p=8,Vg(i,o,c,f)}finally{K.p=x,B.T=v}}function Vg(i,o,c,f){if(ph){var v=qg(f);if(v===null)Ag(i,o,f,mh,c),xw(i,f);else if(WO(v,i,o,c,f))f.stopPropagation();else if(xw(i,f),o&4&&-1<$O.indexOf(i)){for(;v!==null;){var x=gl(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=Dt(x.pendingLanes);if(E!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var G=1<<31-ot(E);O.entanglements[1]|=G,E&=~G}mi(x),(ut&6)===0&&(Zd=se()+500,Rc(0))}}break;case 31:case 13:O=wo(x,2),O!==null&&rr(O,x,2),Jd(),Wg(x,2)}if(x=qg(f),x===null&&Ag(i,o,f,mh,c),x===v)break;v=x}v!==null&&f.stopPropagation()}else Ag(i,o,f,null,c)}}function qg(i){return i=Gp(i),Kg(i)}var mh=null;function Kg(i){if(mh=null,i=ml(i),i!==null){var o=l(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=a(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 mh=i,null}function bw(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(Rt()){case ue:return 2;case ve:return 8;case Le:case Ie:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Gg=!1,Hs=null,Fs=null,Us=null,Lc=new Map,jc=new Map,$s=[],$O="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 xw(i,o){switch(i){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":Lc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":jc.delete(o.pointerId)}}function zc(i,o,c,f,v,x){return i===null||i.nativeEvent!==x?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:x,targetContainers:[v]},o!==null&&(o=gl(o),o!==null&&_w(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function WO(i,o,c,f,v){switch(o){case"focusin":return Hs=zc(Hs,i,o,c,f,v),!0;case"dragenter":return Fs=zc(Fs,i,o,c,f,v),!0;case"mouseover":return Us=zc(Us,i,o,c,f,v),!0;case"pointerover":var x=v.pointerId;return Lc.set(x,zc(Lc.get(x)||null,i,o,c,f,v)),!0;case"gotpointercapture":return x=v.pointerId,jc.set(x,zc(jc.get(x)||null,i,o,c,f,v)),!0}return!1}function Sw(i){var o=ml(i.target);if(o!==null){var c=l(o);if(c!==null){if(o=c.tag,o===13){if(o=a(c),o!==null){i.blockedOn=o,xs(i.priority,function(){yw(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,xs(i.priority,function(){yw(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 gh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=qg(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);Kp=f,c.target.dispatchEvent(f),Kp=null}else return o=gl(c),o!==null&&_w(o),i.blockedOn=c,!1;o.shift()}return!0}function ww(i,o,c){gh(i)&&c.delete(o)}function VO(){Gg=!1,Hs!==null&&gh(Hs)&&(Hs=null),Fs!==null&&gh(Fs)&&(Fs=null),Us!==null&&gh(Us)&&(Us=null),Lc.forEach(ww),jc.forEach(ww)}function vh(i,o){i.blockedOn===o&&(i.blockedOn=null,Gg||(Gg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VO)))}var _h=null;function Cw(i){_h!==i&&(_h=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_h===i&&(_h=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],v=i[o+2];if(typeof f!="function"){if(Kg(f||c)===null)continue;break}var x=gl(c);x!==null&&(i.splice(o,3),o-=3,qm(x,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}function Zl(i){function o(G){return vh(G,i)}Hs!==null&&vh(Hs,i),Fs!==null&&vh(Fs,i),Us!==null&&vh(Us,i),Lc.forEach(o),jc.forEach(o);for(var c=0;c<$s.length;c++){var f=$s[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<$s.length&&(c=$s[0],c.blockedOn===null);)Sw(c),c.blockedOn===null&&$s.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var v=c[f],x=c[f+1],E=v[Zn]||null;if(typeof x=="function")E||Cw(c);else if(E){var O=null;if(x&&x.hasAttribute("formAction")){if(v=x,E=x[Zn]||null)O=E.formAction;else if(Kg(v)!==null)continue}else O=E.action;typeof O=="function"?c[f+1]=O:(c.splice(f,3),f-=3),Cw(c)}}}function kw(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return v=E})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=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),v!==null&&(v(),v=null)}}}function Yg(i){this._internalRoot=i}yh.prototype.render=Yg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=_r();gw(c,f,i,o,null,null)},yh.prototype.unmount=Yg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;gw(i.current,2,null,i,null,null),Jd(),o[pl]=null}};function yh(i){this._internalRoot=i}yh.prototype.unstable_scheduleHydration=function(i){if(i){var o=Xr();i={blockedOn:null,target:i,priority:o};for(var c=0;c<$s.length&&o!==0&&o<$s[c].priority;c++);$s.splice(c,0,i),c===0&&Sw(i)}};var Ew=t.version;if(Ew!=="19.2.1")throw Error(r(527,Ew,"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=d(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var qO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bh.isDisabled&&bh.supportsFiber)try{nn=bh.inject(qO),Pt=bh}catch{}}return Ic.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",v=O1,x=L1,E=j1;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(x=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=pw(i,1,!1,null,null,c,f,null,v,x,E,kw),i[pl]=o.current,Ng(i),new Yg(o)},Ic.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,v="",x=O1,E=L1,O=j1,G=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(O=c.onRecoverableError),c.formState!==void 0&&(G=c.formState)),o=pw(i,1,!0,o,c??null,f,v,G,x,E,O,kw),o.context=mw(null),c=o.current,f=_r(),f=ji(f),v=Ts(f),v.callback=null,Ms(c,v,f),c=f,o.current.lanes=c,ur(o,c),mi(o),i[pl]=o.current,Ng(i),new yh(o)},Ic.version="19.2.1",Ic}var Hw;function i4(){if(Hw)return Qg.exports;Hw=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(),Qg.exports=r4(),Qg.exports}var s4=i4();/**
|
|
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 Fw="popstate";function Uw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function o4(e={}){function t(r,s){var d;let l=(d=s.state)==null?void 0:d.masked,{pathname:a,search:u,hash:h}=l||r.location;return d_("",{pathname:a,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:wu(s)}return a4(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function si(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function l4(){return Math.random().toString(36).substring(2,10)}function $w(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 d_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ta(t):t,state:n,key:t&&t.key||r||l4(),unstable_mask:s}}function wu({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 Ta(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 a4(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,a=s.history,u="POP",h=null,d=p();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function p(){return(a.state||{idx:null}).idx}function m(){u="POP";let C=p(),k=C==null?null:C-d;d=C,h&&h({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=Uw(C)?C:d_(w.location,C,k);d=p()+1;let R=$w(T,d),M=w.createHref(T.unstable_mask||T);try{a.pushState(R,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(M)}l&&h&&h({action:u,location:w.location,delta:1})}function y(C,k){u="REPLACE";let T=Uw(C)?C:d_(w.location,C,k);d=p();let R=$w(T,d),M=w.createHref(T.unstable_mask||T);a.replaceState(R,"",M),l&&h&&h({action:u,location:w.location,delta:0})}function S(C){return c4(C)}let w={get action(){return u},get location(){return e(s,a)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Fw,m),h=C,()=>{s.removeEventListener(Fw,m),h=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:y,go(C){return a.go(C)}};return w}function c4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:wu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function BE(e,t,n="/"){return u4(e,t,n,!1)}function u4(e,t,n,r){let s=typeof t=="string"?Ta(t):t,l=us(s.pathname||"/",n);if(l==null)return null;let a=IE(e);d4(a);let u=null;for(let h=0;u==null&&h<a.length;++h){let d=S4(l);u=b4(a[h],d,r)}return u}function IE(e,t=[],n=[],r="",s=!1){let l=(a,u,h=s,d)=>{let p={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:u,route:a};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&h)return;Lt(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=Ei([r,p.relativePath]),_=n.concat(p);a.children&&a.children.length>0&&(Lt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),IE(a.children,t,_,m,h)),!(a.path==null&&!a.index)&&t.push({path:m,score:_4(m,a.index),routesMeta:_})};return e.forEach((a,u)=>{var h;if(a.path===""||!((h=a.path)!=null&&h.includes("?")))l(a,u);else for(let d of HE(a.path))l(a,u,!0,d)}),t}function HE(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let a=HE(r.join("/")),u=[];return u.push(...a.map(h=>h===""?l:[l,h].join("/"))),s&&u.push(...a),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function d4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:y4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var h4=/^:[\w-]+$/,f4=3,p4=2,m4=1,g4=10,v4=-2,Ww=e=>e==="*";function _4(e,t){let n=e.split("/"),r=n.length;return n.some(Ww)&&(r+=v4),t&&(r+=p4),n.filter(s=>!Ww(s)).reduce((s,l)=>s+(h4.test(l)?f4:l===""?m4:g4),r)}function y4(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 b4(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",a=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",m=yf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},p),_=h.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=yf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},p)),!m)return null;Object.assign(s,m.params),a.push({params:s,pathname:Ei([l,m.pathname]),pathnameBase:E4(Ei([l,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(l=Ei([l,m.pathnameBase]))}return a}function yf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=x4(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],a=l.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:p,isOptional:m},_)=>{if(p==="*"){let S=u[_]||"";a=l.slice(0,l.length-S.length).replace(/(.)\/+$/,"$1")}const y=u[_];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function x4(e,t=!1,n=!0){si(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,(a,u,h,d,p)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let m=p.charAt(d+a.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 S4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return si(!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 us(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 w4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function C4(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ta(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Vw(n.substring(1),"/"):l=Vw(n,t)):l=t,{pathname:l,search:R4(r),hash:T4(s)}}function Vw(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 nv(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 k4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Gy(e){let t=k4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ep(e,t,n,r=!1){let s;typeof e=="string"?s=Ta(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),nv("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),nv("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),nv("#","search","hash",s)));let l=e===""||s.pathname==="",a=l?"/":s.pathname,u;if(a==null)u=n;else{let m=t.length-1;if(!r&&a.startsWith("..")){let _=a.split("/");for(;_[0]==="..";)_.shift(),m-=1;s.pathname=_.join("/")}u=m>=0?t[m]:"/"}let h=C4(s,u),d=a&&a!=="/"&&a.endsWith("/"),p=(l||a===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||p)&&(h.pathname+="/"),h}var Ei=e=>e.join("/").replace(/\/\/+/g,"/"),E4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),R4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,M4=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 N4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function A4(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var FE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function UE(e,t){let n=e;if(typeof n!="string"||!w4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(FE)try{let l=new URL(window.location.href),a=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=us(a.pathname,t);a.origin===l.origin&&u!=null?n=u+a.search+a.hash:s=!0}catch{si(!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 $E=["POST","PUT","PATCH","DELETE"];new Set($E);var D4=["GET",...$E];new Set(D4);var Ma=b.createContext(null);Ma.displayName="DataRouter";var tp=b.createContext(null);tp.displayName="DataRouterState";var O4=b.createContext(!1),WE=b.createContext({isTransitioning:!1});WE.displayName="ViewTransition";var L4=b.createContext(new Map);L4.displayName="Fetchers";var j4=b.createContext(null);j4.displayName="Await";var kr=b.createContext(null);kr.displayName="Navigation";var Hu=b.createContext(null);Hu.displayName="Location";var qr=b.createContext({outlet:null,matches:[],isDataRoute:!1});qr.displayName="Route";var Yy=b.createContext(null);Yy.displayName="RouteError";var VE="REACT_ROUTER_ERROR",z4="REDIRECT",P4="ROUTE_ERROR_RESPONSE";function B4(e){if(e.startsWith(`${VE}:${z4}:{`))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 I4(e){if(e.startsWith(`${VE}:${P4}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new M4(t.status,t.statusText,t.data)}catch{}}function H4(e,{relative:t}={}){Lt(Na(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(kr),{hash:s,pathname:l,search:a}=Fu(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:Ei([n,l])),r.createHref({pathname:u,search:a,hash:s})}function Na(){return b.useContext(Hu)!=null}function ui(){return Lt(Na(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Hu).location}var qE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function KE(e){b.useContext(kr).static||b.useLayoutEffect(e)}function Aa(){let{isDataRoute:e}=b.useContext(qr);return e?eL():F4()}function F4(){Lt(Na(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Ma),{basename:t,navigator:n}=b.useContext(kr),{matches:r}=b.useContext(qr),{pathname:s}=ui(),l=JSON.stringify(Gy(r)),a=b.useRef(!1);return KE(()=>{a.current=!0}),b.useCallback((h,d={})=>{if(si(a.current,qE),!a.current)return;if(typeof h=="number"){n.go(h);return}let p=ep(h,JSON.parse(l),s,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ei([t,p.pathname])),(d.replace?n.replace:n.push)(p,d.state,d)},[t,n,l,s,e])}var GE=b.createContext(null);function Xy(){return b.useContext(GE)}function U4(e){let t=b.useContext(qr).outlet;return b.useMemo(()=>t&&b.createElement(GE.Provider,{value:e},t),[t,e])}function YE(){let{matches:e}=b.useContext(qr),t=e[e.length-1];return t?t.params:{}}function Fu(e,{relative:t}={}){let{matches:n}=b.useContext(qr),{pathname:r}=ui(),s=JSON.stringify(Gy(n));return b.useMemo(()=>ep(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function $4(e,t){return XE(e,t)}function XE(e,t,n){var C;Lt(Na(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(kr),{matches:s}=b.useContext(qr),l=s[s.length-1],a=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",d=l&&l.route;{let k=d&&d.path||"";QE(u,!d||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=ui(),m;if(t){let k=typeof t=="string"?Ta(t):t;Lt(h==="/"||((C=k.pathname)==null?void 0:C.startsWith(h)),`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 "${h}" but pathname "${k.pathname}" was given in the \`location\` prop.`),m=k}else m=p;let _=m.pathname||"/",y=_;if(h!=="/"){let k=h.replace(/^\//,"").split("/");y="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=BE(e,{pathname:y});si(d||S!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),si(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=G4(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:Ei([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Ei([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?b.createElement(Hu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},w):w}function W4(){let e=J4(),t=N4(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},l={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,a)}var V4=b.createElement(W4,null),ZE=class extends b.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=I4(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(qr.Provider,{value:this.props.routeContext},b.createElement(Yy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(q4,{error:e},t):t}};ZE.contextType=O4;var rv=new WeakMap;function q4({children:e,error:t}){let{basename:n}=b.useContext(kr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=B4(t.digest);if(r){let s=rv.get(t);if(s)throw s;let l=UE(r.location,n);if(FE&&!rv.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw rv.set(t,a),a}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function K4({routeContext:e,match:t,children:n}){let r=b.useContext(Ma);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(qr.Provider,{value:e},n)}function G4(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,l=r==null?void 0:r.errors;if(l!=null){let p=s.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Lt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let a=!1,u=-1;if(n&&r){a=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:y}=r,S=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!y||y[m.route.id]===void 0);if(m.route.lazy||S){n.isStatic&&(a=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(p,m)=>{var _,y;h(p,{location:r.location,params:((y=(_=r.matches)==null?void 0:_[0])==null?void 0:y.params)??{},unstable_pattern:A4(r.matches),errorInfo:m})}:void 0;return s.reduceRight((p,m,_)=>{let y,S=!1,w=null,C=null;r&&(y=l&&m.route.id?l[m.route.id]:void 0,w=m.route.errorElement||V4,a&&(u<0&&_===0?(QE("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 y?R=w:S?R=C:m.route.Component?R=b.createElement(m.route.Component,null):m.route.element?R=m.route.element:R=p,b.createElement(K4,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:R})};return r&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?b.createElement(ZE,{location:r.location,revalidation:r.revalidation,component:w,error:y,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):T()},null)}function Zy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y4(e){let t=b.useContext(Ma);return Lt(t,Zy(e)),t}function X4(e){let t=b.useContext(tp);return Lt(t,Zy(e)),t}function Z4(e){let t=b.useContext(qr);return Lt(t,Zy(e)),t}function Qy(e){let t=Z4(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Q4(){return Qy("useRouteId")}function J4(){var r;let e=b.useContext(Yy),t=X4("useRouteError"),n=Qy("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function eL(){let{router:e}=Y4("useNavigate"),t=Qy("useNavigate"),n=b.useRef(!1);return KE(()=>{n.current=!0}),b.useCallback(async(s,l={})=>{si(n.current,qE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var qw={};function QE(e,t,n){!t&&!qw[e]&&(qw[e]=!0,si(!1,n))}b.memo(tL);function tL({routes:e,future:t,state:n,isStatic:r,onError:s}){return XE(e,void 0,{state:n,isStatic:r,onError:s})}function nL({to:e,replace:t,state:n,relative:r}){Lt(Na(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(kr);si(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=b.useContext(qr),{pathname:a}=ui(),u=Aa(),h=ep(e,Gy(l),a,r==="path"),d=JSON.stringify(h);return b.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:r})},[u,d,r,t,n]),null}function rL(e){return U4(e.context)}function aa(e){Lt(!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 iL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:a}){Lt(!Na(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:s,static:l,unstable_useTransitions:a,future:{}}),[u,s,l,a]);typeof n=="string"&&(n=Ta(n));let{pathname:d="/",search:p="",hash:m="",state:_=null,key:y="default",unstable_mask:S}=n,w=b.useMemo(()=>{let C=us(d,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:_,key:y,unstable_mask:S},navigationType:r}},[u,d,p,m,_,y,r,S]);return si(w!=null,`<Router basename="${u}"> is not able to match the URL "${d}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(kr.Provider,{value:h},b.createElement(Hu.Provider,{children:t,value:w}))}function sL({children:e,location:t}){return $4(h_(e),t)}function h_(e,t=[]){let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let l=[...t,s];if(r.type===b.Fragment){n.push.apply(n,h_(r.props.children,l));return}Lt(r.type===aa,`[${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>`),Lt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||l.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&&(a.children=h_(r.props.children,l)),n.push(a)}),n}var Qh="get",Jh="application/x-www-form-urlencoded";function np(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function oL(e){return np(e)&&e.tagName.toLowerCase()==="button"}function lL(e){return np(e)&&e.tagName.toLowerCase()==="form"}function aL(e){return np(e)&&e.tagName.toLowerCase()==="input"}function cL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uL(e,t){return e.button===0&&(!t||t==="_self")&&!cL(e)}var xh=null;function dL(){if(xh===null)try{new FormData(document.createElement("form"),0),xh=!1}catch{xh=!0}return xh}var hL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function iv(e){return e!=null&&!hL.has(e)?(si(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jh}"`),null):e}function fL(e,t){let n,r,s,l,a;if(lL(e)){let u=e.getAttribute("action");r=u?us(u,t):null,n=e.getAttribute("method")||Qh,s=iv(e.getAttribute("enctype"))||Jh,l=new FormData(e)}else if(oL(e)||aL(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 h=e.getAttribute("formaction")||u.getAttribute("action");if(r=h?us(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Qh,s=iv(e.getAttribute("formenctype"))||iv(u.getAttribute("enctype"))||Jh,l=new FormData(u,e),!dL()){let{name:d,type:p,value:m}=e;if(p==="image"){let _=d?`${d}.`:"";l.append(`${_}x`,"0"),l.append(`${_}y`,"0")}else d&&l.append(d,m)}}else{if(np(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qh,r=null,s=Jh,a=e}return l&&s==="text/plain"&&(a=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jy(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pL(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&&us(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function mL(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 gL(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 vL(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let a=await mL(l,n);return a.links?a.links():[]}return[]}));return xL(r.flat(1).filter(gL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Kw(e,t,n,r,s,l){let a=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var p;return n[d].pathname!==h.pathname||((p=n[d].route.path)==null?void 0:p.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,d)=>a(h,d)||u(h,d)):l==="data"?t.filter((h,d)=>{var m;let p=r.routes[h.route.id];if(!p||!p.hasLoader)return!1;if(a(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let _=h.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:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function _L(e,t,{includeHydrateFallback:n}={}){return yL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function yL(e){return[...new Set(e)]}function bL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function xL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(bL(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function JE(){let e=b.useContext(Ma);return Jy(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function SL(){let e=b.useContext(tp);return Jy(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var eb=b.createContext(void 0);eb.displayName="FrameworkContext";function eR(){let e=b.useContext(eb);return Jy(e,"You must render this element inside a <HydratedRouter> element"),e}function wL(e,t){let n=b.useContext(eb),[r,s]=b.useState(!1),[l,a]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:p,onTouchStart:m}=t,_=b.useRef(null);b.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let w=k=>{k.forEach(T=>{a(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(r){let w=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{s(!0)},S=()=>{s(!1),a(!1)};return n?e!=="intent"?[l,_,{}]:[l,_,{onFocus:Hc(u,y),onBlur:Hc(h,S),onMouseEnter:Hc(d,y),onMouseLeave:Hc(p,S),onTouchStart:Hc(m,y)}]:[!1,_,{}]}function Hc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function CL({page:e,...t}){let{router:n}=JE(),r=b.useMemo(()=>BE(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?b.createElement(EL,{page:e,matches:r,...t}):null}function kL(e){let{manifest:t,routeModules:n}=eR(),[r,s]=b.useState([]);return b.useEffect(()=>{let l=!1;return vL(e,t,n).then(a=>{l||s(a)}),()=>{l=!0}},[e,t,n]),r}function EL({page:e,matches:t,...n}){let r=ui(),{future:s,manifest:l,routeModules:a}=eR(),{basename:u}=JE(),{loaderData:h,matches:d}=SL(),p=b.useMemo(()=>Kw(e,t,d,l,r,"data"),[e,t,d,l,r]),m=b.useMemo(()=>Kw(e,t,d,l,r,"assets"),[e,t,d,l,r]),_=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var M;let R=l.routes[T.route.id];!R||!R.hasLoader||(!p.some(L=>L.route.id===T.route.id)&&T.route.id in h&&((M=a[T.route.id])!=null&&M.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=pL(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,h,r,l,p,t,e,a]),y=b.useMemo(()=>_L(m,l),[m,l]),S=kL(m);return b.createElement(b.Fragment,null,_.map(w=>b.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>b.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>b.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function RL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var TL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{TL&&(window.__reactRouterVersion="7.13.1")}catch{}function ML({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=b.useRef();s.current==null&&(s.current=o4({window:r,v5Compat:!0}));let l=s.current,[a,u]=b.useState({action:l.action,location:l.location}),h=b.useCallback(d=>{n===!1?u(d):b.startTransition(()=>u(d))},[n]);return b.useLayoutEffect(()=>l.listen(h),[l,h]),b.createElement(iL,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:l,unstable_useTransitions:n})}var tR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nR=b.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:a,unstable_mask:u,state:h,target:d,to:p,preventScrollReset:m,viewTransition:_,unstable_defaultShouldRevalidate:y,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=b.useContext(kr),R=typeof p=="string"&&tR.test(p),M=UE(p,C);p=M.to;let L=H4(p,{relative:s}),D=ui(),j=null;if(u){let $=ep(u,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&($.pathname=$.pathname==="/"?C:Ei([C,$.pathname])),j=k.createHref($)}let[F,Y,z]=wL(r,S),H=OL(p,{replace:a,unstable_mask:u,state:h,target:d,preventScrollReset:m,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function P($){t&&t($),$.defaultPrevented||H($)}let U=!(M.isExternal||l),V=b.createElement("a",{...S,...z,href:(U?j:void 0)||M.absoluteURL||L,onClick:U?P:t,ref:RL(w,Y),target:d,"data-discover":!R&&n==="render"?"true":void 0});return F&&!R?b.createElement(b.Fragment,null,V,b.createElement(CL,{page:L})):V});nR.displayName="Link";var NL=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:a,viewTransition:u,children:h,...d},p){let m=Fu(a,{relative:d.relative}),_=ui(),y=b.useContext(tp),{navigator:S,basename:w}=b.useContext(kr),C=y!=null&&BL(m)&&u===!0,k=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,T=_.pathname,R=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=us(R,w)||R);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=T===k||!s&&T.startsWith(k)&&T.charAt(M)==="/",D=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),j={isActive:L,isPending:D,isTransitioning:C},F=L?t:void 0,Y;typeof r=="function"?Y=r(j):Y=[r,L?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let z=typeof l=="function"?l(j):l;return b.createElement(nR,{...d,"aria-current":F,className:Y,ref:p,style:z,to:a,viewTransition:u},typeof h=="function"?h(j):h)});NL.displayName="NavLink";var AL=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:a=Qh,action:u,onSubmit:h,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_,...y},S)=>{let{unstable_useTransitions:w}=b.useContext(kr),C=zL(),k=PL(u,{relative:d}),T=a.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&tR.test(u),M=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let D=L.nativeEvent.submitter,j=(D==null?void 0:D.getAttribute("formmethod"))||a,F=()=>C(D||L.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:s,state:l,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:_});w&&n!==!1?b.startTransition(()=>F()):F()};return b.createElement("form",{ref:S,method:T,action:k,onSubmit:r?h:M,...y,"data-discover":!R&&e==="render"?"true":void 0})});AL.displayName="Form";function DL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rR(e){let t=b.useContext(Ma);return Lt(t,DL(e)),t}function OL(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let p=Aa(),m=ui(),_=Fu(e,{relative:a});return b.useCallback(y=>{if(uL(y,t)){y.preventDefault();let S=n!==void 0?n:wu(m)===wu(_),w=()=>p(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h});d?b.startTransition(()=>w()):w()}},[m,p,_,n,r,s,t,e,l,a,u,h,d])}var LL=0,jL=()=>`__${String(++LL)}__`;function zL(){let{router:e}=rR("useSubmit"),{basename:t}=b.useContext(kr),n=Q4(),r=e.fetch,s=e.navigate;return b.useCallback(async(l,a={})=>{let{action:u,method:h,encType:d,formData:p,body:m}=fL(l,t);if(a.navigate===!1){let _=a.fetcherKey||jL();await r(_,n,a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||h,formEncType:a.encType||d,flushSync:a.flushSync})}else await s(a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:p,body:m,formMethod:a.method||h,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,s,t,n])}function PL(e,{relative:t}={}){let{basename:n}=b.useContext(kr),r=b.useContext(qr);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...Fu(e||".",{relative:t})},a=ui();if(e==null){l.search=a.search;let u=new URLSearchParams(l.search),h=u.getAll("index");if(h.some(p=>p==="")){u.delete("index"),h.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ei([n,l.pathname])),wu(l)}function BL(e,{relative:t}={}){let n=b.useContext(WE);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=rR("useViewTransitionState"),s=Fu(e,{relative:t});if(!n.isTransitioning)return!1;let l=us(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=us(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yf(s.pathname,a)!=null||yf(s.pathname,l)!=null}var Si=PE();const IL=Jf(Si);function iR(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=iR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sR(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=iR(e))&&(r&&(r+=" "),r+=t);return r}const Gw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yw=sR,HL=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Yw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,a=Object.keys(s).map(d=>{const p=n==null?void 0:n[d],m=l==null?void 0:l[d];if(p===null)return null;const _=Gw(p)||Gw(m);return s[d][_]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,_]=p;return _===void 0||(d[m]=_),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:_,...y}=p;return Object.entries(y).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...l,...u}[w]):{...l,...u}[w]===C})?[...d,m,_]:d},[]);return Yw(e,a,h,n==null?void 0:n.class,n==null?void 0:n.className)},FL=(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},UL=(e,t)=>({classGroupId:e,validator:t}),oR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bf="-",Xw=[],$L="arbitrary..",WL=e=>{const t=qL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return VL(a);const u=a.split(bf),h=u[0]===""&&u.length>1?1:0;return lR(u,h,t)},getConflictingClassGroupIds:(a,u)=>{if(u){const h=r[a],d=n[a];return h?d?FL(d,h):h:d||Xw}return n[a]||Xw}}},lR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const d=lR(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const u=t===0?e.join(bf):e.slice(t).join(bf),h=a.length;for(let d=0;d<h;d++){const p=a[d];if(p.validator(u))return p.classGroupId}},VL=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?$L+r:void 0})(),qL=e=>{const{theme:t,classGroups:n}=e;return KL(n,t)},KL=(e,t)=>{const n=oR();for(const r in e){const s=e[r];tb(s,n,r,t)}return n},tb=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const a=e[l];GL(a,t,n,r)}},GL=(e,t,n,r)=>{if(typeof e=="string"){YL(e,t,n);return}if(typeof e=="function"){XL(e,t,n,r);return}ZL(e,t,n,r)},YL=(e,t,n)=>{const r=e===""?t:aR(t,e);r.classGroupId=n},XL=(e,t,n,r)=>{if(QL(e)){tb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(UL(n,e))},ZL=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let a=0;a<l;a++){const[u,h]=s[a];tb(h,aR(t,u),n,r)}},aR=(e,t)=>{let n=e;const r=t.split(bf),s=r.length;for(let l=0;l<s;l++){const a=r[l];let u=n.nextPart.get(a);u||(u=oR(),n.nextPart.set(a,u)),n=u}return n},QL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,JL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(l,a)=>{n[l]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return s(l,a),a},set(l,a){l in n?n[l]=a:s(l,a)}}},f_="!",Zw=":",ej=[],Qw=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),tj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let a=0,u=0,h=0,d;const p=s.length;for(let w=0;w<p;w++){const C=s[w];if(a===0&&u===0){if(C===Zw){l.push(s.slice(h,w)),h=w+1;continue}if(C==="/"){d=w;continue}}C==="["?a++:C==="]"?a--:C==="("?u++:C===")"&&u--}const m=l.length===0?s:s.slice(h);let _=m,y=!1;m.endsWith(f_)?(_=m.slice(0,-1),y=!0):m.startsWith(f_)&&(_=m.slice(1),y=!0);const S=d&&d>h?d-h:void 0;return Qw(l,y,_,S)};if(t){const s=t+Zw,l=r;r=a=>a.startsWith(s)?l(a.slice(s.length)):Qw(ej,!1,a,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},nj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const a=n[l],u=a[0]==="[",h=t.has(a);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},rj=e=>({cache:JL(e.cacheSize),parseClassName:tj(e),sortModifiers:nj(e),...WL(e)}),ij=/\s+/,sj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,a=[],u=e.trim().split(ij);let h="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:_,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(m){h=p+(h.length>0?" "+h:h);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){h=p+(h.length>0?" "+h:h);continue}if(k=r(S),!k){h=p+(h.length>0?" "+h:h);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:l(_).join(":"),R=y?T+f_:T,M=R+k;if(a.indexOf(M)>-1)continue;a.push(M);const L=s(k,C);for(let D=0;D<L.length;++D){const j=L[D];a.push(R+j)}h=p+(h.length>0?" "+h:h)}return h},oj=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=cR(n))&&(s&&(s+=" "),s+=r);return s},cR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cR(e[r]))&&(n&&(n+=" "),n+=t);return n},lj=(e,...t)=>{let n,r,s,l;const a=h=>{const d=t.reduce((p,m)=>m(p),e());return n=rj(d),r=n.cache.get,s=n.cache.set,l=u,u(h)},u=h=>{const d=r(h);if(d)return d;const p=sj(h,n);return s(h,p),p};return l=a,(...h)=>l(oj(...h))},aj=[],ln=e=>{const t=n=>n[e]||aj;return t.isThemeGetter=!0,t},uR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dj=/\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$/,hj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vs=e=>cj.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),qs=e=>!!e&&Number.isInteger(Number(e)),sv=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ts=e=>uj.test(e),hR=()=>!0,mj=e=>dj.test(e)&&!hj.test(e),nb=()=>!1,gj=e=>fj.test(e),vj=e=>pj.test(e),_j=e=>!Ne(e)&&!Ae(e),yj=e=>ho(e,mR,nb),Ne=e=>uR.test(e),zo=e=>ho(e,gR,mj),Jw=e=>ho(e,Rj,Ke),bj=e=>ho(e,_R,hR),xj=e=>ho(e,vR,nb),eC=e=>ho(e,fR,nb),Sj=e=>ho(e,pR,vj),Sh=e=>ho(e,yR,gj),Ae=e=>dR.test(e),Fc=e=>ll(e,gR),wj=e=>ll(e,vR),tC=e=>ll(e,fR),Cj=e=>ll(e,mR),kj=e=>ll(e,pR),wh=e=>ll(e,yR,!0),Ej=e=>ll(e,_R,!0),ho=(e,t,n)=>{const r=uR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ll=(e,t,n=!1)=>{const r=dR.exec(e);return r?r[1]?t(r[1]):n:!1},fR=e=>e==="position"||e==="percentage",pR=e=>e==="image"||e==="url",mR=e=>e==="length"||e==="size"||e==="bg-size",gR=e=>e==="length",Rj=e=>e==="number",vR=e=>e==="family-name",_R=e=>e==="number"||e==="weight",yR=e=>e==="shadow",Tj=()=>{const e=ln("color"),t=ln("font"),n=ln("text"),r=ln("font-weight"),s=ln("tracking"),l=ln("leading"),a=ln("breakpoint"),u=ln("container"),h=ln("spacing"),d=ln("radius"),p=ln("shadow"),m=ln("inset-shadow"),_=ln("text-shadow"),y=ln("drop-shadow"),S=ln("blur"),w=ln("perspective"),C=ln("aspect"),k=ln("ease"),T=ln("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...M(),Ae,Ne],D=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],F=()=>[Ae,Ne,h],Y=()=>[Vs,"full","auto",...F()],z=()=>[qs,"none","subgrid",Ae,Ne],H=()=>["auto",{span:["full",qs,Ae,Ne]},qs,Ae,Ne],P=()=>[qs,"auto",Ae,Ne],U=()=>["auto","min","max","fr",Ae,Ne],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...F()],K=()=>[Vs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],W=()=>[Vs,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Z=()=>[Vs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],N=()=>[e,Ae,Ne],I=()=>[...M(),tC,eC,{position:[Ae,Ne]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Cj,yj,{size:[Ae,Ne]}],ae=()=>[sv,Fc,zo],fe=()=>["","none","full",d,Ae,Ne],oe=()=>["",Ke,Fc,zo],J=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ke,sv,tC,eC],ce=()=>["","none",S,Ae,Ne],we=()=>["none",Ke,Ae,Ne],Se=()=>["none",Ke,Ae,Ne],ke=()=>[Ke,Ae,Ne],Be=()=>[Vs,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ts],breakpoint:[ts],color:[hR],container:[ts],"drop-shadow":[ts],ease:["in","out","in-out"],font:[_j],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ts],shadow:[ts],spacing:["px",Ke],text:[ts],"text-shadow":[ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vs,Ne,Ae,C]}],container:["container"],columns:[{columns:[Ke,Ne,Ae,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:L()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[qs,"auto",Ae,Ne]}],basis:[{basis:[Vs,"full","auto",u,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Vs,"auto","initial","none",Ne]}],grow:[{grow:["",Ke,Ae,Ne]}],shrink:[{shrink:["",Ke,Ae,Ne]}],order:[{order:[qs,"first","last","none",Ae,Ne]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...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,Fc,zo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ej,bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sv,Ne]}],"font-family":[{font:[wj,xj,t]}],"font-features":[{"font-features":[Ne]}],"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,Ae,Ne]}],"line-clamp":[{"line-clamp":[Ke,"none",Ae,Jw]}],leading:[{leading:[l,...F()]}],"list-image":[{"list-image":["none",Ae,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ae,zo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ae,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Ne]}],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",Ae,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qs,Ae,Ne],radial:["",Ae,Ne],conic:[qs,Ae,Ne]},kj,Sj]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ae,Ne]}],"outline-w":[{outline:["",Ke,Fc,zo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",p,wh,Sh]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",m,wh,Sh]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Ke,zo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",_,wh,Sh]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Ke,Ae,Ne]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Ae,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Ne]}],filter:[{filter:["","none",Ae,Ne]}],blur:[{blur:ce()}],brightness:[{brightness:[Ke,Ae,Ne]}],contrast:[{contrast:[Ke,Ae,Ne]}],"drop-shadow":[{"drop-shadow":["","none",y,wh,Sh]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Ke,Ae,Ne]}],"hue-rotate":[{"hue-rotate":[Ke,Ae,Ne]}],invert:[{invert:["",Ke,Ae,Ne]}],saturate:[{saturate:[Ke,Ae,Ne]}],sepia:[{sepia:["",Ke,Ae,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Ne]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ae,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ae,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ae,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ae,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ae,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ae,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ae,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ae,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ae,Ne]}],ease:[{ease:["linear","initial",k,Ae,Ne]}],delay:[{delay:[Ke,Ae,Ne]}],animate:[{animate:["none",T,Ae,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,Ne]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Ae,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",Ae,Ne]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ae,Ne]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Ke,Fc,zo,Jw]}],stroke:[{stroke:["none",...N()]}],"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"]}},Mj=lj(Tj);function ye(...e){return Mj(sR(e))}function ov(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function nC(e){return e.startsWith("chatId:")?e.slice(7):e}const rb=HL("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-9 w-9 rounded-full","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),rt=b.forwardRef(({className:e,variant:t,size:n,...r},s)=>g.jsx("button",{className:ye(rb({variant:t,size:n,className:e})),ref:s,...r}));rt.displayName="Button";function Re(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 rC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ib(...e){return t=>{let n=!1;const r=e.map(s=>{const l=rC(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():rC(e[s],null)}}}}function ht(...e){return b.useCallback(ib(...e),e)}function Nj(e,t){const n=b.createContext(t),r=l=>{const{children:a,...u}=l,h=b.useMemo(()=>u,Object.values(u));return g.jsx(n.Provider,{value:h,children:a})};r.displayName=e+"Provider";function s(l){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function ms(e,t=[]){let n=[];function r(l,a){const u=b.createContext(a),h=n.length;n=[...n,a];const d=m=>{var k;const{scope:_,children:y,...S}=m,w=((k=_==null?void 0:_[e])==null?void 0:k[h])||u,C=b.useMemo(()=>S,Object.values(S));return g.jsx(w.Provider,{value:C,children:y})};d.displayName=l+"Provider";function p(m,_){var w;const y=((w=_==null?void 0:_[e])==null?void 0:w[h])||u,S=b.useContext(y);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[d,p]}const s=()=>{const l=n.map(a=>b.createContext(a));return function(u){const h=(u==null?void 0:u[e])||l;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,Aj(s,...t)]}function Aj(...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(l){const a=r.reduce((u,{useScope:h,scopeName:d})=>{const m=h(l)[`__scope${d}`];return{...u,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Pn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},Dj=zE[" useId ".trim().toString()]||(()=>{}),Oj=0;function cs(e){const[t,n]=b.useState(Dj());return Pn(()=>{n(r=>r??String(Oj++))},[e]),t?`radix-${t}`:""}var Lj=zE[" useInsertionEffect ".trim().toString()]||Pn;function xa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,a]=jj({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const p=b.useRef(e!==void 0);b.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 d=b.useCallback(p=>{var m;if(u){const _=zj(p)?p(e):p;_!==e&&((m=a.current)==null||m.call(a,_))}else l(p)},[u,e,l,a]);return[h,d]}function jj({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),l=b.useRef(t);return Lj(()=>{l.current=t},[t]),b.useEffect(()=>{var a;s.current!==n&&((a=l.current)==null||a.call(l,n),s.current=n)},[n,s]),[n,r,l]}function zj(e){return typeof e=="function"}function Xo(e){const t=Pj(e),n=b.forwardRef((r,s)=>{const{children:l,...a}=r,u=b.Children.toArray(l),h=u.find(Ij);if(h){const d=h.props.children,p=u.map(m=>m===h?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return g.jsx(t,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,p):null})}return g.jsx(t,{...a,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function Pj(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const a=Fj(s),u=Hj(l,s.props);return s.type!==b.Fragment&&(u.ref=r?ib(r,a):a),b.cloneElement(s,u)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bR=Symbol("radix.slottable");function Bj(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bR,t}function Ij(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bR}function Hj(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...u)=>{const h=l(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function Fj(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 Uj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=Uj.reduce((e,t)=>{const n=Xo(`Primitive.${t}`),r=b.forwardRef((s,l)=>{const{asChild:a,...u}=s,h=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...u,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xR(e,t){e&&Si.flushSync(()=>e.dispatchEvent(t))}function oi(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function $j(e,t=globalThis==null?void 0:globalThis.document){const n=oi(e);b.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 Wj="DismissableLayer",p_="dismissableLayer.update",Vj="dismissableLayer.pointerDownOutside",qj="dismissableLayer.focusOutside",iC,SR=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Da=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:a,onDismiss:u,...h}=e,d=b.useContext(SR),[p,m]=b.useState(null),_=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),S=ht(t,j=>m(j)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=p?w.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,M=T>=k,L=Yj(j=>{const F=j.target,Y=[...d.branches].some(z=>z.contains(F));!M||Y||(s==null||s(j),a==null||a(j),j.defaultPrevented||u==null||u())},_),D=Xj(j=>{const F=j.target;[...d.branches].some(z=>z.contains(F))||(l==null||l(j),a==null||a(j),j.defaultPrevented||u==null||u())},_);return $j(j=>{T===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},_),b.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(iC=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),sC(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=iC)}},[p,_,n,d]),b.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),sC())},[p,d]),b.useEffect(()=>{const j=()=>y({});return document.addEventListener(p_,j),()=>document.removeEventListener(p_,j)},[]),g.jsx(et.div,{...h,ref:S,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,L.onPointerDownCapture)})});Da.displayName=Wj;var Kj="DismissableLayerBranch",Gj=b.forwardRef((e,t)=>{const n=b.useContext(SR),r=b.useRef(null),s=ht(t,r);return b.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),g.jsx(et.div,{...e,ref:s})});Gj.displayName=Kj;function Yj(e,t=globalThis==null?void 0:globalThis.document){const n=oi(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const l=u=>{if(u.target&&!r.current){let h=function(){wR(Vj,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xj(e,t=globalThis==null?void 0:globalThis.document){const n=oi(e),r=b.useRef(!1);return b.useEffect(()=>{const s=l=>{l.target&&!r.current&&wR(qj,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sC(){const e=new CustomEvent(p_);document.dispatchEvent(e)}function wR(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xR(s,l):s.dispatchEvent(l)}var lv="focusScope.autoFocusOnMount",av="focusScope.autoFocusOnUnmount",oC={bubbles:!1,cancelable:!0},Zj="FocusScope",Uu=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...a}=e,[u,h]=b.useState(null),d=oi(s),p=oi(l),m=b.useRef(null),_=ht(t,w=>h(w)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let w=function(R){if(y.paused||!u)return;const M=R.target;u.contains(M)?m.current=M:Zs(m.current,{select:!0})},C=function(R){if(y.paused||!u)return;const M=R.relatedTarget;M!==null&&(u.contains(M)||Zs(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Zs(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,y.paused]),b.useEffect(()=>{if(u){aC.add(y);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(lv,oC);u.addEventListener(lv,d),u.dispatchEvent(k),k.defaultPrevented||(Qj(rz(CR(u)),{select:!0}),document.activeElement===w&&Zs(u))}return()=>{u.removeEventListener(lv,d),setTimeout(()=>{const k=new CustomEvent(av,oC);u.addEventListener(av,p),u.dispatchEvent(k),k.defaultPrevented||Zs(w??document.body,{select:!0}),u.removeEventListener(av,p),aC.remove(y)},0)}}},[u,d,p,y]);const S=b.useCallback(w=>{if(!n&&!r||y.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,M]=Jj(T);R&&M?!w.shiftKey&&k===M?(w.preventDefault(),n&&Zs(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Zs(M,{select:!0})):k===T&&w.preventDefault()}},[n,r,y.paused]);return g.jsx(et.div,{tabIndex:-1,...a,ref:_,onKeyDown:S})});Uu.displayName=Zj;function Qj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function Jj(e){const t=CR(e),n=lC(t,e),r=lC(t.reverse(),e);return[n,r]}function CR(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 lC(e,t){for(const n of e)if(!ez(n,{upTo:t}))return n}function ez(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 tz(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tz(e)&&t&&e.select()}}var aC=nz();function nz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cC(e,t),e.unshift(t)},remove(t){var n;e=cC(e,t),(n=e[0])==null||n.resume()}}}function cC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rz(e){return e.filter(t=>t.tagName!=="A")}var iz="Portal",Oa=b.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,l]=b.useState(!1);Pn(()=>l(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?IL.createPortal(g.jsx(et.div,{...r,ref:t}),a):null});Oa.displayName=iz;function sz(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Kr=e=>{const{present:t,children:n}=e,r=oz(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),l=ht(r.ref,lz(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:l}):null};Kr.displayName="Presence";function oz(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),l=b.useRef("none"),a=e?"mounted":"unmounted",[u,h]=sz(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=Ch(r.current);l.current=u==="mounted"?d:"none"},[u]),Pn(()=>{const d=r.current,p=s.current;if(p!==e){const _=l.current,y=Ch(d);e?h("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Pn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=y=>{const w=Ch(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=y=>{y.target===t&&(l.current=Ch(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Ch(e){return(e==null?void 0:e.animationName)||"none"}function lz(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 cv=0;function rp(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uC()),document.body.insertAdjacentElement("beforeend",e[1]??uC()),cv++,()=>{cv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cv--}},[])}function uC(){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 xi=function(){return xi=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},xi.apply(this,arguments)};function kR(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 az(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var ef="right-scroll-bar-position",tf="width-before-scroll-bar",cz="with-scroll-bars-hidden",uz="--removed-body-scroll-bar-size";function uv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dz(e,t){var n=b.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 hz=typeof window<"u"?b.useLayoutEffect:b.useEffect,dC=new WeakMap;function fz(e,t){var n=dz(null,function(r){return e.forEach(function(s){return uv(s,r)})});return hz(function(){var r=dC.get(n);if(r){var s=new Set(r),l=new Set(e),a=n.current;s.forEach(function(u){l.has(u)||uv(u,null)}),l.forEach(function(u){s.has(u)||uv(u,a)})}dC.set(n,e)},[e]),n}function pz(e){return e}function mz(e,t){t===void 0&&(t=pz);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(l){var a=t(l,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(l),a=n}var h=function(){var p=a;a=[],p.forEach(l)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),n}}}};return s}function gz(e){e===void 0&&(e={});var t=mz(null);return t.options=xi({async:!0,ssr:!1},e),t}var ER=function(e){var t=e.sideCar,n=kR(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 b.createElement(r,xi({},n))};ER.isSideCarExport=!0;function vz(e,t){return e.useMedium(t),ER}var RR=gz(),dv=function(){},ip=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:dv,onWheelCapture:dv,onTouchMoveCapture:dv}),s=r[0],l=r[1],a=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,_=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,M=kR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=_,D=fz([n,t]),j=xi(xi({},M),s);return b.createElement(b.Fragment,null,p&&b.createElement(L,{sideCar:RR,removeScrollBar:d,shards:m,noRelative:y,noIsolation:S,inert:w,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),a?b.cloneElement(b.Children.only(u),xi(xi({},j),{ref:D})):b.createElement(T,xi({},j,{className:h,ref:D}),u))});ip.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ip.classNames={fullWidth:tf,zeroRight:ef};var _z=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_z();return t&&e.setAttribute("nonce",t),e}function bz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yz())&&(bz(t,n),xz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wz=function(){var e=Sz();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},TR=function(){var e=wz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Cz={left:0,top:0,right:0,gap:0},hv=function(e){return parseInt(e||"",10)||0},kz=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[hv(n),hv(r),hv(s)]},Ez=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cz;var t=kz(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])}},Rz=TR(),ma="data-scroll-locked",Tz=function(e,t,n,r){var s=e.left,l=e.top,a=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
-
.`.concat(cz,` {
|
|
62
|
-
overflow: hidden `).concat(r,`;
|
|
63
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
-
}
|
|
65
|
-
body[`).concat(ma,`] {
|
|
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(l,`px;
|
|
71
|
-
padding-right: `).concat(a,`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(ef,` {
|
|
79
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(tf,` {
|
|
83
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(ef," .").concat(ef,` {
|
|
87
|
-
right: 0 `).concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.`).concat(tf," .").concat(tf,` {
|
|
91
|
-
margin-right: 0 `).concat(r,`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
body[`).concat(ma,`] {
|
|
95
|
-
`).concat(uz,": ").concat(u,`px;
|
|
96
|
-
}
|
|
97
|
-
`)},hC=function(){var e=parseInt(document.body.getAttribute(ma)||"0",10);return isFinite(e)?e:0},Mz=function(){b.useEffect(function(){return document.body.setAttribute(ma,(hC()+1).toString()),function(){var e=hC()-1;e<=0?document.body.removeAttribute(ma):document.body.setAttribute(ma,e.toString())}},[])},Nz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Mz();var l=b.useMemo(function(){return Ez(s)},[s]);return b.createElement(Rz,{styles:Tz(l,!t,s,n?"":"!important")})},m_=!1;if(typeof window<"u")try{var kh=Object.defineProperty({},"passive",{get:function(){return m_=!0,!0}});window.addEventListener("test",kh,kh),window.removeEventListener("test",kh,kh)}catch{m_=!1}var Ql=m_?{passive:!1}:!1,Az=function(e){return e.tagName==="TEXTAREA"},MR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Az(e)&&n[t]==="visible")},Dz=function(e){return MR(e,"overflowY")},Oz=function(e){return MR(e,"overflowX")},fC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=NR(e,r);if(s){var l=AR(e,r),a=l[1],u=l[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},jz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},NR=function(e,t){return e==="v"?Dz(t):Oz(t)},AR=function(e,t){return e==="v"?Lz(t):jz(t)},zz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pz=function(e,t,n,r,s){var l=zz(e,window.getComputedStyle(t).direction),a=l*r,u=n.target,h=t.contains(u),d=!1,p=a>0,m=0,_=0;do{if(!u)break;var y=AR(e,u),S=y[0],w=y[1],C=y[2],k=w-C-l*S;(S||k)&&NR(e,u)&&(m+=k,_+=S);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(d=!0),d},Eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pC=function(e){return[e.deltaX,e.deltaY]},mC=function(e){return e&&"current"in e?e.current:e},Bz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Iz=function(e){return`
|
|
98
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
-
`)},Hz=0,Jl=[];function Fz(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(Hz++)[0],l=b.useState(TR)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=az([e.lockRef.current],(e.shards||[]).map(mC),!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=b.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var k=Eh(w),T=n.current,R="deltaX"in w?w.deltaX:T[0]-k[0],M="deltaY"in w?w.deltaY:T[1]-k[1],L,D=w.target,j=Math.abs(R)>Math.abs(M)?"h":"v";if("touches"in w&&j==="h"&&D.type==="range")return!1;var F=window.getSelection(),Y=F&&F.anchorNode,z=Y?Y===D||Y.contains(D):!1;if(z)return!1;var H=fC(j,D);if(!H)return!0;if(H?L=j:(L=j==="v"?"h":"v",H=fC(j,D)),!H)return!1;if(!r.current&&"changedTouches"in w&&(R||M)&&(r.current=L),!L)return!0;var P=r.current||L;return Pz(P,C,w,P==="h"?R:M)},[]),h=b.useCallback(function(w){var C=w;if(!(!Jl.length||Jl[Jl.length-1]!==l)){var k="deltaY"in C?pC(C):Eh(C),T=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&Bz(L.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(a.current.shards||[]).map(mC).filter(Boolean).filter(function(L){return L.contains(C.target)}),M=R.length>0?u(C,R[0]):!a.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),d=b.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:Uz(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(M){return M!==R})},1)},[]),p=b.useCallback(function(w){n.current=Eh(w),r.current=void 0},[]),m=b.useCallback(function(w){d(w.type,pC(w),w.target,u(w,e.lockRef.current))},[]),_=b.useCallback(function(w){d(w.type,Eh(w),w.target,u(w,e.lockRef.current))},[]);b.useEffect(function(){return Jl.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",h,Ql),document.addEventListener("touchmove",h,Ql),document.addEventListener("touchstart",p,Ql),function(){Jl=Jl.filter(function(w){return w!==l}),document.removeEventListener("wheel",h,Ql),document.removeEventListener("touchmove",h,Ql),document.removeEventListener("touchstart",p,Ql)}},[]);var y=e.removeScrollBar,S=e.inert;return b.createElement(b.Fragment,null,S?b.createElement(l,{styles:Iz(s)}):null,y?b.createElement(Nz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Uz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $z=vz(RR,Fz);var $u=b.forwardRef(function(e,t){return b.createElement(ip,xi({},e,{ref:t,sideCar:$z}))});$u.classNames=ip.classNames;var Wz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ea=new WeakMap,Rh=new WeakMap,Th={},fv=0,DR=function(e){return e&&(e.host||DR(e.parentNode))},Vz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=DR(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})},qz=function(e,t,n,r){var s=Vz(t,Array.isArray(e)?e:[e]);Th[n]||(Th[n]=new WeakMap);var l=Th[n],a=[],u=new Set,h=new Set(s),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};s.forEach(d);var p=function(m){!m||h.has(m)||Array.prototype.forEach.call(m.children,function(_){if(u.has(_))p(_);else try{var y=_.getAttribute(r),S=y!==null&&y!=="false",w=(ea.get(_)||0)+1,C=(l.get(_)||0)+1;ea.set(_,w),l.set(_,C),a.push(_),w===1&&S&&Rh.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(),fv++,function(){a.forEach(function(m){var _=ea.get(m)-1,y=l.get(m)-1;ea.set(m,_),l.set(m,y),_||(Rh.has(m)||m.removeAttribute(r),Rh.delete(m)),y||m.removeAttribute(n)}),fv--,fv||(ea=new WeakMap,ea=new WeakMap,Rh=new WeakMap,Th={})}},sp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Wz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),qz(r,s,n,"aria-hidden")):function(){return null}},op="Dialog",[OR]=ms(op),[Kz,di]=OR(op),LR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,u=b.useRef(null),h=b.useRef(null),[d,p]=xa({prop:r,defaultProp:s??!1,onChange:l,caller:op});return g.jsx(Kz,{scope:t,triggerRef:u,contentRef:h,contentId:cs(),titleId:cs(),descriptionId:cs(),open:d,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:a,children:n})};LR.displayName=op;var jR="DialogTrigger",Gz=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(jR,n),l=ht(t,s.triggerRef);return g.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":lb(s.open),...r,ref:l,onClick:Re(e.onClick,s.onOpenToggle)})});Gz.displayName=jR;var sb="DialogPortal",[Yz,zR]=OR(sb,{forceMount:void 0}),PR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=di(sb,t);return g.jsx(Yz,{scope:t,forceMount:n,children:b.Children.map(r,a=>g.jsx(Kr,{present:n||l.open,children:g.jsx(Oa,{asChild:!0,container:s,children:a})}))})};PR.displayName=sb;var xf="DialogOverlay",BR=b.forwardRef((e,t)=>{const n=zR(xf,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=di(xf,e.__scopeDialog);return l.modal?g.jsx(Kr,{present:r||l.open,children:g.jsx(Zz,{...s,ref:t})}):null});BR.displayName=xf;var Xz=Xo("DialogOverlay.RemoveScroll"),Zz=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(xf,n);return g.jsx($u,{as:Xz,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(et.div,{"data-state":lb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Zo="DialogContent",IR=b.forwardRef((e,t)=>{const n=zR(Zo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=di(Zo,e.__scopeDialog);return g.jsx(Kr,{present:r||l.open,children:l.modal?g.jsx(Qz,{...s,ref:t}):g.jsx(Jz,{...s,ref:t})})});IR.displayName=Zo;var Qz=b.forwardRef((e,t)=>{const n=di(Zo,e.__scopeDialog),r=b.useRef(null),s=ht(t,n.contentRef,r);return b.useEffect(()=>{const l=r.current;if(l)return sp(l)},[]),g.jsx(HR,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),Jz=b.forwardRef((e,t)=>{const n=di(Zo,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return g.jsx(HR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),HR=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...a}=e,u=di(Zo,n),h=b.useRef(null),d=ht(t,h);return rp(),g.jsxs(g.Fragment,{children:[g.jsx(Uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:g.jsx(Da,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":lb(u.open),...a,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(e6,{titleId:u.titleId}),g.jsx(n6,{contentRef:h,descriptionId:u.descriptionId})]})]})}),ob="DialogTitle",FR=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(ob,n);return g.jsx(et.h2,{id:s.titleId,...r,ref:t})});FR.displayName=ob;var UR="DialogDescription",$R=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(UR,n);return g.jsx(et.p,{id:s.descriptionId,...r,ref:t})});$R.displayName=UR;var WR="DialogClose",VR=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=di(WR,n);return g.jsx(et.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});VR.displayName=WR;function lb(e){return e?"open":"closed"}var qR="DialogTitleWarning",[Vee,KR]=Nj(qR,{contentName:Zo,titleName:ob,docsSlug:"dialog"}),e6=({titleId:e})=>{const t=KR(qR),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 b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},t6="DialogDescriptionWarning",n6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${KR(t6).contentName}}.`;return b.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},r6=LR,i6=PR,GR=BR,YR=IR,s6=FR,o6=$R,l6=VR;/**
|
|
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 a6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),gC=e=>{const t=c6(e);return t.charAt(0).toUpperCase()+t.slice(1)},XR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),u6=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 d6={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 h6=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:a,...u},h)=>b.createElement("svg",{ref:h,...d6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:XR("lucide",s),...!l&&!u6(u)&&{"aria-hidden":"true"},...u},[...a.map(([d,p])=>b.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
|
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 Me=(e,t)=>{const n=b.forwardRef(({className:r,...s},l)=>b.createElement(h6,{ref:l,iconNode:t,className:XR(`lucide-${a6(gC(e))}`,`lucide-${e}`,r),...s}));return n.displayName=gC(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 f6=[["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"}]],p6=Me("archive",f6);/**
|
|
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 m6=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],g6=Me("arrow-down-to-line",m6);/**
|
|
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 v6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_6=Me("arrow-down",v6);/**
|
|
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 y6=[["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"}]],b6=Me("arrow-left-right",y6);/**
|
|
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 x6=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],S6=Me("arrow-up",x6);/**
|
|
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 w6=[["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"}]],C6=Me("asterisk",w6);/**
|
|
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 k6=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]],E6=Me("book-text",k6);/**
|
|
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 R6=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],vC=Me("box",R6);/**
|
|
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 T6=[["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"}]],pv=Me("brain",T6);/**
|
|
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 M6=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],N6=Me("check-check",M6);/**
|
|
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 A6=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],D6=Me("check-line",A6);/**
|
|
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 O6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lo=Me("check",O6);/**
|
|
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 L6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ab=Me("chevron-down",L6);/**
|
|
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 j6=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],z6=Me("chevron-left",j6);/**
|
|
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 P6=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ds=Me("chevron-right",P6);/**
|
|
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 B6=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],I6=Me("chevron-up",B6);/**
|
|
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 H6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],F6=Me("circle-slash",H6);/**
|
|
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 U6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$6=Me("circle",U6);/**
|
|
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 W6=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],V6=Me("cloud-download",W6);/**
|
|
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 q6=[["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"}]],_C=Me("code-xml",q6);/**
|
|
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 K6=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ZR=Me("code",K6);/**
|
|
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 G6=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Y6=Me("command",G6);/**
|
|
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 X6=[["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"}]],lp=Me("copy",X6);/**
|
|
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 Z6=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Q6=Me("corner-down-left",Z6);/**
|
|
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 J6=[["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"}]],eP=Me("eraser",J6);/**
|
|
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 tP=[["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"}]],nP=Me("file-pen",tP);/**
|
|
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 rP=[["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"}]],iP=Me("file-plus-corner",rP);/**
|
|
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 sP=[["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"}]],oP=Me("file",sP);/**
|
|
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 lP=[["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"}]],fu=Me("flower",lP);/**
|
|
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 aP=[["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"}]],QR=Me("folder-open",aP);/**
|
|
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 cP=[["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"}]],uP=Me("folder",cP);/**
|
|
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 dP=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Mh=Me("gauge",dP);/**
|
|
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 hP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],fP=Me("info",hP);/**
|
|
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 pP=[["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"}]],mP=Me("list-checks",pP);/**
|
|
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 gP=[["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"}]],Sf=Me("list-todo",gP);/**
|
|
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 vP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Mi=Me("loader-circle",vP);/**
|
|
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 _P=[["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"}]],yC=Me("lock-open",_P);/**
|
|
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 yP=[["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"}]],bC=Me("map",yP);/**
|
|
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 bP=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],cb=Me("menu",bP);/**
|
|
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 xP=[["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"}]],JR=Me("message-circle-question-mark",xP);/**
|
|
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 SP=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],wP=Me("message-square-quote",SP);/**
|
|
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 CP=[["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"}]],eT=Me("minimize",CP);/**
|
|
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 kP=[["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"}]],ub=Me("monitor",kP);/**
|
|
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 EP=[["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"}]],RP=Me("moon",EP);/**
|
|
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 TP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],g_=Me("panel-left",TP);/**
|
|
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 MP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],NP=Me("panel-right",MP);/**
|
|
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 AP=[["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"}]],tT=Me("pencil",AP);/**
|
|
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 DP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],db=Me("plus",DP);/**
|
|
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 OP=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],LP=Me("refresh-cw",OP);/**
|
|
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 jP=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mv=Me("search",jP);/**
|
|
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 zP=[["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"}]],PP=Me("send",zP);/**
|
|
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 BP=[["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"}]],IP=Me("settings",BP);/**
|
|
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 HP=[["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"}]],FP=Me("settings-2",HP);/**
|
|
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 UP=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],$P=Me("slash",UP);/**
|
|
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 WP=[["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"}]],VP=Me("sparkles",WP);/**
|
|
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 qP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],xC=Me("square-menu",qP);/**
|
|
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 KP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],SC=Me("square-minus",KP);/**
|
|
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 GP=[["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"}]],hb=Me("square-pen",GP);/**
|
|
415
|
-
* @license lucide-react v0.562.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const YP=[["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"}]],XP=Me("square-x",YP);/**
|
|
420
|
-
* @license lucide-react v0.562.0 - ISC
|
|
421
|
-
*
|
|
422
|
-
* This source code is licensed under the ISC license.
|
|
423
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/const ZP=[["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"}]],QP=Me("sun",ZP);/**
|
|
425
|
-
* @license lucide-react v0.562.0 - ISC
|
|
426
|
-
*
|
|
427
|
-
* This source code is licensed under the ISC license.
|
|
428
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/const JP=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],fb=Me("terminal",JP);/**
|
|
430
|
-
* @license lucide-react v0.562.0 - ISC
|
|
431
|
-
*
|
|
432
|
-
* This source code is licensed under the ISC license.
|
|
433
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/const eB=[["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"}]],tB=Me("toy-brick",eB);/**
|
|
435
|
-
* @license lucide-react v0.562.0 - ISC
|
|
436
|
-
*
|
|
437
|
-
* This source code is licensed under the ISC license.
|
|
438
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
-
*/const nB=[["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"}]],rB=Me("trash-2",nB);/**
|
|
440
|
-
* @license lucide-react v0.562.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* This source code is licensed under the ISC license.
|
|
443
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
-
*/const iB=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],pb=Me("user-round",iB);/**
|
|
445
|
-
* @license lucide-react v0.562.0 - ISC
|
|
446
|
-
*
|
|
447
|
-
* This source code is licensed under the ISC license.
|
|
448
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
-
*/const sB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],La=Me("x",sB),Cu="data-focus-fallback-ignore",nT="data-allow-focus-retain",wf="kanna:restore-chat-input-focus",mb="data-chat-input",Cf="data-chat-selection-zone";function Vo(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function rT(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:Vo(e,nT):!1}function oB(e){const t=e;return t!=null&&t.matches?rT(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:Vo(e,nT):!1}function wC(e){return!!e.querySelector(`[${Cu}][data-state='open']`)}function lB(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function aB(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${mb}]`)).filter(a=>!a.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,l=n[s];return l?(l.focus({preventScroll:!0}),!0):!1}function CC(e){const{activeElement:t,fallback:n,hasActiveOverlay:r}=e;if(!n||n.disabled||r||t===n)return"none";if(e.trigger==="escape")return e.defaultPrevented||Vo(t,mb)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:l,root:a,hasActiveSelection:u}=e,h=l??s;return!a||!h||!a.contains(h)||Vo(h,Cu)||Vo(t,Cu)||u&&(Vo(s,Cf)||Vo(h,Cf))||rT(t)?"none":t&&t===h?"restore":oB(t)?"none":"restore"}const iT=r6,cB=i6,sT=b.forwardRef(({className:e,...t},n)=>g.jsx(GR,{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}));sT.displayName=GR.displayName;const uB={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},gb=b.forwardRef(({className:e,children:t,size:n="md",...r},s)=>g.jsxs(cB,{children:[g.jsx(sT,{}),g.jsxs(YR,{ref:s,[Cu]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event(wf)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},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",uB[n],e),...r,children:[t,g.jsxs(l6,{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:[g.jsx(La,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gb.displayName=YR.displayName;function oT({className:e,...t}){return g.jsx(s6,{className:ye("text-lg font-medium leading-none tracking-tight",e),...t})}function dB({className:e,...t}){return g.jsx(o6,{className:ye("text-sm text-muted-foreground",e),...t})}function lT({className:e,...t}){return g.jsx("div",{className:ye("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function aT({className:e,...t}){return g.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 ro=b.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{ref:r,type:t,className:ye("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n}));ro.displayName="Input";const cT=b.createContext(null);function hB({children:e}){const[t,n]=b.useState(null),[r,s]=b.useState(""),l=b.useRef(null);b.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var y,S;(y=l.current)==null||y.focus(),(S=l.current)==null||S.select()},0))},[t]);const a=b.useCallback(()=>{n(null),s("")},[]),u=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),a())},[a,t]),h=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),a())},[a,t,r]),d=b.useCallback(y=>new Promise(S=>{n({kind:"confirm",options:y,resolve:S})}),[]),p=b.useCallback(y=>new Promise(S=>{n({kind:"prompt",options:y,resolve:S})}),[]),m=b.useCallback(y=>new Promise(S=>{n({kind:"alert",options:y,resolve:S})}),[]),_=b.useMemo(()=>({confirm:d,prompt:p,alert:m}),[m,d,p]);return g.jsxs(cT.Provider,{value:_,children:[e,g.jsx(iT,{open:t!==null,onOpenChange:y=>{y||!t||u()},children:g.jsx(gb,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!t||t.kind!=="confirm"||(y.preventDefault(),h())},children:t?g.jsxs(g.Fragment,{children:[g.jsxs(lT,{className:"space-y-4",children:[g.jsx(oT,{children:t.options.title}),t.options.description?g.jsx(dB,{children:t.options.description}):null,t.kind==="prompt"?g.jsx(ro,{ref:l,type:"text",value:r,onChange:y=>s(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),g.jsxs(aT,{children:[g.jsx(rt,{variant:"ghost",size:"sm",onClick:u,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),g.jsx(rt,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:h,disabled:t.kind==="prompt"&&!r.trim(),children:t.kind==="alert"?t.options.closeLabel??"OK":"confirmLabel"in t.options?t.options.confirmLabel??"Confirm":"Confirm"})]})]}):null})})]})}function fB(){const e=b.useContext(cT);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const pB=["top","right","bottom","left"],ao=Math.min,Sr=Math.max,kf=Math.round,Nh=Math.floor,Ri=e=>({x:e,y:e}),mB={left:"right",right:"left",bottom:"top",top:"bottom"};function v_(e,t,n){return Sr(e,ao(t,n))}function hs(e,t){return typeof e=="function"?e(t):e}function fs(e){return e.split("-")[0]}function ja(e){return e.split("-")[1]}function vb(e){return e==="x"?"y":"x"}function _b(e){return e==="y"?"height":"width"}function wi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yb(e){return vb(wi(e))}function gB(e,t,n){n===void 0&&(n=!1);const r=ja(e),s=yb(e),l=_b(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Ef(a)),[a,Ef(a)]}function vB(e){const t=Ef(e);return[__(e),t,__(t)]}function __(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const kC=["left","right"],EC=["right","left"],_B=["top","bottom"],yB=["bottom","top"];function bB(e,t,n){switch(e){case"top":case"bottom":return n?t?EC:kC:t?kC:EC;case"left":case"right":return t?_B:yB;default:return[]}}function xB(e,t,n,r){const s=ja(e);let l=bB(fs(e),n==="start",r);return s&&(l=l.map(a=>a+"-"+s),t&&(l=l.concat(l.map(__)))),l}function Ef(e){const t=fs(e);return mB[t]+e.slice(t.length)}function SB(e){return{top:0,right:0,bottom:0,left:0,...e}}function uT(e){return typeof e!="number"?SB(e):{top:e,right:e,bottom:e,left:e}}function Rf(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 RC(e,t,n){let{reference:r,floating:s}=e;const l=wi(t),a=yb(t),u=_b(a),h=fs(t),d=l==="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 y;switch(h){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}switch(ja(t)){case"start":y[a]-=_*(n&&d?-1:1);break;case"end":y[a]+=_*(n&&d?-1:1);break}return y}async function wB(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:a,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:y=0}=hs(t,e),S=uT(y),C=u[_?m==="floating"?"reference":"floating":m],k=Rf(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:h})),T=m==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),M=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},L=Rf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:h}):T);return{top:(k.top-L.top+S.top)/M.y,bottom:(L.bottom-k.bottom+S.bottom)/M.y,left:(k.left-L.left+S.left)/M.x,right:(L.right-k.right+S.right)/M.x}}const CB=50,kB=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:wB},h=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=RC(d,r,h),_=r,y=0;const S={};for(let w=0;w<l.length;w++){const C=l[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:M,data:L,reset:D}=await T({x:p,y:m,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:d,platform:u,elements:{reference:e,floating:t}});p=R??p,m=M??m,S[k]={...S[k],...L},D&&y<CB&&(y++,typeof D=="object"&&(D.placement&&(_=D.placement),D.rects&&(d=D.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:p,y:m}=RC(d,_,h)),w=-1)}return{x:p,y:m,placement:_,strategy:s,middlewareData:S}},EB=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:a,elements:u,middlewareData:h}=t,{element:d,padding:p=0}=hs(e,t)||{};if(d==null)return{};const m=uT(p),_={x:n,y:r},y=yb(s),S=_b(y),w=await a.getDimensions(d),C=y==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=l.reference[S]+l.reference[y]-_[y]-l.floating[S],L=_[y]-l.reference[y],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let j=D?D[R]:0;(!j||!await(a.isElement==null?void 0:a.isElement(D)))&&(j=u.floating[R]||l.floating[S]);const F=M/2-L/2,Y=j/2-w[S]/2-1,z=ao(m[k],Y),H=ao(m[T],Y),P=z,U=j-w[S]-H,V=j/2-w[S]/2+F,$=v_(P,V,U),B=!h.arrow&&ja(s)!=null&&V!==$&&l.reference[S]/2-(V<P?z:H)-w[S]/2<0,K=B?V<P?V-P:V-U:0;return{[y]:_[y]+K,data:{[y]:$,centerOffset:V-$-K,...B&&{alignmentOffset:K}},reset:B}}}),RB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:a,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=hs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const k=fs(s),T=wi(u),R=fs(u)===u,M=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=_||(R||!w?[Ef(u)]:vB(u)),D=S!=="none";!_&&D&&L.push(...xB(u,w,S,M));const j=[u,...L],F=await h.detectOverflow(t,C),Y=[];let z=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Y.push(F[k]),m){const V=gB(s,a,M);Y.push(F[V[0]],F[V[1]])}if(z=[...z,{placement:s,overflows:Y}],!Y.every(V=>V<=0)){var H,P;const V=(((H=l.flip)==null?void 0:H.index)||0)+1,$=j[V];if($&&(!(m==="alignment"?T!==wi($):!1)||z.every(W=>wi(W.placement)===T?W.overflows[0]>0:!0)))return{data:{index:V,overflows:z},reset:{placement:$}};let B=(P=z.filter(K=>K.overflows[0]<=0).sort((K,W)=>K.overflows[1]-W.overflows[1])[0])==null?void 0:P.placement;if(!B)switch(y){case"bestFit":{var U;const K=(U=z.filter(W=>{if(D){const Z=wi(W.placement);return Z===T||Z==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(Z=>Z>0).reduce((Z,N)=>Z+N,0)]).sort((W,Z)=>W[1]-Z[1])[0])==null?void 0:U[0];K&&(B=K);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function TC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MC(e){return pB.some(t=>e[t]>=0)}const TB=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...l}=hs(e,t);switch(s){case"referenceHidden":{const a=await r.detectOverflow(t,{...l,elementContext:"reference"}),u=TC(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:MC(u)}}}case"escaped":{const a=await r.detectOverflow(t,{...l,altBoundary:!0}),u=TC(a,n.floating);return{data:{escapedOffsets:u,escaped:MC(u)}}}default:return{}}}}},dT=new Set(["left","top"]);async function MB(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=fs(n),u=ja(n),h=wi(n)==="y",d=dT.has(a)?-1:1,p=l&&h?-1:1,m=hs(t,e);let{mainAxis:_,crossAxis:y,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"&&(y=u==="end"?S*-1:S),h?{x:y*p,y:_*d}:{x:_*d,y:y*p}}const NB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:a,middlewareData:u}=t,h=await MB(t,e);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:a}}}}},AB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:l}=t,{mainAxis:a=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...d}=hs(e,t),p={x:n,y:r},m=await l.detectOverflow(t,d),_=wi(fs(s)),y=vb(_);let S=p[y],w=p[_];if(a){const k=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=S+m[k],M=S-m[T];S=v_(R,S,M)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+m[k],M=w-m[T];w=v_(R,w,M)}const C=h.fn({...t,[y]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:a,[_]:u}}}}}},DB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:a}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=hs(e,t),p={x:n,y:r},m=wi(s),_=vb(m);let y=p[_],S=p[m];const w=hs(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const R=_==="y"?"height":"width",M=l.reference[_]-l.floating[R]+C.mainAxis,L=l.reference[_]+l.reference[R]-C.mainAxis;y<M?y=M:y>L&&(y=L)}if(d){var k,T;const R=_==="y"?"width":"height",M=dT.has(fs(s)),L=l.reference[m]-l.floating[R]+(M&&((k=a.offset)==null?void 0:k[m])||0)+(M?0:C.crossAxis),D=l.reference[m]+l.reference[R]+(M?0:((T=a.offset)==null?void 0:T[m])||0)-(M?C.crossAxis:0);S<L?S=L:S>D&&(S=D)}return{[_]:y,[m]:S}}}},OB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:a,elements:u}=t,{apply:h=()=>{},...d}=hs(e,t),p=await a.detectOverflow(t,d),m=fs(s),_=ja(s),y=wi(s)==="y",{width:S,height:w}=l.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=_===(await(a.isRTL==null?void 0:a.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,M=ao(w-p[C],T),L=ao(S-p[k],R),D=!t.middlewareData.shift;let j=M,F=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=T),D&&!_){const z=Sr(p.left,0),H=Sr(p.right,0),P=Sr(p.top,0),U=Sr(p.bottom,0);y?F=S-2*(z!==0||H!==0?z+H:Sr(p.left,p.right)):j=w-2*(P!==0||U!==0?P+U:Sr(p.top,p.bottom))}await h({...t,availableWidth:F,availableHeight:j});const Y=await a.getDimensions(u.floating);return S!==Y.width||w!==Y.height?{reset:{rects:!0}}:{}}}};function ap(){return typeof window<"u"}function za(e){return hT(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Di(e){var t;return(t=(hT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hT(e){return ap()?e instanceof Node||e instanceof wr(e).Node:!1}function li(e){return ap()?e instanceof Element||e instanceof wr(e).Element:!1}function gs(e){return ap()?e instanceof HTMLElement||e instanceof wr(e).HTMLElement:!1}function NC(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Wu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function LB(e){return/^(table|td|th)$/.test(za(e))}function cp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const jB=/transform|translate|scale|rotate|perspective|filter/,zB=/paint|layout|strict|content/,Po=e=>!!e&&e!=="none";let gv;function bb(e){const t=li(e)?ai(e):e;return Po(t.transform)||Po(t.translate)||Po(t.scale)||Po(t.rotate)||Po(t.perspective)||!xb()&&(Po(t.backdropFilter)||Po(t.filter))||jB.test(t.willChange||"")||zB.test(t.contain||"")}function PB(e){let t=co(e);for(;gs(t)&&!Sa(t);){if(bb(t))return t;if(cp(t))return null;t=co(t)}return null}function xb(){return gv==null&&(gv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gv}function Sa(e){return/^(html|body|#document)$/.test(za(e))}function ai(e){return wr(e).getComputedStyle(e)}function up(e){return li(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function co(e){if(za(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NC(e)&&e.host||Di(e);return NC(t)?t.host:t}function fT(e){const t=co(e);return Sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:gs(t)&&Wu(t)?t:fT(t)}function ku(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=fT(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),a=wr(s);if(l){const u=y_(a);return t.concat(a,a.visualViewport||[],Wu(s)?s:[],u&&n?ku(u):[])}else return t.concat(s,ku(s,[],n))}function y_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pT(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=gs(e),l=s?e.offsetWidth:n,a=s?e.offsetHeight:r,u=kf(n)!==l||kf(r)!==a;return u&&(n=l,r=a),{width:n,height:r,$:u}}function Sb(e){return li(e)?e:e.contextElement}function ga(e){const t=Sb(e);if(!gs(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=pT(t);let a=(l?kf(n.width):n.width)/r,u=(l?kf(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const BB=Ri(0);function mT(e){const t=wr(e);return!xb()||!t.visualViewport?BB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function Qo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=Sb(e);let a=Ri(1);t&&(r?li(r)&&(a=ga(r)):a=ga(e));const u=IB(l,n,r)?mT(l):Ri(0);let h=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,p=s.width/a.x,m=s.height/a.y;if(l){const _=wr(l),y=r&&li(r)?wr(r):r;let S=_,w=y_(S);for(;w&&r&&y!==S;){const C=ga(w),k=w.getBoundingClientRect(),T=ai(w),R=k.left+(w.clientLeft+parseFloat(T.paddingLeft))*C.x,M=k.top+(w.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,d*=C.y,p*=C.x,m*=C.y,h+=R,d+=M,S=wr(w),w=y_(S)}}return Rf({width:p,height:m,x:h,y:d})}function dp(e,t){const n=up(e).scrollLeft;return t?t.left+n:Qo(Di(e)).left+n}function gT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function HB(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",a=Di(r),u=t?cp(t.floating):!1;if(r===a||u&&l)return n;let h={scrollLeft:0,scrollTop:0},d=Ri(1);const p=Ri(0),m=gs(r);if((m||!m&&!l)&&((za(r)!=="body"||Wu(a))&&(h=up(r)),m)){const y=Qo(r);d=ga(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const _=a&&!m&&!l?gT(a,h):Ri(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+p.x+_.x,y:n.y*d.y-h.scrollTop*d.y+p.y+_.y}}function FB(e){return Array.from(e.getClientRects())}function UB(e){const t=Di(e),n=up(e),r=e.ownerDocument.body,s=Sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+dp(e);const u=-n.scrollTop;return ai(r).direction==="rtl"&&(a+=Sr(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:a,y:u}}const AC=25;function $B(e,t){const n=wr(e),r=Di(e),s=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,u=0,h=0;if(s){l=s.width,a=s.height;const p=xb();(!p||p&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=dp(r);if(d<=0){const p=r.ownerDocument,m=p.body,_=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-y);S<=AC&&(l-=S)}else d<=AC&&(l+=d);return{width:l,height:a,x:u,y:h}}function WB(e,t){const n=Qo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=gs(e)?ga(e):Ri(1),a=e.clientWidth*l.x,u=e.clientHeight*l.y,h=s*l.x,d=r*l.y;return{width:a,height:u,x:h,y:d}}function DC(e,t,n){let r;if(t==="viewport")r=$B(e,n);else if(t==="document")r=UB(Di(e));else if(li(t))r=WB(t,n);else{const s=mT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Rf(r)}function vT(e,t){const n=co(e);return n===t||!li(n)||Sa(n)?!1:ai(n).position==="fixed"||vT(n,t)}function VB(e,t){const n=t.get(e);if(n)return n;let r=ku(e,[],!1).filter(u=>li(u)&&za(u)!=="body"),s=null;const l=ai(e).position==="fixed";let a=l?co(e):e;for(;li(a)&&!Sa(a);){const u=ai(a),h=bb(a);!h&&u.position==="fixed"&&(s=null),(l?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Wu(a)&&!h&&vT(e,a))?r=r.filter(p=>p!==a):s=u,a=co(a)}return t.set(e,r),r}function qB(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?cp(t)?[]:VB(t,this._c):[].concat(n),r],u=DC(t,a[0],s);let h=u.top,d=u.right,p=u.bottom,m=u.left;for(let _=1;_<a.length;_++){const y=DC(t,a[_],s);h=Sr(y.top,h),d=ao(y.right,d),p=ao(y.bottom,p),m=Sr(y.left,m)}return{width:d-m,height:p-h,x:m,y:h}}function KB(e){const{width:t,height:n}=pT(e);return{width:t,height:n}}function GB(e,t,n){const r=gs(t),s=Di(t),l=n==="fixed",a=Qo(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const h=Ri(0);function d(){h.x=dp(s)}if(r||!r&&!l)if((za(t)!=="body"||Wu(s))&&(u=up(t)),r){const y=Qo(t,!0,l,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else s&&d();l&&!r&&s&&d();const p=s&&!r&&!l?gT(s,u):Ri(0),m=a.left+u.scrollLeft-h.x-p.x,_=a.top+u.scrollTop-h.y-p.y;return{x:m,y:_,width:a.width,height:a.height}}function vv(e){return ai(e).position==="static"}function OC(e,t){if(!gs(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Di(e)===n&&(n=n.ownerDocument.body),n}function _T(e,t){const n=wr(e);if(cp(e))return n;if(!gs(e)){let s=co(e);for(;s&&!Sa(s);){if(li(s)&&!vv(s))return s;s=co(s)}return n}let r=OC(e,t);for(;r&&LB(r)&&vv(r);)r=OC(r,t);return r&&Sa(r)&&vv(r)&&!bb(r)?n:r||PB(e)||n}const YB=async function(e){const t=this.getOffsetParent||_T,n=this.getDimensions,r=await n(e.floating);return{reference:GB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XB(e){return ai(e).direction==="rtl"}const ZB={convertOffsetParentRelativeRectToViewportRelativeRect:HB,getDocumentElement:Di,getClippingRect:qB,getOffsetParent:_T,getElementRects:YB,getClientRects:FB,getDimensions:KB,getScale:ga,isElement:li,isRTL:XB};function yT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QB(e,t){let n=null,r;const s=Di(e);function l(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),l();const d=e.getBoundingClientRect(),{left:p,top:m,width:_,height:y}=d;if(u||t(),!_||!y)return;const S=Nh(m),w=Nh(s.clientWidth-(p+_)),C=Nh(s.clientHeight-(m+y)),k=Nh(p),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:Sr(0,ao(1,h))||1};let M=!0;function L(D){const j=D[0].intersectionRatio;if(j!==h){if(!M)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!yT(d,e.getBoundingClientRect())&&a(),M=!1}try{n=new IntersectionObserver(L,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,R)}n.observe(e)}return a(!0),l}function JB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=Sb(e),p=s||l?[...d?ku(d):[],...t?ku(t):[]]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),l&&k.addEventListener("resize",n)});const m=d&&u?QB(d,n):null;let _=-1,y=null;a&&(y=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let S,w=h?Qo(e):null;h&&C();function C(){const k=Qo(e);w&&!yT(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;p.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),m==null||m(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(S)}}const eI=NB,tI=AB,nI=RB,rI=OB,iI=TB,LC=EB,sI=DB,oI=(e,t,n)=>{const r=new Map,s={platform:ZB,...n},l={...s.platform,_c:r};return kB(e,t,{...s,platform:l})};var lI=typeof document<"u",aI=function(){},nf=lI?b.useLayoutEffect:aI;function Tf(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(!Tf(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 l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!Tf(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function bT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jC(e,t){const n=bT(e);return Math.round(t*n)/n}function _v(e){const t=b.useRef(e);return nf(()=>{t.current=e}),t}function cI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:a}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[p,m]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,y]=b.useState(r);Tf(_,r)||y(r);const[S,w]=b.useState(null),[C,k]=b.useState(null),T=b.useCallback(W=>{W!==D.current&&(D.current=W,w(W))},[]),R=b.useCallback(W=>{W!==j.current&&(j.current=W,k(W))},[]),M=l||S,L=a||C,D=b.useRef(null),j=b.useRef(null),F=b.useRef(p),Y=h!=null,z=_v(h),H=_v(s),P=_v(d),U=b.useCallback(()=>{if(!D.current||!j.current)return;const W={placement:t,strategy:n,middleware:_};H.current&&(W.platform=H.current),oI(D.current,j.current,W).then(Z=>{const N={...Z,isPositioned:P.current!==!1};V.current&&!Tf(F.current,N)&&(F.current=N,Si.flushSync(()=>{m(N)}))})},[_,t,n,H,P]);nf(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[d]);const V=b.useRef(!1);nf(()=>(V.current=!0,()=>{V.current=!1}),[]),nf(()=>{if(M&&(D.current=M),L&&(j.current=L),M&&L){if(z.current)return z.current(M,L,U);U()}},[M,L,U,z,Y]);const $=b.useMemo(()=>({reference:D,floating:j,setReference:T,setFloating:R}),[T,R]),B=b.useMemo(()=>({reference:M,floating:L}),[M,L]),K=b.useMemo(()=>{const W={position:n,left:0,top:0};if(!B.floating)return W;const Z=jC(B.floating,p.x),N=jC(B.floating,p.y);return u?{...W,transform:"translate("+Z+"px, "+N+"px)",...bT(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:N}},[n,u,B.floating,p.x,p.y]);return b.useMemo(()=>({...p,update:U,refs:$,elements:B,floatingStyles:K}),[p,U,$,B,K])}const uI=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?LC({element:r.current,padding:s}).fn(n):{}:r?LC({element:r,padding:s}).fn(n):{}}}},dI=(e,t)=>{const n=eI(e);return{name:n.name,fn:n.fn,options:[e,t]}},hI=(e,t)=>{const n=tI(e);return{name:n.name,fn:n.fn,options:[e,t]}},fI=(e,t)=>({fn:sI(e).fn,options:[e,t]}),pI=(e,t)=>{const n=nI(e);return{name:n.name,fn:n.fn,options:[e,t]}},mI=(e,t)=>{const n=rI(e);return{name:n.name,fn:n.fn,options:[e,t]}},gI=(e,t)=>{const n=iI(e);return{name:n.name,fn:n.fn,options:[e,t]}},vI=(e,t)=>{const n=uI(e);return{name:n.name,fn:n.fn,options:[e,t]}};var _I="Arrow",xT=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return g.jsx(et.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});xT.displayName=_I;var yI=xT;function bI(e){const[t,n]=b.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let a,u;if("borderBoxSize"in l){const h=l.borderBoxSize,d=Array.isArray(h)?h[0]:h;a=d.inlineSize,u=d.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wb="Popper",[ST,fo]=ms(wb),[xI,wT]=ST(wb),CT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return g.jsx(xI,{scope:t,anchor:r,onAnchorChange:s,children:n})};CT.displayName=wb;var kT="PopperAnchor",ET=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=wT(kT,n),a=b.useRef(null),u=ht(t,a),h=b.useRef(null);return b.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||a.current,d!==h.current&&l.onAnchorChange(h.current)}),r?null:g.jsx(et.div,{...s,ref:u})});ET.displayName=kT;var Cb="PopperContent",[SI,wI]=ST(Cb),RT=b.forwardRef((e,t)=>{var J,ge,ie,ce,we,Se;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:y="optimized",onPlaced:S,...w}=e,C=wT(Cb,n),[k,T]=b.useState(null),R=ht(t,ke=>T(ke)),[M,L]=b.useState(null),D=bI(M),j=(D==null?void 0:D.width)??0,F=(D==null?void 0:D.height)??0,Y=r+(l!=="center"?"-"+l:""),z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(d)?d:[d],P=H.length>0,U={padding:z,boundary:H.filter(kI),altBoundary:P},{refs:V,floatingStyles:$,placement:B,isPositioned:K,middlewareData:W}=cI({strategy:"fixed",placement:Y,whileElementsMounted:(...ke)=>JB(...ke,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[dI({mainAxis:s+F,alignmentAxis:a}),h&&hI({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?fI():void 0,...U}),h&&pI({...U}),mI({...U,apply:({elements:ke,rects:Be,availableWidth:Ce,availableHeight:Oe})=>{const{width:bt,height:hn}=Be.reference,xt=ke.floating.style;xt.setProperty("--radix-popper-available-width",`${Ce}px`),xt.setProperty("--radix-popper-available-height",`${Oe}px`),xt.setProperty("--radix-popper-anchor-width",`${bt}px`),xt.setProperty("--radix-popper-anchor-height",`${hn}px`)}}),M&&vI({element:M,padding:u}),EI({arrowWidth:j,arrowHeight:F}),_&&gI({strategy:"referenceHidden",...U})]}),[Z,N]=NT(B),I=oi(S);Pn(()=>{K&&(I==null||I())},[K,I]);const q=(J=W.arrow)==null?void 0:J.x,A=(ge=W.arrow)==null?void 0:ge.y,ae=((ie=W.arrow)==null?void 0:ie.centerOffset)!==0,[fe,oe]=b.useState();return Pn(()=>{k&&oe(window.getComputedStyle(k).zIndex)},[k]),g.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:K?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ce=W.transformOrigin)==null?void 0:ce.x,(we=W.transformOrigin)==null?void 0:we.y].join(" "),...((Se=W.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(SI,{scope:n,placedSide:Z,onArrowChange:L,arrowX:q,arrowY:A,shouldHideArrow:ae,children:g.jsx(et.div,{"data-side":Z,"data-align":N,...w,ref:R,style:{...w.style,animation:K?void 0:"none"}})})})});RT.displayName=Cb;var TT="PopperArrow",CI={top:"bottom",right:"left",bottom:"top",left:"right"},MT=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=wI(TT,r),a=CI[l.placedSide];return g.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:g.jsx(yI,{...s,ref:n,style:{...s.style,display:"block"}})})});MT.displayName=TT;function kI(e){return e!==null}var EI=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,a=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=a?0:e.arrowWidth,h=a?0:e.arrowHeight,[d,p]=NT(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,y=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let S="",w="";return d==="bottom"?(S=a?m:`${_}px`,w=`${-h}px`):d==="top"?(S=a?m:`${_}px`,w=`${r.floating.height+h}px`):d==="right"?(S=`${-h}px`,w=a?m:`${y}px`):d==="left"&&(S=`${r.floating.width+h}px`,w=a?m:`${y}px`),{data:{x:S,y:w}}}});function NT(e){const[t,n="center"]=e.split("-");return[t,n]}var hp=CT,Vu=ET,fp=RT,pp=MT,AT=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"}),RI="VisuallyHidden",DT=b.forwardRef((e,t)=>g.jsx(et.span,{...e,ref:t,style:{...AT,...e.style}}));DT.displayName=RI;var TI=DT,[mp]=ms("Tooltip",[fo]),gp=fo(),OT="TooltipProvider",MI=700,b_="tooltip.open",[NI,kb]=mp(OT),LT=e=>{const{__scopeTooltip:t,delayDuration:n=MI,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,a=b.useRef(!0),u=b.useRef(!1),h=b.useRef(0);return b.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),g.jsx(NI,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(h.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:l})};LT.displayName=OT;var Eu="Tooltip",[AI,qu]=mp(Eu),jT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:a,delayDuration:u}=e,h=kb(Eu,e.__scopeTooltip),d=gp(t),[p,m]=b.useState(null),_=cs(),y=b.useRef(0),S=a??h.disableHoverableContent,w=u??h.delayDuration,C=b.useRef(!1),[k,T]=xa({prop:r,defaultProp:s??!1,onChange:j=>{j?(h.onOpen(),document.dispatchEvent(new CustomEvent(b_))):h.onClose(),l==null||l(j)},caller:Eu}),R=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),M=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,T(!0)},[T]),L=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),D=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,T(!0),y.current=0},w)},[w,T]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),g.jsx(hp,{...d,children:g.jsx(AI,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{h.isOpenDelayedRef.current?D():M()},[h.isOpenDelayedRef,D,M]),onTriggerLeave:b.useCallback(()=>{S?L():(window.clearTimeout(y.current),y.current=0)},[L,S]),onOpen:M,onClose:L,disableHoverableContent:S,children:n})})};jT.displayName=Eu;var x_="TooltipTrigger",zT=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=qu(x_,n),l=kb(x_,n),a=gp(n),u=b.useRef(null),h=ht(t,u,s.onTriggerChange),d=b.useRef(!1),p=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),g.jsx(Vu,{asChild:!0,...a,children:g.jsx(et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Re(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Re(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});zT.displayName=x_;var Eb="TooltipPortal",[DI,OI]=mp(Eb,{forceMount:void 0}),PT=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=qu(Eb,t);return g.jsx(DI,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(Oa,{asChild:!0,container:s,children:r})})})};PT.displayName=Eb;var wa="TooltipContent",BT=b.forwardRef((e,t)=>{const n=OI(wa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,a=qu(wa,e.__scopeTooltip);return g.jsx(Kr,{present:r||a.open,children:a.disableHoverableContent?g.jsx(IT,{side:s,...l,ref:t}):g.jsx(LI,{side:s,...l,ref:t})})}),LI=b.forwardRef((e,t)=>{const n=qu(wa,e.__scopeTooltip),r=kb(wa,e.__scopeTooltip),s=b.useRef(null),l=ht(t,s),[a,u]=b.useState(null),{trigger:h,onClose:d}=n,p=s.current,{onPointerInTransitChange:m}=r,_=b.useCallback(()=>{u(null),m(!1)},[m]),y=b.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=II(k,C.getBoundingClientRect()),R=HI(k,T),M=FI(w.getBoundingClientRect()),L=$I([...R,...M]);u(L),m(!0)},[m]);return b.useEffect(()=>()=>_(),[_]),b.useEffect(()=>{if(h&&p){const S=C=>y(C,p),w=C=>y(C,h);return h.addEventListener("pointerleave",S),p.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",w)}}},[h,p,y,_]),b.useEffect(()=>{if(a){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(h==null?void 0:h.contains(C))||(p==null?void 0:p.contains(C)),R=!UI(k,a);T?_():R&&(_(),d())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,p,a,d,_]),g.jsx(IT,{...e,ref:l})}),[jI,zI]=mp(Eu,{isInside:!1}),PI=Bj("TooltipContent"),IT=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:a,...u}=e,h=qu(wa,n),d=gp(n),{onClose:p}=h;return b.useEffect(()=>(document.addEventListener(b_,p),()=>document.removeEventListener(b_,p)),[p]),b.useEffect(()=>{if(h.trigger){const m=_=>{const y=_.target;y!=null&&y.contains(h.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[h.trigger,p]),g.jsx(Da,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:g.jsxs(fp,{"data-state":h.stateAttribute,...d,...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:[g.jsx(PI,{children:r}),g.jsx(jI,{scope:n,isInside:!0,children:g.jsx(TI,{id:h.contentId,role:"tooltip",children:s||r})})]})})});BT.displayName=wa;var HT="TooltipArrow",BI=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=gp(n);return zI(HT,n).isInside?null:g.jsx(pp,{...s,...r,ref:t})});BI.displayName=HT;function II(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function HI(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 FI(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 UI(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,p=u.y,m=h.x,_=h.y;p>r!=_>r&&n<(m-d)*(r-p)/(_-p)+d&&(s=!s)}return s}function $I(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),WI(t)}function WI(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 l=t[t.length-1],a=t[t.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.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 l=n[n.length-1],a=n[n.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.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 VI=LT,FT=jT,UT=zT,$T=PT,Rb=BT;function qI({className:e,...t}){return g.jsx("kbd",{className:ye("pointer-events-none inline-flex h-5 min-w-5 items-center justify-center rounded border border-border/60 bg-muted/50 px-1.5 font-mono text-[11px] font-medium text-current select-none",e),...t})}function KI({className:e,...t}){return g.jsx("span",{className:ye("inline-flex items-center gap-0.5",e),...t})}const GI="z-50 overflow-hidden rounded-md border border-border backdrop-blur-md p-0.5 text-[11px] font-medium text-card-foreground shadow-sm 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",YI=VI,Mf=FT,Nf=UT,Ru=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx($T,{children:g.jsx(Rb,{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})}));Ru.displayName=Rb.displayName;const eu=FT,tu=UT;function WT(e){return e.toUpperCase()}function XI(e){const t=e.split("+");return g.jsx(KI,{children:t.map((n,r)=>g.jsx(qI,{children:WT(n)},`${n}-${r}`))})}const ua=b.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},l)=>{const a=r===void 0?null:Array.isArray(r)?r[0]??null:r;return g.jsx($T,{children:g.jsx(Rb,{ref:l,sideOffset:t,className:ye(GI,e),...s,children:a?XI(a):g.jsx("span",{children:typeof n=="string"?WT(n):n})})})});ua.displayName="HotkeyTooltipContent";const ZI="0.17.0",QI={version:ZI},$n="Kanna",zC="kanna",JI=".kanna",e8=".kanna-dev",t8="KANNA_RUNTIME_PROFILE",Tb=`kanna/${QI.version}`,n8="[kanna]",r8=`~/${$n}`;function vp(){var t;return(t=globalThis.process)==null?void 0:t.env}function i8(e=vp()){var t;return((t=e==null?void 0:e[t8])==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function s8(e=vp()){return i8(e)==="dev"?e8:JI}function o8(e=vp()){return`~/${s8(e)}`}function l8(e=vp()){return`${o8(e)}/keybindings.json`}function Ah(e){return e?`${zC} ${e}`:zC}const _p=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>g.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 S_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const a8=[/^(?:\/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 c8(e){const t=e.trim();for(const n of a8){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function VT(e){return e.split("/").pop()||e}function u8(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,l=24*s,a=7*l;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<l?`${Math.floor(n/s)}h`:n<a?`${Math.floor(n/l)}d`:`${Math.floor(n/a)}w`}const d8=new Set(["starting","running"]);function h8({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const l=u8(e.lastMessageAt,n);return g.jsxs("div",{"data-chat-id":nC(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===nC(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[d8.has(e.status)?g.jsx(Mi,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?g.jsx("div",{className:"relative ",children:g.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[g.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),g.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,g.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?g.jsx(_p,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),g.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[l?g.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:l}):null,g.jsx(rt,{variant:"ghost",size:"icon",className:ye("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",l?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:a=>{a.stopPropagation(),s(e.chatId)},title:"Delete chat",children:g.jsx(p6,{className:"size-3.5"})})]})]},e._id)}function f8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const yp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Pa(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Mb(e){return"nodeType"in e}function lr(e){var t,n;return e?Pa(e)?e:Mb(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Nb(e){const{Document:t}=lr(e);return e instanceof t}function Ku(e){return Pa(e)?!1:e instanceof lr(e).HTMLElement}function qT(e){return e instanceof lr(e).SVGElement}function Ba(e){return e?Pa(e)?e.document:Mb(e)?Nb(e)?e:Ku(e)||qT(e)?e.ownerDocument:document:document:document}const Ni=yp?b.useLayoutEffect:b.useEffect;function Ab(e){const t=b.useRef(e);return Ni(()=>{t.current=e}),b.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 p8(){const e=b.useRef(null),t=b.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Tu(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return Ni(()=>{n.current!==e&&(n.current=e)},t),n}function Gu(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Af(e){const t=Ab(e),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function w_(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let yv={};function Yu(e,t){return b.useMemo(()=>{if(t)return t;const n=yv[e]==null?0:yv[e]+1;return yv[e]=n,e+"-"+n},[e,t])}function KT(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((l,a)=>{const u=Object.entries(a);for(const[h,d]of u){const p=l[h];p!=null&&(l[h]=p+e*d)}return l},{...t})}}const va=KT(1),Df=KT(-1);function m8(e){return"clientX"in e&&"clientY"in e}function Db(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function g8(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function C_(e){if(g8(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 m8(e)?{x:e.clientX,y:e.clientY}:null}const Mu=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[Mu.Translate.toString(e),Mu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),PC="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function v8(e){return e.matches(PC)?e:e.querySelector(PC)}const _8={display:"none"};function y8(e){let{id:t,value:n}=e;return Et.createElement("div",{id:t,style:_8},n)}function b8(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 Et.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function x8(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const GT=b.createContext(null);function S8(e){const t=b.useContext(GT);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function w8(){const[e]=b.useState(()=>new Set),t=b.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[b.useCallback(r=>{let{type:s,event:l}=r;e.forEach(a=>{var u;return(u=a[s])==null?void 0:u.call(a,l)})},[e]),t]}const C8={draggable:`
|
|
450
|
-
To pick up a draggable item, press the space bar.
|
|
451
|
-
While dragging, use the arrow keys to move the item.
|
|
452
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
453
|
-
`},k8={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 E8(e){let{announcements:t=k8,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=C8}=e;const{announce:l,announcement:a}=x8(),u=Yu("DndLiveRegion"),[h,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),S8(b.useMemo(()=>({onDragStart(m){let{active:_}=m;l(t.onDragStart({active:_}))},onDragMove(m){let{active:_,over:y}=m;t.onDragMove&&l(t.onDragMove({active:_,over:y}))},onDragOver(m){let{active:_,over:y}=m;l(t.onDragOver({active:_,over:y}))},onDragEnd(m){let{active:_,over:y}=m;l(t.onDragEnd({active:_,over:y}))},onDragCancel(m){let{active:_,over:y}=m;l(t.onDragCancel({active:_,over:y}))}}),[l,t])),!h)return null;const p=Et.createElement(Et.Fragment,null,Et.createElement(y8,{id:r,value:s.draggable}),Et.createElement(b8,{id:u,announcement:a}));return n?Si.createPortal(p,n):p}var un;(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"})(un||(un={}));function Of(){}function BC(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function R8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ci=Object.freeze({x:0,y:0});function T8(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function M8(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function N8(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function A8(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function IC(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 D8=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=IC(t,t.left,t.top),l=[];for(const a of r){const{id:u}=a,h=n.get(u);if(h){const d=T8(IC(h),s);l.push({id:u,data:{droppableContainer:a,value:d}})}}return l.sort(M8)};function O8(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),l=Math.min(t.top+t.height,e.top+e.height),a=s-r,u=l-n;if(r<s&&n<l){const h=t.width*t.height,d=e.width*e.height,p=a*u,m=p/(h+d-p);return Number(m.toFixed(4))}return 0}const L8=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:a}=l,u=n.get(a);if(u){const h=O8(u,t);h>0&&s.push({id:a,data:{droppableContainer:l,value:h}})}}return s.sort(N8)};function j8(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function YT(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ci}function z8(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((a,u)=>({...a,top:a.top+e*u.y,bottom:a.bottom+e*u.y,left:a.left+e*u.x,right:a.right+e*u.x}),{...n})}}const P8=z8(1);function B8(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 I8(e,t,n){const r=B8(t);if(!r)return e;const{scaleX:s,scaleY:l,x:a,y:u}=r,h=e.left-a-(1-s)*parseFloat(n),d=e.top-u-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),p=s?e.width/s:e.width,m=l?e.height/l:e.height;return{width:p,height:m,top:d,right:h+p,bottom:d+m,left:h}}const H8={ignoreTransform:!1};function Ia(e,t){t===void 0&&(t=H8);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:p}=lr(e).getComputedStyle(e);d&&(n=I8(n,d,p))}const{top:r,left:s,width:l,height:a,bottom:u,right:h}=n;return{top:r,left:s,width:l,height:a,bottom:u,right:h}}function HC(e){return Ia(e,{ignoreTransform:!0})}function F8(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function U8(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function $8(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function Ob(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Nb(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Ku(s)||qT(s)||n.includes(s))return n;const l=lr(e).getComputedStyle(s);return s!==e&&$8(s,l)&&n.push(s),U8(s,l)?n:r(s.parentNode)}return e?r(e):n}function XT(e){const[t]=Ob(e,1);return t??null}function bv(e){return!yp||!e?null:Pa(e)?e:Mb(e)?Nb(e)||e===Ba(e).scrollingElement?window:Ku(e)?e:null:null}function ZT(e){return Pa(e)?e.scrollX:e.scrollLeft}function QT(e){return Pa(e)?e.scrollY:e.scrollTop}function k_(e){return{x:ZT(e),y:QT(e)}}var gn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(gn||(gn={}));function JT(e){return!yp||!e?!1:e===document.scrollingElement}function eM(e){const t={x:0,y:0},n=JT(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,l=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:a,isRight:u,maxScroll:r,minScroll:t}}const W8={x:.2,y:.2};function V8(e,t,n,r,s){let{top:l,left:a,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=W8);const{isTop:d,isBottom:p,isLeft:m,isRight:_}=eM(e),y={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!d&&l<=t.top+w.height?(y.y=gn.Backward,S.y=r*Math.abs((t.top+w.height-l)/w.height)):!p&&h>=t.bottom-w.height&&(y.y=gn.Forward,S.y=r*Math.abs((t.bottom-w.height-h)/w.height)),!_&&u>=t.right-w.width?(y.x=gn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!m&&a<=t.left+w.width&&(y.x=gn.Backward,S.x=r*Math.abs((t.left+w.width-a)/w.width)),{direction:y,speed:S}}function q8(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:a}=window;return{top:0,left:0,right:l,bottom:a,width:l,height:a}}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 tM(e){return e.reduce((t,n)=>va(t,k_(n)),ci)}function K8(e){return e.reduce((t,n)=>t+ZT(n),0)}function G8(e){return e.reduce((t,n)=>t+QT(n),0)}function Y8(e,t){if(t===void 0&&(t=Ia),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);XT(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const X8=[["x",["left","right"],K8],["y",["top","bottom"],G8]];class Lb{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=Ob(n),s=tM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,a,u]of X8)for(const h of a)Object.defineProperty(this,h,{get:()=>{const d=u(r),p=s[l]-d;return this.rect[h]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class pu{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 Z8(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Ba(e)}function xv(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 Fr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Fr||(Fr={}));function FC(e){e.preventDefault()}function Q8(e){e.stopPropagation()}var dt;(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"})(dt||(dt={}));const nM={start:[dt.Space,dt.Enter],cancel:[dt.Esc],end:[dt.Space,dt.Enter,dt.Tab]},J8=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case dt.Right:return{...n,x:n.x+25};case dt.Left:return{...n,x:n.x-25};case dt.Down:return{...n,y:n.y+25};case dt.Up:return{...n,y:n.y-25}}};class jb{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 pu(Ba(n)),this.windowListeners=new pu(lr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Y8(r),n(ci)}handleKeyDown(t){if(Db(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=nM,coordinateGetter:a=J8,scrollBehavior:u="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,p=d?{x:d.left,y:d.top}:ci;this.referenceCoordinates||(this.referenceCoordinates=p);const m=a(t,{active:n,context:r.current,currentCoordinates:p});if(m){const _=Df(m,p),y={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:M,maxScroll:L,minScroll:D}=eM(w),j=q8(w),F={x:Math.min(C===dt.Right?j.right-j.width/2:j.right,Math.max(C===dt.Right?j.left:j.left+j.width/2,m.x)),y:Math.min(C===dt.Down?j.bottom-j.height/2:j.bottom,Math.max(C===dt.Down?j.top:j.top+j.height/2,m.y))},Y=C===dt.Right&&!T||C===dt.Left&&!R,z=C===dt.Down&&!M||C===dt.Up&&!k;if(Y&&F.x!==m.x){const H=w.scrollLeft+_.x,P=C===dt.Right&&H<=L.x||C===dt.Left&&H>=D.x;if(P&&!_.y){w.scrollTo({left:H,behavior:u});return}P?y.x=w.scrollLeft-H:y.x=C===dt.Right?w.scrollLeft-L.x:w.scrollLeft-D.x,y.x&&w.scrollBy({left:-y.x,behavior:u});break}else if(z&&F.y!==m.y){const H=w.scrollTop+_.y,P=C===dt.Down&&H<=L.y||C===dt.Up&&H>=D.y;if(P&&!_.x){w.scrollTo({top:H,behavior:u});return}P?y.y=w.scrollTop-H:y.y=C===dt.Down?w.scrollTop-L.y:w.scrollTop-D.y,y.y&&w.scrollBy({top:-y.y,behavior:u});break}}this.handleMove(t,va(Df(m,this.referenceCoordinates),y))}}}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()}}jb.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nM,onActivation:s}=t,{active:l}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function UC(e){return!!(e&&"distance"in e)}function $C(e){return!!(e&&"delay"in e)}class zb{constructor(t,n,r){var s;r===void 0&&(r=Z8(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:l}=t,{target:a}=l;this.props=t,this.events=n,this.document=Ba(a),this.documentListeners=new pu(this.document),this.listeners=new pu(r),this.windowListeners=new pu(lr(a)),this.initialCoordinates=(s=C_(l))!=null?s:ci,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(Fr.Resize,this.handleCancel),this.windowListeners.add(Fr.DragStart,FC),this.windowListeners.add(Fr.VisibilityChange,this.handleCancel),this.windowListeners.add(Fr.ContextMenu,FC),this.documentListeners.add(Fr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($C(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(UC(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(Fr.Click,Q8,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:a,options:{activationConstraint:u}}=l;if(!s)return;const h=(n=C_(t))!=null?n:ci,d=Df(s,h);if(!r&&u){if(UC(u)){if(u.tolerance!=null&&xv(d,u.tolerance))return this.handleCancel();if(xv(d,u.distance))return this.handleStart()}if($C(u)&&xv(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),a(h)}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===dt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const e7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Pb extends zb{constructor(t){const{event:n}=t,r=Ba(n.target);super(t,e7,r)}}Pb.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 t7={move:{name:"mousemove"},end:{name:"mouseup"}};var E_;(function(e){e[e.RightClick=2]="RightClick"})(E_||(E_={}));class n7 extends zb{constructor(t){super(t,t7,Ba(t.event.target))}}n7.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===E_.RightClick?!1:(r==null||r({event:n}),!0)}}];const Sv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class r7 extends zb{constructor(t){super(t,Sv)}static setup(){return window.addEventListener(Sv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Sv.move.name,t)};function t(){}}}r7.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 mu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(mu||(mu={}));var Lf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Lf||(Lf={}));function i7(e){let{acceleration:t,activator:n=mu.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:a=5,order:u=Lf.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:p,delta:m,threshold:_}=e;const y=o7({delta:m,disabled:!l}),[S,w]=p8(),C=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),T=b.useMemo(()=>{switch(n){case mu.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case mu.DraggableRect:return s}},[n,s,h]),R=b.useRef(null),M=b.useCallback(()=>{const D=R.current;if(!D)return;const j=C.current.x*k.current.x,F=C.current.y*k.current.y;D.scrollBy(j,F)},[]),L=b.useMemo(()=>u===Lf.TreeOrder?[...d].reverse():d,[u,d]);b.useEffect(()=>{if(!l||!d.length||!T){w();return}for(const D of L){if((r==null?void 0:r(D))===!1)continue;const j=d.indexOf(D),F=p[j];if(!F)continue;const{direction:Y,speed:z}=V8(D,F,T,t,_);for(const H of["x","y"])y[H][Y[H]]||(z[H]=0,Y[H]=0);if(z.x>0||z.y>0){w(),R.current=D,S(M,a),C.current=z,k.current=Y;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,M,r,w,l,a,JSON.stringify(T),JSON.stringify(y),S,d,L,p,JSON.stringify(_)])}const s7={x:{[gn.Backward]:!1,[gn.Forward]:!1},y:{[gn.Backward]:!1,[gn.Forward]:!1}};function o7(e){let{delta:t,disabled:n}=e;const r=w_(t);return Gu(s=>{if(n||!r||!s)return s7;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[gn.Backward]:s.x[gn.Backward]||l.x===-1,[gn.Forward]:s.x[gn.Forward]||l.x===1},y:{[gn.Backward]:s.y[gn.Backward]||l.y===-1,[gn.Forward]:s.y[gn.Forward]||l.y===1}}},[n,t,r])}function l7(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Gu(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function a7(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...l]},[]),[e,t])}var Nu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Nu||(Nu={}));var R_;(function(e){e.Optimized="optimized"})(R_||(R_={}));const WC=new Map;function c7(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,a]=b.useState(null),{frequency:u,measure:h,strategy:d}=s,p=b.useRef(e),m=C(),_=Tu(m),y=b.useCallback(function(k){k===void 0&&(k=[]),!_.current&&a(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=b.useRef(null),w=Gu(k=>{if(m&&!n)return WC;if(!k||k===WC||p.current!==e||l!=null){const T=new Map;for(let R of e){if(!R)continue;if(l&&l.length>0&&!l.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const M=R.node.current,L=M?new Lb(h(M),M):null;R.rect.current=L,L&&T.set(R.id,L)}return T}return k},[e,l,n,m,h]);return b.useEffect(()=>{p.current=e},[e]),b.useEffect(()=>{m||y()},[n,m]),b.useEffect(()=>{l&&l.length>0&&a(null)},[JSON.stringify(l)]),b.useEffect(()=>{m||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{y(),S.current=null},u))},[u,m,y,...r]),{droppableRects:w,measureDroppableContainers:y,measuringScheduled:l!=null};function C(){switch(d){case Nu.Always:return!1;case Nu.BeforeDragging:return n;default:return!n}}}function rM(e,t){return Gu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function u7(e,t){return rM(e,t)}function d7(e){let{callback:t,disabled:n}=e;const r=Ab(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function bp(e){let{callback:t,disabled:n}=e;const r=Ab(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function h7(e){return new Lb(Ia(e),e)}function VC(e,t,n){t===void 0&&(t=h7);const[r,s]=b.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const p=t(e);return JSON.stringify(h)===JSON.stringify(p)?h:p})}const a=d7({callback(h){if(e)for(const d of h){const{type:p,target:m}=d;if(p==="childList"&&m instanceof HTMLElement&&m.contains(e)){l();break}}}}),u=bp({callback:l});return Ni(()=>{l(),e?(u==null||u.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),a==null||a.disconnect())},[e]),r}function f7(e){const t=rM(e);return YT(e,t)}const qC=[];function p7(e){const t=b.useRef(e),n=Gu(r=>e?r&&r!==qC&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ob(e):qC,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function m7(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(l=>{const a=bv(l.target);a&&n(u=>u?(u.set(a,k_(a)),new Map(u)):null)},[]);return b.useEffect(()=>{const l=r.current;if(e!==l){a(l);const u=e.map(h=>{const d=bv(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,k_(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{a(e),a(l)};function a(u){u.forEach(h=>{const d=bv(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,a)=>va(l,a),ci):tM(e):ci,[e,t])}function KC(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==ci;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Df(e,n.current):ci}function g7(e){b.useEffect(()=>{if(!yp)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 v7(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=a=>{l(a,t)},n},{}),[e,t])}function iM(e){return b.useMemo(()=>e?F8(e):null,[e])}const GC=[];function _7(e,t){t===void 0&&(t=Ia);const[n]=e,r=iM(n?lr(n):null),[s,l]=b.useState(GC);function a(){l(()=>e.length?e.map(h=>JT(h)?r:new Lb(t(h),h)):GC)}const u=bp({callback:a});return Ni(()=>{u==null||u.disconnect(),a(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function y7(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ku(t)?t:e}function b7(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:p}of d)if(Ku(p)){r(m=>{const _=t(p);return m?{...m,width:_.width,height:_.height}:_});break}},[t]),l=bp({callback:s}),a=b.useCallback(d=>{const p=y7(d);l==null||l.disconnect(),p&&(l==null||l.observe(p)),r(p?t(p):null)},[t,l]),[u,h]=Af(a);return b.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const x7=[{sensor:Pb,options:{}},{sensor:jb,options:{}}],S7={current:{}},rf={draggable:{measure:HC},droppable:{measure:HC,strategy:Nu.WhileDragging,frequency:R_.Optimized},dragOverlay:{measure:Ia}};class gu 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 w7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Of},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rf,measureDroppableContainers:Of,windowRect:null,measuringScheduled:!1},C7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Of,draggableNodes:new Map,over:null,measureDroppableContainers:Of},xp=b.createContext(C7),sM=b.createContext(w7);function k7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gu}}}function E7(e,t){switch(t.type){case un.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case un.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 un.DragEnd:case un.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case un.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new gu(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case un.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const a=new gu(e.droppable.containers);return a.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case un.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new gu(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function R7(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(xp),l=w_(r),a=w_(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&l&&a!=null){if(!Db(l)||document.activeElement===l.target)return;const u=s.get(a);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const p of[h.current,d.current]){if(!p)continue;const m=v8(p);if(m){m.focus();break}}})}},[r,t,s,a,l]),null}function T7(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function M7(e){return b.useMemo(()=>({draggable:{...rf.draggable,...e==null?void 0:e.draggable},droppable:{...rf.droppable,...e==null?void 0:e.droppable},dragOverlay:{...rf.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 N7(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=b.useRef(!1),{x:a,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Ni(()=>{if(!a&&!u||!t){l.current=!1;return}if(l.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const p=n(d),m=YT(p,r);if(a||(m.x=0),u||(m.y=0),l.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const _=XT(d);_&&_.scrollBy({top:m.y,left:m.x})}},[t,a,u,r,n])}const oM=b.createContext({...ci,scaleX:1,scaleY:1});var Js;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Js||(Js={}));const A7=b.memo(function(t){var n,r,s,l;let{id:a,accessibility:u,autoScroll:h=!0,children:d,sensors:p=x7,collisionDetection:m=L8,measuring:_,modifiers:y,...S}=t;const w=b.useReducer(E7,void 0,k7),[C,k]=w,[T,R]=w8(),[M,L]=b.useState(Js.Uninitialized),D=M===Js.Initialized,{draggable:{active:j,nodes:F,translate:Y},droppable:{containers:z}}=C,H=j!=null?F.get(j):null,P=b.useRef({initial:null,translated:null}),U=b.useMemo(()=>{var At;return j!=null?{id:j,data:(At=H==null?void 0:H.data)!=null?At:S7,rect:P}:null},[j,H]),V=b.useRef(null),[$,B]=b.useState(null),[K,W]=b.useState(null),Z=Tu(S,Object.values(S)),N=Yu("DndDescribedBy",a),I=b.useMemo(()=>z.getEnabled(),[z]),q=M7(_),{droppableRects:A,measureDroppableContainers:ae,measuringScheduled:fe}=c7(I,{dragging:D,dependencies:[Y.x,Y.y],config:q.droppable}),oe=l7(F,j),J=b.useMemo(()=>K?C_(K):null,[K]),ge=Li(),ie=u7(oe,q.draggable.measure);N7({activeNode:j!=null?F.get(j):null,config:ge.layoutShiftCompensation,initialRect:ie,measure:q.draggable.measure});const ce=VC(oe,q.draggable.measure,ie),we=VC(oe?oe.parentElement:null),Se=b.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:A,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=z.getNodeFor((n=Se.current.over)==null?void 0:n.id),Be=b7({measure:q.dragOverlay.measure}),Ce=(r=Be.nodeRef.current)!=null?r:oe,Oe=D?(s=Be.rect)!=null?s:ce:null,bt=!!(Be.nodeRef.current&&Be.rect),hn=f7(bt?null:ce),xt=iM(Ce?lr(Ce):null),zt=p7(D?ke??oe:null),In=_7(zt),cr=T7(y,{transform:{x:Y.x-hn.x,y:Y.y-hn.y,scaleX:1,scaleY:1},activatorEvent:K,active:U,activeNodeRect:ce,containerNodeRect:we,draggingNodeRect:Oe,over:Se.current.over,overlayNodeRect:Be.rect,scrollableAncestors:zt,scrollableAncestorRects:In,windowRect:xt}),Gr=J?va(J,Y):null,se=m7(zt),Rt=KC(se),ue=KC(se,[ce]),ve=va(cr,Rt),Le=Oe?P8(Oe,cr):null,Ie=U&&Le?m({active:U,collisionRect:Le,droppableRects:A,droppableContainers:I,pointerCoordinates:Gr}):null,Xe=A8(Ie,"id"),[Ct,Yn]=b.useState(null),nn=bt?cr:va(cr,ue),Pt=j8(nn,(l=Ct==null?void 0:Ct.rect)!=null?l:null,ce),Gt=b.useRef(null),ot=b.useCallback((At,Dt)=>{let{sensor:re,options:_e}=Dt;if(V.current==null)return;const Ue=F.get(V.current);if(!Ue)return;const Ye=At.nativeEvent,lt=new re({active:V.current,activeNode:Ue,event:Ye,options:_e,context:Se,onAbort(rn){if(!F.get(rn))return;const{onDragAbort:dr}=Z.current,Er={id:rn};dr==null||dr(Er),T({type:"onDragAbort",event:Er})},onPending(rn,Yr,dr,Er){if(!F.get(rn))return;const{onDragPending:zi}=Z.current,Xr={id:rn,constraint:Yr,initialCoordinates:dr,offset:Er};zi==null||zi(Xr),T({type:"onDragPending",event:Xr})},onStart(rn){const Yr=V.current;if(Yr==null)return;const dr=F.get(Yr);if(!dr)return;const{onDragStart:Er}=Z.current,ji={activatorEvent:Ye,active:{id:Yr,data:dr.data,rect:P}};Si.unstable_batchedUpdates(()=>{Er==null||Er(ji),L(Js.Initializing),k({type:un.DragStart,initialCoordinates:rn,active:Yr}),T({type:"onDragStart",event:ji}),B(Gt.current),W(Ye)})},onMove(rn){k({type:un.DragMove,coordinates:rn})},onEnd:ur(un.DragEnd),onCancel:ur(un.DragCancel)});Gt.current=lt;function ur(rn){return async function(){const{active:dr,collisions:Er,over:ji,scrollAdjustedTranslate:zi}=Se.current;let Xr=null;if(dr&&zi){const{cancelDrop:xs}=Z.current;Xr={activatorEvent:Ye,active:dr,collisions:Er,delta:zi,over:ji},rn===un.DragEnd&&typeof xs=="function"&&await Promise.resolve(xs(Xr))&&(rn=un.DragCancel)}V.current=null,Si.unstable_batchedUpdates(()=>{k({type:rn}),L(Js.Uninitialized),Yn(null),B(null),W(null),Gt.current=null;const xs=rn===un.DragEnd?"onDragEnd":"onDragCancel";if(Xr){const Rr=Z.current[xs];Rr==null||Rr(Xr),T({type:xs,event:Xr})}})}}},[F]),Xn=b.useCallback((At,Dt)=>(re,_e)=>{const Ue=re.nativeEvent,Ye=F.get(_e);if(V.current!==null||!Ye||Ue.dndKit||Ue.defaultPrevented)return;const lt={active:Ye};At(re,Dt.options,lt)===!0&&(Ue.dndKit={capturedBy:Dt.sensor},V.current=_e,ot(re,Dt))},[F,ot]),Dn=a7(p,Xn);g7(p),Ni(()=>{ce&&M===Js.Initializing&&L(Js.Initialized)},[ce,M]),b.useEffect(()=>{const{onDragMove:At}=Z.current,{active:Dt,activatorEvent:re,collisions:_e,over:Ue}=Se.current;if(!Dt||!re)return;const Ye={active:Dt,activatorEvent:re,collisions:_e,delta:{x:ve.x,y:ve.y},over:Ue};Si.unstable_batchedUpdates(()=>{At==null||At(Ye),T({type:"onDragMove",event:Ye})})},[ve.x,ve.y]),b.useEffect(()=>{const{active:At,activatorEvent:Dt,collisions:re,droppableContainers:_e,scrollAdjustedTranslate:Ue}=Se.current;if(!At||V.current==null||!Dt||!Ue)return;const{onDragOver:Ye}=Z.current,lt=_e.get(Xe),ur=lt&<.rect.current?{id:lt.id,rect:lt.rect.current,data:lt.data,disabled:lt.disabled}:null,rn={active:At,activatorEvent:Dt,collisions:re,delta:{x:Ue.x,y:Ue.y},over:ur};Si.unstable_batchedUpdates(()=>{Yn(ur),Ye==null||Ye(rn),T({type:"onDragOver",event:rn})})},[Xe]),Ni(()=>{Se.current={activatorEvent:K,active:U,activeNode:oe,collisionRect:Le,collisions:Ie,droppableRects:A,draggableNodes:F,draggingNode:Ce,draggingNodeRect:Oe,droppableContainers:z,over:Ct,scrollableAncestors:zt,scrollAdjustedTranslate:ve},P.current={initial:Oe,translated:Le}},[U,oe,Ie,Le,F,Ce,Oe,A,z,Ct,zt,ve]),i7({...ge,delta:Y,draggingRect:Le,pointerCoordinates:Gr,scrollableAncestors:zt,scrollableAncestorRects:In});const Ka=b.useMemo(()=>({active:U,activeNode:oe,activeNodeRect:ce,activatorEvent:K,collisions:Ie,containerNodeRect:we,dragOverlay:Be,draggableNodes:F,droppableContainers:z,droppableRects:A,over:Ct,measureDroppableContainers:ae,scrollableAncestors:zt,scrollableAncestorRects:In,measuringConfiguration:q,measuringScheduled:fe,windowRect:xt}),[U,oe,ce,K,Ie,we,Be,F,z,A,Ct,ae,zt,In,q,fe,xt]),bs=b.useMemo(()=>({activatorEvent:K,activators:Dn,active:U,activeNodeRect:ce,ariaDescribedById:{draggable:N},dispatch:k,draggableNodes:F,over:Ct,measureDroppableContainers:ae}),[K,Dn,U,ce,k,N,F,Ct,ae]);return Et.createElement(GT.Provider,{value:R},Et.createElement(xp.Provider,{value:bs},Et.createElement(sM.Provider,{value:Ka},Et.createElement(oM.Provider,{value:Pt},d)),Et.createElement(R7,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Et.createElement(E8,{...u,hiddenTextDescribedById:N}));function Li(){const At=($==null?void 0:$.autoScrollEnabled)===!1,Dt=typeof h=="object"?h.enabled===!1:h===!1,re=D&&!At&&!Dt;return typeof h=="object"?{...h,enabled:re}:{enabled:re}}}),D7=b.createContext(null),YC="button",O7="Draggable";function L7(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=Yu(O7),{activators:a,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:p,draggableNodes:m,over:_}=b.useContext(xp),{role:y=YC,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(h==null?void 0:h.id)===t,k=b.useContext(C?oM:D7),[T,R]=Af(),[M,L]=Af(),D=v7(a,t),j=Tu(n);Ni(()=>(m.set(t,{id:t,key:l,node:T,activatorNode:M,data:j}),()=>{const Y=m.get(t);Y&&Y.key===l&&m.delete(t)}),[m,t]);const F=b.useMemo(()=>({role:y,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&y===YC?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[r,y,w,C,S,p.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:F,isDragging:C,listeners:r?void 0:D,node:T,over:_,setNodeRef:R,setActivatorNodeRef:L,transform:k}}function j7(){return b.useContext(sM)}const z7="Droppable",P7={timeout:25};function B7(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=Yu(z7),{active:a,dispatch:u,over:h,measureDroppableContainers:d}=b.useContext(xp),p=b.useRef({disabled:n}),m=b.useRef(!1),_=b.useRef(null),y=b.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...P7,...s},k=Tu(w??r),T=b.useCallback(()=>{if(!m.current){m.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),y.current=null},C)},[C]),R=bp({callback:T,disabled:S||!a}),M=b.useCallback((F,Y)=>{R&&(Y&&(R.unobserve(Y),m.current=!1),F&&R.observe(F))},[R]),[L,D]=Af(M),j=Tu(t);return b.useEffect(()=>{!R||!L.current||(R.disconnect(),m.current=!1,R.observe(L.current))},[L,R]),b.useEffect(()=>(u({type:un.RegisterDroppable,element:{id:r,key:l,disabled:n,node:L,rect:_,data:j}}),()=>u({type:un.UnregisterDroppable,key:l,id:r})),[r]),b.useEffect(()=>{n!==p.current.disabled&&(u({type:un.SetDroppableDisabled,id:r,key:l,disabled:n}),p.current.disabled=n)},[r,l,n,u]),{active:a,rect:_,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:D}}function Bb(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function I7(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Dh(e){return e!==null&&e>=0}function H7(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 F7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const lM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=Bb(t,r,n),a=t[s],u=l[s];return!u||!a?null:{x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height}},Oh={scaleX:1,scaleY:1},U7=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:a}=e;const u=(t=l[n])!=null?t:r;if(!u)return null;if(s===n){const d=l[a];return d?{x:0,y:n<a?d.top+d.height-(u.top+u.height):d.top-u.top,...Oh}:null}const h=$7(l,s,n);return s>n&&s<=a?{x:0,y:-u.height-h,...Oh}:s<n&&s>=a?{x:0,y:u.height+h,...Oh}:{x:0,y:0,...Oh}};function $7(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const aM="Sortable",cM=Et.createContext({activeIndex:-1,containerId:aM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:lM,disabled:{draggable:!1,droppable:!1}});function W7(e){let{children:t,id:n,items:r,strategy:s=lM,disabled:l=!1}=e;const{active:a,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:p}=j7(),m=Yu(aM,n),_=u.rect!==null,y=b.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),S=a!=null,w=a?y.indexOf(a.id):-1,C=d?y.indexOf(d.id):-1,k=b.useRef(y),T=!H7(y,k.current),R=C!==-1&&w===-1||T,M=F7(l);Ni(()=>{T&&S&&p(y)},[T,y,S,p]),b.useEffect(()=>{k.current=y},[y]);const L=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:M,disableTransforms:R,items:y,overIndex:C,useDragOverlay:_,sortedRects:I7(y,h),strategy:s}),[w,m,M.draggable,M.droppable,R,y,C,h,_,s]);return Et.createElement(cM.Provider,{value:L},t)}const V7=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Bb(n,r,s).indexOf(t)},q7=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:a,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==l&&s===a?!1:n?!0:a!==s&&t===h},K7={duration:200,easing:"ease"},uM="transform",G7=Mu.Transition.toString({property:uM,duration:0,easing:"linear"}),Y7={roleDescription:"sortable"};function X7(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,a]=b.useState(null),u=b.useRef(n);return Ni(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Ia(r.current,{ignoreTransform:!0}),p={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(p.x||p.y)&&a(p)}}n!==u.current&&(u.current=n)},[t,n,r,s]),b.useEffect(()=>{l&&a(null)},[l]),l}function Z7(e){let{animateLayoutChanges:t=q7,attributes:n,disabled:r,data:s,getNewIndex:l=V7,id:a,strategy:u,resizeObserverConfig:h,transition:d=K7}=e;const{items:p,containerId:m,activeIndex:_,disabled:y,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=b.useContext(cM),R=Q7(r,y),M=p.indexOf(a),L=b.useMemo(()=>({sortable:{containerId:m,index:M,items:p},...s}),[m,s,M,p]),D=b.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:j,node:F,isOver:Y,setNodeRef:z}=B7({id:a,data:L,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:H,activatorEvent:P,activeNodeRect:U,attributes:V,setNodeRef:$,listeners:B,isDragging:K,over:W,setActivatorNodeRef:Z,transform:N}=L7({id:a,data:L,attributes:{...Y7,...n},disabled:R.draggable}),I=f8(z,$),q=!!H,A=q&&!S&&Dh(_)&&Dh(C),ae=!k&&K,fe=ae&&A?N:null,J=A?fe??(u??T)({rects:w,activeNodeRect:U,activeIndex:_,overIndex:C,index:M}):null,ge=Dh(_)&&Dh(C)?l({id:a,items:p,activeIndex:_,overIndex:C}):M,ie=H==null?void 0:H.id,ce=b.useRef({activeId:ie,items:p,newIndex:ge,containerId:m}),we=p!==ce.current.items,Se=t({active:H,containerId:m,isDragging:K,isSorting:q,id:a,index:M,items:p,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:d,wasDragging:ce.current.activeId!=null}),ke=X7({disabled:!Se,index:M,node:F,rect:j});return b.useEffect(()=>{q&&ce.current.newIndex!==ge&&(ce.current.newIndex=ge),m!==ce.current.containerId&&(ce.current.containerId=m),p!==ce.current.items&&(ce.current.items=p)},[q,ge,m,p]),b.useEffect(()=>{if(ie===ce.current.activeId)return;if(ie!=null&&ce.current.activeId==null){ce.current.activeId=ie;return}const Ce=setTimeout(()=>{ce.current.activeId=ie},50);return()=>clearTimeout(Ce)},[ie]),{active:H,activeIndex:_,attributes:V,data:L,rect:j,index:M,newIndex:ge,items:p,isOver:Y,isSorting:q,isDragging:K,listeners:B,node:F,overIndex:C,over:W,setNodeRef:I,setActivatorNodeRef:Z,setDroppableNodeRef:z,setDraggableNodeRef:$,transform:ke??J,transition:Be()};function Be(){if(ke||we&&ce.current.newIndex===M)return G7;if(!(ae&&!Db(P)||!d)&&(q||Se))return Mu.Transition.toString({...d,property:uM})}}function Q7(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}}dt.Down,dt.Right,dt.Up,dt.Left;function Ib(e){const t=e+"CollectionProvider",[n,r]=ms(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:C,children:k}=w,T=Et.useRef(null),R=Et.useRef(new Map).current;return g.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};a.displayName=t;const u=e+"CollectionSlot",h=Xo(u),d=Et.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=l(u,k),M=ht(C,R.collectionRef);return g.jsx(h,{ref:M,children:T})});d.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",_=Xo(p),y=Et.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,M=Et.useRef(null),L=ht(C,M),D=l(p,k);return Et.useEffect(()=>(D.itemMap.set(M,{ref:M,...R}),()=>void D.itemMap.delete(M))),g.jsx(_,{[m]:"",ref:L,children:T})});y.displayName=p;function S(w){const C=l(e+"CollectionConsumer",w);return Et.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((D,j)=>R.indexOf(D.ref.current)-R.indexOf(j.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:d,ItemSlot:y},S,r]}var J7=b.createContext(void 0);function Hb(e){const t=b.useContext(J7);return e||t||"ltr"}var wv="rovingFocusGroup.onEntryFocus",e9={bubbles:!1,cancelable:!0},Xu="RovingFocusGroup",[T_,dM,t9]=Ib(Xu),[n9,hM]=ms(Xu,[t9]),[r9,i9]=n9(Xu),fM=b.forwardRef((e,t)=>g.jsx(T_.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(T_.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(s9,{...e,ref:t})})}));fM.displayName=Xu;var s9=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,_=b.useRef(null),y=ht(t,_),S=Hb(l),[w,C]=xa({prop:a,defaultProp:u??null,onChange:h,caller:Xu}),[k,T]=b.useState(!1),R=oi(d),M=dM(n),L=b.useRef(!1),[D,j]=b.useState(0);return b.useEffect(()=>{const F=_.current;if(F)return F.addEventListener(wv,R),()=>F.removeEventListener(wv,R)},[R]),g.jsx(r9,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(F=>C(F),[C]),onItemShiftTab:b.useCallback(()=>T(!0),[]),onFocusableItemAdd:b.useCallback(()=>j(F=>F+1),[]),onFocusableItemRemove:b.useCallback(()=>j(F=>F-1),[]),children:g.jsx(et.div,{tabIndex:k||D===0?-1:0,"data-orientation":r,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{L.current=!0}),onFocus:Re(e.onFocus,F=>{const Y=!L.current;if(F.target===F.currentTarget&&Y&&!k){const z=new CustomEvent(wv,e9);if(F.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=M().filter(B=>B.focusable),P=H.find(B=>B.active),U=H.find(B=>B.id===w),$=[P,U,...H].filter(Boolean).map(B=>B.ref.current);gM($,p)}}L.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),pM="RovingFocusGroupItem",mM=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:a,...u}=e,h=cs(),d=l||h,p=i9(pM,n),m=p.currentTabStopId===d,_=dM(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:w}=p;return b.useEffect(()=>{if(r)return y(),()=>S()},[r,y,S]),g.jsx(T_.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:g.jsx(et.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Re(e.onMouseDown,C=>{r?p.onItemFocus(d):C.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=a9(C,p.orientation,p.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(M=>M.focusable).map(M=>M.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const M=R.indexOf(C.currentTarget);R=p.loop?c9(R,M+1):R.slice(M+1)}setTimeout(()=>gM(R))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});mM.displayName=pM;var o9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function a9(e,t,n){const r=l9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return o9[r]}function gM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function c9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var u9=fM,d9=mM,M_=["Enter"," "],h9=["ArrowDown","PageUp","Home"],vM=["ArrowUp","PageDown","End"],f9=[...h9,...vM],p9={ltr:[...M_,"ArrowRight"],rtl:[...M_,"ArrowLeft"]},m9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zu="Menu",[Au,g9,v9]=Ib(Zu),[al,_M]=ms(Zu,[v9,fo,hM]),Sp=fo(),yM=hM(),[_9,cl]=al(Zu),[y9,Qu]=al(Zu),bM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:a=!0}=e,u=Sp(t),[h,d]=b.useState(null),p=b.useRef(!1),m=oi(l),_=Hb(s);return b.useEffect(()=>{const y=()=>{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",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),g.jsx(hp,{...u,children:g.jsx(_9,{scope:t,open:n,onOpenChange:m,content:h,onContentChange:d,children:g.jsx(y9,{scope:t,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:_,modal:a,children:r})})})};bM.displayName=Zu;var b9="MenuAnchor",Fb=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sp(n);return g.jsx(Vu,{...s,...r,ref:t})});Fb.displayName=b9;var Ub="MenuPortal",[x9,xM]=al(Ub,{forceMount:void 0}),SM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=cl(Ub,t);return g.jsx(x9,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(Oa,{asChild:!0,container:s,children:r})})})};SM.displayName=Ub;var Wr="MenuContent",[S9,$b]=al(Wr),wM=b.forwardRef((e,t)=>{const n=xM(Wr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=cl(Wr,e.__scopeMenu),a=Qu(Wr,e.__scopeMenu);return g.jsx(Au.Provider,{scope:e.__scopeMenu,children:g.jsx(Kr,{present:r||l.open,children:g.jsx(Au.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(w9,{...s,ref:t}):g.jsx(C9,{...s,ref:t})})})})}),w9=b.forwardRef((e,t)=>{const n=cl(Wr,e.__scopeMenu),r=b.useRef(null),s=ht(t,r);return b.useEffect(()=>{const l=r.current;if(l)return sp(l)},[]),g.jsx(Wb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),C9=b.forwardRef((e,t)=>{const n=cl(Wr,e.__scopeMenu);return g.jsx(Wb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),k9=Xo("MenuContent.ScrollLock"),Wb=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,disableOutsideScroll:S,...w}=e,C=cl(Wr,n),k=Qu(Wr,n),T=Sp(n),R=yM(n),M=g9(n),[L,D]=b.useState(null),j=b.useRef(null),F=ht(t,j,C.onContentChange),Y=b.useRef(0),z=b.useRef(""),H=b.useRef(0),P=b.useRef(null),U=b.useRef("right"),V=b.useRef(0),$=S?$u:b.Fragment,B=S?{as:k9,allowPinchZoom:!0}:void 0,K=Z=>{var J,ge;const N=z.current+Z,I=M().filter(ie=>!ie.disabled),q=document.activeElement,A=(J=I.find(ie=>ie.ref.current===q))==null?void 0:J.textValue,ae=I.map(ie=>ie.textValue),fe=P9(ae,N,A),oe=(ge=I.find(ie=>ie.textValue===fe))==null?void 0:ge.ref.current;(function ie(ce){z.current=ce,window.clearTimeout(Y.current),ce!==""&&(Y.current=window.setTimeout(()=>ie(""),1e3))})(N),oe&&setTimeout(()=>oe.focus())};b.useEffect(()=>()=>window.clearTimeout(Y.current),[]),rp();const W=b.useCallback(Z=>{var I,q;return U.current===((I=P.current)==null?void 0:I.side)&&I9(Z,(q=P.current)==null?void 0:q.area)},[]);return g.jsx(S9,{scope:n,searchRef:z,onItemEnter:b.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),onItemLeave:b.useCallback(Z=>{var N;W(Z)||((N=j.current)==null||N.focus(),D(null))},[W]),onTriggerLeave:b.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),pointerGraceTimerRef:H,onPointerGraceIntentChange:b.useCallback(Z=>{P.current=Z},[]),children:g.jsx($,{...B,children:g.jsx(Uu,{asChild:!0,trapped:s,onMountAutoFocus:Re(l,Z=>{var N;Z.preventDefault(),(N=j.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(Da,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:_,onDismiss:y,children:g.jsx(u9,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:D,onEntryFocus:Re(h,Z=>{k.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(fp,{role:"menu","aria-orientation":"vertical","data-state":IM(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:F,style:{outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,Z=>{const I=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,q=Z.ctrlKey||Z.altKey||Z.metaKey,A=Z.key.length===1;I&&(Z.key==="Tab"&&Z.preventDefault(),!q&&A&&K(Z.key));const ae=j.current;if(Z.target!==ae||!f9.includes(Z.key))return;Z.preventDefault();const oe=M().filter(J=>!J.disabled).map(J=>J.ref.current);vM.includes(Z.key)&&oe.reverse(),j9(oe)}),onBlur:Re(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(Y.current),z.current="")}),onPointerMove:Re(e.onPointerMove,Du(Z=>{const N=Z.target,I=V.current!==Z.clientX;if(Z.currentTarget.contains(N)&&I){const q=Z.clientX>V.current?"right":"left";U.current=q,V.current=Z.clientX}}))})})})})})})});wM.displayName=Wr;var E9="MenuGroup",Vb=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{role:"group",...r,ref:t})});Vb.displayName=E9;var R9="MenuLabel",CM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{...r,ref:t})});CM.displayName=R9;var jf="MenuItem",XC="menu.itemSelect",wp=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=b.useRef(null),a=Qu(jf,e.__scopeMenu),u=$b(jf,e.__scopeMenu),h=ht(t,l),d=b.useRef(!1),p=()=>{const m=l.current;if(!n&&m){const _=new CustomEvent(XC,{bubbles:!0,cancelable:!0});m.addEventListener(XC,y=>r==null?void 0:r(y),{once:!0}),xR(m,_),_.defaultPrevented?d.current=!1:a.onClose()}};return g.jsx(kM,{...s,ref:h,disabled:n,onClick:Re(e.onClick,p),onPointerDown:m=>{var _;(_=e.onPointerDown)==null||_.call(e,m),d.current=!0},onPointerUp:Re(e.onPointerUp,m=>{var _;d.current||(_=m.currentTarget)==null||_.click()}),onKeyDown:Re(e.onKeyDown,m=>{const _=u.searchRef.current!=="";n||_&&m.key===" "||M_.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});wp.displayName=jf;var kM=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,a=$b(jf,n),u=yM(n),h=b.useRef(null),d=ht(t,h),[p,m]=b.useState(!1),[_,y]=b.useState("");return b.useEffect(()=>{const S=h.current;S&&y((S.textContent??"").trim())},[l.children]),g.jsx(Au.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:g.jsx(d9,{asChild:!0,...u,focusable:!r,children:g.jsx(et.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:Re(e.onPointerMove,Du(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Du(S=>a.onItemLeave(S))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})}),T9="MenuCheckboxItem",EM=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(AM,{scope:e.__scopeMenu,checked:n,children:g.jsx(wp,{role:"menuitemcheckbox","aria-checked":zf(n)?"mixed":n,...s,ref:t,"data-state":Kb(n),onSelect:Re(s.onSelect,()=>r==null?void 0:r(zf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});EM.displayName=T9;var RM="MenuRadioGroup",[M9,N9]=al(RM,{value:void 0,onValueChange:()=>{}}),TM=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=oi(r);return g.jsx(M9,{scope:e.__scopeMenu,value:n,onValueChange:l,children:g.jsx(Vb,{...s,ref:t})})});TM.displayName=RM;var MM="MenuRadioItem",NM=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=N9(MM,e.__scopeMenu),l=n===s.value;return g.jsx(AM,{scope:e.__scopeMenu,checked:l,children:g.jsx(wp,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":Kb(l),onSelect:Re(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});NM.displayName=MM;var qb="MenuItemIndicator",[AM,A9]=al(qb,{checked:!1}),DM=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=A9(qb,n);return g.jsx(Kr,{present:r||zf(l.checked)||l.checked===!0,children:g.jsx(et.span,{...s,ref:t,"data-state":Kb(l.checked)})})});DM.displayName=qb;var D9="MenuSeparator",OM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});OM.displayName=D9;var O9="MenuArrow",LM=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sp(n);return g.jsx(pp,{...s,...r,ref:t})});LM.displayName=O9;var L9="MenuSub",[qee,jM]=al(L9),nu="MenuSubTrigger",zM=b.forwardRef((e,t)=>{const n=cl(nu,e.__scopeMenu),r=Qu(nu,e.__scopeMenu),s=jM(nu,e.__scopeMenu),l=$b(nu,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=l,d={__scopeMenu:e.__scopeMenu},p=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>p,[p]),b.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),h(null)}},[u,h]),g.jsx(Fb,{asChild:!0,...d,children:g.jsx(kM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":IM(n.open),...e,ref:ib(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:Re(e.onPointerMove,Du(m=>{l.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Re(e.onPointerLeave,Du(m=>{var y,S;p();const _=(y=n.content)==null?void 0:y.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"];l.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(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(m),m.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,m=>{var y;const _=l.searchRef.current!=="";e.disabled||_&&m.key===" "||p9[r.dir].includes(m.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),m.preventDefault())})})})});zM.displayName=nu;var PM="MenuSubContent",BM=b.forwardRef((e,t)=>{const n=xM(Wr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=cl(Wr,e.__scopeMenu),a=Qu(Wr,e.__scopeMenu),u=jM(PM,e.__scopeMenu),h=b.useRef(null),d=ht(t,h);return g.jsx(Au.Provider,{scope:e.__scopeMenu,children:g.jsx(Kr,{present:r||l.open,children:g.jsx(Au.Slot,{scope:e.__scopeMenu,children:g.jsx(Wb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;a.isUsingKeyboardRef.current&&((m=h.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Re(e.onFocusOutside,p=>{p.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{var y;const m=p.currentTarget.contains(p.target),_=m9[a.dir].includes(p.key);m&&_&&(l.onOpenChange(!1),(y=u.trigger)==null||y.focus(),p.preventDefault())})})})})})});BM.displayName=PM;function IM(e){return e?"open":"closed"}function zf(e){return e==="indeterminate"}function Kb(e){return zf(e)?"indeterminate":e?"checked":"unchecked"}function j9(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function P9(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=z9(e,Math.max(l,0));s.length===1&&(a=a.filter(d=>d!==n));const h=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function B9(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,p=u.y,m=h.x,_=h.y;p>r!=_>r&&n<(m-d)*(r-p)/(_-p)+d&&(s=!s)}return s}function I9(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return B9(n,t)}function Du(e){return t=>t.pointerType==="mouse"?e(t):void 0}var H9=bM,F9=Fb,U9=SM,$9=wM,W9=Vb,V9=CM,q9=wp,K9=EM,G9=TM,Y9=NM,X9=DM,Z9=OM,Q9=LM,J9=zM,eH=BM,Gb="ContextMenu",[tH]=ms(Gb,[_M]),qn=_M(),[nH,HM]=tH(Gb),FM=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:l=!0}=e,[a,u]=b.useState(!1),h=qn(t),d=oi(r),p=b.useCallback(m=>{u(m),d(m)},[d]);return g.jsx(nH,{scope:t,open:a,onOpenChange:p,modal:l,children:g.jsx(H9,{...h,dir:s,open:a,onOpenChange:p,modal:l,children:n})})};FM.displayName=Gb;var UM="ContextMenuTrigger",$M=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,l=HM(UM,n),a=qn(n),u=b.useRef({x:0,y:0}),h=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=b.useRef(0),p=b.useCallback(()=>window.clearTimeout(d.current),[]),m=_=>{u.current={x:_.clientX,y:_.clientY},l.onOpenChange(!0)};return b.useEffect(()=>p,[p]),b.useEffect(()=>void(r&&p()),[r,p]),g.jsxs(g.Fragment,{children:[g.jsx(F9,{...a,virtualRef:h}),g.jsx(et.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Re(e.onContextMenu,_=>{p(),m(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Re(e.onPointerDown,Lh(_=>{p(),d.current=window.setTimeout(()=>m(_),700)})),onPointerMove:r?e.onPointerMove:Re(e.onPointerMove,Lh(p)),onPointerCancel:r?e.onPointerCancel:Re(e.onPointerCancel,Lh(p)),onPointerUp:r?e.onPointerUp:Re(e.onPointerUp,Lh(p))})]})});$M.displayName=UM;var rH="ContextMenuPortal",WM=e=>{const{__scopeContextMenu:t,...n}=e,r=qn(t);return g.jsx(U9,{...r,...n})};WM.displayName=rH;var VM="ContextMenuContent",qM=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=HM(VM,n),l=qn(n),a=b.useRef(!1);return g.jsx($9,{...l,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&a.current&&u.preventDefault(),a.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(a.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)"}})});qM.displayName=VM;var iH="ContextMenuGroup",sH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(W9,{...s,...r,ref:t})});sH.displayName=iH;var oH="ContextMenuLabel",lH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(V9,{...s,...r,ref:t})});lH.displayName=oH;var aH="ContextMenuItem",KM=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(q9,{...s,...r,ref:t})});KM.displayName=aH;var cH="ContextMenuCheckboxItem",uH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(K9,{...s,...r,ref:t})});uH.displayName=cH;var dH="ContextMenuRadioGroup",hH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(G9,{...s,...r,ref:t})});hH.displayName=dH;var fH="ContextMenuRadioItem",pH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Y9,{...s,...r,ref:t})});pH.displayName=fH;var mH="ContextMenuItemIndicator",gH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(X9,{...s,...r,ref:t})});gH.displayName=mH;var vH="ContextMenuSeparator",_H=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Z9,{...s,...r,ref:t})});_H.displayName=vH;var yH="ContextMenuArrow",bH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(Q9,{...s,...r,ref:t})});bH.displayName=yH;var xH="ContextMenuSubTrigger",SH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(J9,{...s,...r,ref:t})});SH.displayName=xH;var wH="ContextMenuSubContent",CH=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=qn(n);return g.jsx(eH,{...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)"}})});CH.displayName=wH;function Lh(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var kH=FM,EH=$M,RH=WM,GM=qM,YM=KM;const TH=kH,MH=EH,XM=b.forwardRef(({className:e,...t},n)=>g.jsx(RH,{children:g.jsx(GM,{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})}));XM.displayName=GM.displayName;const ZM=b.forwardRef(({className:e,...t},n)=>g.jsx(YM,{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}));ZM.displayName=YM.displayName;function NH({onRemove:e,children:t}){return g.jsxs(TH,{children:[g.jsx(MH,{asChild:!0,children:t}),g.jsx(XM,{children:g.jsxs(ZM,{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:[g.jsx(rB,{className:"h-4 w-4"}),g.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function AH({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:d,startingLocalPath:p}){const{groupKey:m,localPath:_,chats:y}=e,S=n.has(m),w=S?y:y.slice(0,a),C=y.length>a,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:M,transform:L,transition:D,isDragging:j}=Z7({id:m}),F={transform:Mu.Translate.toString(L),transition:D},Y=g.jsxs("div",{ref:M,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:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:t.has(m)?g.jsx(ds,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):g.jsxs(g.Fragment,{children:[g.jsx(QR,{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"}),g.jsx(ds,{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"})]})}),g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:VT(_)})}),g.jsx(Ru,{side:"right",sideOffset:4,children:_})]})]}),u&&g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.jsx(rt,{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",(!d||p===_)&&"opacity-50 cursor-not-allowed"),disabled:!d||p===_,onClick:z=>{z.stopPropagation(),u(_)},children:p===_?g.jsx(Mi,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):g.jsx(hb,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),g.jsx(Ru,{side:"right",sideOffset:4,children:d?"New chat":`Start ${$n} to connect`})]})]});return g.jsxs("div",{ref:R,style:F,className:ye("group/section",j&&"opacity-50 shadow-lg z-50 relative"),...k,children:[h?g.jsx(NH,{onRemove:()=>h(m),children:Y}):Y,!t.has(m)&&(w.length>0||C)&&g.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(l),C&&g.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 (${y.length-a})`})]})]})}function DH({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,onReorderGroups:d,isConnected:p,startingLocalPath:m}){const _=R8(BC(Pb,{activationConstraint:{distance:8}}),BC(jb)),y=b.useMemo(()=>e.map(k=>k.groupKey),[e]),S=b.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&&d){const M=y.indexOf(T.id),L=y.indexOf(R.id);if(M!==-1&&L!==-1){const D=Bb(y,M,L);d(D)}}if(S.current){const M=S.current;S.current=null,requestAnimationFrame(()=>r(M))}}return g.jsx(A7,{sensors:_,collisionDetection:D8,onDragStart:w,onDragEnd:C,children:g.jsx(W7,{items:y,strategy:U7,children:e.map(k=>g.jsx(AH,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:p,startingLocalPath:m},k.groupKey))})})}const ZC=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const _=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,_))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,s,u);return u},OH=(e=>e?ZC(e):ZC),LH=e=>e;function jH(e,t=LH){const n=Et.useSyncExternalStore(e.subscribe,Et.useCallback(()=>t(e.getState()),[e,t]),Et.useCallback(()=>t(e.getInitialState()),[e,t]));return Et.useDebugValue(n),n}const zH=e=>{const t=OH(e),n=r=>jH(t,r);return Object.assign(n,t),n},Ha=(e=>zH);function PH(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const a=h=>h===null?null:JSON.parse(h,void 0),u=(l=n.getItem(s))!=null?l:null;return u instanceof Promise?u.then(a):a(u)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const N_=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return N_(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return N_(r)(n)}}}},BH=(e,t)=>(n,r,s)=>{let l={storage:PH(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},a=!1,u=0;const h=new Set,d=new Set;let p=l.storage;if(!p)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...C)},r,s);const m=()=>{const C=l.partialize({...r()});return p.setItem(l.name,{state:C,version:l.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),m());const y=e((...C)=>(n(...C),m()),r,s);s.getInitialState=()=>y;let S;const w=()=>{var C,k;if(!p)return;const T=++u;a=!1,h.forEach(M=>{var L;return M((L=r())!=null?L:y)});const R=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(C=r())!=null?C:y))||void 0;return N_(p.getItem.bind(p))(l.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==l.version){if(l.migrate){const L=l.migrate(M.state,M.version);return L instanceof Promise?L.then(D=>[!0,D]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var L;if(T!==u)return;const[D,j]=M;if(S=l.merge(j,(L=r())!=null?L:y),n(S,!0),D)return m()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),a=!0,d.forEach(M=>M(S)))}).catch(M=>{T===u&&(R==null||R(void 0,M))})};return s.persist={setOptions:C=>{l={...l,...C},C.storage&&(p=C.storage)},clearStorage:()=>{p==null||p.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>w(),hasHydrated:()=>a,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},l.skipHydration||w(),S||y},Fa=BH,QC=Ha()(Fa(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function IH({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:l,showMobileOpenButton:a,onOpen:u,onClose:h,onCollapse:d,onExpand:p,onCreateChat:m,onDeleteChat:_,onRemoveProject:y,updateSnapshot:S,onInstallUpdate:w}){const C=ui(),k=Aa(),T=b.useRef(null),[R,M]=b.useState(new Set),[L,D]=b.useState(new Set),[j,F]=b.useState(()=>Date.now()),Y=10,z=QC(ie=>ie.order),H=QC(ie=>ie.setOrder),P=b.useMemo(()=>{if(z.length===0)return e.projectGroups;const ie=new Map(e.projectGroups.map(Se=>[Se.groupKey,Se])),ce=z.filter(Se=>ie.has(Se)).map(Se=>ie.get(Se)),we=new Set(z);for(const Se of e.projectGroups)we.has(Se.groupKey)||ce.push(Se);return ce},[e.projectGroups,z]),U=b.useCallback(ie=>H(ie),[H]),V=b.useMemo(()=>new Map(e.projectGroups.map(ie=>[ie.localPath,ie.groupKey])),[e.projectGroups]),$=b.useMemo(()=>e.projectGroups.reduce((ie,ce)=>ie+ce.chats.length,0),[e.projectGroups]),B=b.useCallback(ie=>{M(ce=>{const we=new Set(ce);return we.has(ie)?we.delete(ie):we.add(ie),we})},[]),K=b.useCallback(ie=>{D(ce=>{const we=new Set(ce);return we.has(ie)?we.delete(ie):we.add(ie),we})},[]),W=b.useCallback(ie=>g.jsx(h8,{chat:ie,activeChatId:t,nowMs:j,onSelectChat:ce=>{k(`/chat/${ce}`),h()},onDeleteChat:()=>_(ie)},ie._id),[t,k,j,h,_]);b.useEffect(()=>{const ie=window.setInterval(()=>{F(Date.now())},3e4);return()=>window.clearInterval(ie)},[]),b.useEffect(()=>{!t||!T.current||requestAnimationFrame(()=>{const ie=T.current,ce=ie==null?void 0:ie.querySelector(`[data-chat-id="${t}"]`);if(!ce||!ie)return;const we=ce.getBoundingClientRect(),Se=ie.getBoundingClientRect();if(we.top<Se.top+38){const ke=we.top-Se.top+ie.scrollTop;ie.scrollTo({top:ke-38,behavior:"smooth"})}else if(we.bottom>Se.bottom){const ke=we.top+we.height/2-Se.top+ie.scrollTop,Be=ie.clientHeight/2;ie.scrollTo({top:ke-Be,behavior:"smooth"})}})},[t,$]);const Z=$>0,N=C.pathname==="/",I=C.pathname.startsWith("/settings"),q=N||I,A=n==="connecting"||!r,ae=A?"Connecting":n==="connected"?"Connected":"Disconnected",fe=n==="connected"?"bg-emerald-500":"bg-amber-500",oe=(S==null?void 0:S.updateAvailable)===!0,J=S?S.latestVersion===`${S.currentVersion}-dev`:!1,ge=(S==null?void 0:S.status)==="updating"||(S==null?void 0:S.status)==="restart_pending";return g.jsxs(g.Fragment,{children:[!s&&a&&g.jsx(rt,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:g.jsx(cb,{className:"h-5 w-5"})}),l&&q&&g.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:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(fu,{className:"size-6 text-logo"}),g.jsx(rt,{variant:"ghost",size:"icon",onClick:p,title:"Expand sidebar",children:g.jsx(g_,{className:"h-5 w-5"})})]})}),g.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",l&&"md:hidden"),children:[g.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:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{type:"button",onClick:d,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:[g.jsx(fu,{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"}),g.jsx(g_,{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"})]}),g.jsx(fu,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),g.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:$n})]}),g.jsxs("div",{className:"flex items-center",children:[J?g.jsx("span",{className:"mr-1 inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-bold tracking-wider text-muted-foreground",title:"Development build",children:"DEV"}):oe?g.jsxs(rt,{variant:"outline",size:"sm",className:"rounded-full !h-auto mr-1 py-0.5 px-2 bg-logo/20 hover:bg-logo text-logo border-logo/20 hover:text-foreground hover:border-logo/20 text-[11px] font-bold tracking-wider",onClick:w,disabled:ge,title:S!=null&&S.latestVersion?`Update to ${S.latestVersion}`:"Update Kanna",children:[ge?g.jsx(Mi,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>{k("/"),h()},className:"size-10 rounded-lg",title:"New project",children:g.jsx(db,{className:"size-4"})}),g.jsx(rt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:h,children:g.jsx(La,{className:"h-5 w-5"})})]})]}),g.jsx("div",{ref:T,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:g.jsxs("div",{className:"p-[7px]",children:[!Z&&A?g.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(ie=>g.jsxs("div",{className:"space-y-2 animate-pulse",children:[g.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),g.jsx("div",{className:"space-y-1",children:[0,1,2].map(ce=>g.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[g.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),g.jsx("div",{className:ye("h-3.5 rounded bg-muted",ce===0?"w-32":ce===1?"w-40":"w-28")})]},ce))})]},ie))}):null,!Z&&!A&&e.projectGroups.length===0?g.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,g.jsx(DH,{projectGroups:P,onReorderGroups:U,collapsedSections:R,expandedGroups:L,onToggleSection:B,onToggleExpandedGroup:K,renderChatRow:W,chatsPerProject:Y,onNewLocalChat:ie=>{const ce=V.get(ie);ce&&m(ce)},onRemoveProject:y,isConnected:n==="connected"})]})}),g.jsx("div",{className:"border-t border-border p-2",children:g.jsx("button",{type:"button",onClick:()=>{k("/settings/general"),h()},className:ye("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",I?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:g.jsxs("div",{className:"flex items- justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(IP,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:"Settings"})]}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:ae}),A?g.jsx(Mi,{className:"h-2 w-2 animate-spin"}):g.jsx("span",{className:ye("h-2 w-2 rounded-full",fe)})]})]})})})]}),s?g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:h}):null]})}const Pf=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],A_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],Ou={reasoningEffort:"high",contextWindow:"200k"},D_={reasoningEffort:"high",fastMode:!1};function JC(e){return Pf.some(t=>t.id===e)}function ek(e){return A_.some(t=>t.id===e)}const O_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}],vu=[{id:"claude",label:"Claude",defaultModel:"sonnet",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...O_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...O_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Pf]},{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:[]}];function HH(e){const t=vu.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function FH(e){return HH("claude").models.find(t=>t.id===e)}function UH(e){var t;return((t=FH(e))==null?void 0:t.contextWindowOptions)??[]}function QM(e,t){const n=UH(e);return n.length===0?Ou.contextWindow:n.some(r=>r.id===t)?t:Ou.contextWindow}const to={toggleEmbeddedTerminal:["cmd+j","ctrl+`"],toggleRightSidebar:["cmd+b","ctrl+b"],openInFinder:["cmd+alt+f","ctrl+alt+f"],openInEditor:["cmd+shift+o","ctrl+shift+o"],addSplitTerminal:["cmd+/","ctrl+/"]},JM=b.forwardRef(({className:e,...t},n)=>g.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}));JM.displayName="Textarea";function $H(){const[e,t]=b.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return b.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 WH=Ha()(Fa((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:l,...a}=s.drafts;return{drafts:a}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...l}=r.drafts;return{drafts:l}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));function VH(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function qH(e){return e==="claude"||e==="codex"?e:"last_used"}function qo(e){var l,a;const t=(l=e==null?void 0:e.modelOptions)==null?void 0:l.reasoningEffort,n=JC(t)?t:JC(e==null?void 0:e.effort)?e.effort:Ou.reasoningEffort,r=(e==null?void 0:e.model)??"opus",s=QM(r,(a=e==null?void 0:e.modelOptions)==null?void 0:a.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,contextWindow:s},planMode:!!(e!=null&&e.planMode)}}function Ko(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:VH(e==null?void 0:e.model),modelOptions:{reasoningEffort:ek(t)?t:ek(e==null?void 0:e.effort)?e.effort:D_.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:D_.fastMode},planMode:!!(e!=null&&e.planMode)}}function KH(){return{claude:{model:"opus",modelOptions:{...Ou},planMode:!1},codex:{model:"gpt-5.4",modelOptions:{...D_},planMode:!1}}}function GH(e){return{claude:qo(e==null?void 0:e.claude),codex:Ko(e==null?void 0:e.codex)}}function tk(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function L_(e,t){if(e==="claude"){const r=t.claude;return{provider:"claude",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}const n=t.codex;return{provider:"codex",model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function YH(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=qo(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Ko(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=qo(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Ko(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return L_("claude",t)}function XH(e){const t=GH(e==null?void 0:e.providerDefaults);return{defaultProvider:qH(e==null?void 0:e.defaultProvider),providerDefaults:t,composerState:YH(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const ls=Ha()(Fa(e=>({defaultProvider:"last_used",providerDefaults:KH(),composerState:{provider:"claude",model:"opus",modelOptions:{...Ou},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?qo({...r.providerDefaults.claude,model:n}):Ko({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?qo({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):Ko({...r.providerDefaults.codex,modelOptions:{...r.providerDefaults.codex.modelOptions,...n}})}})),setProviderDefaultPlanMode:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:{...r.providerDefaults[t],planMode:n}}})),setComposerProvider:t=>e(n=>({composerState:{...n.composerState,provider:t}})),setComposerModel:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:t,modelOptions:qo({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:Ko({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}),setComposerModelOptions:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:n.composerState.model,modelOptions:qo({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Ko({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}),setComposerPlanMode:t=>e(n=>({composerState:{...n.composerState,planMode:t}})),resetComposerFromProvider:t=>e(n=>({composerState:L_(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return tk("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=L_(t.defaultProvider,t.providerDefaults);return tk("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:3,migrate:e=>XH(e)}));var Cp="Popover",[eN]=ms(Cp,[fo]),Ju=fo(),[ZH,po]=eN(Cp),tN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!1}=e,u=Ju(t),h=b.useRef(null),[d,p]=b.useState(!1),[m,_]=xa({prop:r,defaultProp:s??!1,onChange:l,caller:Cp});return g.jsx(hp,{...u,children:g.jsx(ZH,{scope:t,contentId:cs(),triggerRef:h,open:m,onOpenChange:_,onOpenToggle:b.useCallback(()=>_(y=>!y),[_]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>p(!0),[]),onCustomAnchorRemove:b.useCallback(()=>p(!1),[]),modal:a,children:n})})};tN.displayName=Cp;var nN="PopoverAnchor",QH=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=po(nN,n),l=Ju(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return b.useEffect(()=>(a(),()=>u()),[a,u]),g.jsx(Vu,{...l,...r,ref:t})});QH.displayName=nN;var rN="PopoverTrigger",iN=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=po(rN,n),l=Ju(n),a=ht(t,s.triggerRef),u=g.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":cN(s.open),...r,ref:a,onClick:Re(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:g.jsx(Vu,{asChild:!0,...l,children:u})});iN.displayName=rN;var Yb="PopoverPortal",[JH,eF]=eN(Yb,{forceMount:void 0}),sN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=po(Yb,t);return g.jsx(JH,{scope:t,forceMount:n,children:g.jsx(Kr,{present:n||l.open,children:g.jsx(Oa,{asChild:!0,container:s,children:r})})})};sN.displayName=Yb;var Ca="PopoverContent",oN=b.forwardRef((e,t)=>{const n=eF(Ca,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=po(Ca,e.__scopePopover);return g.jsx(Kr,{present:r||l.open,children:l.modal?g.jsx(nF,{...s,ref:t}):g.jsx(rF,{...s,ref:t})})});oN.displayName=Ca;var tF=Xo("PopoverContent.RemoveScroll"),nF=b.forwardRef((e,t)=>{const n=po(Ca,e.__scopePopover),r=b.useRef(null),s=ht(t,r),l=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return sp(a)},[]),g.jsx($u,{as:tF,allowPinchZoom:!0,children:g.jsx(lN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),l.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),rF=b.forwardRef((e,t)=>{const n=po(Ca,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return g.jsx(lN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),lN=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,...m}=e,_=po(Ca,n),y=Ju(n);return rp(),g.jsx(Uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:g.jsx(Da,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),children:g.jsx(fp,{"data-state":cN(_.open),role:"dialog",id:_.contentId,...y,...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)"}})})})}),aN="PopoverClose",iF=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=po(aN,n);return g.jsx(et.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});iF.displayName=aN;var sF="PopoverArrow",oF=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ju(n);return g.jsx(pp,{...s,...r,ref:t})});oF.displayName=sF;function cN(e){return e?"open":"closed"}var lF=tN,aF=iN,cF=sN,uN=oN;const uF=lF,dF=aF,dN=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>g.jsx(cF,{children:g.jsx(uN,{ref:s,align:t,sideOffset:n,[Cu]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event(wf)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},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})}));dN.displayName=uN.displayName;function hF({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:g.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 fF({className:e,...t}){return g.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:g.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 nk={claude:hF,codex:fF};function ns({onClick:e,selected:t,icon:n,label:r,description:s,disabled:l}){return g.jsxs("button",{onClick:e,disabled:l,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",l&&"opacity-40 cursor-not-allowed"),children:[n,g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:r}),s?g.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function ta({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,l]=b.useState(!1);return n?g.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 [&>span]:whitespace-nowrap",t),children:e}):g.jsxs(uF,{open:s,onOpenChange:l,children:[g.jsx(dF,{asChild:!0,children:g.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 [&>span]:whitespace-nowrap","hover:bg-muted/50",t),children:e})}),g.jsx(dN,{align:"center",className:"w-64 p-1",children:g.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>l(!1)):r})})]})}function j_({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,providerLocked:r=!1,model:s,modelOptions:l,onProviderChange:a,onModelChange:u,onModelOptionChange:h,planMode:d=!1,onPlanModeChange:p,includePlanMode:m=!0,className:_}){var D,j,F,Y,z;const y=e.find(H=>H.id===t)??e[0],S=nk[t],w=vC,C=m&&(y==null?void 0:y.supportsPlanMode)&&p,k=t==="claude"?l:null,T=t==="codex"?l:null,R=((D=y.models.find(H=>H.id===s))==null?void 0:D.contextWindowOptions)??[],M=(k==null?void 0:k.contextWindow)??O_[0].id,L=M==="1m"?xC:SC;return g.jsxs("div",{className:ye("flex md:justify-center items-center gap-0.5",_),children:[n?g.jsx(ta,{disabled:r||!a,trigger:g.jsxs(g.Fragment,{children:[g.jsx(S,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:(y==null?void 0:y.label)??t})]}),children:H=>e.map(P=>{const U=nk[P.id];return g.jsx(ns,{onClick:()=>{a==null||a(P.id),H()},selected:t===P.id,icon:g.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id)})}):null,g.jsx(ta,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(w,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((j=y.models.find(H=>H.id===s))==null?void 0:j.label)??s})]}),children:H=>y.models.map(P=>{const U=vC;return g.jsx(ns,{onClick:()=>{u(t,P.id),H()},selected:s===P.id,icon:g.jsx(U,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id)})}),g.jsx(ta,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(pv,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:t==="claude"?((F=Pf.find(H=>H.id===l.reasoningEffort))==null?void 0:F.label)??l.reasoningEffort:((Y=A_.find(H=>H.id===l.reasoningEffort))==null?void 0:Y.label)??l.reasoningEffort})]}),children:H=>t==="claude"?Pf.map(P=>g.jsx(ns,{onClick:()=>{h({type:"claudeReasoningEffort",effort:P.id}),H()},selected:l.reasoningEffort===P.id,icon:g.jsx(pv,{className:"h-4 w-4 text-muted-foreground"}),label:P.label,disabled:P.id==="max"&&s!=="opus"},P.id)):A_.map(P=>g.jsx(ns,{onClick:()=>{h({type:"codexReasoningEffort",effort:P.id}),H()},selected:l.reasoningEffort===P.id,icon:g.jsx(pv,{className:"h-4 w-4 text-muted-foreground"}),label:P.label},P.id))}),t==="claude"&&R.length>1?g.jsx(ta,{trigger:g.jsxs(g.Fragment,{children:[g.jsx(L,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:((z=R.find(H=>H.id===M))==null?void 0:z.label)??M})]}),children:H=>R.map(P=>g.jsx(ns,{onClick:()=>{h({type:"contextWindow",contextWindow:P.id}),H()},selected:M===P.id,icon:P.id==="1m"?g.jsx(xC,{className:"h-4 w-4 text-muted-foreground"}):g.jsx(SC,{className:"h-4 w-4 text-muted-foreground"}),label:P.label,description:P.id==="1m"?"Expanded context window":"Standard context window"},P.id))}):null,t==="codex"?g.jsx(ta,{trigger:g.jsxs(g.Fragment,{children:[T!=null&&T.fastMode?g.jsx(Mh,{className:"h-3.5 w-3.5"}):g.jsx(Mh,{className:"h-3.5 w-3.5 -scale-x-100"}),g.jsx("span",{children:T!=null&&T.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:T!=null&&T.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:H=>g.jsxs(g.Fragment,{children:[g.jsx(ns,{onClick:()=>{h({type:"fastMode",fastMode:!1}),H()},selected:!(T!=null&&T.fastMode),icon:g.jsx(Mh,{className:"h-4 w-4 text-muted-foreground -scale-x-100"}),label:"Standard"}),g.jsx(ns,{onClick:()=>{h({type:"fastMode",fastMode:!0}),H()},selected:!!(T!=null&&T.fastMode),icon:g.jsx(Mh,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,C?g.jsx(ta,{trigger:g.jsxs(g.Fragment,{children:[d?g.jsx(Sf,{className:"h-3.5 w-3.5"}):g.jsx(yC,{className:"h-3.5 w-3.5"}),g.jsx("span",{children:d?"Plan Mode":"Full Access"})]}),triggerClassName:d?"text-blue-400 dark:text-blue-300":void 0,children:H=>g.jsxs(g.Fragment,{children:[g.jsx(ns,{onClick:()=>{p(!1),H()},selected:!d,icon:g.jsx(yC,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),g.jsx(ns,{onClick:()=>{p(!0),H()},selected:d,icon:g.jsx(Sf,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})}function rk(e,t){return e.provider!=="claude"?{...e,model:t}:{...e,model:t,modelOptions:{...e.modelOptions,contextWindow:QM(t,e.modelOptions.contextWindow)}}}function ik(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function ru(e,t,n){return e==="claude"?t.provider==="claude"?{provider:"claude",model:t.model,modelOptions:{...t.modelOptions},planMode:t.planMode}:{provider:"claude",model:n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:n.claude.planMode}:t.provider==="codex"?{provider:"codex",model:t.model,modelOptions:{...t.modelOptions},planMode:t.planMode}:{provider:"codex",model:n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:n.codex.planMode}}function pF(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??ru(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const mF=b.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:l,activeProvider:a,availableProviders:u},h){const{getDraft:d,setDraft:p,clearDraft:m}=WH(),{composerState:_,providerDefaults:y,setComposerModel:S,setComposerModelOptions:w,setComposerPlanMode:C,resetComposerFromProvider:k}=ls(),[T,R]=b.useState(()=>l?d(l):""),M=b.useRef(null),L=$H(),[D,j]=b.useState(()=>a?ru(a,_,y):null),F=a!==null,Y=F?D??ru(a,_,y):_,z=F?a:_.provider,H=u.find(q=>q.id===z)??u[0],P=(H==null?void 0:H.supportsPlanMode)??!1,U=b.useCallback(()=>{const q=M.current;if(q){if(q.value.length===0){q.style.height="";return}q.style.height="auto",q.style.height=`${q.scrollHeight}px`}},[]),V=b.useCallback(q=>{if(M.current=q,!!h){if(typeof h=="function"){h(q);return}h.current=q}},[h]);b.useLayoutEffect(()=>{U()},[T,U]),b.useEffect(()=>(window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)),[U]),b.useEffect(()=>{var q;(q=M.current)==null||q.focus()},[l]),b.useEffect(()=>{if(a===null){j(null);return}j(ru(a,_,y))},[a,l]),b.useEffect(()=>{ik("resolved provider state",{chatId:l??null,activeProvider:a,composerProvider:_.provider,composerModel:_.model,effectiveProvider:Y.provider,effectiveModel:Y.model,selectedProvider:z,providerLocked:F,lockedComposerProvider:(D==null?void 0:D.provider)??null})},[a,l,_.model,_.provider,D==null?void 0:D.provider,F,Y.model,Y.provider,z]);function $(q,A){if(F){j(ae=>{const fe=ae??ru(z,_,y);return q(fe)});return}A()}function B(q){$(A=>({...A,modelOptions:{...A.modelOptions,reasoningEffort:q}}),()=>w(z==="claude"?{reasoningEffort:q}:{reasoningEffort:q}))}function K(q){$(A=>A.provider!=="claude"?A:rk({...A,modelOptions:{...A.modelOptions,contextWindow:q}},A.model),()=>w({contextWindow:q}))}function W(q){const A=pF({providerLocked:F,planMode:q,selectedProvider:z,composerState:_,providerDefaults:y,lockedComposerState:D});A.lockedComposerState!==D&&j(A.lockedComposerState),A.composerPlanMode!==_.planMode&&C(A.composerPlanMode)}function Z(){W(!Y.planMode)}async function N(){if(!T.trim())return;const q=T;let A;Y.provider==="claude"?A={claude:{...Y.modelOptions}}:A={codex:{...Y.modelOptions}};const ae={provider:z,model:Y.model,modelOptions:A,planMode:P?Y.planMode:!1};ik("submit settings",{chatId:l??null,activeProvider:a,composerProvider:Y.provider,submitOptions:ae}),R(""),l&&m(l),M.current&&(M.current.style.height="auto");try{await t(q,ae)}catch(fe){console.error("[ChatInput] Submit failed:",fe),R(q),l&&p(l,q)}}function I(q){if(q.key==="Tab"&&!q.shiftKey){q.preventDefault(),aB(M.current,document);return}if(q.key==="Tab"&&q.shiftKey&&P){q.preventDefault(),Z();return}if(q.key==="Escape"&&s){q.preventDefault(),n==null||n();return}const A="ontouchstart"in window||navigator.maxTouchPoints>0;q.key==="Enter"&&!q.shiftKey&&!s&&!A&&(q.preventDefault(),N())}return g.jsxs("div",{children:[g.jsx("div",{className:ye("px-3 pt-0",L&&"px-5"),children:g.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:[g.jsx(JM,{ref:V,placeholder:"Build something...",value:T,autoFocus:!0,[mb]:"",rows:1,onChange:q=>{R(q.target.value),l&&p(l,q.target.value),U()},onKeyDown:I,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"}),g.jsx(rt,{type:"button",onPointerDown:q=>{q.preventDefault(),s?n==null||n():!r&&T.trim()&&N()},disabled:!s&&(r||!T.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?g.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):g.jsx(S6,{className:"h-5 w-5 md:h-6 md:w-6"})})]})}),g.jsxs("div",{className:ye("overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden py-3 flex flex-row",L&&"p-5 pt-3"),children:[g.jsx("div",{className:"min-w-3"}),g.jsx(j_,{availableProviders:u,selectedProvider:z,providerLocked:F,model:Y.model,modelOptions:Y.modelOptions,onProviderChange:q=>{F||k(q)},onModelChange:(q,A)=>{$(ae=>rk(ae,A),()=>S(A))},onModelOptionChange:q=>{switch(q.type){case"claudeReasoningEffort":B(q.effort);break;case"codexReasoningEffort":B(q.effort);break;case"contextWindow":K(q.contextWindow);break;case"fastMode":$(A=>A.provider==="claude"?A:{...A,modelOptions:{...A.modelOptions,fastMode:q.fastMode}},()=>w({fastMode:q.fastMode}));break}},planMode:Y.planMode,onPlanModeChange:W,includePlanMode:P,className:"max-w-[840px] mx-auto"}),g.jsx("div",{className:"min-w-3"})]})]})}),gF=b.memo(mF),hN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("bg-card text-card-foreground",e),...t}));hN.displayName="Card";const fN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-2",e),...t}));fN.displayName="CardHeader";const vF=b.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));vF.displayName="CardTitle";const _F=b.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));_F.displayName="CardDescription";const pN=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));pN.displayName="CardContent";const yF=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));yF.displayName="CardFooter";function bF({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:a,rightSidebarVisible:u=!1,onToggleRightSidebar:h,onOpenExternal:d,editorLabel:p="Editor",finderShortcut:m,editorShortcut:_,terminalShortcut:y,rightSidebarShortcut:S}){return g.jsx(fN,{className:ye("absolute top-0 left-0 right-0 z-10 md:pt-3 px-3 border-border/0 md:pb-0 flex items-center justify-center"," bg-gradient-to-b from-background/70"),children:g.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[g.jsxs("div",{className:`flex items-center gap-1 flex-shrink-0 border border-border rounded-full ${e?"px-1.5":""} p-1 backdrop-blur-lg`,children:[g.jsx(rt,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:g.jsx(cb,{className:"size-4.5"})}),e&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"flex items-center justify-center w-[36px] h-[36px]",children:g.jsx(fu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),g.jsx(rt,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:g.jsx(g_,{className:"size-4.5"})})]}),g.jsx(rt,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:g.jsx(hb,{className:"size-4.5"})})]}),g.jsx("div",{className:"flex-1 min-w-0"}),g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border border-border rounded-full px-1.5 py-1 backdrop-blur-lg",children:[s&&(d||a)&&g.jsxs(g.Fragment,{children:[d?g.jsxs(eu,{children:[g.jsx(tu,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>d("open_finder"),title:"Open in Finder",className:"border border-border/0",children:g.jsx(QR,{className:"h-4.5 w-4.5"})})}),g.jsx(ua,{side:"bottom",shortcut:m})]}):null,a?g.jsxs(eu,{children:[g.jsx(tu,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:a,className:ye("border border-border/0",l&&"text-white"),children:g.jsx(fb,{className:"h-4.5 w-4.5"})})}),g.jsx(ua,{side:"bottom",shortcut:y})]}):null,d?g.jsxs(eu,{children:[g.jsx(tu,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:()=>d("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:g.jsx(ZR,{className:"h-4.5 w-4.5"})})}),g.jsx(ua,{side:"bottom",shortcut:_})]}):null]}),h?g.jsxs(eu,{children:[g.jsx(tu,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon",onClick:h,className:ye("border border-border/0",u&&"text-white"),children:g.jsx(NP,{className:"h-4.5 w-4.5"})})}),g.jsx(ua,{side:"bottom",shortcut:S})]}):null]})]})})}function xF({onClose:e}){return g.jsx("div",{className:"h-full min-h-0 border-l border-border bg-background md:min-w-[300px]",children:g.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[g.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[g.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),g.jsx("button",{type:"button","aria-label":"Close right sidebar",onClick:e,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:g.jsx(La,{className:"h-4 w-4"})})]}),g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:g.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function SF(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function wF(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function CF(e){return e/100*window.innerHeight}function kF(e){return e/100*window.innerWidth}function EF(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 iu({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,l]=EF(n);switch(l){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=wF(t,s);break}case"em":{r=SF(t,s);break}case"vh":{r=CF(s);break}case"vw":{r=kF(s);break}}return r}function or(e){return parseFloat(e.toFixed(3))}function ka({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 z_(e){const{panels:t}=e,n=ka({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:l}=r;let a=0;if(l.collapsedSize!==void 0){const p=iu({groupSize:n,panelElement:s,styleProp:l.collapsedSize});a=or(p/n*100)}let u;if(l.defaultSize!==void 0){const p=iu({groupSize:n,panelElement:s,styleProp:l.defaultSize});u=or(p/n*100)}let h=0;if(l.minSize!==void 0){const p=iu({groupSize:n,panelElement:s,styleProp:l.minSize});h=or(p/n*100)}let d=100;if(l.maxSize!==void 0){const p=iu({groupSize:n,panelElement:s,styleProp:l.maxSize});d=or(p/n*100)}return{groupResizeBehavior:l.groupResizeBehavior,collapsedSize:a,collapsible:l.collapsible===!0,defaultSize:u,disabled:l.disabled,minSize:h,maxSize:d,panelId:r.id}})}function yt(e,t="Assertion error"){if(!e)throw Error(t)}function P_(e,t){return Array.from(t).sort(e==="horizontal"?RF:TF)}function RF(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function TF(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function mN(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function gN(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 MF({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,l=Number.MAX_VALUE;for(const a of t){const{x:u,y:h}=gN(r,a),d=e==="horizontal"?u:h;d<l&&(l=d,s=a)}return yt(s,"No rect found"),s}let jh;function NF(){return jh===void 0&&(typeof matchMedia=="function"?jh=!!matchMedia("(pointer:coarse)").matches:jh=!1),jh}function vN(e){const{element:t,orientation:n,panels:r,separators:s}=e,l=P_(n,Array.from(t.children).filter(mN).map(S=>({element:S}))).map(({element:S})=>S),a=[];let u=!1,h=!1,d=-1,p=-1,m=0,_,y=[];{let S=-1;for(const w of l)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(m++,d===-1&&(d=S),p=S))}if(m>1){let S=-1;for(const w of l)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(h){const M=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),L=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(y.length){case 0:{R=[M,L];break}case 1:{const D=y[0],j=MF({orientation:n,rects:[k,T],targetRect:D.element.getBoundingClientRect()});R=[D,j===k?L:M];break}default:{R=y;break}}}else y.length?R=y: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 M of R){let L="width"in M?M:M.element.getBoundingClientRect();const D=NF()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<D){const F=D-L.width;L=new DOMRect(L.x-F/2,L.y,L.width+F,L.height)}if(L.height<D){const F=D-L.height;L=new DOMRect(L.x,L.y-F/2,L.width,L.height+F)}const j=S<=d||S>p;!u&&!j&&a.push({group:e,groupSize:ka({group:e}),panels:[_,C],separator:"width"in M?void 0:M,rect:L}),u=!1}}h=!1,_=C,y=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?y.push(C):(_=void 0,y=[])}else h=!0}return a}var no,DE;let _N=(DE=class{constructor(){Mw(this,no,{})}addListener(t,n){const r=Pc(this,no)[t];return r===void 0?Pc(this,no)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Pc(this,no)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,l=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const h=a[u];try{h.call(null,n)}catch(d){l===null&&(s=!0,l=d)}}if(s)throw l}}removeAllListeners(){Nw(this,no,{})}removeListener(t,n){const r=Pc(this,no)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},no=new WeakMap,DE),Ci=new Map;const yN=new _N;function AF(e){Ci=new Map(Ci),Ci.delete(e)}function sk(e,t){for(const[n]of Ci)if(n.id===e)return n}function so(e,t){for(const[n,r]of Ci)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ul(){return Ci}function Xb(e,t){return yN.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function ps(e,t){const n=Ci.get(e);Ci=new Map(Ci),Ci.set(e,t),yN.emit("groupChange",{group:e,prev:n,next:t})}function DF(e,t,n){let r,s={x:1/0,y:1/0};for(const l of t){const a=gN(n,l.rect);switch(e){case"horizontal":{a.x<=s.x&&(r=l,s=a);break}case"vertical":{a.y<=s.y&&(r=l,s=a);break}}}return r?{distance:s,hitRegion:r}:void 0}function OF(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function LF(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:ak(e),b:ak(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();yt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:lk(ok(n.a)),b:lk(ok(n.b))};if(s.a===s.b){const l=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=l.length;for(;u--;){const h=l[u];if(h===a.a)return 1;if(h===a.b)return-1}}return Math.sign(s.a-s.b)}const jF=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function zF(e){const t=getComputedStyle(bN(e)??e).display;return t==="flex"||t==="inline-flex"}function PF(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||zF(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"||jF.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function ok(e){let t=e.length;for(;t--;){const n=e[t];if(yt(n,"Missing node"),PF(n))return n}return null}function lk(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ak(e){const t=[];for(;e;)t.push(e),e=bN(e);return t}function bN(e){const{parentNode:t}=e;return OF(t)?t.host:t}function BF(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 IF({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!mN(n)||n.contains(e)||e.contains(n))return!0;if(LF(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(BF(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Zb(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const l=vN(s),a=DF(s.orientation,l,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&IF({groupElement:s.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function HF(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 Wn(e,t,n=0){return Math.abs(or(e)-or(t))<=n}function bi(e,t){return Wn(e,t)?0:e>t?1:-1}function da({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:l,disabled:a,maxSize:u=100,minSize:h=0}=t;if(a&&!e)return n;if(bi(r,h)<0)if(l){const d=(s+h)/2;bi(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=or(r),r}function Lu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:l}){if(Wn(e,0))return t;const a=l==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[p,m]=r;yt(p!=null,"Invalid first pivot index"),yt(m!=null,"Invalid second pivot index");let _=0;switch(l){case"keyboard":{{const w=e<0?m:p,C=n[w];yt(C,`Panel constraints not found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(yt(M!=null,`Previous layout not found for panel index ${w}`),Wn(M,k)){const L=R-M;bi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const w=e<0?p:m,C=n[w];yt(C,`No panel constraints found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const M=u[w];if(yt(M!=null,`Previous layout not found for panel index ${w}`),Wn(M,R)){const L=M-k;bi(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const w=e<0?m:p,C=n[w];yt(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:M}=C;if(T&&bi(k,M)<0)if(e>0){const L=M-R,D=L/2,j=k+e;bi(j,M)<0&&(e=bi(e,D)<=0?0:L)}else{const L=M-R,D=100-L/2,j=k-e;bi(j,M)<0&&(e=bi(100+e,D)>0?0:-L)}break}}{const w=e<0?1:-1;let C=e<0?m:p,k=0;for(;;){const R=u[C];yt(R!=null,`Previous layout not found for panel index ${C}`);const M=da({overrideDisabledPanels:a,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=M,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];yt(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=da({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:k,size:T});if(!Wn(k,R)&&(_+=k-R,d[w]=R,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(HF(h,d))return s;{const w=e<0?m:p,C=u[w];yt(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=da({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:C,size:k});if(d[w]=T,!Wn(T,k)){let R=k-T,M=e<0?m:p;for(;M>=0&&M<n.length;){const L=d[M];yt(L!=null,`Previous layout not found for panel index ${M}`);const D=L+R,j=da({overrideDisabledPanels:a,panelConstraints:n[M],prevSize:L,size:D});if(Wn(L,j)||(R-=j-L,d[M]=j),Wn(R,0))break;e>0?M--:M++}}}const y=Object.values(d).reduce((w,C)=>C+w,0);if(!Wn(y,100,.1))return s;const S=Object.keys(s);return d.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function Jo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||bi(e[n],t[n])!==0)return!1;return!0}function el({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,h)=>u+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!Wn(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];yt(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let l=0;for(let u=0;u<t.length;u++){const h=n[u];yt(h!=null,`No layout data found for index ${u}`);const d=r[u];yt(d!=null,`No layout data found for index ${u}`);const p=da({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=p&&(l+=d-p,r[u]=p)}if(!Wn(l,0))for(let u=0;u<t.length;u++){const h=r[u];yt(h!=null,`No layout data found for index ${u}`);const d=h+l,p=da({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==p&&(l-=p-h,r[u]=p,Wn(l,0)))break}const a=Object.keys(e);return r.reduce((u,h,d)=>(u[a[d]]=h,u),{})}function xN({groupId:e,panelId:t}){const n=()=>{const u=ul();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:m,groupSize:_,separatorToPanels:y}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:h,groupSize:_,layout:m,separatorToPanels:y};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(h=>h.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(h=>h.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=u=>{const h=l();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:m,groupSize:_,layout:y,separatorToPanels:S}=n(),w=m.panels.findIndex(R=>R.id===t),C=w===m.panels.length-1,k=Lu({delta:C?h-u:u-h,initialLayout:y,panelConstraints:p,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:y,trigger:"imperative-api"}),T=el({layout:k,panelConstraints:p});Jo(y,T)||ps(m,{defaultLayoutDeferred:d,derivedPanelConstraints:p,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),p=l();u&&p!==h&&(d.expandToSize=p,a(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:p}=s(),m=l();if(u&&m===h){let _=p.expandToSize??d;_===0&&(_=1),a(_)}},getSize:()=>{const{group:u}=n(),h=l(),{element:d}=s(),p=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:p}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=l();return u&&Wn(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),p=ka({group:h}),m=iu({groupSize:p,panelElement:d,styleProp:u}),_=or(m/p*100);a(_)}}}function ck(e){if(e.defaultPrevented)return;const t=ul();Zb(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,l=xN({groupId:n.group.id,panelId:r.id});l&&s!==void 0&&(l.resize(s),e.preventDefault())}}})}function sf(e){const t=ul();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 SN({groupId:e}){const t=()=>{const n=ul();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:l,groupSize:a,layout:u,separatorToPanels:h}=t(),d=el({layout:n,panelConstraints:s});return r?u:(Jo(u,d)||ps(l,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:a,layout:d,separatorToPanels:h}),d)}}}function Bo(e,t){const n=sf(e),r=so(n.id,!0),s=n.separators.find(p=>p.element===e);yt(s,"Matching separator not found");const l=r.separatorToPanels.get(s);yt(l,"Matching panels not found");const a=l.map(p=>n.panels.indexOf(p)),u=SN({groupId:n.id}).getLayout(),h=Lu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=el({layout:h,panelConstraints:r.derivedPanelConstraints});Jo(u,d)||ps(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function uk(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=sf(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Bo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Bo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Bo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Bo(t,-5);break}case"End":{e.preventDefault(),Bo(t,100);break}case"Enter":{e.preventDefault();const r=sf(t),s=so(r.id,!0),{derivedPanelConstraints:l,layout:a,separatorToPanels:u}=s,h=r.separators.find(_=>_.element===t);yt(h,"Matching separator not found");const d=u.get(h);yt(d,"Matching panels not found");const p=d[0],m=l.find(_=>_.panelId===p.id);if(yt(m,"Panel metadata not found"),m.collapsible){const _=a[p.id],y=m.collapsedSize===_?r.mutableState.expandedPanelSizes[p.id]??m.minSize:m.collapsedSize;Bo(t,y-_)}break}case"F6":{e.preventDefault();const r=sf(t).separators.map(a=>a.element),s=Array.from(r).findIndex(a=>a===e.currentTarget);yt(s!==null,"Index not found");const l=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Bo(t,-100);break}}}let _a={cursorFlags:0,state:"inactive"};const Qb=new _N;function tl(){return _a}function FF(e){return Qb.addListener("change",e)}function UF(e){const t=_a,n={..._a};n.cursorFlags=e,_a=n,Qb.emit("change",{prev:t,next:n})}function ya(e){const t=_a;_a=e,Qb.emit("change",{prev:t,next:e})}function dk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ul(),n=Zb(e,t),r=new Map;let s=!1;n.forEach(l=>{l.separator&&(s||(s=!0,l.separator.element.focus({preventScroll:!0})));const a=t.get(l.group);a&&r.set(l.group,a.layout)}),ya({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const $F=e=>e,Cv=()=>{},wN=1,CN=2,kN=4,EN=8,hk=3,fk=12;let zh;function pk(){return zh===void 0&&(zh=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(zh=!0)),zh}function WF({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(l=>{if(!l.mutableState.disableCursor)switch(l.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&pk()){const l=(e&wN)!==0,a=(e&CN)!==0,u=(e&kN)!==0,h=(e&EN)!==0;if(l)return u?"se-resize":h?"ne-resize":"e-resize";if(a)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return pk()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const mk=new WeakMap;function Jb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=mk.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=tl();switch(r.state){case"active":case"hover":{const s=WF({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),l=`*, *:hover {cursor: ${s} !important; }`;if(t===l)return;t=l,s?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}mk.set(e,{prevStyle:t,styleSheet:n})}function RN({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:l,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:p,groupSize:m}=d,{orientation:_,panels:y}=p,{disableCursor:S}=p.mutableState;let w=0;l?_==="horizontal"?w=(t.clientX-l.x)/m*100:w=(t.clientY-l.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:M,layout:L,separatorToPanels:D}=k;if(R&&L&&D){const j=Lu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:d.panels.map(F=>y.indexOf(F)),prevLayout:L,trigger:"mouse-or-touch"});if(Jo(j,L)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?wN:CN;break}case"vertical":{u|=w<0?kN:EN;break}}}else ps(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:M,layout:j,separatorToPanels:D})}});let h=0;t.movementX===0?h|=a&hk:h|=u&hk,t.movementY===0?h|=a&fk:h|=u&fk,UF(h),Jb(e)}function gk(e){const t=ul(),n=tl();switch(n.state){case"active":RN({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function vk(e){if(e.defaultPrevented)return;const t=tl(),n=ul();switch(t.state){case"active":{if(e.buttons===0){ya({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=so(r.group.id,!0);ps(r.group,s)});return}RN({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Zb(e,n);r.length===0?t.state!=="inactive"&&ya({cursorFlags:0,state:"inactive"}):ya({cursorFlags:0,hitRegions:r,state:"hover"}),Jb(e.currentTarget);break}}}function _k(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(tl().state){case"hover":ya({cursorFlags:0,state:"inactive"})}}function yk(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=tl();switch(t.state){case"active":ya({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Jb(e.currentTarget),t.hitRegions.forEach(n=>{const r=so(n.group.id,!0);ps(n.group,r)}),e.preventDefault())}}function bk(e){let t=0,n=0;const r={};for(const l of e)if(l.defaultSize!==void 0){t++;const a=or(l.defaultSize);n+=a,r[l.panelId]=a}else r[l.panelId]=void 0;const s=e.length-t;if(s!==0){const l=or((100-n)/s);for(const a of e)a.defaultSize===void 0&&(r[a.panelId]=l)}return r}function VF(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=ka({group:e}),l=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:or(l/s*100),inPixels:l};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function qF(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 KF({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,l=0,a=!1;const u=new Map,h=[];for(const m of e.panels){const _=r[m.id]??0;switch(m.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{a=!0;const y=_/100*n,S=or(y/t*100);u.set(m.id,S),s+=S;break}case"preserve-relative-size":default:{h.push(m.id),l+=_;break}}}if(!a||h.length===0)return r;const d=100-s,p={...r};if(u.forEach((m,_)=>{p[_]=m}),l>0)for(const m of h){const _=r[m]??0;p[m]=or(_/l*d)}else{const m=or(d/h.length);for(const _ of h)p[_]=m}return p}function GF(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 na=new Map;function YF(e){let t=!0;yt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,l=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=ka({group:e});if(T===0)return;const R=so(e.id);if(!R)return;const M=z_(e),L=R.defaultLayoutDeferred?bk(M):R.layout,D=KF({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:L}),j=el({layout:D,panelConstraints:M});if(!R.defaultLayoutDeferred&&Jo(R.layout,j)&&qF(R.derivedPanelConstraints,M)&&R.groupSize===T)return;ps(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,groupSize:T,layout:j,separatorToPanels:R.separatorToPanels})}}else VF(e,k,C)}});l.observe(e.element),e.panels.forEach(S=>{yt(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&l.observe(S.element)});const a=ka({group:e}),u=z_(e),h=e.panels.map(({id:S})=>S).join(",");let d=e.mutableState.defaultLayout;d&&(GF(e.panels,d)||(d=void 0));const p=e.mutableState.layouts[h]??d??bk(u),m=el({layout:p,panelConstraints:u}),_=e.element.ownerDocument;na.set(_,(na.get(_)??0)+1);const y=new Map;return vN(e).forEach(S=>{S.separator&&y.set(S.separator,S.panels)}),ps(e,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:m,separatorToPanels:y}),e.separators.forEach(S=>{yt(!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",uk)}),na.get(_)===1&&(_.addEventListener("dblclick",ck,!0),_.addEventListener("pointerdown",dk,!0),_.addEventListener("pointerleave",gk),_.addEventListener("pointermove",vk),_.addEventListener("pointerout",_k),_.addEventListener("pointerup",yk,!0)),function(){t=!1,na.set(_,Math.max(0,(na.get(_)??0)-1)),AF(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",uk)}),na.get(_)||(_.removeEventListener("dblclick",ck,!0),_.removeEventListener("pointerdown",dk,!0),_.removeEventListener("pointerleave",gk),_.removeEventListener("pointermove",vk),_.removeEventListener("pointerout",_k),_.removeEventListener("pointerup",yk,!0)),l.disconnect()}}function XF(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function e0(e){const t=b.useId();return`${e??t}`}const dl=typeof window<"u"?b.useLayoutEffect:b.useEffect;function _u(e){const t=b.useRef(e);return dl(()=>{t.current=e},[e]),b.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function t0(...e){return _u(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function n0(e){const t=b.useRef({...e});return dl(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const TN=b.createContext(null);function ZF(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:$F});b.useImperativeHandle(t,()=>n.current,[]),dl(()=>{Object.assign(n.current,SN({groupId:e}))})}function MN({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:l,groupRef:a,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:p="horizontal",resizeTargetMinimumSize:m={coarse:20,fine:10},style:_,...y}){const S=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=_u(H=>{Jo(S.current.onLayoutChange,H)||(S.current.onLayoutChange=H,h==null||h(H))}),C=_u(H=>{Jo(S.current.onLayoutChanged,H)||(S.current.onLayoutChanged=H,d==null||d(H))}),k=e0(u),T=b.useRef(null),[R,M]=XF(),L=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:m,separators:[]}),D=t0(T,l);ZF(k,a);const j=_u((H,P)=>{const U=tl(),V=sk(H),$=so(H);if($){let B=!1;switch(U.state){case"active":{B=U.hitRegions.some(K=>K.group===V);break}}return{flexGrow:$.layout[P]??1,pointerEvents:B?"none":void 0}}return{flexGrow:(n==null?void 0:n[P])??1}}),F=n0({defaultLayout:n,disableCursor:r}),Y=b.useMemo(()=>({get disableCursor(){return!!F.disableCursor},getPanelStyles:j,id:k,orientation:p,registerPanel:H=>{const P=L.current;return P.panels=P_(p,[...P.panels,H]),M(),()=>{P.panels=P.panels.filter(U=>U!==H),M()}},registerSeparator:H=>{const P=L.current;return P.separators=P_(p,[...P.separators,H]),M(),()=>{P.separators=P.separators.filter(U=>U!==H),M()}},togglePanelDisabled:(H,P)=>{const U=L.current.panels.find(B=>B.id===H);U&&(U.panelConstraints.disabled=P);const V=sk(k),$=so(k);V&&$&&ps(V,{...$,derivedPanelConstraints:z_(V)})},toggleSeparatorDisabled:(H,P)=>{const U=L.current.separators.find(V=>V.id===H);U&&(U.disabled=P)}}),[j,k,M,p,F]),z=b.useRef(null);return dl(()=>{const H=T.current;if(H===null)return;const P=L.current;let U;if(F.defaultLayout!==void 0&&Object.keys(F.defaultLayout).length===P.panels.length){U={};for(const N of P.panels){const I=F.defaultLayout[N.id];I!==void 0&&(U[N.id]=I)}}const V={disabled:!!s,element:H,id:k,mutableState:{defaultLayout:U,disableCursor:!!F.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:p,panels:P.panels,resizeTargetMinimumSize:P.resizeTargetMinimumSize,separators:P.separators};z.current=V;const $=YF(V),{defaultLayoutDeferred:B,derivedPanelConstraints:K,layout:W}=so(V.id,!0);!B&&K.length>0&&(w(W),C(W));const Z=Xb(k,N=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:q,layout:A}=N.next;if(I||q.length===0)return;const ae=V.panels.map(({id:oe})=>oe).join(",");V.mutableState.layouts[ae]=A,q.forEach(oe=>{if(oe.collapsible){const{layout:J}=N.prev??{};if(J){const ge=Wn(oe.collapsedSize,A[oe.panelId]),ie=Wn(oe.collapsedSize,J[oe.panelId]);ge&&!ie&&(V.mutableState.expandedPanelSizes[oe.panelId]=J[oe.panelId])}}});const fe=tl().state!=="active";w(A),fe&&C(A)});return()=>{z.current=null,$(),Z()}},[s,k,C,w,p,R,F]),b.useEffect(()=>{const H=z.current;H&&(H.mutableState.defaultLayout=n,H.mutableState.disableCursor=!!r)}),g.jsx(TN.Provider,{value:Y,children:g.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:D,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})})}MN.displayName="Group";function r0(){const e=b.useContext(TN);return yt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function QF(e,t){const{id:n}=r0(),r=b.useRef({collapse:Cv,expand:Cv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Cv});b.useImperativeHandle(t,()=>r.current,[]),dl(()=>{Object.assign(r.current,xN({groupId:n,panelId:e}))})}function NN({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:l,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:p="0%",onResize:m,panelRef:_,style:y,...S}){const w=!!h,C=e0(h),k=n0({disabled:l}),T=b.useRef(null),R=t0(T,a),{getPanelStyles:M,id:L,orientation:D,registerPanel:j,togglePanelDisabled:F}=r0(),Y=m!==null,z=_u((P,U,V)=>{m==null||m(P,h,V)});dl(()=>{const P=T.current;if(P!==null){const U={element:P,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Y?z:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:p}};return j(U)}},[u,n,r,s,Y,C,w,d,p,z,j,k]),b.useEffect(()=>{F(C,!!l)},[l,C,F]),QF(C,_);const H=b.useSyncExternalStore(P=>Xb(L,P),()=>JSON.stringify(M(L,C)),()=>JSON.stringify(M(L,C)));return g.jsx("div",{...S,"aria-disabled":l||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...JF,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(H)},children:g.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:e})})}NN.displayName="Panel";const JF={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function eU({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,l;const a=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,p=[r,r+1];l=el({layout:Lu({delta:d-a,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n],s=el({layout:Lu({delta:h-a,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:l,valueNow:a}}function AN({children:e,className:t,disabled:n,elementRef:r,id:s,style:l,...a}){const u=e0(s),h=n0({disabled:n}),[d,p]=b.useState({}),[m,_]=b.useState("inactive"),y=b.useRef(null),S=t0(y,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=r0(),M=k==="horizontal"?"vertical":"horizontal";dl(()=>{const D=y.current;if(D!==null){const j={disabled:h.disabled,element:D,id:u},F=T(j),Y=FF(H=>{_(H.next.state!=="inactive"&&H.next.hitRegions.some(P=>P.separator===j)?H.next.state:"inactive")}),z=Xb(C,H=>{const{derivedPanelConstraints:P,layout:U,separatorToPanels:V}=H.next,$=V.get(j);if($){const B=$[0],K=$.indexOf(B);p(eU({layout:U,panelConstraints:P,panelId:B.id,panelIndex:K}))}});return()=>{Y(),z(),F()}}},[C,u,T,h]),b.useEffect(()=>{R(u,!!n)},[n,u,R]);let L;return n&&!w&&(L="not-allowed"),g.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":m,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:L,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}AN.displayName="Separator";const of=({className:e,...t})=>g.jsx(MN,{className:ye("flex h-full w-full",e),...t}),Uo=e=>g.jsx(NN,{...e}),lf=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>g.jsx(AN,{disabled:n,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",r),...s,children:g.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
454
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
455
|
-
* @license MIT
|
|
456
|
-
*
|
|
457
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
458
|
-
* @license MIT
|
|
459
|
-
*
|
|
460
|
-
* Originally forked from (with the author's permission):
|
|
461
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
462
|
-
* http://bellard.org/jslinux/
|
|
463
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
464
|
-
*/var vn=0,_n=0,yn=0,Ut=0,jn;(e=>{function t(s,l,a,u){return u!==void 0?`#${Io(s)}${Io(l)}${Io(a)}${Io(u)}`:`#${Io(s)}${Io(l)}${Io(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})(jn||(jn={}));var tU;(e=>{function t(h,d){if(Ut=(d.rgba&255)/255,Ut===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,m=d.rgba>>16&255,_=d.rgba>>8&255,y=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;vn=y+Math.round((p-y)*Ut),_n=S+Math.round((m-S)*Ut),yn=w+Math.round((_-w)*Ut);let C=jn.toCss(vn,_n,yn),k=jn.toRgba(vn,_n,yn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,p){let m=af.ensureContrastRatio(h.rgba,d.rgba,p);if(m)return jn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[vn,_n,yn]=af.toChannels(d),{css:jn.toCss(vn,_n,yn),rgba:d}}e.opaque=s;function l(h,d){return Ut=Math.round(d*255),[vn,_n,yn]=af.toChannels(h.rgba),{css:jn.toCss(vn,_n,yn,Ut),rgba:jn.toRgba(vn,_n,yn,Ut)}}e.opacity=l;function a(h,d){return Ut=h.rgba&255,l(h,Ut*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(tU||(tU={}));var Mn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,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 vn=parseInt(s.slice(1,2).repeat(2),16),_n=parseInt(s.slice(2,3).repeat(2),16),yn=parseInt(s.slice(3,4).repeat(2),16),jn.toColor(vn,_n,yn);case 5:return vn=parseInt(s.slice(1,2).repeat(2),16),_n=parseInt(s.slice(2,3).repeat(2),16),yn=parseInt(s.slice(3,4).repeat(2),16),Ut=parseInt(s.slice(4,5).repeat(2),16),jn.toColor(vn,_n,yn,Ut);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 l=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(l)return vn=parseInt(l[1]),_n=parseInt(l[2]),yn=parseInt(l[3]),Ut=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),jn.toColor(vn,_n,yn,Ut);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),[vn,_n,yn,Ut]=t.getImageData(0,0,1,1).data,Ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:jn.toRgba(vn,_n,yn,Ut),css:s}}e.toColor=r})(Mn||(Mn={}));var Fn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Fn||(Fn={}));var af;(e=>{function t(a,u){if(Ut=(u&255)/255,Ut===1)return u;let h=u>>24&255,d=u>>16&255,p=u>>8&255,m=a>>24&255,_=a>>16&255,y=a>>8&255;return vn=m+Math.round((h-m)*Ut),_n=_+Math.round((d-_)*Ut),yn=y+Math.round((p-y)*Ut),jn.toRgba(vn,_n,yn)}e.blend=t;function n(a,u,h){let d=Fn.relativeLuminance(a>>8),p=Fn.relativeLuminance(u>>8);if(rs(d,p)<h){if(p<d){let y=r(a,u,h),S=rs(d,Fn.relativeLuminance(y>>8));if(S<h){let w=s(a,u,h),C=rs(d,Fn.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(a,u,h),_=rs(d,Fn.relativeLuminance(m>>8));if(_<h){let y=r(a,u,h),S=rs(d,Fn.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));for(;w<h&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));for(;w<h&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=rs(Fn.relativeLuminance2(_,y,S),Fn.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(af||(af={}));function Io(e){let t=e.toString(16);return t.length<2?"0"+t:t}function rs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var nU=Object.freeze((()=>{let e=[Mn.toColor("#2e3436"),Mn.toColor("#cc0000"),Mn.toColor("#4e9a06"),Mn.toColor("#c4a000"),Mn.toColor("#3465a4"),Mn.toColor("#75507b"),Mn.toColor("#06989a"),Mn.toColor("#d3d7cf"),Mn.toColor("#555753"),Mn.toColor("#ef2929"),Mn.toColor("#8ae234"),Mn.toColor("#fce94f"),Mn.toColor("#729fcf"),Mn.toColor("#ad7fa8"),Mn.toColor("#34e2e2"),Mn.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],l=t[n%6];e.push({css:jn.toCss(r,s,l),rgba:jn.toRgba(r,s,l)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:jn.toCss(r,r,r),rgba:jn.toRgba(r,r,r)})}return e})());function xk(e,t,n){return Math.max(t,Math.min(e,n))}function rU(e){switch(e){case"&":return"&";case"<":return"<"}return e}var DN=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),l=r,a=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-a,a,u);for(let p=a;p<=u;p++){let m=this._buffer.getLine(p);if(m){let _=p===t.start.y?h:0,y=p===t.end.y?d:m.length;for(let S=_;S<y;S++){let w=m.getCell(S,l===r?s:r);if(!w){console.warn(`Can't get cell at row=${p}, col=${S}`);continue}this._nextCell(w,l,p,S),l=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 ON(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function os(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function LN(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 iU=class extends DN{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&&!os(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 l=this._buffer.getLine(t),a=this._buffer.getLine(t+1);if(!a.isWrapped)r=`\r
|
|
465
|
-
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=l.getCell(l.length-1,this._thisRowLastChar),h=l.getCell(l.length-2,this._thisRowLastSecondChar),d=a.getCell(0,this._nextRowFirstChar),p=d.getWidth()>1,m=!1;(d.getChars()&&p?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&os(u,d)&&(m=!0),p&&(h.getChars()||h.getWidth()===0)&&os(u,d)&&os(h,d)&&(m=!0)),m||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${l.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${l.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=!ON(t,n),l=!os(t,n),a=!LN(t,n);if(s||l||a)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(l){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)}a&&(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 l=t.getChars()==="",a=this._diffStyle(t,this._cursorStyle);if(l?!os(this._cursorStyle,t):a.length>0){this._nullCellCount>0&&(os(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[${a.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}l?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(os(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 a=0;a<n;a++)r+=this._allRows[a],a+1<n&&(r+=this._allRowSeparators[a]);if(!t){let a=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,h=a!==this._lastCursorRow||u!==this._lastCursorCol,d=p=>{p>0?r+=`\x1B[${p}C`:p<0&&(r+=`\x1B[${-p}D`)};h&&((p=>{p>0?r+=`\x1B[${p}B`:p<0&&(r+=`\x1B[${-p}A`)})(a-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,l=this._diffStyle(s,this._cursorStyle);return l.length>0&&(r+=`\x1B[${l.join(";")}m`),r}},sU=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,l=r===void 0?s:xk(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-l,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new iU(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 h;let r=t.buffer.active,s=new oU(r,t,n),l=n.onlySelection??!1,a=n.range;if(a)return s.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:t.cols,y:(a.endLine,a.endLine)}});if(!l){let d=r.length,p=n.scrollback,m=p===void 0?d:xk(p+t.rows,0,d);return s.serialize({start:{x:0,y:d-m},end:{x:t.cols,y:d-1}})}let u=(h=this._terminal)==null?void 0:h.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(){}},oU=class extends DN{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=nU}_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,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",l="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",l=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let a=[];a.push("color: "+s+";"),a.push("background-color: "+l+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.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=!ON(t,n),l=!os(t,n),a=!LN(t,n);if(s||l||a){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let h=this._getHexColor(t,!1);return h&&r.push("background-color: "+h+";"),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 l=t.getChars()==="",a=this._diffStyle(t,n);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),l?this._currentRow+=" ":this._currentRow+=rU(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
466
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
467
|
-
* @license MIT
|
|
468
|
-
*
|
|
469
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
470
|
-
* @license MIT
|
|
471
|
-
*
|
|
472
|
-
* Originally forked from (with the author's permission):
|
|
473
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
474
|
-
* http://bellard.org/jslinux/
|
|
475
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
476
|
-
*/var lU=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=cU.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:l}=n;this._options.hover(r,s,l)}},n))}};function aU(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 cU=class cf{static computeLink(t,n,r,s){let l=new RegExp(n.source,(n.flags||"")+"g"),[a,u]=cf._getWindowedLineStrings(t-1,r),h=a.join(""),d,p=[];for(;d=l.exec(h);){let m=d[0];if(!aU(m))continue;let[_,y]=cf._mapStrIdx(r,u,0,d.index),[S,w]=cf._mapStrIdx(r,_,y,m.length);if(_===-1||y===-1||S===-1||w===-1)continue;let C={start:{x:y+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,l=t,a=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(a=0;(r=n.buffer.active.getLine(--s))&&a<2048&&(u=r.translateToString(!0),a+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),a=0;(r=n.buffer.active.getLine(++l))&&r.isWrapped&&a<2048&&(u=r.translateToString(!0),a+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let l=t.buffer.active,a=l.getNullCell(),u=r;for(;s;){let h=l.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,a);let p=a.getChars();if(a.getWidth()&&(s-=p.length||1,d===h.length-1&&p==="")){let m=l.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,a),a.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},uU=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function dU(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 hU=class{constructor(t=dU,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||uU;this._linkProvider=this._terminal.registerLinkProvider(new lU(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
477
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
478
|
-
* @license MIT
|
|
479
|
-
*
|
|
480
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
481
|
-
* @license MIT
|
|
482
|
-
*
|
|
483
|
-
* Originally forked from (with the author's permission):
|
|
484
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
485
|
-
* http://bellard.org/jslinux/
|
|
486
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
487
|
-
*/var jN=Object.defineProperty,fU=Object.getOwnPropertyDescriptor,pU=(e,t)=>{for(var n in t)jN(e,n,{get:t[n],enumerable:!0})},Wt=(e,t,n,r)=>{for(var s=r>1?void 0:r?fU(t,n):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&jN(t,n,s),s},Ee=(e,t)=>(n,r)=>t(n,r,e),Sk="Terminal input",B_={get:()=>Sk,set:e=>Sk=e},wk="Too much output to announce, navigate to rows manually to read",I_={get:()=>wk,set:e=>wk=e};function mU(e){return e.replace(/\r?\n/g,"\r")}function gU(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function vU(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function _U(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");zN(s,t,n,r)}}function zN(e,t,n,r){e=mU(e),e=gU(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function PN(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function Ck(e,t,n,r,s){PN(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function eo(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function kp(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let l=e[s];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var yU=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 l=e.charCodeAt(s++);56320<=l&&l<=57343?t[r++]=(this._interim-55296)*1024+l-56320+65536:(t[r++]=this._interim,t[r++]=l),this._interim=0}for(let l=s;l<n;++l){let a=e.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=n)return this._interim=a,r;let u=e.charCodeAt(l);56320<=u&&u<=57343?t[r++]=(a-55296)*1024+u-56320+65536:(t[r++]=a,t[r++]=u);continue}a!==65279&&(t[r++]=a)}return r}},bU=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,l,a,u,h=0,d=0;if(this.interim[0]){let _=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)y<<=6,y|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;d<k;){if(d>=n)return 0;if(w=e[d++],(w&192)!==128){d--,_=!0;break}else this.interim[S++]=w,y<<=6,y|=w&63}_||(C===2?y<128?d--:t[r++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let p=n-4,m=d;for(;m<n;){for(;m<p&&!((s=e[m])&128)&&!((l=e[m+1])&128)&&!((a=e[m+2])&128)&&!((u=e[m+3])&128);)t[r++]=s,t[r++]=l,t[r++]=a,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(l=e[m++],(l&192)!==128){m--;continue}if(h=(s&31)<<6|l&63,h<128){m--;continue}t[r++]=h}else if((s&240)===224){if(m>=n)return this.interim[0]=s,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[m++],(a&192)!==128){m--;continue}if(h=(s&15)<<12|(l&63)<<6|a&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(m>=n)return this.interim[0]=s,r;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=l,this.interim[2]=a,r;if(u=e[m++],(u&192)!==128){m--;continue}if(h=(s&7)<<18|(l&63)<<12|(a&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},BN="",io=" ",ed=class IN{constructor(){this.fg=0,this.bg=0,this.extended=new Bf}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 IN;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}},Bf=class HN{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 HN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Vr=class FN extends ed{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Bf,this.combinedData=""}static fromCharData(t){let n=new FN;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?eo(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()]}},kk="di$target",H_="di$dependencies",kv=new Map;function xU(e){return e[H_]||[]}function wn(e){if(kv.has(e))return kv.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");SU(t,n,s)};return t._id=e,kv.set(e,t),t}function SU(e,t,n){t[kk]===t?t[H_].push({id:e,index:n}):(t[H_]=[{id:e,index:n}],t[kk]=t)}var Kn=wn("BufferService"),UN=wn("CoreMouseService"),hl=wn("CoreService"),wU=wn("CharsetService"),i0=wn("InstantiationService"),$N=wn("LogService"),Gn=wn("OptionsService"),WN=wn("OscLinkService"),CU=wn("UnicodeService"),td=wn("DecorationService"),F_=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,l=new Vr,a=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let m=0;m<a;m++)if(!(h===-1&&!n.hasContent(m))){if(n.loadCell(m,l),l.hasExtendedAttrs()&&l.extended.urlId)if(h===-1){h=m,u=l.extended.urlId;continue}else d=l.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&m===a-1){let _=(p=this._oscLinkService.getLinkData(u))==null?void 0:p.uri;if(_){let y={start:{x:h+1,y:e},end:{x:m+(!d&&m===a-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:y,activate:(w,C)=>s?s.activate(w,C,y):kU(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,y)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,y)}})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=m,u=l.extended.urlId):(h=-1,u=-1)}}t(r)}};F_=Wt([Ee(0,Kn),Ee(1,Gn),Ee(2,WN)],F_);function kU(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
488
|
-
|
|
489
|
-
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 Ep=wn("CharSizeService"),vs=wn("CoreBrowserService"),s0=wn("MouseService"),_s=wn("RenderService"),EU=wn("SelectionService"),VN=wn("CharacterJoinerService"),Ua=wn("ThemeService"),qN=wn("LinkProviderService"),RU=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Ek.isErrorNoTelemetry(e)?new Ek(e.message+`
|
|
490
|
-
|
|
491
|
-
`+e.stack):new Error(e.message+`
|
|
492
|
-
|
|
493
|
-
`+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)}},TU=new RU;function uf(e){MU(e)||TU.onUnexpectedError(e)}var U_="Canceled";function MU(e){return e instanceof NU?!0:e instanceof Error&&e.name===U_&&e.message===U_}var NU=class extends Error{constructor(){super(U_),this.name=this.message}};function AU(e){return new Error(`Illegal argument: ${e}`)}var Ek=class $_ extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof $_)return t;let n=new $_;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},W_=class KN extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,KN.prototype)}};function yr(e,t=0){return e[e.length-(1+t)]}var DU;(e=>{function t(l){return l<0}e.isLessThan=t;function n(l){return l<=0}e.isLessThanOrEqual=n;function r(l){return l>0}e.isGreaterThan=r;function s(l){return l===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(DU||(DU={}));function OU(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var GN;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(M){yield M}e.single=s;function l(M){return t(M)?M:s(M)}e.wrap=l;function a(M){return M||n}e.from=a;function*u(M){for(let L=M.length-1;L>=0;L--)yield M[L]}e.reverse=u;function h(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(M){return M[Symbol.iterator]().next().value}e.first=d;function p(M,L){let D=0;for(let j of M)if(L(j,D++))return!0;return!1}e.some=p;function m(M,L){for(let D of M)if(L(D))return D}e.find=m;function*_(M,L){for(let D of M)L(D)&&(yield D)}e.filter=_;function*y(M,L){let D=0;for(let j of M)yield L(j,D++)}e.map=y;function*S(M,L){let D=0;for(let j of M)yield*L(j,D++)}e.flatMap=S;function*w(...M){for(let L of M)yield*L}e.concat=w;function C(M,L,D){let j=D;for(let F of M)j=L(j,F);return j}e.reduce=C;function*k(M,L,D=M.length){for(L<0&&(L+=M.length),D<0?D+=M.length:D>M.length&&(D=M.length);L<D;L++)yield M[L]}e.slice=k;function T(M,L=Number.POSITIVE_INFINITY){let D=[];if(L===0)return[D,M];let j=M[Symbol.iterator]();for(let F=0;F<L;F++){let Y=j.next();if(Y.done)return[D,e.empty()];D.push(Y.value)}return[D,{[Symbol.iterator](){return j}}]}e.consume=T;async function R(M){let L=[];for await(let D of M)L.push(D);return Promise.resolve(L)}e.asyncToArray=R})(GN||(GN={}));function nl(e){if(GN.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 LU(...e){return jt(()=>nl(e))}function jt(e){return{dispose:OU(()=>{e()})}}var YN=class XN{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{nl(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?XN.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)}};YN.DISABLE_DISPOSED_WARNING=!1;var oo=YN,Ge=class{constructor(){this._store=new oo,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)}};Ge.None=Object.freeze({dispose(){}});var Ea=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}},as=typeof window=="object"?window:globalThis,V_=class q_{constructor(t){this.element=t,this.next=q_.Undefined,this.prev=q_.Undefined}};V_.Undefined=new V_(void 0);var Bt=V_,Rk=class{constructor(){this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Bt.Undefined}clear(){let e=this._first;for(;e!==Bt.Undefined;){let t=e.next;e.prev=Bt.Undefined,e.next=Bt.Undefined,e=t}this._first=Bt.Undefined,this._last=Bt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Bt(e);if(this._first===Bt.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!==Bt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Bt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Bt.Undefined&&e.next!==Bt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Bt.Undefined&&e.next===Bt.Undefined?(this._first=Bt.Undefined,this._last=Bt.Undefined):e.next===Bt.Undefined?(this._last=this._last.prev,this._last.next=Bt.Undefined):e.prev===Bt.Undefined&&(this._first=this._first.next,this._first.prev=Bt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Bt.Undefined;)yield e.element,e=e.next}},jU=globalThis.performance&&typeof globalThis.performance.now=="function",zU=class ZN{static create(t){return new ZN(t)}constructor(t){this._now=jU&&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}},An;(e=>{e.None=()=>Ge.None;function t(P,U){return m(P,()=>{},0,void 0,!0,void 0,U)}e.defer=t;function n(P){return(U,V=null,$)=>{let B=!1,K;return K=P(W=>{if(!B)return K?K.dispose():B=!0,U.call(V,W)},null,$),B&&K.dispose(),K}}e.once=n;function r(P,U,V){return d(($,B=null,K)=>P(W=>$.call(B,U(W)),null,K),V)}e.map=r;function s(P,U,V){return d(($,B=null,K)=>P(W=>{U(W),$.call(B,W)},null,K),V)}e.forEach=s;function l(P,U,V){return d(($,B=null,K)=>P(W=>U(W)&&$.call(B,W),null,K),V)}e.filter=l;function a(P){return P}e.signal=a;function u(...P){return(U,V=null,$)=>{let B=LU(...P.map(K=>K(W=>U.call(V,W))));return p(B,$)}}e.any=u;function h(P,U,V,$){let B=V;return r(P,K=>(B=U(B,K),B),$)}e.reduce=h;function d(P,U){let V,$={onWillAddFirstListener(){V=P(B.fire,B)},onDidRemoveLastListener(){V==null||V.dispose()}},B=new xe($);return U==null||U.add(B),B.event}function p(P,U){return U instanceof Array?U.push(P):U&&U.add(P),P}function m(P,U,V=100,$=!1,B=!1,K,W){let Z,N,I,q=0,A,ae={leakWarningThreshold:K,onWillAddFirstListener(){Z=P(oe=>{q++,N=U(N,oe),$&&!I&&(fe.fire(N),N=void 0),A=()=>{let J=N;N=void 0,I=void 0,(!$||q>1)&&fe.fire(J),q=0},typeof V=="number"?(clearTimeout(I),I=setTimeout(A,V)):I===void 0&&(I=0,queueMicrotask(A))})},onWillRemoveListener(){B&&q>0&&(A==null||A())},onDidRemoveLastListener(){A=void 0,Z.dispose()}},fe=new xe(ae);return W==null||W.add(fe),fe.event}e.debounce=m;function _(P,U=0,V){return e.debounce(P,($,B)=>$?($.push(B),$):[B],U,void 0,!0,void 0,V)}e.accumulate=_;function y(P,U=($,B)=>$===B,V){let $=!0,B;return l(P,K=>{let W=$||!U(K,B);return $=!1,B=K,W},V)}e.latch=y;function S(P,U,V){return[e.filter(P,U,V),e.filter(P,$=>!U($),V)]}e.split=S;function w(P,U=!1,V=[],$){let B=V.slice(),K=P(N=>{B?B.push(N):Z.fire(N)});$&&$.add(K);let W=()=>{B==null||B.forEach(N=>Z.fire(N)),B=null},Z=new xe({onWillAddFirstListener(){K||(K=P(N=>Z.fire(N)),$&&$.add(K))},onDidAddFirstListener(){B&&(U?setTimeout(W):W())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return $&&$.add(Z),Z.event}e.buffer=w;function C(P,U){return(V,$,B)=>{let K=U(new T);return P(function(W){let Z=K.evaluate(W);Z!==k&&V.call($,Z)},void 0,B)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(V=>(U(V),V)),this}filter(U){return this.steps.push(V=>U(V)?V:k),this}reduce(U,V){let $=V;return this.steps.push(B=>($=U($,B),$)),this}latch(U=(V,$)=>V===$){let V=!0,$;return this.steps.push(B=>{let K=V||!U(B,$);return V=!1,$=B,K?B:k}),this}evaluate(U){for(let V of this.steps)if(U=V(U),U===k)break;return U}}function R(P,U,V=$=>$){let $=(...Z)=>W.fire(V(...Z)),B=()=>P.on(U,$),K=()=>P.removeListener(U,$),W=new xe({onWillAddFirstListener:B,onDidRemoveLastListener:K});return W.event}e.fromNodeEventEmitter=R;function M(P,U,V=$=>$){let $=(...Z)=>W.fire(V(...Z)),B=()=>P.addEventListener(U,$),K=()=>P.removeEventListener(U,$),W=new xe({onWillAddFirstListener:B,onDidRemoveLastListener:K});return W.event}e.fromDOMEventEmitter=M;function L(P){return new Promise(U=>n(P)(U))}e.toPromise=L;function D(P){let U=new xe;return P.then(V=>{U.fire(V)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=D;function j(P,U){return P(V=>U.fire(V))}e.forward=j;function F(P,U,V){return U(V),P($=>U($))}e.runAndSubscribe=F;class Y{constructor(U,V){this._observable=U,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new xe($),V&&V.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,V){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function z(P,U){return new Y(P,U).emitter.event}e.fromObservable=z;function H(P){return(U,V,$)=>{let B=0,K=!1,W={beginUpdate(){B++},endUpdate(){B--,B===0&&(P.reportChanges(),K&&(K=!1,U.call(V)))},handlePossibleChange(){},handleChange(){K=!0}};P.addObserver(W),P.reportChanges();let Z={dispose(){P.removeObserver(W)}};return $ instanceof oo?$.add(Z):Array.isArray($)&&$.push(Z),Z}}e.fromObservableLight=H})(An||(An={}));var K_=class G_{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${G_._idPool++}`,G_.all.add(this)}start(t){this._stopWatch=new zU,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}}};K_.all=new Set,K_._idPool=0;var PU=K_,BU=-1,QN=class JN{constructor(t,n,r=(JN._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[l,a]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${a}):`;console.warn(u),console.warn(l);let h=new FU(u,l);this._errorHandler(h)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-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}};QN._idPool=1;var IU=QN,HU=class eA{constructor(t){this.value=t}static create(){let t=new Error;return new eA(t.stack??"")}print(){console.warn(this.value.split(`
|
|
494
|
-
`).slice(2).join(`
|
|
495
|
-
`))}},FU=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},UU=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},$U=0,Ev=class{constructor(e){this.value=e,this.id=$U++}},WU=2,VU,xe=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new IU((e==null?void 0:e.onListenerError)??uf,((n=this._options)==null?void 0:n.leakWarningThreshold)??BU):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new PU(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 a,u,h,d,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],y=new UU(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((a=this._options)==null?void 0:a.onListenerError)||uf)(y),Ge.None}if(this._disposed)return Ge.None;t&&(e=e.bind(t));let r=new Ev(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=HU.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Ev?(this._deliveryQueue??(this._deliveryQueue=new qU),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=r,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let l=jt(()=>{s==null||s(),this._removeListener(r)});return n instanceof oo?n.add(l):Array.isArray(n)&&n.push(l),l}),this._event}_removeListener(e){var s,l,a,u;if((l=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||l.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||u.call(a,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*WU<=t.length){let h=0;for(let d=0;d<t.length;d++)t[d]?t[h++]=t[d]:r&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=h}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||uf;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 Ev)this._deliver(this._listeners,e);else{let l=this._deliveryQueue;l.enqueue(this,e,this._listeners.length),this._deliverQueue(l)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},qU=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}},Y_=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new xe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new xe,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}};Y_.INSTANCE=new Y_;var o0=Y_;function KU(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}o0.INSTANCE.onDidChangeZoomLevel;function GU(e){return o0.INSTANCE.getZoomFactor(e)}o0.INSTANCE.onDidChangeFullscreen;var $a=typeof navigator=="object"?navigator.userAgent:"",X_=$a.indexOf("Firefox")>=0,YU=$a.indexOf("AppleWebKit")>=0,l0=$a.indexOf("Chrome")>=0,XU=!l0&&$a.indexOf("Safari")>=0;$a.indexOf("Electron/")>=0;$a.indexOf("Android")>=0;var Rv=!1;if(typeof as.matchMedia=="function"){let e=as.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=as.matchMedia("(display-mode: fullscreen)");Rv=e.matches,KU(as,e,({matches:n})=>{Rv&&t.matches||(Rv=n)})}var ha="en",Z_=!1,Q_=!1,df=!1,tA=!1,Ph,hf=ha,Tk=ha,ZU,ni,Yo=globalThis,Nn,OE;typeof Yo.vscode<"u"&&typeof Yo.vscode.process<"u"?Nn=Yo.vscode.process:typeof process<"u"&&typeof((OE=process==null?void 0:process.versions)==null?void 0:OE.node)=="string"&&(Nn=process);var LE,QU=typeof((LE=Nn==null?void 0:Nn.versions)==null?void 0:LE.electron)=="string",JU=QU&&(Nn==null?void 0:Nn.type)==="renderer",jE;if(typeof Nn=="object"){Z_=Nn.platform==="win32",Q_=Nn.platform==="darwin",df=Nn.platform==="linux",df&&Nn.env.SNAP&&Nn.env.SNAP_REVISION,Nn.env.CI||Nn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ph=ha,hf=ha;let e=Nn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ph=t.userLocale,Tk=t.osLocale,hf=t.resolvedLanguage||ha,ZU=(jE=t.languagePack)==null?void 0:jE.translationsConfigFile}catch{}tA=!0}else typeof navigator=="object"&&!JU?(ni=navigator.userAgent,Z_=ni.indexOf("Windows")>=0,Q_=ni.indexOf("Macintosh")>=0,(ni.indexOf("Macintosh")>=0||ni.indexOf("iPad")>=0||ni.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,df=ni.indexOf("Linux")>=0,(ni==null?void 0:ni.indexOf("Mobi"))>=0,hf=globalThis._VSCODE_NLS_LANGUAGE||ha,Ph=navigator.language.toLowerCase(),Tk=Ph):console.error("Unable to resolve platform.");var nA=Z_,Ti=Q_,e$=df,Mk=tA,Ai=ni,Ks=hf,t$;(e=>{function t(){return Ks}e.value=t;function n(){return Ks.length===2?Ks==="en":Ks.length>=3?Ks[0]==="e"&&Ks[1]==="n"&&Ks[2]==="-":!1}e.isDefaultVariant=n;function r(){return Ks==="en"}e.isDefault=r})(t$||(t$={}));var n$=typeof Yo.postMessage=="function"&&!Yo.importScripts;(()=>{if(n$){let e=[];Yo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let l=e[r];if(l.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Yo.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var r$=!!(Ai&&Ai.indexOf("Chrome")>=0);Ai&&Ai.indexOf("Firefox")>=0;!r$&&Ai&&Ai.indexOf("Safari")>=0;Ai&&Ai.indexOf("Edg/")>=0;Ai&&Ai.indexOf("Android")>=0;var ra=typeof navigator=="object"?navigator:{};Mk||document.queryCommandSupported&&document.queryCommandSupported("copy")||ra&&ra.clipboard&&ra.clipboard.writeText,Mk||ra&&ra.clipboard&&ra.clipboard.readText;var a0=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}},Tv=new a0,Nk=new a0,Ak=new a0,i$=new Array(230),rA;(e=>{function t(u){return Tv.keyCodeToStr(u)}e.toString=t;function n(u){return Tv.strToKeyCode(u)}e.fromString=n;function r(u){return Nk.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return Ak.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function l(u){return Nk.strToKeyCode(u)||Ak.strToKeyCode(u)}e.fromUserSettings=l;function a(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 Tv.keyCodeToStr(u)}e.toElectronAccelerator=a})(rA||(rA={}));var s$=class iA{constructor(t,n,r,s,l){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=l}equals(t){return t instanceof iA&&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 o$([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},o$=class{constructor(e){if(e.length===0)throw AU("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 l$(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return rA.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(X_)switch(t){case 59:return 85;case 60:if(e$)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ti)return 57;break}else if(YU&&(Ti&&t===93||!Ti&&t===92))return 57;return i$[t]||0}var a$=Ti?256:2048,c$=512,u$=1024,d$=Ti?2048:256,Dk=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=l$(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|=a$),this.altKey&&(t|=c$),this.shiftKey&&(t|=u$),this.metaKey&&(t|=d$),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new s$(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ok=new WeakMap;function h$(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 f$=class{static getSameOriginWindowChain(e){let t=Ok.get(e);if(!t){t=[],Ok.set(e,t);let n=e,r;do r=h$(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 l of s){let a=l.window.deref();if(n+=(a==null?void 0:a.scrollY)??0,r+=(a==null?void 0:a.scrollX)??0,a===t||!l.iframeElement)break;let u=l.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},Bh=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=f$.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Lk=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(l0){let l=navigator.userAgent.match(/Chrome\/(\d+)/);r=(l?parseInt(l[1]):123)<=122}if(e){let l=e,a=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof l.wheelDeltaY<"u")r?this.deltaY=l.wheelDeltaY/(120*u):this.deltaY=l.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?X_&&!Ti?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")XU&&nA?this.deltaX=-(l.wheelDeltaX/120):r?this.deltaX=l.wheelDeltaX/(120*u):this.deltaX=l.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?X_&&!Ti?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()}},sA=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),p$;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof m$?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:An.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:sA})})(p$||(p$={}));var m$=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?sA:(this._emitter||(this._emitter=new xe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},c0=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 W_("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new W_("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},g$=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 W_("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=jt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},v$;(e=>{async function t(r){let s,l=await Promise.all(r.map(a=>a.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return l}e.settled=t;function n(r){return new Promise(async(s,l)=>{try{await r(s,l)}catch(a){l(a)}})}e.withAsyncBody=n})(v$||(v$={}));var jk=class Ir{static fromArray(t){return new Ir(n=>{n.emitMany(t)})}static fromPromise(t){return new Ir(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Ir(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Ir(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 xe,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 An.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 Ir(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return Ir.map(this,t)}static filter(t,n){return new Ir(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return Ir.filter(this,t)}static coalesce(t){return Ir.filter(t,n=>!!n)}coalesce(){return Ir.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Ir.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())}};jk.EMPTY=jk.fromArray([]);var{getWindow:ki,getWindowId:_$,onDidRegisterWindow:y$}=(function(){let e=new Map,t={window:as,disposables:new oo};e.set(as.vscodeWindowId,t);let n=new xe,r=new xe,s=new xe;function l(a,u){return(typeof a=="number"?e.get(a):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Ge.None;let u=new oo,h={window:a,disposables:u.add(new oo)};return e.set(a.vscodeWindowId,h),u.add(jt(()=>{e.delete(a.vscodeWindowId),r.fire(a)})),u.add(He(a,mn.BEFORE_UNLOAD,()=>{s.fire(a)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:l,getWindow(a){var d;let u=a;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=a;return h!=null&&h.view?h.view.window:as},getDocument(a){return ki(a).document}}})(),b$=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 He(e,t,n,r){return new b$(e,t,n,r)}var zk=function(e,t,n,r){return He(e,t,n,r)},u0,x$=class extends g${constructor(e){super(),this.defaultTarget=e&&ki(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},Pk=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){uf(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=l=>{n.set(l,!1);let a=e.get(l)??[];for(t.set(l,a),e.set(l,[]),r.set(l,!0);a.length>0;)a.sort(Pk.sort),a.shift().execute();r.set(l,!1)};u0=(l,a,u=0)=>{let h=_$(l),d=new Pk(a,u),p=e.get(h);return p||(p=[],e.set(h,p)),p.push(d),n.get(h)||(n.set(h,!0),l.requestAnimationFrame(()=>s(h))),d}})();function S$(e){let t=e.getBoundingClientRect(),n=ki(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var mn={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"},w$=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=ir(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ir(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ir(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ir(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ir(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ir(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ir(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ir(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ir(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ir(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ir(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=ir(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=ir(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ir(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 ir(e){return typeof e=="number"?`${e}px`:e}function yu(e){return new w$(e)}var oA=class{constructor(){this._hooks=new oo,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 l=e;try{e.setPointerCapture(t),this._hooks.add(jt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=ki(e)}this._hooks.add(He(l,mn.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(He(l,mn.POINTER_UP,a=>this.stopMonitoring(!0)))}};function C$(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 l=`$memoize$${t}`;n[r]=function(...a){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,a)}),this[l]}}var _i;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(_i||(_i={}));var su=class Ln extends Ge{constructor(){super(),this.dispatched=!1,this.targets=new Rk,this.ignoreTargets=new Rk,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(An.runAndSubscribe(y$,({window:t,disposables:n})=>{n.add(He(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(He(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(He(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:as,disposables:this._store}))}static addTarget(t){if(!Ln.isTouchDevice())return Ge.None;Ln.INSTANCE||(Ln.INSTANCE=new Ln);let n=Ln.INSTANCE.targets.push(t);return jt(n)}static ignoreTarget(t){if(!Ln.isTouchDevice())return Ge.None;Ln.INSTANCE||(Ln.INSTANCE=new Ln);let n=Ln.INSTANCE.ignoreTargets.push(t);return jt(n)}static isTouchDevice(){return"ontouchstart"in as||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 l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:n,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[n],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let a=this.newGestureEvent(_i.Start,l.target);a.pageX=l.pageX,a.pageY=l.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let l=0,a=n.changedTouches.length;l<a;l++){let u=n.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<Ln.HOLD_DELAY&&Math.abs(h.initialPageX-yr(h.rollingPageX))<30&&Math.abs(h.initialPageY-yr(h.rollingPageY))<30){let p=this.newGestureEvent(_i.Tap,h.initialTarget);p.pageX=yr(h.rollingPageX),p.pageY=yr(h.rollingPageY),this.dispatchEvent(p)}else if(d>=Ln.HOLD_DELAY&&Math.abs(h.initialPageX-yr(h.rollingPageX))<30&&Math.abs(h.initialPageY-yr(h.rollingPageY))<30){let p=this.newGestureEvent(_i.Contextmenu,h.initialTarget);p.pageX=yr(h.rollingPageX),p.pageY=yr(h.rollingPageY),this.dispatchEvent(p)}else if(s===1){let p=yr(h.rollingPageX),m=yr(h.rollingPageY),_=yr(h.rollingTimestamps)-h.rollingTimestamps[0],y=p-h.rollingPageX[0],S=m-h.rollingPageY[0],w=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,w,r,Math.abs(y)/_,y>0?1:-1,p,Math.abs(S)/_,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(_i.End,h.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===_i.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Ln.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===_i.Change||t.type===_i.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,l=t.initialTarget;for(;l&&l!==r;)s++,l=l.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,l,a,u,h,d){this.handle=u0(t,()=>{let p=Date.now(),m=p-r,_=0,y=0,S=!0;s+=Ln.SCROLL_FRICTION*m,u+=Ln.SCROLL_FRICTION*m,s>0&&(S=!1,_=l*s*m),u>0&&(S=!1,y=h*u*m);let w=this.newGestureEvent(_i.Change);w.translationX=_,w.translationY=y,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,p,s,l,a+_,u,h,d+y)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let a=this.activeTouches[l.identifier],u=this.newGestureEvent(_i.Change,a.initialTarget);u.translationX=l.pageX-yr(a.rollingPageX),u.translationY=l.pageY-yr(a.rollingPageY),u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(l.pageX),a.rollingPageY.push(l.pageY),a.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};su.SCROLL_FRICTION=-.005,su.HOLD_DELAY=700,su.CLEAR_TAP_COUNT_TIME=400,Wt([C$],su,"isTouchDevice",1);var k$=su,d0=class extends Ge{onclick(e,t){this._register(He(e,mn.CLICK,n=>t(new Bh(ki(e),n))))}onmousedown(e,t){this._register(He(e,mn.MOUSE_DOWN,n=>t(new Bh(ki(e),n))))}onmouseover(e,t){this._register(He(e,mn.MOUSE_OVER,n=>t(new Bh(ki(e),n))))}onmouseleave(e,t){this._register(He(e,mn.MOUSE_LEAVE,n=>t(new Bh(ki(e),n))))}onkeydown(e,t){this._register(He(e,mn.KEY_DOWN,n=>t(new Dk(n))))}onkeyup(e,t){this._register(He(e,mn.KEY_UP,n=>t(new Dk(n))))}oninput(e,t){this._register(He(e,mn.INPUT,t))}onblur(e,t){this._register(He(e,mn.BLUR,t))}onfocus(e,t){this._register(He(e,mn.FOCUS,t))}onchange(e,t){this._register(He(e,mn.CHANGE,t))}ignoreGesture(e){return k$.ignoreTarget(e)}},Bk=11,E$=class extends d0{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=Bk+"px",this.domNode.style.height=Bk+"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 oA),this._register(zk(this.bgDomNode,mn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(zk(this.domNode,mn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new x$),this._pointerdownScheduleRepeatTimer=this._register(new c0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ki(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()}},R$=class J_{constructor(t,n,r,s,l,a,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,l=l|0,a=a|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),l<0&&(l=0),u+l>a&&(u=a-l),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=l,this.scrollHeight=a,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 J_(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 J_(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,l=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=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:l,heightChanged:a,scrollHeightChanged:u,scrollTopChanged:h}}},T$=class extends Ge{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new R$(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 Hk(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=Hk.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)))}},Ik=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Mv(e,t){let n=t-e;return function(r){return e+n*A$(r)}}function M$(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Hk=class ey{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,l;return t<n?(s=t+.75*r,l=n-.75*r):(s=t-.75*r,l=n+.75*r),M$(Mv(t,s),Mv(l,n),.33)}return Mv(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 Ik(r,s,!1)}return new Ik(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return ey.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new ey(t,n,s,r)}};function N$(e){return Math.pow(e,3)}function A$(e){return 1-N$(1-e)}var D$=class extends Ge{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 c0)}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":"")))}},O$=140,lA=class extends d0{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 D$(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new oA),this._shouldRender=!0,this.domNode=yu(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(He(this.domNode.domNode,mn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new E$(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=yu(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(He(this.slider.domNode,mn.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=S$(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 l=this._sliderOrthogonalPointerPosition(s),a=Math.abs(l-n);if(nA&&a>O$){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()}},aA=class ty{constructor(t,n,r,s,l,a){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=l,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ty(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,l){let a=Math.max(0,r-t),u=Math.max(0,a-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),p=(u-d)/(s-r),m=l*p;return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=ty._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)}},L$=class extends lA{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new aA(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}},j$=class extends lA{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new aA(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}},z$=500,Fk=50,P$=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},ny=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 l=s===this._front?t:Math.pow(2,-r);if(t-=l,n+=this._memory[s].score*l,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(l0){let n=ki(t.browserEvent),r=GU(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,l=new P$(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,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]=l),l.score=this._computeScore(l,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),l=Math.abs(t.deltaY),a=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,a),1),d=Math.max(Math.min(l,u),1),p=Math.max(s,a),m=Math.max(l,u);p%h===0&&m%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};ny.INSTANCE=new ny;var B$=ny,I$=class extends d0{constructor(e,t,n){super(),this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new xe),this.onWillScroll=this._onWillScroll.event,this._options=F$(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 j$(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new L$(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=yu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=yu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=yu(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 c0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=nl(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,Ti&&(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 Lk(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=nl(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new Lk(n))};this._mouseWheelToDispose.push(He(this._listenOnDomNode,mn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=B$.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+l===0?a=l=0:Math.abs(l)>=Math.abs(a)?a=0:l=0),this._options.flipAxes&&([l,a]=[a,l]);let u=!Ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!a&&(a=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(l){let p=Fk*l,m=h.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(d,m)}if(a){let p=Fk*a,m=h.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(d,m)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),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":"",l=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${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(),z$)}},H$=class extends I${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 F$(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,Ti&&(t.className+=" mac"),t}var ry=class extends Ge{constructor(e,t,n,r,s,l,a,u){super(),this._bufferService=n,this._optionsService=a,this._renderService=u,this._onRequestScrollLines=this._register(new xe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new T$({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>u0(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new H$(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(An.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(jt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(jt(()=>this._styleElement.remove())),this._register(An.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
496
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){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}};ry=Wt([Ee(2,Kn),Ee(3,vs),Ee(4,UN),Ee(5,Ua),Ee(6,Gn),Ee(7,_s)],ry);var iy=class extends Ge{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(l=>this._removeDecoration(l))),this._register(jt(()=>{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()}};iy=Wt([Ee(1,Kn),Ee(2,vs),Ee(3,td),Ee(4,_s)],iy);var U$=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)}},gi={full:0,left:0,center:0,right:0},Gs={full:0,left:0,center:0,right:0},Uc={full:0,left:0,center:0,right:0},If=class extends Ge{constructor(e,t,n,r,s,l,a,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=l,this._themeService=a,this._coreBrowserService=u,this._colorZoneStore=new U$,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(jt(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let h=this._canvas.getContext("2d");if(h)this._ctx=h;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);Gs.full=this._canvas.width,Gs.left=e,Gs.center=t,Gs.right=e,this._refreshDrawHeightConstants(),Uc.full=1,Uc.left=1,Uc.center=1+Gs.left,Uc.right=1+Gs.left+Gs.center}_refreshDrawHeightConstants(){gi.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);gi.left=t,gi.center=t,gi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*gi.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(Uc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-gi[e.position||"full"]/2),Gs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+gi[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}))}};If=Wt([Ee(2,Kn),Ee(3,td),Ee(4,_s),Ee(5,Gn),Ee(6,Ua),Ee(7,vs)],If);var me;(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=`
|
|
497
|
-
`,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=""))(me||(me={}));var ff;(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=""))(ff||(ff={}));var cA;(e=>e.ST=`${me.ESC}\\`)(cA||(cA={}));var sy=class{constructor(e,t,n,r,s,l){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let 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(`${me.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 l=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};sy=Wt([Ee(2,Kn),Ee(3,Gn),Ee(4,hl),Ee(5,_s)],sy);var bn=0,xn=0,Sn=0,$t=0,Uk={css:"#00000000",rgba:0},tn;(e=>{function t(s,l,a,u){return u!==void 0?`#${Ho(s)}${Ho(l)}${Ho(a)}${Ho(u)}`:`#${Ho(s)}${Ho(l)}${Ho(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})(tn||(tn={}));var Nt;(e=>{function t(h,d){if($t=(d.rgba&255)/255,$t===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,m=d.rgba>>16&255,_=d.rgba>>8&255,y=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;bn=y+Math.round((p-y)*$t),xn=S+Math.round((m-S)*$t),Sn=w+Math.round((_-w)*$t);let C=tn.toCss(bn,xn,Sn),k=tn.toRgba(bn,xn,Sn);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,p){let m=pf.ensureContrastRatio(h.rgba,d.rgba,p);if(m)return tn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[bn,xn,Sn]=pf.toChannels(d),{css:tn.toCss(bn,xn,Sn),rgba:d}}e.opaque=s;function l(h,d){return $t=Math.round(d*255),[bn,xn,Sn]=pf.toChannels(h.rgba),{css:tn.toCss(bn,xn,Sn,$t),rgba:tn.toRgba(bn,xn,Sn,$t)}}e.opacity=l;function a(h,d){return $t=h.rgba&255,l(h,$t*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(Nt||(Nt={}));var It;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,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 bn=parseInt(s.slice(1,2).repeat(2),16),xn=parseInt(s.slice(2,3).repeat(2),16),Sn=parseInt(s.slice(3,4).repeat(2),16),tn.toColor(bn,xn,Sn);case 5:return bn=parseInt(s.slice(1,2).repeat(2),16),xn=parseInt(s.slice(2,3).repeat(2),16),Sn=parseInt(s.slice(3,4).repeat(2),16),$t=parseInt(s.slice(4,5).repeat(2),16),tn.toColor(bn,xn,Sn,$t);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 l=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(l)return bn=parseInt(l[1]),xn=parseInt(l[2]),Sn=parseInt(l[3]),$t=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),tn.toColor(bn,xn,Sn,$t);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),[bn,xn,Sn,$t]=t.getImageData(0,0,1,1).data,$t!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:tn.toRgba(bn,xn,Sn,$t),css:s}}e.toColor=r})(It||(It={}));var Un;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Un||(Un={}));var pf;(e=>{function t(a,u){if($t=(u&255)/255,$t===1)return u;let h=u>>24&255,d=u>>16&255,p=u>>8&255,m=a>>24&255,_=a>>16&255,y=a>>8&255;return bn=m+Math.round((h-m)*$t),xn=_+Math.round((d-_)*$t),Sn=y+Math.round((p-y)*$t),tn.toRgba(bn,xn,Sn)}e.blend=t;function n(a,u,h){let d=Un.relativeLuminance(a>>8),p=Un.relativeLuminance(u>>8);if(is(d,p)<h){if(p<d){let y=r(a,u,h),S=is(d,Un.relativeLuminance(y>>8));if(S<h){let w=s(a,u,h),C=is(d,Un.relativeLuminance(w>>8));return S>C?y:w}return y}let m=s(a,u,h),_=is(d,Un.relativeLuminance(m>>8));if(_<h){let y=r(a,u,h),S=is(d,Un.relativeLuminance(y>>8));return _>S?m:y}return m}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));for(;w<h&&(_>0||y>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,p=a>>16&255,m=a>>8&255,_=u>>24&255,y=u>>16&255,S=u>>8&255,w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));for(;w<h&&(_<255||y<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=is(Un.relativeLuminance2(_,y,S),Un.relativeLuminance2(d,p,m));return(_<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(pf||(pf={}));function Ho(e){let t=e.toString(16);return t.length<2?"0"+t:t}function is(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var $$=class extends ed{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()]}},Hf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Vr}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,l=0,a=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let p=this._getJoinedRanges(r,a,l,t,s);for(let m=0;m<p.length;m++)n.push(p[m])}s=d,a=l,u=this._workCell.fg,h=this._workCell.bg}l+=this._workCell.getChars().length||io.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,a,l,t,s);for(let p=0;p<d.length;p++)n.push(d[p])}return n}_getJoinedRanges(e,t,n,r,s){let l=e.substring(t,n),a=[];try{a=this._characterJoiners[0].handler(l)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(l);for(let d=0;d<h.length;d++)Hf._mergeRanges(a,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(a,r,s),a}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,l=0,a=e[r];if(a){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||io.length;if(h!==0){if(!s&&a[0]<=l&&(a[0]=u,s=!0),a[1]<=l){if(a[1]=u,a=e[++r],!a)break;a[0]<=l?(a[0]=u,s=!0):s=!1}l+=d}}a&&(a[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}};Hf=Wt([Ee(0,Kn)],Hf);function W$(e){return 57508<=e&&e<=57558}function V$(e){return 9472<=e&&e<=9631}function q$(e){return W$(e)||V$(e)}function K$(){return{css:{canvas:Ih(),cell:Ih()},device:{canvas:Ih(),cell:Ih(),char:{width:0,height:0,left:0,top:0}}}}function Ih(){return{width:0,height:0}}var oy=class{constructor(e,t,n,r,s,l,a){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=l,this._themeService=a,this._workCell=new Vr,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,l,a,u,h,d,p){let m=[],_=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<l+1&&(S=l+1);let w,C=0,k="",T=0,R=0,M=0,L=0,D=!1,j=0,F=!1,Y=0,z=0,H=[],P=d!==-1&&p!==-1;for(let U=0;U<S;U++){e.loadCell(U,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let $=!1,B=U>=z,K=U,W=this._workCell;if(_.length>0&&U===_[0][0]&&B){let ke=_.shift(),Be=this._isCellInSelection(ke[0],t);for(T=ke[0]+1;T<ke[1];T++)B&&(B=Be===this._isCellInSelection(T,t));B&&(B=!n||l<ke[0]||l>=ke[1]),B?($=!0,W=new $$(this._workCell,e.translateToString(!0,ke[0],ke[1]),ke[1]-ke[0]),K=ke[1]-1,V=W.getWidth()):z=ke[1]}let Z=this._isCellInSelection(U,t),N=n&&U===l,I=P&&U>=d&&U<=p,q=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,ke=>{q=!0});let A=W.getChars()||io;if(A===" "&&(W.isUnderline()||W.isOverline())&&(A=" "),Y=V*u-h.get(A,W.isBold(),W.isItalic()),!w)w=this._document.createElement("span");else if(C&&(Z&&F||!Z&&!F&&W.bg===R)&&(Z&&F&&y.selectionForeground||W.fg===M)&&W.extended.ext===L&&I===D&&Y===j&&!N&&!$&&!q&&B){W.isInvisible()?k+=io:k+=A,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=W.bg,M=W.fg,L=W.extended.ext,D=I,j=Y,F=Z,$&&l>=U&&l<=K&&(l=U),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&H.push("xterm-cursor-blink"),H.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(W.isBold()&&H.push("xterm-bold"),W.isItalic()&&H.push("xterm-italic"),W.isDim()&&H.push("xterm-dim"),W.isInvisible()?k=io:k=W.getChars()||io,W.isUnderline()&&(H.push(`xterm-underline-${W.extended.underlineStyle}`),k===" "&&(k=" "),!W.isUnderlineColorDefault()))if(W.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${ed.toColorRGB(W.getUnderlineColor()).join(",")})`;else{let ke=W.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&W.isBold()&&ke<8&&(ke+=8),w.style.textDecorationColor=y.ansi[ke].css}W.isOverline()&&(H.push("xterm-overline"),k===" "&&(k=" ")),W.isStrikethrough()&&H.push("xterm-strikethrough"),I&&(w.style.textDecoration="underline");let ae=W.getFgColor(),fe=W.getFgColorMode(),oe=W.getBgColor(),J=W.getBgColorMode(),ge=!!W.isInverse();if(ge){let ke=ae;ae=oe,oe=ke;let Be=fe;fe=J,J=Be}let ie,ce,we=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,ke=>{ke.options.layer!=="top"&&we||(ke.backgroundColorRGB&&(J=50331648,oe=ke.backgroundColorRGB.rgba>>8&16777215,ie=ke.backgroundColorRGB),ke.foregroundColorRGB&&(fe=50331648,ae=ke.foregroundColorRGB.rgba>>8&16777215,ce=ke.foregroundColorRGB),we=ke.options.layer==="top")}),!we&&Z&&(ie=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,oe=ie.rgba>>8&16777215,J=50331648,we=!0,y.selectionForeground&&(fe=50331648,ae=y.selectionForeground.rgba>>8&16777215,ce=y.selectionForeground)),we&&H.push("xterm-decoration-top");let Se;switch(J){case 16777216:case 33554432:Se=y.ansi[oe],H.push(`xterm-bg-${oe}`);break;case 50331648:Se=tn.toColor(oe>>16,oe>>8&255,oe&255),this._addStyle(w,`background-color:#${$k((oe>>>0).toString(16),"0",6)}`);break;case 0:default:ge?(Se=y.foreground,H.push("xterm-bg-257")):Se=y.background}switch(ie||W.isDim()&&(ie=Nt.multiplyOpacity(Se,.5)),fe){case 16777216:case 33554432:W.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(w,Se,y.ansi[ae],W,ie,void 0)||H.push(`xterm-fg-${ae}`);break;case 50331648:let ke=tn.toColor(ae>>16&255,ae>>8&255,ae&255);this._applyMinimumContrast(w,Se,ke,W,ie,ce)||this._addStyle(w,`color:#${$k(ae.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,Se,y.foreground,W,ie,ce)||ge&&H.push("xterm-fg-257")}H.length&&(w.className=H.join(" "),H.length=0),!N&&!$&&!q&&B?C++:w.textContent=k,Y!==this.defaultSpacing&&(w.style.letterSpacing=`${Y}px`),m.push(w),U=K}return w&&C&&(w.textContent=k),m}_applyMinimumContrast(e,t,n,r,s,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||q$(r.getCode()))return!1;let a=this._getContrastCache(r),u;if(!s&&!l&&(u=a.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=Nt.ensureContrastRatio(s||t,l||n,h),a.setColor((s||t).rgba,(l||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]}};oy=Wt([Ee(1,VN),Ee(2,Gn),Ee(3,vs),Ee(4,hl),Ee(5,td),Ee(6,Ua)],oy);function $k(e,t,n){for(;e.length<n;)e=t+e;return e}var G$=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 l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[n,r,s,l],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(l),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,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 a=this._measure(e,0);return a>0&&(this._flat[r]=a),a}let s=e;t&&(s+="B"),n&&(s+="I");let l=this._holey.get(s);if(l===void 0){let a=0;t&&(a|=1),n&&(a|=2),l=this._measure(e,a),l>0&&this._holey.set(s,l)}return l}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},Y$=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,l=t[1]-s,a=n[1]-s,u=Math.max(l,0),h=Math.min(a,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,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 X$(){return new Y$}var Nv="xterm-dom-renderer-owner-",Br="xterm-rows",Hh="xterm-fg-",Wk="xterm-bg-",$c="xterm-focus",Fh="xterm-selection",Z$=1,ly=class extends Ge{constructor(e,t,n,r,s,l,a,u,h,d,p,m,_,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=l,this._linkifier2=a,this._charSizeService=h,this._optionsService=d,this._bufferService=p,this._coreService=m,this._coreBrowserService=_,this._themeService=y,this._terminalClass=Z$++,this._rowElements=[],this._selectionRenderModel=X$(),this.onRequestRedraw=this._register(new xe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Br),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(Fh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=K$(),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(oy,document),this._element.classList.add(Nv+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(jt(()=>{this._element.classList.remove(Nv+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new G$(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} .${Br} 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} .${Br} { 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} .${Br} .xterm-dim { color: ${Nt.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} .${Br}.${$c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Br}.${$c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Br}.${$c} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Br} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Fh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Fh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Fh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())t+=`${this._terminalSelector} .${Hh}${l} { color: ${a.css}; }${this._terminalSelector} .${Hh}${l}.xterm-dim { color: ${Nt.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${Wk}${l} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${Hh}257 { color: ${Nt.opaque(e.background).css}; }${this._terminalSelector} .${Hh}257.xterm-dim { color: ${Nt.multiplyOpacity(Nt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Wk}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,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(l,h?t[0]:e[0],h?e[0]:t[0],a-l+1))}else{let h=r===l?e[0]:0,d=l===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,h,d));let p=a-l-1;if(u.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,p)),l!==a){let m=s===a?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,0,m))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(n-t);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${l}px`,s.style.width=`${a}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),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,p=this._rowElements[h],m=n.lines.get(d);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,d,d===r,a,u,s,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Nv}${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,l){n<0&&(e=0),r<0&&(t=0);let a=this._bufferService.rows-1;n=Math.max(Math.min(n,a),0),r=Math.max(Math.min(r,a),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let S=y+u.ydisp,w=this._rowElements[y],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===h,m,_,d,p,this.dimensions.css.cell.width,this._widthCache,l?y===n?e:0:-1,l?(y===r?t:s)-1:-1))}}};ly=Wt([Ee(7,i0),Ee(8,Ep),Ee(9,Gn),Ee(10,Kn),Ee(11,hl),Ee(12,vs),Ee(13,Ua)],ly);var ay=class extends Ge{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new xe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new J$(this._optionsService))}catch{this._measureStrategy=this._register(new Q$(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())}};ay=Wt([Ee(2,Gn)],ay);var uA=class extends Ge{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},Q$=class extends uA{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}},J$=class extends uA{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}},eW=class extends Ge{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 tW(this._window)),this._onDprChange=this._register(new xe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new xe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(An.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(He(this._textarea,"focus",()=>this._isFocused=!0)),this._register(He(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}},tW=class extends Ge{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ea),this._onDprChange=this._register(new xe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(jt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=He(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)}},nW=class extends Ge{constructor(){super(),this.linkProviders=[],this._register(jt(()=>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 h0(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),l=parseInt(s.getPropertyValue("padding-left")),a=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-a]}function rW(e,t,n,r,s,l,a,u,h){if(!l)return;let d=h0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?a/2:0))/a),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var cy=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return rW(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=h0(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])}}};cy=Wt([Ee(0,_s),Ee(1,Ep)],cy);var iW=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=[]}},dA={};pU(dA,{getSafariVersion:()=>oW,isChromeOS:()=>mA,isFirefox:()=>hA,isIpad:()=>lW,isIphone:()=>aW,isLegacyEdge:()=>sW,isLinux:()=>f0,isMac:()=>Ff,isNode:()=>Rp,isSafari:()=>fA,isWindows:()=>pA});var Rp=typeof process<"u"&&"title"in process,nd=Rp?"node":navigator.userAgent,rd=Rp?"node":navigator.platform,hA=nd.includes("Firefox"),sW=nd.includes("Edge"),fA=/^((?!chrome|android).)*safari/i.test(nd);function oW(){if(!fA)return 0;let e=nd.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Ff=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(rd),lW=rd==="iPad",aW=rd==="iPhone",pA=["Windows","Win16","Win32","WinCE"].includes(rd),f0=rd.indexOf("Linux")>=0,mA=/\bCrOS\b/.test(nd),gA=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()}},cW=class extends gA{_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())}}},uW=class extends gA{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Uf=!Rp&&"requestIdleCallback"in window?uW:cW,dW=class{constructor(){this._queue=new Uf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},uy=class extends Ge{constructor(e,t,n,r,s,l,a,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new Ea),this._pausedResizeTask=new dW,this._observerDisposable=this._register(new Ea),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 xe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new xe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new xe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new xe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new iW((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new hW(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(jt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=jt(()=>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()}};uy=Wt([Ee(2,Gn),Ee(3,Ep),Ee(4,hl),Ee(5,td),Ee(6,Kn),Ee(7,vs),Ee(8,Ua)],uy);var hW=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 fW(e,t,n,r){let s=n.buffer.x,l=n.buffer.y;if(!n.buffer.hasScrollback)return gW(s,l,e,t,n,r)+Tp(l,t,n,r)+vW(s,l,e,t,n,r);let a;if(l===t)return a=s>e?"D":"C",zu(Math.abs(s-e),ju(a,r));a=l>t?"D":"C";let u=Math.abs(l-t),h=mW(l>t?e:s,n)+(u-1)*n.cols+1+pW(l>t?s:e);return zu(h,ju(a,r))}function pW(e,t){return e-1}function mW(e,t){return t.cols-e}function gW(e,t,n,r,s,l){return Tp(t,r,s,l).length===0?"":zu(_A(e,t,e,t-rl(t,s),!1,s).length,ju("D",l))}function Tp(e,t,n,r){let s=e-rl(e,n),l=t-rl(t,n),a=Math.abs(s-l)-_W(e,t,n);return zu(a,ju(vA(e,t),r))}function vW(e,t,n,r,s,l){let a;Tp(t,r,s,l).length>0?a=r-rl(r,s):a=t;let u=r,h=yW(e,t,n,r,s,l);return zu(_A(e,a,n,u,h==="C",s).length,ju(h,l))}function _W(e,t,n){var a;let r=0,s=e-rl(e,n),l=t-rl(t,n);for(let u=0;u<Math.abs(s-l);u++){let h=vA(e,t)==="A"?-1:1;(a=n.buffer.lines.get(s+h*u))!=null&&a.isWrapped&&r++}return r}function rl(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 yW(e,t,n,r,s,l){let a;return Tp(n,r,s,l).length>0?a=r-rl(r,s):a=t,e<n&&a<=r||e>=n&&a<r?"C":"D"}function vA(e,t){return e>t?"A":"B"}function _A(e,t,n,r,s,l){let a=e,u=t,h="";for(;(a!==n||u!==r)&&u>=0&&u<l.buffer.lines.length;)a+=s?1:-1,s&&a>l.cols-1?(h+=l.buffer.translateBufferLineToString(u,!1,e,a),a=0,e=0,u++):!s&&a<0&&(h+=l.buffer.translateBufferLineToString(u,!1,0,e+1),a=l.cols-1,e=a,u--);return h+l.buffer.translateBufferLineToString(u,!1,e,a)}function ju(e,t){let n=t?"O":"[";return me.ESC+n+e}function zu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var bW=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 Vk(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 Av=50,xW=15,SW=50,wW=500,CW=" ",kW=new RegExp(CW,"g"),dy=class extends Ge{constructor(e,t,n,r,s,l,a,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=l,this._optionsService=a,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Vr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new xe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new xe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new xe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new xe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new bW(this._bufferService),this._activeSelectionMode=0,this._register(jt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let 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],l=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let u=n.translateBufferLineToString(a,!0,s,l);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 l=e[1]+1;l<=t[1]-1;l++){let a=n.lines.get(l),u=n.translateBufferLineToString(l,!0);a!=null&&a.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let l=n.lines.get(t[1]),a=n.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=a:r.push(a)}}return r.map(s=>s.replace(kW," ")).join(pA?`\r
|
|
498
|
-
`:`
|
|
499
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f0&&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,l;let n=(l=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:l.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Vk(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=h0(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,-Av),Av),t/=Av,t/Math.abs(t)+Math.round(t*(xW-1)))}shouldForceSelection(e){return Ff?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(),SW)}_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&&!(Ff&&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<wW&&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=fW(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,l=s.lines.get(e[1]);if(!l)return;let a=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(l,e[0]),h=u,d=e[0]-u,p=0,m=0,_=0,y=0;if(a.charAt(u)===" "){for(;u>0&&a.charAt(u-1)===" ";)u--;for(;h<a.length&&a.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];l.getWidth(C)===0&&(p++,C--),l.getWidth(k)===2&&(m++,k++);let T=l.getString(k).length;for(T>1&&(y+=T-1,h+=T-1);C>0&&u>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.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<l.length&&h+1<a.length&&!this._isCharWordSeparator(l.loadCell(k+1,this._workCell));){l.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(y+=R-1,h+=R-1),h++,k++}}h++;let S=u+d-p+_,w=Math.min(this._bufferService.cols,h-u+p+m-_-y);if(!(!t&&a.slice(u,h).trim()==="")){if(n&&S===0&&l.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&l.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&&l.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=Vk(n,this._bufferService.cols)}};dy=Wt([Ee(3,Kn),Ee(4,hl),Ee(5,s0),Ee(6,Gn),Ee(7,_s),Ee(8,vs)],dy);var qk=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={}}},Kk=class{constructor(){this._color=new qk,this._css=new qk}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()}},an=Object.freeze((()=>{let e=[It.toColor("#2e3436"),It.toColor("#cc0000"),It.toColor("#4e9a06"),It.toColor("#c4a000"),It.toColor("#3465a4"),It.toColor("#75507b"),It.toColor("#06989a"),It.toColor("#d3d7cf"),It.toColor("#555753"),It.toColor("#ef2929"),It.toColor("#8ae234"),It.toColor("#fce94f"),It.toColor("#729fcf"),It.toColor("#ad7fa8"),It.toColor("#34e2e2"),It.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],l=t[n%6];e.push({css:tn.toCss(r,s,l),rgba:tn.toRgba(r,s,l)})}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})()),$o=It.toColor("#ffffff"),ou=It.toColor("#000000"),Gk=It.toColor("#ffffff"),Yk=ou,Wc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},EW=$o,hy=class extends Ge{constructor(e){super(),this._optionsService=e,this._contrastCache=new Kk,this._halfContrastCache=new Kk,this._onChangeColors=this._register(new xe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:$o,background:ou,cursor:Gk,cursorAccent:Yk,selectionForeground:void 0,selectionBackgroundTransparent:Wc,selectionBackgroundOpaque:Nt.blend(ou,Wc),selectionInactiveBackgroundTransparent:Wc,selectionInactiveBackgroundOpaque:Nt.blend(ou,Wc),scrollbarSliderBackground:Nt.opacity($o,.2),scrollbarSliderHoverBackground:Nt.opacity($o,.4),scrollbarSliderActiveBackground:Nt.opacity($o,.5),overviewRulerBorder:$o,ansi:an.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=_t(e.foreground,$o),t.background=_t(e.background,ou),t.cursor=Nt.blend(t.background,_t(e.cursor,Gk)),t.cursorAccent=Nt.blend(t.background,_t(e.cursorAccent,Yk)),t.selectionBackgroundTransparent=_t(e.selectionBackground,Wc),t.selectionBackgroundOpaque=Nt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=_t(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Nt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?_t(e.selectionForeground,Uk):void 0,t.selectionForeground===Uk&&(t.selectionForeground=void 0),Nt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Nt.opacity(t.selectionBackgroundTransparent,.3)),Nt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Nt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=_t(e.scrollbarSliderBackground,Nt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=_t(e.scrollbarSliderHoverBackground,Nt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=_t(e.scrollbarSliderActiveBackground,Nt.opacity(t.foreground,.5)),t.overviewRulerBorder=_t(e.overviewRulerBorder,EW),t.ansi=an.slice(),t.ansi[0]=_t(e.black,an[0]),t.ansi[1]=_t(e.red,an[1]),t.ansi[2]=_t(e.green,an[2]),t.ansi[3]=_t(e.yellow,an[3]),t.ansi[4]=_t(e.blue,an[4]),t.ansi[5]=_t(e.magenta,an[5]),t.ansi[6]=_t(e.cyan,an[6]),t.ansi[7]=_t(e.white,an[7]),t.ansi[8]=_t(e.brightBlack,an[8]),t.ansi[9]=_t(e.brightRed,an[9]),t.ansi[10]=_t(e.brightGreen,an[10]),t.ansi[11]=_t(e.brightYellow,an[11]),t.ansi[12]=_t(e.brightBlue,an[12]),t.ansi[13]=_t(e.brightMagenta,an[13]),t.ansi[14]=_t(e.brightCyan,an[14]),t.ansi[15]=_t(e.brightWhite,an[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]=_t(e.extendedAnsi[r],an[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()}}};hy=Wt([Ee(0,Gn)],hy);function _t(e,t){if(e!==void 0)try{return It.toColor(e)}catch{}return t}var RW=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)}},TW=class{constructor(){this._services=new RW,this._services.set(i0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=xU(e).sort((l,a)=>l.index-a.index),r=[];for(let l of n){let a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(a)}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)}},MW={trace:0,debug:1,info:2,warn:3,error:4,off:5},NW="xterm.js: ",fy=class extends Ge{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=MW[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?"":NW)+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)}};fy=Wt([Ee(0,Gn)],fy);var Xk=class extends Ge{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new xe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new xe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new xe),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}},qe=3,en=Object.freeze(new ed),Uh=0,Dv=2,lu=class yA{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*qe);let s=n||Vr.fromCharData([0,BN,1,0]);for(let l=0;l<t;++l)this.setCell(l,s);this.length=t}get(t){let n=this._data[t*qe+0],r=n&2097151;return[this._data[t*qe+1],n&2097152?this._combined[t]:r?eo(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*qe+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*qe+0]=t|2097152|n[2]<<22):this._data[t*qe+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*qe+0]>>22}hasWidth(t){return this._data[t*qe+0]&12582912}getFg(t){return this._data[t*qe+1]}getBg(t){return this._data[t*qe+2]}hasContent(t){return this._data[t*qe+0]&4194303}getCodePoint(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*qe+0]&2097152}getString(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t]:n&2097151?eo(n&2097151):""}isProtected(t){return this._data[t*qe+2]&536870912}loadCell(t,n){return Uh=t*qe,n.content=this._data[Uh+0],n.fg=this._data[Uh+1],n.bg=this._data[Uh+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*qe+0]=n.content,this._data[t*qe+1]=n.fg,this._data[t*qe+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*qe+0]=n|r<<22,this._data[t*qe+1]=s.fg,this._data[t*qe+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*qe+0];s&2097152?this._combined[t]+=eo(n):s&2097151?(this._combined[t]=eo(s&2097151)+eo(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*qe+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 Vr;for(let l=this.length-t-n-1;l>=0;--l)this.setCell(t+n+l,this.loadCell(t+l,s));for(let l=0;l<n;++l)this.setCell(t+l,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 Vr;for(let l=0;l<this.length-t-n;++l)this.setCell(t+l,this.loadCell(t+n+l,s));for(let l=this.length-n;l<this.length;++l)this.setCell(l,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*Dv<this._data.buffer.byteLength;let r=t*qe;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 a=0;a<s.length;a++){let u=parseInt(s[a],10);u>=t&&delete this._combined[u]}let l=Object.keys(this._extendedAttrs);for(let a=0;a<l.length;a++){let u=parseInt(l[a],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Dv<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Dv<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 yA(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*qe+0]&4194303)return t+(this._data[t*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303||this._data[t*qe+2]&50331648)return t+(this._data[t*qe+0]>>22);return 0}copyCellsFrom(t,n,r,s,l){let a=t._data;if(l)for(let h=s-1;h>=0;h--){for(let d=0;d<qe;d++)this._data[(r+h)*qe+d]=a[(n+h)*qe+d];a[(n+h)*qe+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<qe;d++)this._data[(r+h)*qe+d]=a[(n+h)*qe+d];a[(n+h)*qe+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let l="";for(;n<r;){let a=this._data[n*qe+0],u=a&2097151,h=a&2097152?this._combined[n]:u?eo(u):io;if(l+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=a>>22||1}return s&&s.push(n),l}};function AW(e,t,n,r,s,l){let a=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let p=[e.get(u)];for(;h<e.length&&d.isWrapped;)p.push(d),d=e.get(++h);if(!l&&r>=u&&r<h){u+=p.length-1;continue}let m=0,_=Pu(p,m,t),y=1,S=0;for(;y<p.length;){let C=Pu(p,y,t),k=C-S,T=n-_,R=Math.min(k,T);p[m].copyCellsFrom(p[y],S,_,R,!1),_+=R,_===n&&(m++,_=0),S+=R,S===C&&(y++,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&&(a.push(u+p.length-w),a.push(w)),u+=p.length-1}return a}function DW(e,t){let n=[],r=0,s=t[r],l=0;for(let a=0;a<e.length;a++)if(s===a){let u=t[++r];e.onDeleteEmitter.fire({index:a-l,amount:u}),a+=u-1,l+=u,s=t[++r]}else n.push(a);return{layout:n,countRemoved:l}}function OW(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 LW(e,t,n){let r=[],s=e.map((h,d)=>Pu(e,d,t)).reduce((h,d)=>h+d),l=0,a=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}l+=n;let h=Pu(e,a,t);l>h&&(l-=h,a++);let d=e[a].getWidth(l-1)===2;d&&l--;let p=d?n-1:n;r.push(p),u+=p}return r}function Pu(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 bA=class xA{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=xA._nextId++,this._onDispose=this.register(new xe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),nl(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};bA._nextId=1;var jW=bA,dn={},Wo=dn.B;dn[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:"≥","{":"π","|":"≠","}":"£","~":"·"};dn.A={"#":"£"};dn.B=void 0;dn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};dn.C=dn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};dn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};dn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};dn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};dn.E=dn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};dn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};dn.H=dn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Zk=4294967295,Qk=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=en.clone(),this.savedCharset=Wo,this.markers=[],this._nullCell=Vr.fromCharData([0,BN,1,0]),this._whitespaceCell=Vr.fromCharData([0,io,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Uf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Xk(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 Bf),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 Bf),this._whitespaceCell}getBlankLine(e,t){return new lu(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>Zk?Zk:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=en);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 Xk(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(en),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 a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);let l=0;if(this._rows<t)for(let a=this._rows;a<t;a++)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 lu(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new lu(e,n)));else for(let a=this._rows;a>t;a--)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 a=this.lines.length-s;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,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=AW(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(en),n);if(r.length>0){let s=DW(this.lines,r);OW(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(en),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new lu(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(en),s=[],l=0;for(let a=this.lines.length-1;a>=0;a--){let u=this.lines.get(a);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&a>0;)u=this.lines.get(--a),h.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=a&&R<a+h.length)continue}let d=h[h.length-1].getTrimmedLength(),p=LW(h,this._cols,e),m=p.length-h.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 y=[];for(let R=0;R<m;R++){let M=this.getBlankLine(en,!0);y.push(M)}y.length>0&&(s.push({start:a+h.length+l,newLines:y}),l+=y.length),h.push(...y);let S=p.length-1,w=p[S];w===0&&(S--,w=p[S]);let C=h.length-m-1,k=d;for(;C>=0;){let R=Math.min(k,w);if(h[S]===void 0)break;if(h[S].copyCellsFrom(h[C],k-R,w-R,R,!0),w-=R,w===0&&(S--,w=p[S]),k-=R,k===0){C--;let M=Math.max(C,0);k=Pu(h,M,this._cols)}}for(let R=0;R<h.length;R++)p[R]<e&&h[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+l)-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 a=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let h=this.lines.length,d=h-1,p=0,m=s[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let _=0;for(let w=Math.min(this.lines.maxLength-1,h+l-1);w>=0;w--)if(m&&m.start>d+_){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(w--,m.newLines[C]);w++,a.push({index:d+1,amount:m.newLines.length}),_+=m.newLines.length,m=s[++p]}else this.lines.set(w,u[d--]);let y=0;for(let w=a.length-1;w>=0;w--)a[w].index+=y,this.lines.onInsertEmitter.fire(a[w]),y+=a[w].amount;let S=Math.max(0,h+l-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 jW(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)}},zW=class extends Ge{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new xe),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 Qk(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Qk(!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)}},SA=2,wA=1,py=class extends Ge{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new xe),this.onResize=this._onResize.event,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,SA),this.rows=Math.max(e.rawOptions.rows||0,wA),this.buffers=this._register(new zW(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,l=n.ybase+n.scrollBottom;if(n.scrollTop===0){let a=n.lines.isFull;l===n.lines.length-1?a?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(l+1,0,r.clone()),a?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let a=l-s+1;n.lines.shiftElements(s+1,a-1,-1),n.lines.set(l,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))}};py=Wt([Ee(0,Gn)],py);var ia={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:Ff,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},PW=["normal","bold","100","200","300","400","500","600","700","800","900"],BW=class extends Ge{constructor(e){super(),this._onOptionChange=this._register(new xe),this.onOptionChange=this._onOptionChange.event;let t={...ia};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(jt(()=>{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 ia))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in ia))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=ia[e]),!IW(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ia[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=PW.includes(t)?t:ia[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 IW(e){return e==="block"||e==="underline"||e==="bar"}function au(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]&&au(e[r],t-1);return n}var Jk=Object.freeze({insertMode:!1}),e2=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),my=class extends Ge{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 xe),this.onData=this._onData.event,this._onUserInput=this._register(new xe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new xe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new xe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=au(Jk),this.decPrivateModes=au(e2)}reset(){this.modes=au(Jk),this.decPrivateModes=au(e2)}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))}};my=Wt([Ee(0,Kn),Ee(1,$N),Ee(2,Gn)],my);var t2={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 Ov(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 Lv=String.fromCharCode,n2={DEFAULT:e=>{let t=[Ov(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Lv(t[0])}${Lv(t[1])}${Lv(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ov(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ov(e,!0)};${e.x};${e.y}${t}`}},gy=class extends Ge{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 xe),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(t2))this.addProtocol(r,t2[r]);for(let r of Object.keys(n2))this.addEncoding(r,n2[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)}};gy=Wt([Ee(0,Kn),Ee(1,hl),Ee(2,Gn)],gy);var jv=[[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]],HW=[[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]],cn;function FW(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 UW=class{constructor(){if(this.version="6",!cn){cn=new Uint8Array(65536),cn.fill(1),cn[0]=0,cn.fill(0,1,32),cn.fill(0,127,160),cn.fill(2,4352,4448),cn[9001]=2,cn[9002]=2,cn.fill(2,11904,42192),cn[12351]=1,cn.fill(2,44032,55204),cn.fill(2,63744,64256),cn.fill(2,65040,65050),cn.fill(2,65072,65136),cn.fill(2,65280,65377),cn.fill(2,65504,65511);for(let e=0;e<jv.length;++e)cn.fill(0,jv[e][0],jv[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?cn[e]:FW(e,HW)?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=Go.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Go.createPropertyValue(0,n,r)}},Go=class mf{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new xe,this.onChange=this._onChange.event;let t=new UW;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 l=0;l<s;++l){let a=t.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=s)return n+this.wcwidth(a);let d=t.charCodeAt(l);56320<=d&&d<=57343?a=(a-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(a,r),h=mf.extractWidth(u);mf.extractShouldJoin(u)&&(h-=mf.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},$W=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 r2(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 Vc=2147483647,WW=256,CA=class vy{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>WW)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 vy;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 l=0;l<s.length;++l)n.addSubParam(s[l]);else n.addParam(s)}return n}clone(){let t=new vy(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>Vc?Vc: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>Vc?Vc: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,Vc):t}},qc=[],VW=class{constructor(){this._state=0,this._active=qc,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=qc}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=qc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||qc,!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",kp(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=qc,this._id=-1,this._state=0}}},br=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+=kp(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}},Kc=[],qW=class{constructor(){this._handlers=Object.create(null),this._active=Kc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Kc}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=Kc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Kc,!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",kp(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=Kc,this._ident=0}},cu=new CA;cu.addParam(0);var i2=class{constructor(e){this._handler=e,this._data="",this._params=cu,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():cu,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=kp(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=cu,this._data="",this._hitLimit=!1,n));return this._params=cu,this._data="",this._hitLimit=!1,t}},KW=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}},Ur=160,GW=(function(){let e=new KW(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let l=n(0,14),a;e.setDefault(1,0),e.addMany(r,0,2,0);for(a in l)e.addMany([24,26,153,154],a,3,0),e.addMany(n(128,144),a,3,0),e.addMany(n(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,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(Ur,0,2,0),e.add(Ur,8,5,8),e.add(Ur,6,0,6),e.add(Ur,11,0,11),e.add(Ur,13,13,13),e})(),YW=class extends Ge{constructor(e=GW){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 CA,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(jt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new VW),this._dcsParser=this._register(new qW),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 l=e.intermediates.charCodeAt(s);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return 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,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=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,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(a=u[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(a=u[h](),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(r!==24&&r!==26,n),a)return a;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],a=this._oscParser.end(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=l;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Ur)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ur){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 h=this._csiHandlers[this._collect<<8|r],d=h?h.length-1:-1;for(;d>=0&&(a=h[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(3,h,d,s,u),a;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++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&&(a=p[m](),a!==!0);m--)if(a instanceof Promise)return this._preserveStack(4,p,m,s,u),a;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<Ur){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(a=this._dcsParser.unhook(r!==24&&r!==26),a)return this._preserveStack(6,[],0,s,u),a;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<Ur){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(a=this._oscParser.end(r!==24&&r!==26),a)return this._preserveStack(5,[],0,s,u),a;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},XW=/^([\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})$/,ZW=/^[\da-f]+$/;function s2(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=XW.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),ZW.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 l=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?l<<4:n===2?l:n===3?l>>4:l>>8}return r}}function zv(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 QW(e,t=16){let[n,r,s]=e;return`rgb:${zv(n,t)}/${zv(r,t)}/${zv(s,t)}`}var JW={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ys=131072,o2=10;function l2(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 a2=5e3,c2=0,eV=class extends Ge{constructor(e,t,n,r,s,l,a,u,h=new YW){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=l,this._coreMouseService=a,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new yU,this._utf8Decoder=new bU,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=en.clone(),this._eraseAttrDataInternal=en.clone(),this._onRequestBell=this._register(new xe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new xe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new xe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new xe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new xe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new xe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new xe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new xe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new xe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new xe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new xe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new xe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new xe),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 _y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:m})}),this._parser.setDcsHandlerFallback((d,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:m})}),this._parser.setPrintHandler((d,p,m)=>this.print(d,p,m)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(me.BEL,()=>this.bell()),this._parser.setExecuteHandler(me.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(me.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(me.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(me.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(me.BS,()=>this.backspace()),this._parser.setExecuteHandler(me.HT,()=>this.tab()),this._parser.setExecuteHandler(me.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(me.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ff.IND,()=>this.index()),this._parser.setExecuteHandler(ff.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ff.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new br(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new br(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new br(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new br(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new br(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new br(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new br(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new br(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new br(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new br(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new br(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new br(d=>this.restoreCursorColor(d))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let d in dn)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new i2((d,p)=>this.requestStatusString(d,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"),a2))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${a2} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){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>Ys&&(l=this._parseStack.position+Ys)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ys&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ys))),a||this._dirtyRowTracker.clearRange(),e.length>Ys)for(let d=l;d<e.length;d+=Ys){let p=d+Ys<e.length?d+Ys:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,s,m,d),this._logSlowResolvingAsync(n),n}else if(!a){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,s,d,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),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,l=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=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 y=t;y<n;++y){if(r=e[y],r<127&&l){let k=l[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=Go.extractWidth(S);let w=Go.extractShouldJoin(S),C=w?Go.extractWidth(_):0;if(_=S,a&&this._onA11yChar.fire(eo(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){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 lu&&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(d&&(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=>l2(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new i2(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new br(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 l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(l.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(en));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=Go.extractWidth(t),s=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(l.length*n),u=0;for(let d=0;d<l.length;){let p=l.codePointAt(d)||0;a[u++]=p,d+=p>65535?2:1}let h=u;for(let d=1;d<n;++d)a.copyWithin(h,0,u),h+=u;return this.print(a,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(me.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(me.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(me.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(me.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(me.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,Wo),this._charsetService.setgCharset(1,Wo),this._charsetService.setgCharset(2,Wo),this._charsetService.setgCharset(3,Wo);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:l}=this._coreMouseService,a=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:p}=u,m=this._optionsService.rawOptions,_=(w,C)=>(a.triggerDataEvent(`${me.ESC}[${t?"":"?"}${w};${C}$y`),!0),y=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,y(a.modes.insertMode)):S===12?_(S,3):S===20?_(S,y(m.convertEol)):_(S,0):S===1?_(S,y(r.applicationCursorKeys)):S===3?_(S,m.windowOptions.setWinLines?h===80?2:h===132?1:0:0):S===6?_(S,y(r.origin)):S===7?_(S,y(r.wraparound)):S===8?_(S,3):S===9?_(S,y(s==="X10")):S===12?_(S,y(m.cursorBlink)):S===25?_(S,y(!a.isCursorHidden)):S===45?_(S,y(r.reverseWraparound)):S===66?_(S,y(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,y(s==="VT200")):S===1002?_(S,y(s==="DRAG")):S===1003?_(S,y(s==="ANY")):S===1004?_(S,y(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,y(l==="SGR")):S===1015?_(S,4):S===1016?_(S,y(l==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,y(d===p)):S===2004?_(S,y(r.bracketedPasteMode)):S===2026?_(S,y(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=ed.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,l=0;do{if(r[l+s]=e.params[t+l],e.hasSubParams(t+l)){let a=e.getSubParams(t+l),u=0;do r[1]===5&&(s=1),r[l+u+1+s]=a[u];while(++u<a.length&&u+l+1+s<r.length);break}if(r[1]===5&&l+s>=2||r[1]===2&&l+s>=5)break;r[1]&&(s=1)}while(++l+t<e.length&&l+s<r.length);for(let a=2;a<r.length;++a)r[a]===-1&&(r[a]=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 l}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=en.fg,e.bg=en.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|=en.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=en.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|=en.fg&16777215,r.bg&=-67108864,r.bg|=en.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${me.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${me.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(`${me.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=en.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(!l2(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(`${me.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>o2&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>o2&&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 l=parseInt(r);if(u2(l))if(s==="?")t.push({type:0,index:l});else{let a=s2(s);a&&t.push({type:1,index:l,color:a})}}}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(l=>l.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=s2(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]);u2(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,Wo),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(JW[e[0]],dn[e[1]]||Wo),!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=en.clone(),this._eraseAttrDataInternal=en.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 Vr;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=a=>(this._coreService.triggerDataEvent(`${me.ESC}${a}${me.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)}},_y=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&&(c2=e,e=t,t=c2),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};_y=Wt([Ee(0,Kn)],_y);function u2(e){return 0<=e&&e<256}var tV=5e7,d2=12,nV=50,rV=class extends Ge{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new xe),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>tV)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 a=u=>performance.now()-n>=d2?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=d2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>nV&&(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()}},yy=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),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.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 l=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.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)))}};yy=Wt([Ee(0,Kn)],yy);var h2=!1,iV=class extends Ge{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ea),this._onBinary=this._register(new xe),this.onBinary=this._onBinary.event,this._onData=this._register(new xe),this.onData=this._onData.event,this._onLineFeed=this._register(new xe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new xe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new xe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new xe),this._instantiationService=new TW,this.optionsService=this._register(new BW(e)),this._instantiationService.setService(Gn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(py)),this._instantiationService.setService(Kn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(fy)),this._instantiationService.setService($N,this._logService),this.coreService=this._register(this._instantiationService.createInstance(my)),this._instantiationService.setService(hl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(gy)),this._instantiationService.setService(UN,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Go)),this._instantiationService.setService(CU,this.unicodeService),this._charsetService=this._instantiationService.createInstance($W),this._instantiationService.setService(wU,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(yy),this._instantiationService.setService(WN,this._oscLinkService),this._inputHandler=this._register(new eV(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(An.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(An.forward(this._bufferService.onResize,this._onResize)),this._register(An.forward(this.coreService.onData,this._onData)),this._register(An.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 rV((t,n)=>this._inputHandler.parse(t,n))),this._register(An.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new xe),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&&!h2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h2=!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,SA),t=Math.max(t,wA),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(r2.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(r2(this._bufferService),!1))),this._windowsWrappingHeuristics.value=jt(()=>{for(let t of e)t.dispose()})}}},sV={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 oV(e,t,n,r){var a;let s={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=me.ESC+"OA":s.key=me.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=me.ESC+"OD":s.key=me.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=me.ESC+"OC":s.key=me.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=me.ESC+"OB":s.key=me.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":me.DEL,e.altKey&&(s.key=me.ESC+s.key);break;case 9:if(e.shiftKey){s.key=me.ESC+"[Z";break}s.key=me.HT,s.cancel=!0;break;case 13:s.key=e.altKey?me.ESC+me.CR:me.CR,s.cancel=!0;break;case 27:s.key=me.ESC,e.altKey&&(s.key=me.ESC+me.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"D":t?s.key=me.ESC+"OD":s.key=me.ESC+"[D";break;case 39:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"C":t?s.key=me.ESC+"OC":s.key=me.ESC+"[C";break;case 38:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"A":t?s.key=me.ESC+"OA":s.key=me.ESC+"[A";break;case 40:if(e.metaKey)break;l?s.key=me.ESC+"[1;"+(l+1)+"B":t?s.key=me.ESC+"OB":s.key=me.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=me.ESC+"[2~");break;case 46:l?s.key=me.ESC+"[3;"+(l+1)+"~":s.key=me.ESC+"[3~";break;case 36:l?s.key=me.ESC+"[1;"+(l+1)+"H":t?s.key=me.ESC+"OH":s.key=me.ESC+"[H";break;case 35:l?s.key=me.ESC+"[1;"+(l+1)+"F":t?s.key=me.ESC+"OF":s.key=me.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=me.ESC+"[5;"+(l+1)+"~":s.key=me.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=me.ESC+"[6;"+(l+1)+"~":s.key=me.ESC+"[6~";break;case 112:l?s.key=me.ESC+"[1;"+(l+1)+"P":s.key=me.ESC+"OP";break;case 113:l?s.key=me.ESC+"[1;"+(l+1)+"Q":s.key=me.ESC+"OQ";break;case 114:l?s.key=me.ESC+"[1;"+(l+1)+"R":s.key=me.ESC+"OR";break;case 115:l?s.key=me.ESC+"[1;"+(l+1)+"S":s.key=me.ESC+"OS";break;case 116:l?s.key=me.ESC+"[15;"+(l+1)+"~":s.key=me.ESC+"[15~";break;case 117:l?s.key=me.ESC+"[17;"+(l+1)+"~":s.key=me.ESC+"[17~";break;case 118:l?s.key=me.ESC+"[18;"+(l+1)+"~":s.key=me.ESC+"[18~";break;case 119:l?s.key=me.ESC+"[19;"+(l+1)+"~":s.key=me.ESC+"[19~";break;case 120:l?s.key=me.ESC+"[20;"+(l+1)+"~":s.key=me.ESC+"[20~";break;case 121:l?s.key=me.ESC+"[21;"+(l+1)+"~":s.key=me.ESC+"[21~";break;case 122:l?s.key=me.ESC+"[23;"+(l+1)+"~":s.key=me.ESC+"[23~";break;case 123:l?s.key=me.ESC+"[24;"+(l+1)+"~":s.key=me.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=me.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=me.DEL:e.keyCode===219?s.key=me.ESC:e.keyCode===220?s.key=me.FS:e.keyCode===221&&(s.key=me.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(a=sV[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(u)s.key=me.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),s.key=me.ESC+d}else if(e.keyCode===32)s.key=me.ESC+(e.ctrlKey?me.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=me.ESC+h,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=me.US),e.key==="@"&&(s.key=me.NUL));break}return s}var Kt=0,lV=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Uf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Uf,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,l)=>this._getKey(s)-this._getKey(l)),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||(Kt=this._search(t),Kt===-1)||this._getKey(this._array[Kt])!==t)return!1;do if(this._array[Kt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Kt),!0;while(++Kt<this._array.length&&this._getKey(this._array[Kt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,l)=>s-l),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&&(Kt=this._search(e),!(Kt<0||Kt>=this._array.length)&&this._getKey(this._array[Kt])===e))do yield this._array[Kt];while(++Kt<this._array.length&&this._getKey(this._array[Kt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Kt=this._search(e),!(Kt<0||Kt>=this._array.length)&&this._getKey(this._array[Kt])===e))do t(this._array[Kt]);while(++Kt<this._array.length&&this._getKey(this._array[Kt])===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}},Pv=0,f2=0,aV=class extends Ge{constructor(){super(),this._decorations=new lV(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new xe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new xe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(jt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new cV(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 l of this._decorations.getKeyIterator(t))r=l.options.x??0,s=r+(l.options.width??1),e>=r&&e<s&&(!n||(l.options.layer??"bottom")===n)&&(yield l)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{Pv=s.options.x??0,f2=Pv+(s.options.width??1),e>=Pv&&e<f2&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},cV=class extends oo{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new xe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new xe),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=It.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=It.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},uV=1e3,dV=class{constructor(e,t=uV){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,l=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},p2=20,$f=class extends Ge{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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=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 dV(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
500
|
-
`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(He(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(jt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<p2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
501
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===p2+1&&(this._liveRegion.textContent+=I_.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 l=n.lines.get(n.ydisp+s),a=[],u=(l==null?void 0:l.translateToString(!0,void 0,void 0,a))||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,a)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===l||e.relatedTarget!==r)return;let a,u;if(t===0?(a=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(a=this._rowElements.shift(),u=n,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}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:h,offset:d})=>{let p=h instanceof Text?h.parentNode:h,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 y=d<_.length?_[d]:_.slice(-1)[0]+1;return y>=this._terminal.cols&&(++m,y=0),{row:m,column:y}},l=s(t),a=s(n);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.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,l;e.style.transform="";let t=e.getBoundingClientRect().width,n=(l=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:l[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};$f=Wt([Ee(1,i0),Ee(2,vs),Ee(3,_s)],$f);var by=class extends Ge{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 xe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new xe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(jt(()=>{var l;nl(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(He(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(He(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(He(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(He(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(l=>{l==null||l.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,a]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):a.provideLinks(e.y,u=>{var d,p;if(this._isMouseOut)return;let h=u==null?void 0:u.map(m=>({link:m}));(d=this._activeProviderReplies)==null||d.set(l,h),n=this._checkLinkProviderResult(l,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 l=0;l<s.length;l++){let a=s[l],u=a.link.range.start.y<e?0:a.link.range.start.x,h=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(l--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var l;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(s=!0);if(!s&&r){let a=r.find(u=>this._linkAtPosition(u.link,t));a&&(n=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let a=0;a<this._activeProviderReplies.size;a++){let u=(l=this._activeProviderReplies.get(a))==null?void 0:l.find(h=>this._linkAtPosition(h.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&&hV(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,nl(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,l;(r=this._currentLink)!=null&&r.state&&((l=(s=this._currentLink)==null?void 0:s.state)==null?void 0:l.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 l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!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}}};by=Wt([Ee(1,s0),Ee(2,_s),Ee(3,Kn),Ee(4,qN)],by);function hV(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 fV=class extends iV{constructor(e={}){super(e),this._linkifier=this._register(new Ea),this.browser=dA,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ea),this._onCursorMove=this._register(new xe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new xe),this.onKey=this._onKey.event,this._onRender=this._register(new xe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new xe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new xe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new xe),this.onBell=this._onBell.event,this._onFocus=this._register(new xe),this._onBlur=this._register(new xe),this._onA11yCharEmitter=this._register(new xe),this._onA11yTabEmitter=this._register(new xe),this._onWillOpen=this._register(new xe),this._setup(),this._decorationService=this._instantiationService.createInstance(aV),this._instantiationService.setService(td,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(nW),this._instantiationService.setService(qN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(F_)),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(An.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(An.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(An.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(An.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(jt(()=>{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=Nt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${me.ESC}]${r};${QW(s)}${cA.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=tn.toColor(...t.color));else{let l=n;this._themeService.modifyColors(a=>a[l]=tn.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($f,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(me.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(me.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),l=this._renderService.dimensions.css.cell.width*s,a=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=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(He(this.element,"copy",t=>{this.hasSelection()&&vU(t,this._selectionService)}));let e=t=>_U(t,this.textarea,this.coreService,this.optionsService);this._register(He(this.textarea,"paste",e)),this._register(He(this.element,"paste",e)),hA?this._register(He(this.element,"mousedown",t=>{t.button===2&&Ck(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(He(this.element,"contextmenu",t=>{Ck(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),f0&&this._register(He(this.element,"auxclick",t=>{t.button===1&&PN(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(He(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(He(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(He(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(He(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(He(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(He(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(He(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(He(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),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",B_.get()),mA||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(eW,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(vs,this._coreBrowserService),this._register(He(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(He(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(ay,this._document,this._helperContainer),this._instantiationService.setService(Ep,this._charSizeService),this._themeService=this._instantiationService.createInstance(hy),this._instantiationService.setService(Ua,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Hf),this._instantiationService.setService(VN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(uy,this.rows,this.screenElement)),this._instantiationService.setService(_s,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(sy,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(cy),this._instantiationService.setService(s0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(by,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(ry,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(dy,this.element,this.screenElement,r)),this._instantiationService.setService(EU,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(An.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(iy,this.screenElement)),this._register(He(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),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($f,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(If,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(If,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ly,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(l){var d,p,m,_,y;let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let u,h;switch(l.overrideType||l.type){case"mousemove":h=32,l.buttons===void 0?(u=3,l.button!==void 0&&(u=l.button<3?l.button:3)):u=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":h=0,u=l.button<3?l.button:3;break;case"mousedown":h=1,u=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let S=l.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(l,(_=(m=(p=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:p.device)==null?void 0:m.cell)==null?void 0:_.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;h=S<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:u,action:h,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:l=>(n(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(n(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&n(l)},mousemove:l=>{l.buttons||n(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(He(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return n(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(He(t,"wheel",l=>{var a,u,h,d,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(d=(h=(u=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(l,!0);let m=me.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(l,!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){zN(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=oV(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===me.ETX||n.key===me.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)&&(pV(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(en));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(me.ESC+"[I"):this.coreService.triggerDataEvent(me.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(`${me.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(`${me.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function pV(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var mV=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)}},gV=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 Vr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},m2=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 gV(t)}getNullCell(){return new Vr}},vV=class extends Ge{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new xe),this.onBufferChange=this._onBufferChange.event,this._normal=new m2(this._core.buffers.normal,"normal"),this._alternate=new m2(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)}},_V=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)}},yV=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}},bV=["cols","rows"],vi=0,xV=class extends Ge{constructor(e){super(),this._core=this._register(new fV(e)),this._addonManager=this._register(new mV),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(bV.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 _V(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new yV(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 vV(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
|
|
502
|
-
`,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 B_.get()},set promptLabel(e){B_.set(e)},get tooMuchOutput(){return I_.get()},set tooMuchOutput(e){I_.set(e)}}}_verifyIntegers(...e){for(vi of e)if(vi===1/0||isNaN(vi)||vi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(vi of e)if(vi&&(vi===1/0||isNaN(vi)||vi%1!==0||vi<0))throw new Error("This API only accepts positive integers")}};const kA="lever-theme",EA=b.createContext(void 0),SV=e=>e==="light"||e==="dark"||e==="system",RA=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",g2=e=>{if(typeof document>"u")return;const t=e==="system"?RA():e;document.documentElement.classList.toggle("dark",t==="dark")},wV=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(kA);return SV(e)?e:"system"};function CV({children:e}){const[t,n]=b.useState(wV);b.useEffect(()=>{g2(t),typeof window<"u"&&window.localStorage.setItem(kA,t)},[t]),b.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>g2("system");return s.addEventListener?(s.addEventListener("change",l),()=>s.removeEventListener("change",l)):(s.addListener(l),()=>s.removeListener(l))},[t]);const r=b.useMemo(()=>{const s=t==="system"?RA():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return g.jsx(EA.Provider,{value:r,children:e})}function TA(){const e=b.useContext(EA);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const kV={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"},EV={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 MA(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function NA(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,l=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(l)||s<=0||l<=0)return null;const a=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((T=e.options.overviewRuler)==null?void 0:T.width)??14,p=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),m=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),_=Math.max(0,a.width-p-d-1),y=Math.max(0,a.height-m);return{cols:Math.max(2,Math.floor(_/s)),rows:Math.max(1,Math.floor(y/l))}}function $h(e){e.refresh(0,Math.max(0,e.rows-1))}function Wh(e,t,n,r,s){const l=NA(e,t)??MA(e);return n.current&&n.current.cols===l.cols&&n.current.rows===l.rows||(e.resize(l.cols,l.rows),n.current=l,r&&s(l.cols,l.rows)),l}function RV({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:l=0,focusRequestVersion:a=0,onPathChange:u}){const{resolvedTheme:h}=TA(),d=b.useRef(null),p=b.useRef(null),m=b.useRef(null),_=b.useRef(!1),y=b.useRef(0),S=b.useRef(null),w=b.useRef(null),[C,k]=b.useState(null),[T,R]=b.useState(null),M=h==="dark"?EV:kV,L=(j,F)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:F}).catch(()=>{})},D=()=>{const j=()=>{const F=p.current,Y=d.current;!F||!Y||!_.current||Wh(F,Y,w,!0,L)};requestAnimationFrame(()=>{j(),setTimeout(j,0)})};return b.useEffect(()=>{const j=new xV({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:M}),F=new sU;j.loadAddon(F),j.loadAddon(new hU),p.current=j;const Y=d.current;Y&&(j.open(Y),m.current&&j.write(m.current),Wh(j,Y,w,!1,()=>{}),$h(j),D());const z=j.onData(U=>{n.command({type:"terminal.input",terminalId:t,data:U}).catch(V=>{R(V instanceof Error?V.message:String(V))})}),H=j.onResize(({cols:U,rows:V})=>{if(!_.current)return;const $={cols:U,rows:V};w.current&&w.current.cols===U&&w.current.rows===V||(w.current=$,L(U,V))}),P=new ResizeObserver(()=>{const U=p.current,V=d.current;!U||!V||Wh(U,V,w,_.current,($,B)=>{n.command({type:"terminal.resize",terminalId:t,cols:$,rows:B}).catch(()=>{})})});return Y&&P.observe(Y),()=>{P.disconnect(),H.dispose(),z.dispose(),m.current=F.serialize(),j.dispose(),p.current=null}},[r,n,t,M]),b.useEffect(()=>{const j=p.current;j&&(j.options.scrollback=r)},[r]),b.useEffect(()=>{const j=p.current;j&&(j.options.theme=M,$h(j))},[M]),b.useEffect(()=>{if(a===0)return;const j=p.current;j&&requestAnimationFrame(()=>{j.focus()})},[a]),b.useEffect(()=>{if(l===0)return;const j=p.current;j&&(_.current=!1,y.current+=1,S.current=null,m.current=null,k(null),R(null),j.reset(),$h(j),n.command({type:"terminal.close",terminalId:t}).catch(F=>{R(F instanceof Error?F.message:String(F))}))},[l,n,t]),b.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),b.useEffect(()=>{const j=z=>{const H=p.current;if(!H)return;const P=JSON.stringify({cwd:z.cwd,shell:z.shell,cols:z.cols,rows:z.rows,scrollback:z.scrollback,status:z.status,exitCode:z.exitCode,serializedState:z.serializedState});if(S.current===P){k({cwd:z.cwd,shell:z.shell,status:z.status,exitCode:z.exitCode}),m.current=z.serializedState||null;return}S.current=P,k({cwd:z.cwd,shell:z.shell,status:z.status,exitCode:z.exitCode}),m.current=z.serializedState||null,H.options.scrollback=z.scrollback,H.reset(),z.serializedState&&H.write(z.serializedState),$h(H)},F=()=>{const z=p.current,H=d.current;if(!z||!H)return;const P=NA(z,H)??MA(z);z.resize(P.cols,P.rows),w.current=P,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:P.cols,rows:P.rows,scrollback:r}).then(U=>{_.current=!0,R(null),U&&j(U),D()}).catch(U=>{R(U instanceof Error?U.message:String(U))})},Y=()=>{const z=++y.current,H=()=>{if(y.current!==z)return;const P=p.current,U=d.current;if(!P||!U)return;Wh(P,U,w,!1,()=>{});const V=U.getBoundingClientRect();if(V.width<=0||V.height<=0){requestAnimationFrame(H);return}F()};requestAnimationFrame(()=>{requestAnimationFrame(H)})};return Y(),n.subscribeTerminal(t,{onSnapshot:z=>{if(!z){_.current=!1,S.current=null,s==="connected"&&Y();return}_.current=!0,R(null),j(z),D()},onEvent:z=>{const H=p.current;if(H){if(z.type==="terminal.output"){H.write(z.data);return}z.type==="terminal.exit"&&k(P=>({cwd:(P==null?void 0:P.cwd)??"",shell:(P==null?void 0:P.shell)??"",status:"exited",exitCode:z.exitCode}))}}})},[s,e,r,n,t]),g.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[g.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:g.jsx("div",{ref:d,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),T?g.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",T]}):null]})}const TV=24;function AA(e){return e+TV}function MV(e,t){return Math.max(1,e)*AA(t)}function v2({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:l,focusRequestVersion:a=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:p}){const m=b.useRef(null),_=b.useRef({}),y=b.useRef([]),[S,w]=b.useState(0),[C,k]=b.useState({}),[T,R]=b.useState({});b.useLayoutEffect(()=>{const Y=m.current;if(!Y)return;const z=()=>{w(Y.getBoundingClientRect().width)},H=new ResizeObserver(z);return H.observe(Y),z(),()=>H.disconnect()},[]);const M=t.terminals.length,L=AA(l),D=MV(M,l),j=Math.max(S,D),F=b.useMemo(()=>t.terminals.map(Y=>Y.id).join(":"),[t.terminals]);return b.useLayoutEffect(()=>{const Y=y.current,z=t.terminals.map(U=>U.id),H=z.find(U=>!Y.includes(U));if(y.current=z,!H||Y.length===0)return;const P=_.current[H];P&&P.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),g.jsx("div",{className:"flex h-full min-h-0 flex-col",children:g.jsx("div",{ref:m,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:g.jsx("div",{className:"h-full min-h-0",style:{width:j||"100%"},children:g.jsx(of,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:Y=>p(e,t.terminals.map(z=>Y[z.id]??z.size)),children:t.terminals.map((Y,z)=>g.jsxs(b.Fragment,{children:[g.jsx(Uo,{id:Y.id,defaultSize:`${Y.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:g.jsxs("div",{ref:H=>{_.current[Y.id]=H},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:L},children:[g.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[g.jsx("div",{className:"min-w-0 flex-1 text-left",children:g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),g.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[Y.id]??""})]})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>R(H=>({...H,[Y.id]:(H[Y.id]??0)+1})),children:g.jsx(eP,{className:"size-3.5"})}),g.jsxs(eu,{children:[g.jsx(tu,{asChild:!0,children:g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,Y.id),children:g.jsx(db,{className:"size-3.5"})})}),g.jsx(ua,{side:"bottom",shortcut:u})]}),g.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,Y.id),children:g.jsx(La,{className:"size-3.5"})})]})]}),g.jsx(RV,{projectId:e,terminalId:Y.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:T[Y.id]??0,focusRequestVersion:z===0?a:0,onPathChange:H=>k(P=>P[Y.id]===H?P:{...P,[Y.id]:H})})]})}),z<t.terminals.length-1?g.jsx(lf,{withHandle:!0,orientation:"horizontal"}):null]},Y.id))},F)})})})}function _2(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function NV(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:_2(n.groups.line),column:_2(n.groups.column)}:{path:t}}function Bv(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 p0=()=>{},DA=b.createContext(p0);function AV({children:e,onOpenLocalLink:t}){return g.jsx(DA.Provider,{value:t??p0,children:e})}const xy={Task:Sf,TaskOutput:Sf,Bash:fb,Glob:mv,Grep:mv,ExitPlanMode:bC,Read:oP,Edit:nP,Write:iP,NotebookEdit:tT,WebFetch:g6,TodoWrite:D6,WebSearch:mv,KillShell:XP,AskUserQuestion:JR,Skill:VP,EnterPlanMode:bC},OA=tB;function LA(e){return xy[e]?xy[e]:OA}function mo({children:e,className:t}){return g.jsx("div",{className:ye("flex gap-3 justify-start items-center",t),children:e})}function DV({children:e,className:t}){return g.jsx("div",{className:ye("flex items-center gap-1.5 text-xs",t),children:e})}function uo({children:e,className:t}){return g.jsx("span",{className:ye("font-medium text-foreground/80",t),children:e})}function OV({children:e}){return g.jsx("span",{className:"text-muted-foreground",children:e})}function Mp({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=b.useState(n);return g.jsxs("div",{className:"flex flex-col w-full",children:[g.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:[g.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),g.jsx(ds,{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 y2({label:e,children:t,copyText:n}){const[r,s]=b.useState(!1),l=n??Wf(t),a=b.useCallback(async()=>{await navigator.clipboard.writeText(l),s(!0),setTimeout(()=>s(!1),2e3)},[l]);return g.jsxs("div",{children:[g.jsx("span",{className:"font-medium text-muted-foreground",children:e}),g.jsxs("div",{className:"relative group/codeblock",children:[g.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}),g.jsx(rt,{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:a,children:r?g.jsx(lo,{className:"h-3.5 w-3.5 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})]})]})}function jA({children:e,icon:t,className:n}){return g.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&g.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function Np({children:e,className:t}){return g.jsxs("div",{className:ye("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[g.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:g.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),g.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function Wf(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Wf).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Wf(t.children)}return""}function b2(e,t){return b.isValidElement(e)?b.cloneElement(e,{className:ye(e.props.className,t)}):e}const m0={h1:({children:e})=>g.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>g.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>g.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>g.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>g.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>g.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]=b.useState(!1),s=Wf(e),l=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return g.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[g.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),g.jsx(rt,{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:l,children:n?g.jsx(lo,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?g.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):g.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})=>g.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:g.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>g.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>g.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})=>g.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>g.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=b.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=b2(r,"mt-0"));const s=n.length-1,l=n[s];return l!==void 0&&(n[s]=b2(l,"mb-0")),g.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})=>g.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/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 Ap(e){return{...m0,a:({children:t,href:n,onClick:r,...s})=>{const l=b.useContext(DA),a=NV(n);return g.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/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:u=>{r==null||r(u),!(u.defaultPrevented||!a||l===p0)&&(u.preventDefault(),l(a))},...s,children:t})}}}({...m0});const LV={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function jV({status:e}){const t=(e?LV[e]:void 0)||"Processing...",n=e==="failed";return g.jsx(mo,{className:"ml-[1px]",children:g.jsxs(DV,{children:[n?g.jsx(La,{className:"size-4.5 text-red-500"}):g.jsx(Mi,{className:"size-4.5 animate-spin text-muted-icon"}),g.jsx(_p,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const zA=b.forwardRef(({className:e,children:t,...n},r)=>g.jsx("div",{ref:r,className:ye("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));zA.displayName="ScrollArea";const PA={toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Iv(e){return(e??[]).join(", ")}function Gc(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const zV=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function PV(e,t){const n=BV(e);return n?t.key.toLowerCase()===n.key&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Yc(e,t,n){return((e==null?void 0:e.bindings[t])??to[t]).some(s=>PV(s,n))}function BA(e){return{bindings:{toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??to.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??to.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??to.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??to.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??to.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function BV(e){const t=e.split("+").map(r=>r.trim()).filter(Boolean);if(t.length===0)return null;const n={key:"",ctrl:!1,meta:!1,alt:!1,shift:!1};for(const r of t){const s=r.toLowerCase(),l=zV.get(s);if(l==="ctrl"){n.ctrl=!0;continue}if(l==="meta"){n.meta=!0;continue}if(l==="alt"){n.alt=!0;continue}if(l==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}const Dp=20,Sy=50,IA=30;function HA(e){return Number.isFinite(e)?Math.min(Sy,Math.max(Dp,e)):IA}function IV(){return{isVisible:!1,size:Dp}}function Hv(e,t){return e[t]??IV()}function HV(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:HA(s.size??IA)}]))}}const gf=Ha()(Fa(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...Hv(n.projects,t),isVisible:!Hv(n.projects,t).isVisible}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Hv(r.projects,t),size:HA(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:HV})),FV={isVisible:!1,size:Dp},g0=[68,32];function UV(){return{isVisible:!1,mainSizes:[...g0],terminals:[],nextTerminalIndex:0}}function $V(e,t){return e[t]??UV()}function Fv(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 WV(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 VV(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function sa(e,t,n){return{...e,[t]:n($V(e,t))}}const Qs=Ha()(Fa(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:sa(r.projects,t,s=>{var h,d;const l=VV(s.terminals),a={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:WV(s.nextTerminalIndex),size:100/(l.length+1)},u=n?Math.max(l.findIndex(p=>p.id===n)+1,0):l.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...l.slice(0,u),a,...l.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:sa(r.projects,t,s=>{const l=s.terminals.filter(u=>u.id!==n);if(l.length===0)return{...s,isVisible:!1,terminals:[]};const a=Fv(l.map(u=>u.size));return{...s,terminals:l.map((u,h)=>({...u,size:a[h]??100/l.length}))}})})),toggleVisibility:t=>e(n=>({projects:sa(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:sa(n.projects,t,r=>({...r,mainSizes:[...g0]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=Fv(n);return{projects:sa(r.projects,t,l=>({...l,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:sa(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const l=Fv(n);return{...s,terminals:s.terminals.map((a,u)=>({...a,size:l[u]??a.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),qV={isVisible:!1,mainSizes:[...g0],terminals:[],nextTerminalIndex:0},Vf=1e3,wy=500,Cy=5e3,qf=450,ky=250,Ey=900,Ry="cursor";function Ty(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 KV(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function x2(e){return Number.isFinite(e)?Math.min(Cy,Math.max(wy,Math.round(e))):Vf}function S2(e){return Number.isFinite(e)?Math.min(Ey,Math.max(ky,Math.round(e))):qf}function w2(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return Ry}}function Uv(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:Ty(t)}const Hr=Ha()(Fa(e=>({scrollbackLines:Vf,minColumnWidth:qf,editorPreset:Ry,editorCommandTemplate:Ty(Ry),setScrollbackLines:t=>e({scrollbackLines:x2(t)}),setMinColumnWidth:t=>e({minColumnWidth:S2(t)}),setEditorPreset:t=>e(n=>{const r=w2(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?Uv(n.editorCommandTemplate,r):Ty(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:Uv(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=w2(t==null?void 0:t.editorPreset);return{scrollbackLines:x2((t==null?void 0:t.scrollbackLines)??Vf),minColumnWidth:S2((t==null?void 0:t.minColumnWidth)??qf),editorPreset:n,editorCommandTemplate:Uv(t==null?void 0:t.editorCommandTemplate,n)}}})),GV=35;function YV(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function XV(e,t){const n=YV(e,t);return n>=0&&n<GV}const fa=350,ZV=[.4,0,.2,1],QV=8,C2=1e-6;function JV(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function eq(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function tq(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function nq(e,t,n){let r=e;for(let s=0;s<QV;s+=1){const l=JV(r,t,n)-e;if(Math.abs(l)<C2)return r;const a=tq(r,t,n);if(Math.abs(a)<C2)break;r-=l/a}return r}function rq(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=ZV,l=nq(e,t,r);return eq(l,n,s)}function FA(e,t,n){const r=rq(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function iq({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=b.useRef(null),l=b.useRef(null),a=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(!1),p=b.useRef(null),m=b.useRef(!1),_=b.useRef(!1);return b.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),b.useLayoutEffect(()=>{var j,F,Y,z,H,P;if(!t){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),d.current=!1;return}const y=s.current;if(!y)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const S=p.current,w=S!==null&&S!==e,C=n&&!_.current,k=!m.current,T=n?[100-r,r]:[100,0],R=w||k&&n,M=C||k?[100,0]:[y.getLayout().workspace??T[0],y.getLayout().rightSidebar??T[1]];if(p.current=e,m.current=t,_.current=n,R||Math.abs(M[0]-T[0])<.1&&Math.abs(M[1]-T[1])<.1){y.setLayout({workspace:T[0],rightSidebar:T[1]}),(j=l.current)==null||j.setAttribute("data-right-sidebar-open",n?"true":"false"),(F=a.current)==null||F.setAttribute("data-right-sidebar-open",n?"true":"false"),(Y=a.current)==null||Y.setAttribute("data-right-sidebar-animated","false");return}d.current=!0,(z=l.current)==null||z.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=a.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(P=a.current)==null||P.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:M[0],rightSidebar:M[1]});const L=performance.now(),D=U=>{const V=Math.min(1,(U-L)/fa),$=FA(M,T,V);if(y.setLayout({workspace:$[0],rightSidebar:$[1]}),V<1){u.current=window.requestAnimationFrame(D);return}y.setLayout({workspace:T[0],rightSidebar:T[1]}),u.current=null,h.current=window.setTimeout(()=>{d.current=!1,h.current=null},0)};u.current=window.requestAnimationFrame(D)},[e,r,t,n]),b.useEffect(()=>{t||(m.current=!1,_.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:l,sidebarVisualRef:a}}function sq(e){const t=e.previousProjectId!==null&&e.previousProjectId!==e.projectId,n=e.previousProjectId===null&&e.projectId!==null;return!t&&!n&&e.showTerminalPane&&!e.wasTerminalVisible}function oq({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:l,liveLayout:a}){const u=e!==null&&e!==t,h=s&&!r,d=!n,p=e===null&&t!==null,m=s?l.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:a,shouldSkipAnimation:u||p&&d,targetLayout:m}}function lq({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const l=b.useRef(null),a=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(null),p=b.useRef(!1),m=b.useRef(null),_=b.useRef(!1),y=b.useRef(!1),S=b.useRef(!1),[w,C]=b.useState(0);return b.useEffect(()=>{var R;const k=m.current,T=S.current;sq({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:T})&&C(M=>M+1),k!==null&&k===t&&!r&&T&&((R=e.current)==null||R.focus({preventScroll:!0})),S.current=r,m.current=t},[e,t,r]),b.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),b.useLayoutEffect(()=>{var F,Y,z,H,P,U;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),p.current=!1;return}const k=l.current;if(!k)return;h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null);const T=m.current,{currentLayout:R,shouldSkipAnimation:M,targetLayout:L}=oq({previousProjectId:T,projectId:t,previousShouldRenderTerminalLayout:_.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(_.current=n,y.current=r,M||Math.abs(R[0]-L[0])<.1&&Math.abs(R[1]-L[1])<.1){k.setLayout({chat:L[0],terminal:L[1]}),(F=a.current)==null||F.setAttribute("data-terminal-open",r?"true":"false"),(Y=u.current)==null||Y.setAttribute("data-terminal-open",r?"true":"false"),(z=u.current)==null||z.setAttribute("data-terminal-animated","false");return}p.current=!0,(H=a.current)==null||H.setAttribute("data-terminal-open",r?"true":"false"),(P=u.current)==null||P.setAttribute("data-terminal-open",r?"true":"false"),(U=u.current)==null||U.setAttribute("data-terminal-animated","true"),k.setLayout({chat:R[0],terminal:R[1]});const D=performance.now(),j=V=>{const $=Math.min(1,(V-D)/fa),B=FA(R,L,$);if(k.setLayout({chat:B[0],terminal:B[1]}),$<1){h.current=window.requestAnimationFrame(j);return}k.setLayout({chat:L[0],terminal:L[1]}),h.current=null,d.current=window.setTimeout(()=>{p.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(j)},[t,n,r,s.mainSizes]),b.useEffect(()=>{n||(_.current=!1,y.current=!1)},[n]),{isAnimating:p,mainPanelGroupRef:l,terminalFocusRequestVersion:w,terminalPanelRef:a,terminalVisualRef:u}}function aq(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dq={};function k2(e,t){return(dq.jsx?uq:cq).test(e)}const hq=/[ \t\n\f\r]/g;function fq(e){return typeof e=="object"?e.type==="text"?E2(e.value):!1:E2(e)}function E2(e){return e.replace(hq,"")===""}class id{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}id.prototype.normal={};id.prototype.property={};id.prototype.space=void 0;function UA(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new id(n,r,t)}function My(e){return e.toLowerCase()}class ar{constructor(t,n){this.attribute=n,this.property=t}}ar.prototype.attribute="";ar.prototype.booleanish=!1;ar.prototype.boolean=!1;ar.prototype.commaOrSpaceSeparated=!1;ar.prototype.commaSeparated=!1;ar.prototype.defined=!1;ar.prototype.mustUseProperty=!1;ar.prototype.number=!1;ar.prototype.overloadedBoolean=!1;ar.prototype.property="";ar.prototype.spaceSeparated=!1;ar.prototype.space=void 0;let pq=0;const Ve=fl(),Jt=fl(),Ny=fl(),be=fl(),kt=fl(),ba=fl(),xr=fl();function fl(){return 2**++pq}const Ay=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Jt,commaOrSpaceSeparated:xr,commaSeparated:ba,number:be,overloadedBoolean:Ny,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),$v=Object.keys(Ay);class v0 extends ar{constructor(t,n,r,s){let l=-1;if(super(t,n),R2(this,"space",s),typeof r=="number")for(;++l<$v.length;){const a=$v[l];R2(this,$v[l],(r&Ay[a])===Ay[a])}}}v0.prototype.defined=!0;function R2(e,t,n){n&&(e[t]=n)}function Wa(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new v0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[My(r)]=r,n[My(l.attribute)]=r}return new id(t,n,e.space)}const $A=Wa({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:kt,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:be,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:kt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Jt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function WA(e,t){return t in e?e[t]:t}function VA(e,t){return WA(e,t.toLowerCase())}const mq=Wa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ba,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:kt,autoFocus:Ve,autoPlay:Ve,blocking:kt,capture:null,charSet:null,checked:Ve,cite:null,className:kt,cols:be,colSpan:null,content:null,contentEditable:Jt,controls:Ve,controlsList:kt,coords:be|ba,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Ny,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:kt,height:be,hidden:Ny,high:be,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ve,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:be,pattern:null,ping:kt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:kt,required:Ve,reversed:Ve,rows:be,rowSpan:be,sandbox:kt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Jt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:VA}),gq=Wa({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:xr,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:kt,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:ba,g2:ba,glyphName:ba,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,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:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:WA}),qA=Wa({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()}}),KA=Wa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VA}),GA=Wa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vq={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"},_q=/[A-Z]/g,T2=/-[a-z]/g,yq=/^data[-\w.:]+$/i;function bq(e,t){const n=My(t);let r=t,s=ar;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yq.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(T2,Sq);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!T2.test(l)){let a=l.replace(_q,xq);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=v0}return new s(r,t)}function xq(e){return"-"+e.toLowerCase()}function Sq(e){return e.charAt(1).toUpperCase()}const wq=UA([$A,mq,qA,KA,GA],"html"),_0=UA([$A,gq,qA,KA,GA],"svg");function Cq(e){return e.join(" ").trim()}var oa={},Wv,M2;function kq(){if(M2)return Wv;M2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
503
|
-
`,d="/",p="*",m="",_="comment",y="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 M(V){var $=V.match(t);$&&(T+=$.length);var B=V.lastIndexOf(h);R=~B?V.length-B:R+V.length}function L(){var V={line:T,column:R};return function($){return $.position=new D(V),Y(),$}}function D(V){this.start=V,this.end={line:T,column:R},this.source=k.source}D.prototype.content=C;function j(V){var $=new Error(k.source+":"+T+":"+R+": "+V);if($.reason=V,$.filename=k.source,$.line=T,$.column=R,$.source=C,!k.silent)throw $}function F(V){var $=V.exec(C);if($){var B=$[0];return M(B),C=C.slice(B.length),$}}function Y(){F(n)}function z(V){var $;for(V=V||[];$=H();)$!==!1&&V.push($);return V}function H(){var V=L();if(!(d!=C.charAt(0)||p!=C.charAt(1))){for(var $=2;m!=C.charAt($)&&(p!=C.charAt($)||d!=C.charAt($+1));)++$;if($+=2,m===C.charAt($-1))return j("End of comment missing");var B=C.slice(2,$-2);return R+=2,M(B),C=C.slice($),R+=2,V({type:_,comment:B})}}function P(){var V=L(),$=F(r);if($){if(H(),!F(s))return j("property missing ':'");var B=F(l),K=V({type:y,property:w($[0].replace(e,m)),value:B?w(B[0].replace(e,m)):m});return F(a),K}}function U(){var V=[];z(V);for(var $;$=P();)$!==!1&&(V.push($),z(V));return V}return Y(),U()}function w(C){return C?C.replace(u,m):m}return Wv=S,Wv}var N2;function Eq(){if(N2)return oa;N2=1;var e=oa&&oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=n;const t=e(kq());function n(r,s){let l=null;if(!r||typeof r!="string")return l;const a=(0,t.default)(r),u=typeof s=="function";return a.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:p}=h;u?s(d,p,h):p&&(l=l||{},l[d]=p)}),l}return oa}var Xc={},A2;function Rq(){if(A2)return Xc;A2=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},a=function(d,p){return p.toUpperCase()},u=function(d,p){return"".concat(p,"-")},h=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,a))};return Xc.camelCase=h,Xc}var Zc,D2;function Tq(){if(D2)return Zc;D2=1;var e=Zc&&Zc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Eq()),n=Rq();function r(s,l){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(a[(0,n.camelCase)(u,l)]=h)}),a}return r.default=r,Zc=r,Zc}var Mq=Tq();const Nq=Jf(Mq),YA=XA("end"),y0=XA("start");function XA(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 Aq(e){const t=y0(e),n=YA(e);if(t&&n)return{start:t,end:n}}function bu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?O2(e.position):"start"in e||"end"in e?O2(e):"line"in e||"column"in e?Dy(e):""}function Dy(e){return L2(e&&e.line)+":"+L2(e&&e.column)}function O2(e){return Dy(e&&e.start)+"-"+Dy(e&&e.end)}function L2(e){return e&&typeof e=="number"?e:1}class Bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(a=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?l.ruleId=r:(l.source=r.slice(0,h),l.ruleId=r.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=bu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bn.prototype.file="";Bn.prototype.name="";Bn.prototype.reason="";Bn.prototype.message="";Bn.prototype.stack="";Bn.prototype.column=void 0;Bn.prototype.line=void 0;Bn.prototype.ancestors=void 0;Bn.prototype.cause=void 0;Bn.prototype.fatal=void 0;Bn.prototype.place=void 0;Bn.prototype.ruleId=void 0;Bn.prototype.source=void 0;const b0={}.hasOwnProperty,Dq=new Map,Oq=/[A-Z]/g,Lq=new Set(["table","tbody","thead","tfoot","tr"]),jq=new Set(["td","th"]),ZA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zq(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=Wq(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=$q(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"?_0:wq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=QA(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function QA(e,t,n){if(t.type==="element")return Pq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Bq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Hq(e,t,n);if(t.type==="mdxjsEsm")return Iq(e,t);if(t.type==="root")return Fq(e,t,n);if(t.type==="text")return Uq(e,t)}function Pq(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=_0,e.schema=s),e.ancestors.push(t);const l=e5(e,t.tagName,!1),a=Vq(e,t);let u=S0(e,t);return Lq.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!fq(h):!0})),JA(e,a,l,t),x0(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Bq(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)}Bu(e,t.position)}function Iq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bu(e,t.position)}function Hq(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=_0,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:e5(e,t.name,!0),a=qq(e,t),u=S0(e,t);return JA(e,a,l,t),x0(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Fq(e,t,n){const r={};return x0(r,S0(e,t)),e.create(t,e.Fragment,r,n)}function Uq(e,t){return t.value}function JA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function x0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $q(e,t,n){return r;function r(s,l,a,u){const d=Array.isArray(a.children)?n:t;return u?d(l,a,u):d(l,a)}}function Wq(e,t){return n;function n(r,s,l,a){const u=Array.isArray(l.children),h=y0(r);return t(s,l,a,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Vq(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&b0.call(t.properties,s)){const l=Kq(e,s,t.properties[s]);if(l){const[a,u]=l;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&jq.has(t.tagName)?r=u:n[a]=u}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function qq(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Bu(e,t.position);else{const s=r.name;let l;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,l=e.evaluater.evaluateExpression(u.expression)}else Bu(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function S0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Dq;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=s.get(h)||0;a=h+"-"+d,s.set(h,d+1)}}const u=QA(e,l,a);u!==void 0&&n.push(u)}return n}function Kq(e,t,n){const r=bq(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aq(n):Cq(n)),r.property==="style"){let s=typeof n=="object"?n:Gq(e,String(n));return e.stylePropertyNameCase==="css"&&(s=Yq(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?vq[r.property]||r.property:r.attribute,n]}}function Gq(e,t){try{return Nq(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Bn("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=ZA+"#cannot-parse-style-attribute",s}}function e5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,a;for(;++l<s.length;){const u=k2(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}r=a}else r=k2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return b0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bu(e)}function Bu(e,t){const n=new Bn("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=ZA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yq(e){const t={};let n;for(n in e)b0.call(e,n)&&(t[Xq(n)]=e[n]);return t}function Xq(e){let t=e.replace(Oq,Zq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Zq(e){return"-"+e.toLowerCase()}const Vv={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"]},Qq={};function w0(e,t){const n=Qq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return t5(e,r,s)}function t5(e,t,n){if(Jq(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 j2(e.children,t,n)}return Array.isArray(e)?j2(e,t,n):""}function j2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=t5(e[s],t,n);return r.join("")}function Jq(e){return!!(e&&typeof e=="object")}const z2=document.createElement("i");function C0(e){const t="&"+e+";";z2.innerHTML=t;const n=z2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Cr(e,t,n,r){const s=e.length;let l=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function $r(e,t){return e.length>0?(Cr(e,e.length,0,t),e):t}const P2={}.hasOwnProperty;function n5(e){const t={};let n=-1;for(;++n<e.length;)eK(t,e[n]);return t}function eK(e,t){let n;for(n in t){const s=(P2.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){P2.call(s,a)||(s[a]=[]);const u=l[a];tK(s[a],Array.isArray(u)?u:u?[u]:[])}}}function tK(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cr(e,0,0,r)}function r5(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 ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Vn=go(/[A-Za-z]/),zn=go(/[\dA-Za-z]/),nK=go(/[#-'*+\--9=?A-Z^-~]/);function Kf(e){return e!==null&&(e<32||e===127)}const Oy=go(/\d/),rK=go(/[\dA-Fa-f]/),iK=go(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Op=go(new RegExp("\\p{P}|\\p{S}","u")),il=go(/\s/);function go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Va(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&zn(e.charCodeAt(n+1))&&zn(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(a=String.fromCharCode(l,u),s=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function st(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(h){return Je(h)?(e.enter(n),u(h)):t(h)}function u(h){return Je(h)&&l++<s?(e.consume(h),u):(e.exit(n),t(h))}}const sK={tokenize:oK};function oK(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"),st(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),l(u)}function l(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return ze(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),a)}}const lK={tokenize:aK},B2={tokenize:cK};function aK(e){const t=this,n=[];let r=0,s,l,a;return u;function u(R){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,h,d)(R)}return d(R)}function h(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const M=t.events.length;let L=M,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){D=t.events[L][1].end;break}k(r);let j=M;for(;j<t.events.length;)t.events[j][1].end={...D},j++;return Cr(t.events,L+1,0,t.events.slice(M)),t.events.length=j,d(R)}return u(R)}function d(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(B2,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,a=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(B2,y,S)(R)}function y(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:l}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return ze(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(R),w)}function C(R,M){const L=t.sliceStream(R);if(M&&L.push(null),R.previous=l,l&&(l.next=R),l=R,s.defineSkip(R.start),s.write(L),t.parser.lazy[R.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<a&&(!s.events[D][1].end||s.events[D][1].end.offset>a))return;const j=t.events.length;let F=j,Y,z;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(Y){z=t.events[F][1].end;break}Y=!0}for(k(r),D=j;D<t.events.length;)t.events[D][1].end={...z},D++;Cr(t.events,F+1,0,t.events.slice(j)),t.events.length=D}}function k(R){let M=n.length;for(;M-- >R;){const L=n[M];t.containerState=L[1],L[0].exit.call(t,e)}n.length=R}function T(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function cK(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ra(e){if(e===null||wt(e)||il(e))return 1;if(Op(e))return 2}function Lp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Ly={name:"attention",resolveAll:uK,tokenize:dK};function uK(e,t){let n=-1,r,s,l,a,u,h,d,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;h=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};I2(m,-h),I2(_,h),a={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=$r(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=$r(d,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",l,t]]),d=$r(d,Lp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=$r(d,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=$r(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Cr(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dK(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Ra(r);let l;return a;function a(h){return l=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===l)return e.consume(h),u;const d=e.exit("attentionSequence"),p=Ra(h),m=!p||p===2&&s||n.includes(h),_=!s||s===2&&p||n.includes(r);return d._open=!!(l===42?m:m&&(s||!_)),d._close=!!(l===42?_:_&&(p||!m)),t(h)}}function I2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hK={name:"autolink",tokenize:fK};function fK(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(y){return Vn(y)?(e.consume(y),a):y===64?n(y):d(y)}function a(y){return y===43||y===45||y===46||zn(y)?(r=1,u(y)):d(y)}function u(y){return y===58?(e.consume(y),r=0,h):(y===43||y===45||y===46||zn(y))&&r++<32?(e.consume(y),u):(r=0,d(y))}function h(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Kf(y)?n(y):(e.consume(y),h)}function d(y){return y===64?(e.consume(y),p):nK(y)?(e.consume(y),d):n(y)}function p(y){return zn(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):_(y)}function _(y){if((y===45||zn(y))&&r++<63){const S=y===45?_:m;return e.consume(y),S}return n(y)}}const sd={partial:!0,tokenize:pK};function pK(e,t,n){return r;function r(l){return Je(l)?st(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||ze(l)?t(l):n(l)}}const i5={continuation:{tokenize:gK},exit:vK,name:"blockQuote",tokenize:mK};function mK(e,t,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function gK(e,t,n){const r=this;return s;function s(a){return Je(a)?st(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(i5,t,n)(a)}}function vK(e){e.exit("blockQuote")}const s5={name:"characterEscape",tokenize:_K};function _K(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return iK(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const o5={name:"characterReference",tokenize:yK};function yK(e,t,n){const r=this;let s=0,l,a;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,a=zn,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=rK,p):(e.enter("characterReferenceValue"),l=7,a=Oy,p(m))}function p(m){if(m===59&&s){const _=e.exit("characterReferenceValue");return a===zn&&!C0(r.sliceSerialize(_))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(m)&&s++<l?(e.consume(m),p):n(m)}}const H2={partial:!0,tokenize:xK},F2={concrete:!0,name:"codeFenced",tokenize:bK};function bK(e,t,n){const r=this,s={partial:!0,tokenize:L};let l=0,a=0,u;return h;function h(D){return d(D)}function d(D){const j=r.events[r.events.length-1];return l=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===u?(a++,e.consume(D),p):a<3?n(D):(e.exit("codeFencedFenceSequence"),Je(D)?st(e,m,"whitespace")(D):m(D))}function m(D){return D===null||ze(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(H2,w,M)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(D)):Je(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),_)}function y(D){return D===null||ze(D)?m(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(D)):D===96&&D===u?n(D):(e.consume(D),S)}function w(D){return e.attempt(s,M,C)(D)}function C(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),k}function k(D){return l>0&&Je(D)?st(e,T,"linePrefix",l+1)(D):T(D)}function T(D){return D===null||ze(D)?e.check(H2,w,M)(D):(e.enter("codeFlowValue"),R(D))}function R(D){return D===null||ze(D)?(e.exit("codeFlowValue"),T(D)):(e.consume(D),R)}function M(D){return e.exit("codeFenced"),t(D)}function L(D,j,F){let Y=0;return z;function z($){return D.enter("lineEnding"),D.consume($),D.exit("lineEnding"),H}function H($){return D.enter("codeFencedFence"),Je($)?st(D,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):P($)}function P($){return $===u?(D.enter("codeFencedFenceSequence"),U($)):F($)}function U($){return $===u?(Y++,D.consume($),U):Y>=a?(D.exit("codeFencedFenceSequence"),Je($)?st(D,V,"whitespace")($):V($)):F($)}function V($){return $===null||ze($)?(D.exit("codeFencedFence"),j($)):F($)}}}function xK(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const qv={name:"codeIndented",tokenize:wK},SK={partial:!0,tokenize:CK};function wK(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),st(e,l,"linePrefix",5)(d)}function l(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?h(d):ze(d)?e.attempt(SK,a,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||ze(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function CK(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):st(e,l,"linePrefix",5)(a)}function l(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):ze(a)?s(a):n(a)}}const kK={name:"codeText",previous:RK,resolve:EK,tokenize:TK};function EK(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 RK(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function TK(e,t,n){let r=0,s,l;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(l=e.enter("codeTextSequence"),s=0,p(m)):ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||ze(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",d(m))}}class MK{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 l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Qc(this.left,r),l.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),Qc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qc(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);Qc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qc(this.left,n.reverse())}}}function Qc(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 l5(e){const t={};let n=-1,r,s,l,a,u,h,d;const p=new MK(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"&&(h=r[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,NK(p,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(a=p.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=l);else if(!(a[1].type==="linePrefix"||a[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 Cr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function NK(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,h=[],d={};let p,m,_=-1,y=n,S=0,w=0;const C=[w];for(;y;){for(;e.get(++s)[1]!==y;);l.push(s),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),m&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=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),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=l.pop();h.push([T,T+k.length-1]),e.splice(T,2,k)}for(h.reverse(),_=-1;++_<h.length;)d[S+h[_][0]]=S+h[_][1],S+=h[_][1]-h[_][0]-1;return d}const AK={resolve:OK,tokenize:LK},DK={partial:!0,tokenize:jK};function OK(e){return l5(e),e}function LK(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?l(u):ze(u)?e.check(DK,a,l)(u):(e.consume(u),s)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function jK(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),st(e,l,"linePrefix")}function l(a){if(a===null||ze(a))return n(a);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(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function a5(e,t,n,r,s,l,a,u,h){const d=h||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(k),e.exit(l),_):k===null||k===32||k===41||Kf(k)?n(k):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||ze(k)?n(k):(e.consume(k),k===92?S:y)}function S(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function w(k){return!p&&(k===null||k===41||wt(k))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(k)):p<d&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||Kf(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 c5(e,t,n,r,s,l){const a=this;let u=0,h;return d;function d(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(l),p}function p(y){return u>999||y===null||y===91||y===93&&!h||y===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(l),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||ze(y)||u++>999?(e.exit("chunkString"),p(y)):(e.consume(y),h||(h=!Je(y)),y===92?_:m)}function _(y){return y===91||y===92||y===93?(e.consume(y),u++,m):m(y)}}function u5(e,t,n,r,s,l){let a;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),a=_===40?41:_,h):n(_)}function h(_){return _===a?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(l),d(_))}function d(_){return _===a?(e.exit(l),h(a)):_===null?n(_):ze(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),st(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===a||_===null||ze(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?m:p)}function m(_){return _===a||_===92?(e.consume(_),p):p(_)}}function xu(e,t){let n;return r;function r(s){return ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Je(s)?st(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const zK={name:"definition",tokenize:BK},PK={partial:!0,tokenize:IK};function BK(e,t,n){const r=this;let s;return l;function l(y){return e.enter("definition"),a(y)}function a(y){return c5.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return s=ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),h):n(y)}function h(y){return wt(y)?xu(e,d)(y):d(y)}function d(y){return a5(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(PK,m,m)(y)}function m(y){return Je(y)?st(e,_,"whitespace")(y):_(y)}function _(y){return y===null||ze(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function IK(e,t,n){return r;function r(u){return wt(u)?xu(e,s)(u):n(u)}function s(u){return u5(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return Je(u)?st(e,a,"whitespace")(u):a(u)}function a(u){return u===null||ze(u)?t(u):n(u)}}const HK={name:"hardBreakEscape",tokenize:FK};function FK(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return ze(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const UK={name:"headingAtx",resolve:$K,tokenize:WK};function $K(e,t){let n=e.length-2,r=3,s,l;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},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cr(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function WK(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||wt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||ze(p)?(e.exit("atxHeading"),t(p)):Je(p)?st(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||wt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const VK=["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"],U2=["pre","script","style","textarea"],qK={concrete:!0,name:"htmlFlow",resolveTo:YK,tokenize:XK},KK={partial:!0,tokenize:QK},GK={partial:!0,tokenize:ZK};function YK(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 XK(e,t,n){const r=this;let s,l,a,u,h;return d;function d(A){return p(A)}function p(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),_):A===47?(e.consume(A),l=!0,w):A===63?(e.consume(A),s=3,r.interrupt?t:N):Vn(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function _(A){return A===45?(e.consume(A),s=2,y):A===91?(e.consume(A),s=5,u=0,S):Vn(A)?(e.consume(A),s=4,r.interrupt?t:N):n(A)}function y(A){return A===45?(e.consume(A),r.interrupt?t:N):n(A)}function S(A){const ae="CDATA[";return A===ae.charCodeAt(u++)?(e.consume(A),u===ae.length?r.interrupt?t:P:S):n(A)}function w(A){return Vn(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||wt(A)){const ae=A===47,fe=a.toLowerCase();return!ae&&!l&&U2.includes(fe)?(s=1,r.interrupt?t(A):P(A)):VK.includes(a.toLowerCase())?(s=6,ae?(e.consume(A),k):r.interrupt?t(A):P(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):l?T(A):R(A))}return A===45||zn(A)?(e.consume(A),a+=String.fromCharCode(A),C):n(A)}function k(A){return A===62?(e.consume(A),r.interrupt?t:P):n(A)}function T(A){return Je(A)?(e.consume(A),T):z(A)}function R(A){return A===47?(e.consume(A),z):A===58||A===95||Vn(A)?(e.consume(A),M):Je(A)?(e.consume(A),R):z(A)}function M(A){return A===45||A===46||A===58||A===95||zn(A)?(e.consume(A),M):L(A)}function L(A){return A===61?(e.consume(A),D):Je(A)?(e.consume(A),L):R(A)}function D(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),h=A,j):Je(A)?(e.consume(A),D):F(A)}function j(A){return A===h?(e.consume(A),h=null,Y):A===null||ze(A)?n(A):(e.consume(A),j)}function F(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||wt(A)?L(A):(e.consume(A),F)}function Y(A){return A===47||A===62||Je(A)?R(A):n(A)}function z(A){return A===62?(e.consume(A),H):n(A)}function H(A){return A===null||ze(A)?P(A):Je(A)?(e.consume(A),H):n(A)}function P(A){return A===45&&s===2?(e.consume(A),B):A===60&&s===1?(e.consume(A),K):A===62&&s===4?(e.consume(A),I):A===63&&s===3?(e.consume(A),N):A===93&&s===5?(e.consume(A),Z):ze(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(KK,q,U)(A)):A===null||ze(A)?(e.exit("htmlFlowData"),U(A)):(e.consume(A),P)}function U(A){return e.check(GK,V,q)(A)}function V(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),$}function $(A){return A===null||ze(A)?U(A):(e.enter("htmlFlowData"),P(A))}function B(A){return A===45?(e.consume(A),N):P(A)}function K(A){return A===47?(e.consume(A),a="",W):P(A)}function W(A){if(A===62){const ae=a.toLowerCase();return U2.includes(ae)?(e.consume(A),I):P(A)}return Vn(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),W):P(A)}function Z(A){return A===93?(e.consume(A),N):P(A)}function N(A){return A===62?(e.consume(A),I):A===45&&s===2?(e.consume(A),N):P(A)}function I(A){return A===null||ze(A)?(e.exit("htmlFlowData"),q(A)):(e.consume(A),I)}function q(A){return e.exit("htmlFlow"),t(A)}}function ZK(e,t,n){const r=this;return s;function s(a){return ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function QK(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(sd,t,n)}}const JK={name:"htmlText",tokenize:eG};function eG(e,t,n){const r=this;let s,l,a;return u;function u(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),h}function h(N){return N===33?(e.consume(N),d):N===47?(e.consume(N),L):N===63?(e.consume(N),R):Vn(N)?(e.consume(N),F):n(N)}function d(N){return N===45?(e.consume(N),p):N===91?(e.consume(N),l=0,S):Vn(N)?(e.consume(N),T):n(N)}function p(N){return N===45?(e.consume(N),y):n(N)}function m(N){return N===null?n(N):N===45?(e.consume(N),_):ze(N)?(a=m,K(N)):(e.consume(N),m)}function _(N){return N===45?(e.consume(N),y):m(N)}function y(N){return N===62?B(N):N===45?_(N):m(N)}function S(N){const I="CDATA[";return N===I.charCodeAt(l++)?(e.consume(N),l===I.length?w:S):n(N)}function w(N){return N===null?n(N):N===93?(e.consume(N),C):ze(N)?(a=w,K(N)):(e.consume(N),w)}function C(N){return N===93?(e.consume(N),k):w(N)}function k(N){return N===62?B(N):N===93?(e.consume(N),k):w(N)}function T(N){return N===null||N===62?B(N):ze(N)?(a=T,K(N)):(e.consume(N),T)}function R(N){return N===null?n(N):N===63?(e.consume(N),M):ze(N)?(a=R,K(N)):(e.consume(N),R)}function M(N){return N===62?B(N):R(N)}function L(N){return Vn(N)?(e.consume(N),D):n(N)}function D(N){return N===45||zn(N)?(e.consume(N),D):j(N)}function j(N){return ze(N)?(a=j,K(N)):Je(N)?(e.consume(N),j):B(N)}function F(N){return N===45||zn(N)?(e.consume(N),F):N===47||N===62||wt(N)?Y(N):n(N)}function Y(N){return N===47?(e.consume(N),B):N===58||N===95||Vn(N)?(e.consume(N),z):ze(N)?(a=Y,K(N)):Je(N)?(e.consume(N),Y):B(N)}function z(N){return N===45||N===46||N===58||N===95||zn(N)?(e.consume(N),z):H(N)}function H(N){return N===61?(e.consume(N),P):ze(N)?(a=H,K(N)):Je(N)?(e.consume(N),H):Y(N)}function P(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),s=N,U):ze(N)?(a=P,K(N)):Je(N)?(e.consume(N),P):(e.consume(N),V)}function U(N){return N===s?(e.consume(N),s=void 0,$):N===null?n(N):ze(N)?(a=U,K(N)):(e.consume(N),U)}function V(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||wt(N)?Y(N):(e.consume(N),V)}function $(N){return N===47||N===62||wt(N)?Y(N):n(N)}function B(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function K(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),W}function W(N){return Je(N)?st(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Z(N)}function Z(N){return e.enter("htmlTextData"),a(N)}}const k0={name:"labelEnd",resolveAll:iG,resolveTo:sG,tokenize:oG},tG={tokenize:lG},nG={tokenize:aG},rG={tokenize:cG};function iG(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&&Cr(e,0,e.length,n),e}function sG(e,t){let n=e.length,r=0,s,l,a,u;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=$r(u,e.slice(l+1,l+r+3)),u=$r(u,[["enter",p,t]]),u=$r(u,Lp(t.parser.constructs.insideSpan.null,e.slice(l+r+4,a-3),t)),u=$r(u,[["exit",p,t],e[a-2],e[a-1],["exit",d,t]]),u=$r(u,e.slice(a+1)),u=$r(u,[["exit",h,t]]),Cr(e,l,e.length,u),e}function oG(e,t,n){const r=this;let s=r.events.length,l,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return u;function u(_){return l?l._inactive?m(_):(a=r.parser.defined.includes(ii(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):n(_)}function h(_){return _===40?e.attempt(tG,p,a?p:m)(_):_===91?e.attempt(nG,p,a?d:m)(_):a?p(_):m(_)}function d(_){return e.attempt(rG,p,m)(_)}function p(_){return t(_)}function m(_){return l._balanced=!0,n(_)}}function lG(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 wt(m)?xu(e,l)(m):l(m)}function l(m){return m===41?p(m):a5(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return wt(m)?xu(e,h)(m):p(m)}function u(m){return n(m)}function h(m){return m===34||m===39||m===40?u5(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return wt(m)?xu(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 aG(e,t,n){const r=this;return s;function s(u){return c5.call(r,e,l,a,"reference","referenceMarker","referenceString")(u)}function l(u){return r.parser.defined.includes(ii(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function cG(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const uG={name:"labelStartImage",resolveAll:k0.resolveAll,tokenize:dG};function dG(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const hG={name:"labelStartLink",resolveAll:k0.resolveAll,tokenize:fG};function fG(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Kv={name:"lineEnding",tokenize:pG};function pG(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),st(e,t,"linePrefix")}}const vf={name:"thematicBreak",tokenize:mG};function mG(e,t,n){let r=0,s;return l;function l(d){return e.enter("thematicBreak"),a(d)}function a(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||ze(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),Je(d)?st(e,u,"whitespace")(d):u(d))}}const sr={continuation:{tokenize:yG},exit:xG,name:"list",tokenize:_G},gG={partial:!0,tokenize:SG},vG={partial:!0,tokenize:bG};function _G(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(y){const S=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Oy(y)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(vf,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(y)}return n(y)}function h(y){return Oy(y)&&++a<10?(e.consume(y),h):(!r.interrupt||a<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(sd,r.interrupt?n:p,e.attempt(gG,_,m))}function p(y){return r.containerState.initialBlankLine=!0,l++,_(y)}function m(y){return Je(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),_):n(y)}function _(y){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function yG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sd,s,l);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(u)}function l(u){return r.containerState.furtherBlankLines||!Je(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vG,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(sr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function bG(e,t,n){const r=this;return st(e,s,"listItemIndent",r.containerState.size+1);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function xG(e){e.exit(this.containerState.type)}function SG(e,t,n){const r=this;return st(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const a=r.events[r.events.length-1];return!Je(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const $2={name:"setextUnderline",resolveTo:wG,tokenize:CG};function wG(e,t){let n=e.length,r,s,l;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),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",a,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function CG(e,t,n){const r=this;let s;return l;function l(d){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=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Je(d)?st(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||ze(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kG={tokenize:EG};function EG(e){const t=this,n=e.attempt(sd,r,e.attempt(this.parser.constructs.flowInitial,s,st(e,e.attempt(this.parser.constructs.flow,s,e.attempt(AK,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const RG={resolveAll:h5()},TG=d5("string"),MG=d5("text");function d5(e){return{resolveAll:h5(e==="text"?NG:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,a,u);return a;function a(p){return d(p)?l(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),h}function h(p){return d(p)?(n.exit("data"),l(p)):(n.consume(p),h)}function d(p){if(p===null)return!0;const m=s[p];let _=-1;if(m)for(;++_<m.length;){const y=m[_];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function h5(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function NG(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 l=s.length,a=-1,u=0,h;for(;l--;){const d=s[l];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)h=!0,u++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:r.start._bufferIndex+a,_index:r.start._index+l,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const AG={42:sr,43:sr,45:sr,48:sr,49:sr,50:sr,51:sr,52:sr,53:sr,54:sr,55:sr,56:sr,57:sr,62:i5},DG={91:zK},OG={[-2]:qv,[-1]:qv,32:qv},LG={35:UK,42:vf,45:[$2,vf],60:qK,61:$2,95:vf,96:F2,126:F2},jG={38:o5,92:s5},zG={[-5]:Kv,[-4]:Kv,[-3]:Kv,33:uG,38:o5,42:Ly,60:[hK,JK],91:hG,92:[HK,s5],93:k0,95:Ly,96:kK},PG={null:[Ly,RG]},BG={null:[42,95]},IG={null:[]},HG=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:BG,contentInitial:DG,disable:IG,document:AG,flow:LG,flowInitial:OG,insideSpan:PG,string:jG,text:zG},Symbol.toStringTag,{value:"Module"}));function FG(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={},l=[];let a=[],u=[];const h={attempt:j(L),check:j(D),consume:T,enter:R,exit:M,interrupt:j(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:y,write:m};let p=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function m(H){return a=$r(a,H),C(),a[a.length-1]!==null?[]:(F(t,0),d.events=Lp(l,d.events,d),d.events)}function _(H,P){return $G(y(H),P)}function y(H){return UG(a,H)}function S(){const{_bufferIndex:H,_index:P,line:U,column:V,offset:$}=r;return{_bufferIndex:H,_index:P,line:U,column:V,offset:$}}function w(H){s[H.line]=H.column,z()}function C(){let H;for(;r._index<a.length;){const P=a[r._index];if(typeof P=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<P.length;)k(P.charCodeAt(r._bufferIndex));else k(P)}}function k(H){p=p(H)}function T(H){ze(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,z()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function R(H,P){const U=P||{};return U.type=H,U.start=S(),d.events.push(["enter",U,d]),u.push(U),U}function M(H){const P=u.pop();return P.end=S(),d.events.push(["exit",P,d]),P}function L(H,P){F(H,P.from)}function D(H,P){P.restore()}function j(H,P){return U;function U(V,$,B){let K,W,Z,N;return Array.isArray(V)?q(V):"tokenize"in V?q([V]):I(V);function I(oe){return J;function J(ge){const ie=ge!==null&&oe[ge],ce=ge!==null&&oe.null,we=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return q(we)(ge)}}function q(oe){return K=oe,W=0,oe.length===0?B:A(oe[W])}function A(oe){return J;function J(ge){return N=Y(),Z=oe,oe.partial||(d.currentConstruct=oe),oe.name&&d.parser.constructs.disable.null.includes(oe.name)?fe():oe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ae,fe)(ge)}}function ae(oe){return H(Z,N),$}function fe(oe){return N.restore(),++W<K.length?A(K[W]):B}}}function F(H,P){H.resolveAll&&!l.includes(H)&&l.push(H),H.resolve&&Cr(d.events,P,d.events.length-P,H.resolve(d.events.slice(P),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function Y(){const H=S(),P=d.previous,U=d.currentConstruct,V=d.events.length,$=Array.from(u);return{from:V,restore:B};function B(){r=H,d.previous=P,d.currentConstruct=U,d.events.length=V,u=$,z()}}function z(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function UG(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,l)];else{if(a=e.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}l>0&&a.push(e[s].slice(0,l))}return a}function $G(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
|
|
504
|
-
`;break}case-3:{a=`\r
|
|
505
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(l)}s=l===-2,r.push(a)}return r.join("")}function WG(e){const r={constructs:n5([HG,...(e||{}).extensions||[]]),content:s(sK),defined:[],document:s(lK),flow:s(kG),lazy:{},string:s(TG),text:s(MG)};return r;function s(l){return a;function a(u){return FG(r,l,u)}}}function VG(e){for(;!l5(e););return e}const W2=/[\0\t\n\r]/g;function qG(){let e=1,t="",n=!0,r;return s;function s(l,a,u){const h=[];let d,p,m,_,y;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(W2.lastIndex=m,d=W2.exec(l),_=d&&d.index!==void 0?d.index:l.length,y=l.charCodeAt(_),!d){t=l.slice(m);break}if(y===10&&m===_&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),m<_&&(h.push(l.slice(m,_)),e+=_-m),y){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}m=_+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const KG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GG(e){return e.replace(KG,YG)}function YG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return r5(n.slice(l?2:1),l?16:10)}return C0(n)||e}const f5={}.hasOwnProperty;function XG(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ZG(n)(VG(WG(n).document().write(qG()(e,t,!0))))}function ZG(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(xt),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:l(Ce),blockQuote:l(ce),characterEscape:Y,characterReference:Y,codeFenced:l(we),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(we,a),codeText:l(Se,a),codeTextData:Y,data:Y,codeFlowValue:Y,definition:l(ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(Be),hardBreakEscape:l(Oe),hardBreakTrailing:l(Oe),htmlFlow:l(bt,a),htmlFlowData:Y,htmlText:l(bt,a),htmlTextData:Y,image:l(hn),label:a,link:l(xt),listItem:l(In),listItemValue:_,listOrdered:l(zt,m),listUnordered:l(zt),paragraph:l(cr),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(Ce),strong:l(Gr),thematicBreak:l(Rt)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:ie,autolinkProtocol:ge,blockQuote:h(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:oe,characterReference:J,codeFenced:h(C),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:z,codeIndented:h(k),codeText:h($),codeTextData:z,data:z,definition:h(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(U),htmlFlowData:z,htmlText:h(V),htmlTextData:z,image:h(K),label:Z,labelText:W,lineEnding:H,link:h(B),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ae,resourceDestinationString:N,resourceTitleString:I,resource:q,setextHeading:h(F),setextHeadingLineSequence:j,setextHeadingText:D,strong:h(),thematicBreak:h()}};p5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let ve={type:"root",children:[]};const Le={stack:[ve],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:p,data:n},Ie=[];let Xe=-1;for(;++Xe<ue.length;)if(ue[Xe][1].type==="listOrdered"||ue[Xe][1].type==="listUnordered")if(ue[Xe][0]==="enter")Ie.push(Xe);else{const Ct=Ie.pop();Xe=s(ue,Ct,Xe)}for(Xe=-1;++Xe<ue.length;){const Ct=t[ue[Xe][0]];f5.call(Ct,ue[Xe][1].type)&&Ct[ue[Xe][1].type].call(Object.assign({sliceSerialize:ue[Xe][2].sliceSerialize},Le),ue[Xe][1])}if(Le.tokenStack.length>0){const Ct=Le.tokenStack[Le.tokenStack.length-1];(Ct[1]||V2).call(Le,void 0,Ct[0])}for(ve.position={start:Xs(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Xs(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)ve=t.transforms[Xe](ve)||ve;return ve}function s(ue,ve,Le){let Ie=ve-1,Xe=-1,Ct=!1,Yn,nn,Pt,Gt;for(;++Ie<=Le;){const ot=ue[Ie];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Xe++:Xe--,Gt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(Yn&&!Gt&&!Xe&&!Pt&&(Pt=Ie),Gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gt=void 0}if(!Xe&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Xe===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(Yn){let Xn=Ie;for(nn=void 0;Xn--;){const Dn=ue[Xn];if(Dn[1].type==="lineEnding"||Dn[1].type==="lineEndingBlank"){if(Dn[0]==="exit")continue;nn&&(ue[nn][1].type="lineEndingBlank",Ct=!0),Dn[1].type="lineEnding",nn=Xn}else if(!(Dn[1].type==="linePrefix"||Dn[1].type==="blockQuotePrefix"||Dn[1].type==="blockQuotePrefixWhitespace"||Dn[1].type==="blockQuoteMarker"||Dn[1].type==="listItemIndent"))break}Pt&&(!nn||Pt<nn)&&(Yn._spread=!0),Yn.end=Object.assign({},nn?ue[nn][1].start:ot[1].end),ue.splice(nn||Ie,0,["exit",Yn,ot[2]]),Ie++,Le++}if(ot[1].type==="listItemPrefix"){const Xn={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};Yn=Xn,ue.splice(Ie,0,["enter",Xn,ot[2]]),Ie++,Le++,Pt=void 0,Gt=!0}}}return ue[ve][1]._spread=Ct,Le}function l(ue,ve){return Le;function Le(Ie){u.call(this,ue(Ie),Ie),ve&&ve.call(this,Ie)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(ue,ve,Le){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ve,Le||void 0]),ue.position={start:Xs(ve.start),end:void 0}}function h(ue){return ve;function ve(Le){ue&&ue.call(this,Le),d.call(this,Le)}}function d(ue,ve){const Le=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ue.type&&(ve?ve.call(this,ue,Ie[0]):(Ie[1]||V2).call(this,ue,Ie[0]));else throw new Error("Cannot close `"+ue.type+"` ("+bu({start:ue.start,end:ue.end})+"): it’s not open");Le.position.end=Xs(ue.end)}function p(){return w0(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function _(ue){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ue}function S(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue.replace(/(\r?\n|\r)$/g,"")}function T(ue){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ve,Le.identifier=ii(this.sliceSerialize(ue)).toLowerCase()}function R(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function M(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function L(ue){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Le=this.sliceSerialize(ue).length;ve.depth=Le}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function j(ue){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(ue){const Le=this.stack[this.stack.length-1].children;let Ie=Le[Le.length-1];(!Ie||Ie.type!=="text")&&(Ie=se(),Ie.position={start:Xs(ue.start),end:void 0},Le.push(Ie)),this.stack.push(Ie)}function z(ue){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ue),ve.position.end=Xs(ue.end)}function H(ue){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ve.children[ve.children.length-1];Le.position.end=Xs(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(Y.call(this,ue),z.call(this,ue))}function P(){this.data.atHardBreak=!0}function U(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function V(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function $(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ue}function B(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function K(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ve,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function W(ue){const ve=this.sliceSerialize(ue),Le=this.stack[this.stack.length-2];Le.label=GG(ve),Le.identifier=ii(ve).toLowerCase()}function Z(){const ue=this.stack[this.stack.length-1],ve=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ie=ue.children;Le.children=Ie}else Le.alt=ve}function N(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ue}function I(){const ue=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ue}function q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ae(ue){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ve,Le.identifier=ii(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function fe(ue){this.data.characterReferenceType=ue.type}function oe(ue){const ve=this.sliceSerialize(ue),Le=this.data.characterReferenceType;let Ie;Le?(Ie=r5(ve,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=C0(ve);const Xe=this.stack[this.stack.length-1];Xe.value+=Ie}function J(ue){const ve=this.stack.pop();ve.position.end=Xs(ue.end)}function ge(ue){z.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ue)}function ie(ue){z.call(this,ue);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ue)}function ce(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function bt(){return{type:"html",value:""}}function hn(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function zt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function In(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function cr(){return{type:"paragraph",children:[]}}function Gr(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function p5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?p5(e,r):QG(e,r)}}function QG(e,t){let n;for(n in t)if(f5.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 V2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is still open")}function JG(e){const t=this;t.parser=n;function n(r){return XG(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function eY(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 tY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
506
|
-
`}]}function nY(e,t){const n=t.value?t.value+`
|
|
507
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function rY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Va(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,u+=1,e.footnoteCounts.set(r,u);const h={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(a)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function oY(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 lY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function m5(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),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function aY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m5(e,t);const s={src:Va(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function cY(e,t){const n={src:Va(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 uY(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 dY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m5(e,t);const s={href:Va(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function hY(e,t){const n={href:Va(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 fY(e,t,n){const r=e.all(t),s=n?pY(n):g5(t),l={},a=[];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:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(s||u!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
|
|
508
|
-
`}),p.type==="element"&&p.tagName==="p"&&!s?a.push(...p.children):a.push(p)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
|
509
|
-
`});const d={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,d),e.applyData(t,d)}function pY(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=g5(n[r])}return t}function g5(e){const t=e.spread;return t??e.children.length>1}function mY(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 a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function gY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _Y(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yY(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=y0(t.children[1]),h=YA(t.children[t.children.length-1]);u&&h&&(a.position={start:u,end:h}),s.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function bY(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const m=t.children[h],_={},y=a?a[h]:void 0;y&&(_.align=y);let S={type:"element",tagName:l,properties:_,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),d.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function xY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const q2=9,K2=32;function SY(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const l=[];for(;r;)l.push(G2(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return l.push(G2(t.slice(s),s>0,!1)),l.join("")}function G2(e,t,n){let r=0,s=e.length;if(t){let l=e.codePointAt(r);for(;l===q2||l===K2;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(s-1);for(;l===q2||l===K2;)s--,l=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function wY(e,t){const n={type:"text",value:SY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kY={blockquote:eY,break:tY,code:nY,delete:rY,emphasis:iY,footnoteReference:sY,heading:oY,html:lY,imageReference:aY,image:cY,inlineCode:uY,linkReference:dY,link:hY,listItem:fY,list:mY,paragraph:gY,root:vY,strong:_Y,table:yY,tableCell:xY,tableRow:bY,text:wY,thematicBreak:CY,toml:Vh,yaml:Vh,definition:Vh,footnoteDefinition:Vh};function Vh(){}const v5=-1,jp=0,Su=1,Gf=2,E0=3,R0=4,T0=5,M0=6,_5=7,y5=8,Y2=typeof self=="object"?self:globalThis,EY=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),r=s=>{if(e.has(s))return e.get(s);const[l,a]=t[s];switch(l){case jp:case v5:return n(a,s);case Su:{const u=n([],s);for(const h of a)u.push(r(h));return u}case Gf:{const u=n({},s);for(const[h,d]of a)u[r(h)]=r(d);return u}case E0:return n(new Date(a),s);case R0:{const{source:u,flags:h}=a;return n(new RegExp(u,h),s)}case T0:{const u=n(new Map,s);for(const[h,d]of a)u.set(r(h),r(d));return u}case M0:{const u=n(new Set,s);for(const h of a)u.add(r(h));return u}case _5:{const{name:u,message:h}=a;return n(new Y2[u](h),s)}case y5:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new Y2[l](a),s)};return r},X2=e=>EY(new Map,e)(0),la="",{toString:RY}={},{keys:TY}=Object,Jc=e=>{const t=typeof e;if(t!=="object"||!e)return[jp,t];const n=RY.call(e).slice(8,-1);switch(n){case"Array":return[Su,la];case"Object":return[Gf,la];case"Date":return[E0,la];case"RegExp":return[R0,la];case"Map":return[T0,la];case"Set":return[M0,la];case"DataView":return[Su,n]}return n.includes("Array")?[Su,n]:n.includes("Error")?[_5,n]:[Gf,n]},qh=([e,t])=>e===jp&&(t==="function"||t==="symbol"),MY=(e,t,n,r)=>{const s=(a,u)=>{const h=r.push(a)-1;return n.set(u,h),h},l=a=>{if(n.has(a))return n.get(a);let[u,h]=Jc(a);switch(u){case jp:{let p=a;switch(h){case"bigint":u=y5,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return s([v5],a)}return s([u,p],a)}case Su:{if(h){let _=a;return h==="DataView"?_=new Uint8Array(a.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(a)),s([h,[..._]],a)}const p=[],m=s([u,p],a);for(const _ of a)p.push(l(_));return m}case Gf:{if(h)switch(h){case"BigInt":return s([h,a.toString()],a);case"Boolean":case"Number":case"String":return s([h,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const p=[],m=s([u,p],a);for(const _ of TY(a))(e||!qh(Jc(a[_])))&&p.push([l(_),l(a[_])]);return m}case E0:return s([u,a.toISOString()],a);case R0:{const{source:p,flags:m}=a;return s([u,{source:p,flags:m}],a)}case T0:{const p=[],m=s([u,p],a);for(const[_,y]of a)(e||!(qh(Jc(_))||qh(Jc(y))))&&p.push([l(_),l(y)]);return m}case M0:{const p=[],m=s([u,p],a);for(const _ of a)(e||!qh(Jc(_)))&&p.push(l(_));return m}}const{message:d}=a;return s([u,{name:h,message:d}],a)};return l},Z2=(e,{json:t,lossy:n}={})=>{const r=[];return MY(!(t||n),!!t,new Map,r)(e),r},Yf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?X2(Z2(e,t)):structuredClone(e):(e,t)=>X2(Z2(e,t));function NY(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 AY(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DY(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NY,r=e.options.footnoteBackLabel||AY,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),_=Va(m.toLowerCase());let y=0;const S=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++y<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(h,y);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,y),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(d,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Yf(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
510
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
511
|
-
`}]}}const zp=(function(e){if(e==null)return zY;if(typeof e=="function")return Pp(e);if(typeof e=="object")return Array.isArray(e)?OY(e):LY(e);if(typeof e=="string")return jY(e);throw new Error("Expected function, string, or object as test")});function OY(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zp(e[n]);return Pp(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function LY(e){const t=e;return Pp(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function jY(e){return Pp(t);function t(n){return n&&n.type===e}}function Pp(e){return t;function t(n,r,s){return!!(PY(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function zY(){return!0}function PY(e){return e!==null&&typeof e=="object"&&"type"in e}const b5=[],BY=!0,jy=!1,IY="skip";function x5(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const l=zp(s),a=r?-1:1;u(e,void 0,[])();function u(h,d,p){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return _;function _(){let y=b5,S,w,C;if((!t||l(h,d,p[p.length-1]||void 0))&&(y=HY(n(h,p)),y[0]===jy))return y;if("children"in h&&h.children){const k=h;if(k.children&&y[0]!==IY)for(w=(r?k.children.length:-1)+a,C=p.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===jy)return S;w=typeof S[1]=="number"?S[1]:w+a}}return y}}}function HY(e){return Array.isArray(e)?e:typeof e=="number"?[BY,e]:e==null?b5:[e]}function N0(e,t,n,r){let s,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,s=n):(l=t,a=n,s=r),x5(e,l,u,s);function u(h,d){const p=d[d.length-1],m=p?p.children.indexOf(h):void 0;return a(h,m,p)}}const zy={}.hasOwnProperty,FY={};function UY(e,t){const n=t||FY,r=new Map,s=new Map,l=new Map,a={...kY,...n.handlers},u={all:d,applyData:WY,definitionById:r,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:a,one:h,options:n,patch:$Y,wrap:qY};return N0(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 h(p,m){const _=p.type,y=u.handlers[_];if(zy.call(u.handlers,_)&&y)return y(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in p){const{children:w,...C}=p,k=Yf(C);return k.children=u.all(p),k}return Yf(p)}return(u.options.unknownHandler||VY)(u,p,m)}function d(p){const m=[];if("children"in p){const _=p.children;let y=-1;for(;++y<_.length;){const S=u.one(_[y],p);if(S){if(y&&_[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Q2(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=Q2(w.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function $Y(e,t){e.position&&(t.position=Aq(e))}function WY(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,Yf(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function VY(e,t){const n=t.data||{},r="value"in t&&!(zy.call(n,"hProperties")||zy.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 qY(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
512
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
513
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
514
|
-
`}),n}function Q2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function J2(e,t){const n=UY(e,t),r=n.one(e,void 0),s=DY(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
515
|
-
`},s),l}function KY(e,t){return e&&"run"in e?async function(n,r){const s=J2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return J2(n,{file:r,...e||t})}}function eE(e){if(e)throw e}var Gv,tE;function GY(){if(tE)return Gv;tE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},a=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Gv=function h(){var d,p,m,_,y,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(d=arguments[C],d!=null)for(p in d)m=u(w,p),_=u(d,p),w!==_&&(T&&_&&(l(_)||(y=s(_)))?(y?(y=!1,S=m&&s(m)?m:[]):S=m&&l(m)?m:{},a(w,{name:p,newValue:h(T,S,_)})):typeof _<"u"&&a(w,{name:p,newValue:_}));return w},Gv}var YY=GY();const Yv=Jf(YY);function Py(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 XY(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...s);function u(h,...d){const p=e[++l];let m=-1;if(h){a(h);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,p?ZY(p,u)(...d):a(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function ZY(e,t){let n;return r;function r(...a){const u=e.length>a.length;let h;u&&a.push(s);try{h=e.apply(this,a)}catch(d){const p=d;if(u&&n)throw p;return s(p)}u||(h&&h.then&&typeof h.then=="function"?h.then(l,s):h instanceof Error?s(h):l(h))}function s(a,...u){n||(n=!0,t(a,...u))}function l(a){s(null,a)}}const yi={basename:QY,dirname:JY,extname:eX,join:tX,sep:"/"};function QY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');od(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function JY(e){if(od(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 eX(e){od(e);let t=e.length,n=-1,r=0,s=-1,l=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function tX(...e){let t=-1,n;for(;++t<e.length;)od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":nX(n)}function nX(e){od(e);const t=e.codePointAt(0)===47;let n=rX(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rX(e,t){let n="",r=0,s=-1,l=0,a=-1,u,h;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(s===a-1||l===1))if(s!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=a,l=0;continue}}else if(n.length>0){n="",r=0,s=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,l=0}else u===46&&l>-1?l++:l=-1}return n}function od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iX={cwd:sX};function sX(){return"/"}function By(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oX(e){if(typeof e=="string")e=new URL(e);else if(!By(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 lX(e)}function lX(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 Xv=["history","path","basename","stem","extname","dirname"];class S5{constructor(t){let n;t?By(t)?n={path:t}:typeof t=="string"||aX(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":iX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Xv.length;){const l=Xv[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Xv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?yi.basename(this.path):void 0}set basename(t){Qv(t,"basename"),Zv(t,"basename"),this.path=yi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yi.dirname(this.path):void 0}set dirname(t){nE(this.basename,"dirname"),this.path=yi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yi.extname(this.path):void 0}set extname(t){if(Zv(t,"extname"),nE(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=yi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){By(t)&&(t=oX(t)),Qv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yi.basename(this.path,this.extname):void 0}set stem(t){Qv(t,"stem"),Zv(t,"stem"),this.path=yi.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 Bn(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 Zv(e,t){if(e&&e.includes(yi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yi.sep+"`")}function Qv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cX=(function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),uX={}.hasOwnProperty;class A0 extends cX{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=XY()}copy(){const t=new A0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(t_("data",this.frozen),this.namespace[t]=n,this):uX.call(this.namespace,t)&&this.namespace[t]||void 0:t?(t_("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=Kh(t),r=this.parser||this.Parser;return Jv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jv("process",this.parser||this.Parser),e_("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,a){const u=Kh(t),h=r.parse(u);r.run(h,u,function(p,m,_){if(p||!m||!_)return d(p);const y=m,S=r.stringify(y,_);fX(S)?_.value=S:_.result=S,d(p,_)});function d(p,m){p||!m?a(p):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Jv("processSync",this.parser||this.Parser),e_("processSync",this.compiler||this.Compiler),this.process(t,s),iE("processSync","process",n),r;function s(l,a){n=!0,eE(l),r=a}}run(t,n,r){rE(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,u){const h=Kh(n);s.run(t,h,d);function d(p,m,_){const y=m||t;p?u(p):a?a(y):r(void 0,y,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),iE("runSync","run",r),s;function l(a,u){eE(a),s=u,r=!0}}stringify(t,n){this.freeze();const r=Kh(n),s=this.compiler||this.Compiler;return e_("stringify",s),rE(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(t_("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;h(p,m)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(s.settings=Yv(!0,s.settings,d.settings))}function u(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];l(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,p){let m=-1,_=-1;for(;++m<r.length;)if(r[m][0]===d){_=m;break}if(_===-1)r.push([d,...p]);else if(p.length>0){let[y,...S]=p;const w=r[_][1];Py(w)&&Py(y)&&(y=Yv(!0,w,y)),r[_]=[d,y,...S]}}}}const dX=new A0().freeze();function Jv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function e_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function t_(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 rE(e){if(!Py(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Kh(e){return hX(e)?e:new S5(e)}function hX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fX(e){return typeof e=="string"||pX(e)}function pX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sE=[],oE={allowDangerousHtml:!0},gX=/^(https?|ircs?|mailto|xmpp)$/i,vX=[{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 ld(e){const t=_X(e),n=yX(e);return bX(t.runSync(t.parse(n),n),e)}function _X(e){const t=e.rehypePlugins||sE,n=e.remarkPlugins||sE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...oE}:oE;return dX().use(JG).use(n).use(KY,r).use(t)}function yX(e){const t=e.children||"",n=new S5;return typeof t=="string"&&(n.value=t),n}function bX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,l=t.disallowedElements,a=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||xX;for(const p of vX)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+mX+p.id,void 0);return N0(e,d),zq(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function d(p,m,_){if(p.type==="raw"&&_&&typeof m=="number")return a?_.children.splice(m,1):_.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let y;for(y in Vv)if(Object.hasOwn(Vv,y)&&Object.hasOwn(p.properties,y)){const S=p.properties[y],w=Vv[y];(w===null||w.includes(p.tagName))&&(p.properties[y]=h(String(S||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(p,m,_)),y&&_&&typeof m=="number")return u&&p.children?_.children.splice(m,1,...p.children):_.children.splice(m,1),m}}}function xX(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||gX.test(e.slice(0,t))?e:""}function lE(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 SX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wX(e,t,n){const s=zp((n||{}).ignore||[]),l=CX(t);let a=-1;for(;++a<l.length;)x5(e,"text",u);function u(d,p){let m=-1,_;for(;++m<p.length;){const y=p[m],S=_?_.children:void 0;if(s(y,S?S.indexOf(y):void 0,_))return;_=y}if(_)return h(d,p)}function h(d,p){const m=p[p.length-1],_=l[a][0],y=l[a][1];let S=0;const C=m.children.indexOf(d);let k=!1,T=[];_.lastIndex=0;let R=_.exec(d.value);for(;R;){const M=R.index,L={index:R.index,input:R.input,stack:[...p,d]};let D=y(...R,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?_.lastIndex=M+1:(S!==M&&T.push({type:"text",value:d.value.slice(S,M)}),Array.isArray(D)?T.push(...D):D&&T.push(D),S=M+R[0].length,k=!0),!_.global)break;R=_.exec(d.value)}return k?(S<d.value.length&&T.push({type:"text",value:d.value.slice(S)}),m.children.splice(C,1,...T)):T=[d],C+T.length}}function CX(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([kX(s[0]),EX(s[1])])}return t}function kX(e){return typeof e=="string"?new RegExp(SX(e),"g"):e}function EX(e){return typeof e=="function"?e:function(){return e}}const n_="phrasing",r_=["autolink","link","image","label"];function RX(){return{transforms:[LX],enter:{literalAutolink:MX,literalAutolinkEmail:i_,literalAutolinkHttp:i_,literalAutolinkWww:i_},exit:{literalAutolink:OX,literalAutolinkEmail:DX,literalAutolinkHttp:NX,literalAutolinkWww:AX}}}function TX(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:n_,notInConstruct:r_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:n_,notInConstruct:r_},{character:":",before:"[ps]",after:"\\/",inConstruct:n_,notInConstruct:r_}]}}function MX(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function i_(e){this.config.enter.autolinkProtocol.call(this,e)}function NX(e){this.config.exit.autolinkProtocol.call(this,e)}function AX(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 DX(e){this.config.exit.autolinkEmail.call(this,e)}function OX(e){this.exit(e)}function LX(e){wX(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jX],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zX]],{ignore:["link","linkReference"]})}function jX(e,t,n,r,s){let l="";if(!w5(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!PX(n)))return!1;const a=BX(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function zX(e,t,n,r){return!w5(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function PX(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 BX(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=lE(e,"(");let l=lE(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function w5(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||il(n)||Op(n))&&(!t||n!==47)}C5.peek=KX;function IX(){this.buffer()}function HX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FX(){this.buffer()}function UX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $X(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ii(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WX(e){this.exit(e)}function VX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ii(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qX(e){this.exit(e)}function KX(){return"["}function C5(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),u(),a(),l+=s.move("]"),l}function GX(){return{enter:{gfmFootnoteCallString:IX,gfmFootnoteCall:HX,gfmFootnoteDefinitionLabelString:FX,gfmFootnoteDefinition:UX},exit:{gfmFootnoteCallString:$X,gfmFootnoteCall:WX,gfmFootnoteDefinitionLabelString:VX,gfmFootnoteDefinition:qX}}}function YX(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:C5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,a){const u=l.createTracker(a);let h=u.move("[^");const d=l.enter("footnoteDefinition"),p=l.enter("label");return h+=u.move(l.safe(l.associationId(r),{before:h,after:"]"})),p(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
516
|
-
`:" ")+l.indentLines(l.containerFlow(r,u.current()),t?k5:XX))),d(),h}}function XX(e,t,n){return t===0?e:k5(e,t,n)}function k5(e,t,n){return(n?"":" ")+e}const ZX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];E5.peek=nZ;function QX(){return{canContainEols:["delete"],enter:{strikethrough:eZ},exit:{strikethrough:tZ}}}function JX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZX}],handlers:{delete:E5}}}function eZ(e){this.enter({type:"delete",children:[]},e)}function tZ(e){this.exit(e)}function E5(e,t,n,r){const s=n.createTracker(r),l=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),l(),a}function nZ(){return"~"}function rZ(e){return e.length}function iZ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||rZ,l=[],a=[],u=[],h=[];let d=0,p=-1;for(;++p<e.length;){const w=[],C=[];let k=-1;for(e[p].length>d&&(d=e[p].length);++k<e[p].length;){const T=sZ(e[p][k]);if(n.alignDelimiters!==!1){const R=s(T);C[k]=R,(h[k]===void 0||R>h[k])&&(h[k]=R)}w.push(T)}a[p]=w,u[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)l[m]=aE(r[m]);else{const w=aE(r);for(;++m<d;)l[m]=w}m=-1;const _=[],y=[];for(;++m<d;){const w=l[m];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,h[m]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>h[m]&&(h[m]=T),y[m]=T),_[m]=R}a.splice(1,0,_),u.splice(1,0,y),p=-1;const S=[];for(;++p<a.length;){const w=a[p],C=u[p];m=-1;const k=[];for(;++m<d;){const T=w[m]||"";let R="",M="";if(n.alignDelimiters!==!1){const L=h[m]-(C[m]||0),D=l[m];D===114?R=" ".repeat(L):D===99?L%2?(R=" ".repeat(L/2+.5),M=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),M=R):M=" ".repeat(L)}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(M),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
517
|
-
`)}function sZ(e){return e==null?"":String(e)}function aE(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 oZ(e,t,n,r){const s=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),lZ);return s(),a}function lZ(e,t,n){return">"+(n?"":" ")+e}function aZ(e,t){return cE(e,t.inConstruct,!0)&&!cE(e,t.notInConstruct,!1)}function cE(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 uE(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
518
|
-
`&&aZ(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
519
|
-
`}function cZ(e,t){const n=String(e);let r=n.indexOf(t),s=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++l>a&&(a=l):l=1,s=r+t.length,r=n.indexOf(t,s);return a}function uZ(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 dZ(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 hZ(e,t,n,r){const s=dZ(n),l=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(uZ(e,n)){const m=n.enter("codeIndented"),_=n.indentLines(l,fZ);return m(),_}const u=n.createTracker(r),h=s.repeat(Math.max(cZ(l,s)+1,3)),d=n.enter("codeFenced");let p=u.move(h);if(e.lang){const m=n.enter(`codeFencedLang${a}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${a}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
|
|
520
|
-
`,encode:["`"],...u.current()})),m()}return p+=u.move(`
|
|
521
|
-
`),l&&(p+=u.move(l+`
|
|
522
|
-
`)),p+=u.move(h),d(),p}function fZ(e,t,n){return(n?"":" ")+e}function D0(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 pZ(e,t,n,r){const s=D0(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
523
|
-
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),a(),d}function mZ(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 Iu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xf(e,t,n){const r=Ra(e),s=Ra(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=gZ;function R5(e,t,n,r){const s=mZ(n),l=n.enter("emphasis"),a=n.createTracker(r),u=a.move(s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),p=Xf(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(h=Iu(d)+h.slice(1));const m=h.charCodeAt(h.length-1),_=Xf(r.after.charCodeAt(0),m,s);_.inside&&(h=h.slice(0,-1)+Iu(m));const y=a.move(s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+h+y}function gZ(e,t,n){return n.options.emphasis||"*"}function vZ(e,t){let n=!1;return N0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,jy}),!!((!e.depth||e.depth<3)&&w0(e)&&(t.options.setext||n))}function _Z(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(vZ(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:`
|
|
524
|
-
`,after:`
|
|
525
|
-
`});return m(),p(),_+`
|
|
526
|
-
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
527
|
-
`))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");l.move(a+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
528
|
-
`,...l.current()});return/^[\t ]/.test(d)&&(d=Iu(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),h(),u(),d}T5.peek=yZ;function T5(e){return e.value||""}function yZ(){return"<"}M5.peek=bZ;function M5(e,t,n,r){const s=D0(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),d+=h.move(")"),a(),d}function bZ(){return"!"}N5.peek=xZ;function N5(e,t,n,r){const s=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let h=u.move("![");const d=n.safe(e.alt,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=p,l(),s==="full"||!d||d!==m?h+=u.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function xZ(){return"!"}A5.peek=SZ;function A5(e,t,n){let r=e.value||"",s="`",l=-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+" ");++l<n.unsafe.length;){const a=n.unsafe[l],u=n.compilePattern(a);let h;if(a.atBreak)for(;h=u.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return s+r+s}function SZ(){return"`"}function D5(e,t){const n=w0(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))}O5.peek=wZ;function O5(e,t,n,r){const s=D0(n),l=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,h;if(D5(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),u(),n.stack=p,m}u=n.enter("link"),h=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(e,{before:d,after:"](",...a.current()})),d+=a.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(e.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(h=n.enter("destinationRaw"),d+=a.move(n.safe(e.url,{before:d,after:e.title?" ":")",...a.current()}))),h(),e.title&&(h=n.enter(`title${l}`),d+=a.move(" "+s),d+=a.move(n.safe(e.title,{before:d,after:s,...a.current()})),d+=a.move(s),h()),d+=a.move(")"),u(),d}function wZ(e,t,n){return D5(e,n)?"<":"["}L5.peek=CZ;function L5(e,t,n,r){const s=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let h=u.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=p,l(),s==="full"||!d||d!==m?h+=u.move(m+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function CZ(){return"["}function O0(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 kZ(e){const t=O0(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 EZ(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 j5(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 RZ(e,t,n,r){const s=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?EZ(n):O0(n);const u=e.ordered?a==="."?")":".":kZ(n);let h=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&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&&(h=!0),j5(n)===a&&p){let m=-1;for(;++m<e.children.length;){const _=e.children[m];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(a=u),n.bulletCurrent=a;const d=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,s(),d}function TZ(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 MZ(e,t,n,r){const s=TZ(n);let l=n.bulletCurrent||O0(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(l+" ".repeat(a-l.length)),u.shift(a);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return h(),d;function p(m,_,y){return _?(y?"":" ".repeat(a))+m:(y?l:l+" ".repeat(a-l.length))+m}}function NZ(e,t,n,r){const s=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),s(),a}const AZ=zp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function DZ(e,t,n,r){return(e.children.some(function(a){return AZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}z5.peek=LZ;function z5(e,t,n,r){const s=OZ(n),l=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),p=Xf(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(h=Iu(d)+h.slice(1));const m=h.charCodeAt(h.length-1),_=Xf(r.after.charCodeAt(0),m,s);_.inside&&(h=h.slice(0,-1)+Iu(m));const y=a.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},u+h+y}function LZ(e,t,n){return n.options.strong||"*"}function jZ(e,t,n,r){return n.safe(e.value,r)}function zZ(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 PZ(e,t,n){const r=(j5(n)+(n.options.ruleSpaces?" ":"")).repeat(zZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const P5={blockquote:oZ,break:uE,code:hZ,definition:pZ,emphasis:R5,hardBreak:uE,heading:_Z,html:T5,image:M5,imageReference:N5,inlineCode:A5,link:O5,linkReference:L5,list:RZ,listItem:MZ,paragraph:NZ,root:DZ,strong:z5,text:jZ,thematicBreak:PZ};function BZ(){return{enter:{table:IZ,tableData:dE,tableHeader:dE,tableRow:FZ},exit:{codeText:UZ,table:HZ,tableData:s_,tableHeader:s_,tableRow:s_}}}function IZ(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 HZ(e){this.exit(e),this.data.inTable=void 0}function FZ(e){this.enter({type:"tableRow",children:[]},e)}function s_(e){this.exit(e)}function dE(e){this.enter({type:"tableCell",children:[]},e)}function UZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$Z));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $Z(e,t){return t==="|"?t:e}function WZ(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
529
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:a,tableCell:h,tableRow:u}};function a(y,S,w,C){return d(p(y,w,C),y.align)}function u(y,S,w,C){const k=m(y,w,C),T=d([k]);return T.slice(0,T.indexOf(`
|
|
530
|
-
`))}function h(y,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(y,{...C,before:l,after:l});return T(),k(),R}function d(y,S){return iZ(y,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function p(y,S,w){const C=y.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(y,S,w){const C=y.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=h(C[k],y,S,w);return R(),T}function _(y,S,w){let C=P5.inlineCode(y,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function VZ(){return{exit:{taskListCheckValueChecked:hE,taskListCheckValueUnchecked:hE,paragraph:KZ}}}function qZ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GZ}}}function hE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function KZ(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 l=-1,a;for(;++l<s.length;){const u=s[l];if(u.type==="paragraph"){a=u;break}}a===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 GZ(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);l&&u.move(a);let h=P5.listItem(e,t,n,{...r,...u.current()});return l&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(p){return p+a}}function YZ(){return[RX(),GX(),QX(),BZ(),VZ()]}function XZ(e){return{extensions:[TX(),YX(e),JX(),WZ(e),qZ()]}}const ZZ={tokenize:rQ,partial:!0},B5={tokenize:iQ,partial:!0},I5={tokenize:sQ,partial:!0},H5={tokenize:oQ,partial:!0},QZ={tokenize:lQ,partial:!0},F5={name:"wwwAutolink",tokenize:tQ,previous:$5},U5={name:"protocolAutolink",tokenize:nQ,previous:W5},ys={name:"emailAutolink",tokenize:eQ,previous:V5},Oi={};function JZ(){return{text:Oi}}let Fo=48;for(;Fo<123;)Oi[Fo]=ys,Fo++,Fo===58?Fo=65:Fo===91&&(Fo=97);Oi[43]=ys;Oi[45]=ys;Oi[46]=ys;Oi[95]=ys;Oi[72]=[ys,U5];Oi[104]=[ys,U5];Oi[87]=[ys,F5];Oi[119]=[ys,F5];function eQ(e,t,n){const r=this;let s,l;return a;function a(m){return!Iy(m)||!V5.call(r,r.previous)||L0(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return Iy(m)?(e.consume(m),u):m===64?(e.consume(m),h):n(m)}function h(m){return m===46?e.check(QZ,p,d)(m):m===45||m===95||zn(m)?(l=!0,e.consume(m),h):p(m)}function d(m){return e.consume(m),s=!0,h}function p(m){return l&&s&&Vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function tQ(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!$5.call(r,r.previous)||L0(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ZZ,e.attempt(B5,e.attempt(I5,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function nQ(e,t,n){const r=this;let s="",l=!1;return a;function a(m){return(m===72||m===104)&&W5.call(r,r.previous)&&!L0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(Vn(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),h}return n(m)}function h(m){return m===47?(e.consume(m),l?d:(l=!0,h)):n(m)}function d(m){return m===null||Kf(m)||wt(m)||il(m)||Op(m)?n(m):e.attempt(B5,e.attempt(I5,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function rQ(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function iQ(e,t,n){let r,s,l;return a;function a(d){return d===46||d===95?e.check(H5,h,u)(d):d===null||wt(d)||il(d)||d!==45&&Op(d)?h(d):(l=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),a}function h(d){return s||r||!l?n(d):t(d)}}function sQ(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(H5,t,l)(a):a===null||wt(a)||il(a)?t(a):(e.consume(a),s)}function l(a){return a===41&&r++,e.consume(a),s}}function oQ(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),l):u===93?(e.consume(u),s):u===60||u===null||wt(u)||il(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||wt(u)||il(u)?t(u):r(u)}function l(u){return Vn(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):Vn(u)?(e.consume(u),a):n(u)}}function lQ(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return zn(l)?n(l):t(l)}}function $5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function W5(e){return!Vn(e)}function V5(e){return!(e===47||Iy(e))}function Iy(e){return e===43||e===45||e===46||e===95||zn(e)}function L0(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 aQ={tokenize:gQ,partial:!0};function cQ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fQ,continuation:{tokenize:pQ},exit:mQ}},text:{91:{name:"gfmFootnoteCall",tokenize:hQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uQ,resolveTo:dQ}}}}function uQ(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){a=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!a||!a._balanced)return n(h);const d=ii(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function dQ(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 l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function hQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(l>999||m===93&&!a||m===null||m===91||wt(m))return n(m);if(m===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(ii(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return wt(m)||(a=!0),l++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function fQ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,u;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(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(a>999||S===93&&!u||S===null||S===91||wt(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=ii(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return wt(S)||(u=!0),a++,e.consume(S),S===92?m:p}function m(S){return S===91||S===92||S===93?(e.consume(S),a++,p):p(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(l)||s.push(l),st(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function pQ(e,t,n){return e.check(sd,t,e.attempt(aQ,t,n))}function mQ(e){e.exit("gfmFootnoteDefinition")}function gQ(e,t,n){const r=this;return st(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function vQ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let h=-1;for(;++h<a.length;)if(a[h][0]==="enter"&&a[h][1].type==="strikethroughSequenceTemporary"&&a[h][1]._close){let d=h;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[h][1].end.offset-a[h][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[h][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[h][1].end)},m={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[h][1].start)},_=[["enter",p,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",m,u]],y=u.parser.constructs.insideSpan.null;y&&Cr(_,_.length,0,Lp(y,a.slice(d+1,h),u)),Cr(_,_.length,0,[["exit",m,u],["enter",a[h][1],u],["exit",a[h][1],u],["exit",p,u]]),Cr(a,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<a.length;)a[h][1].type==="strikethroughSequenceTemporary"&&(a[h][1].type="data");return a}function l(a,u,h){const d=this.previous,p=this.events;let m=0;return _;function _(S){return d===126&&p[p.length-1][1].type!=="characterEscape"?h(S):(a.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const w=Ra(d);if(S===126)return m>1?h(S):(a.consume(S),m++,y);if(m<2&&!n)return h(S);const C=a.exit("strikethroughSequenceTemporary"),k=Ra(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class _Q{constructor(){this.map=[]}add(t,n,r){yQ(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[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 l of s)t.push(l);s=r.pop()}this.map.length=0}}function yQ(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 bQ(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 l=r.length-1;r[l]=r[l]==="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 xQ(){return{flow:{null:{name:"table",tokenize:SQ,resolveAll:wQ}}}}function SQ(e,t,n){const r=this;let s=0,l=0,a;return u;function u(z){let H=r.events.length-1;for(;H>-1;){const V=r.events[H][1].type;if(V==="lineEnding"||V==="linePrefix")H--;else break}const P=H>-1?r.events[H][1].type:null,U=P==="tableHead"||P==="tableRow"?D:h;return U===D&&r.parser.lazy[r.now().line]?n(z):U(z)}function h(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(a=!0,l+=1),p(z)}function p(z){return z===null?n(z):ze(z)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),y):n(z):Je(z)?st(e,p,"whitespace")(z):(l+=1,a&&(a=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||wt(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?_:m)}function _(z){return z===92||z===124?(e.consume(z),m):m(z)}function y(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),a=!1,Je(z)?st(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):S(z))}function S(z){return z===45||z===58?C(z):z===124?(a=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),w):L(z)}function w(z){return Je(z)?st(e,C,"whitespace")(z):C(z)}function C(z){return z===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),k):z===45?(l+=1,k(z)):z===null||ze(z)?M(z):L(z)}function k(z){return z===45?(e.enter("tableDelimiterFiller"),T(z)):L(z)}function T(z){return z===45?(e.consume(z),T):z===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(z))}function R(z){return Je(z)?st(e,M,"whitespace")(z):M(z)}function M(z){return z===124?S(z):z===null||ze(z)?!a||s!==l?L(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):L(z)}function L(z){return n(z)}function D(z){return e.enter("tableRow"),j(z)}function j(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),j):z===null||ze(z)?(e.exit("tableRow"),t(z)):Je(z)?st(e,j,"whitespace")(z):(e.enter("data"),F(z))}function F(z){return z===null||z===124||wt(z)?(e.exit("data"),j(z)):(e.consume(z),z===92?Y:F)}function Y(z){return z===92||z===124?(e.consume(z),F):F(z)}}function wQ(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],a=[0,0,0,0],u=!1,h=0,d,p,m;const _=new _Q;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(u=!1,h!==0&&(fE(_,t,h,d,p),p=void 0,h=0),d={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",d,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,m=void 0,l=[0,0,0,0],a=[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,a[2]===0&&(l[1]!==0&&(a[0]=a[1],m=Gh(_,t,l,s,void 0,m),l=[0,0,0,0]),a[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],m=Gh(_,t,l,s,void 0,m)),l=a,a=[l[1],n,0,0])):S.type==="tableHead"?(u=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,l[1]!==0?(a[0]=a[1],m=Gh(_,t,l,s,n,m)):a[1]!==0&&(m=Gh(_,t,a,s,n,m)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(a[3]=n)}for(h!==0&&fE(_,t,h,d,p),_.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=bQ(t.events,n))}return e}function Gh(e,t,n,r,s,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},ca(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const h=ca(t.events,n[1]);if(l={type:a,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=ca(t.events,n[2]),p=ca(t.events,n[3]),m={type:u,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const _=t.events[n[2]],y=t.events[n[3]];if(_[1].end=Object.assign({},y[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&&(l.end=Object.assign({},ca(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function fE(e,t,n,r,s){const l=[],a=ca(t.events,n);s&&(s.end=Object.assign({},a),l.push(["exit",s,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function ca(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CQ={name:"tasklistCheck",tokenize:EQ};function kQ(){return{text:{91:CQ}}}function EQ(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),l)}function l(h){return wt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),a):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),a):n(h)}function a(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return ze(h)?t(h):Je(h)?e.check({tokenize:RQ},t,n)(h):n(h)}}function RQ(e,t,n){return st(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function TQ(e){return n5([JZ(),cQ(),vQ(e),xQ(),kQ()])}const MQ={};function ad(e){const t=this,n=e||MQ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(TQ(n)),l.push(YZ()),a.push(XZ(n))}function NQ({content:e}){return g.jsx("div",{className:"flex gap-2 justify-end",children:g.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:g.jsx(ld,{remarkPlugins:[ad],components:Ap(),children:e})})})}function AQ({json:e}){return g.jsx("div",{className:"flex gap-3 justify-start",children:g.jsx("div",{className:"flex-1 max-w-[90%]",children:g.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 q5({title:e,count:t,children:n,badge:r}){const[s,l]=b.useState(!1);return t===0?null:g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>l(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(ds,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:e}),g.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&g.jsx("div",{className:"ml-5",children:n})]})}function o_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:g.jsx(q5,{title:e,count:t.length,children:g.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>g.jsx(jA,{icon:r?r(s):n,children:s},s))})})}function DQ(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function K5({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return g.jsx("span",{className:ye("inline-block h-2 w-2 rounded-full shrink-0",t)})}function OQ(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 pE({server:e}){const[t,n]=b.useState(!1),r=e.status==="connected";return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.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&&g.jsx(ds,{className:ye("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx(K5,{status:e.status}),g.jsx("span",{className:"text-muted-foreground font-medium",children:S_(e.name)}),r?g.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):g.jsx("span",{className:"text-muted-foreground/50",children:OQ(e.status)})]}),!r&&e.error&&g.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>g.jsx(jA,{icon:LA(`mcp__${e.name}__${s}`),children:s},s))})]})}function LQ({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?g.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[g.jsx(K5,{status:"failed"}),g.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return g.jsx(q5,{title:"MCP Servers",count:e.length,badge:r,children:g.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>g.jsx(pE,{server:s},s.name)),n.map(s=>g.jsx(pE,{server:s},s.name))]})})}function jQ({rawJson:e}){const[t,n]=b.useState(!1);return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[g.jsx(ds,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),g.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&g.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 zQ({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=b.useMemo(()=>{const s=new Map,l=[];for(const u of e.tools){const h=DQ(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else l.push(u)}const a=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:l,mcpServersWithTools:a}},[e.tools,e.mcpServers]);return g.jsx(mo,{children:g.jsxs(Mp,{expandedContent:g.jsx(Np,{className:"my-4 text-xs",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(OV,{children:e.model}),g.jsx(o_,{title:"Tools",items:n,getIcon:s=>xy[s]??OA}),g.jsx(o_,{title:"Agents",items:e.agents,icon:pb}),g.jsx(o_,{title:"Commands",items:e.slashCommands,icon:$P}),g.jsx(LQ,{servers:r}),t&&g.jsx(jQ,{rawJson:t})]})}),children:[g.jsx(C6,{className:"h-5 w-5 text-logo"}),g.jsx(uo,{children:"Session Started"})]})})}function PQ({message:e}){return g.jsx(mo,{className:"hidden",children:g.jsxs(Mp,{expandedContent:g.jsx(Np,{className:"my-4 text-xs",children:g.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:[g.jsx("div",{className:"size-5 flex justify-center items-center ",children:g.jsx(pb,{className:"h-4 w-4 text-muted-foreground"})}),g.jsx(uo,{children:"Account"})]})})}function BQ({message:e}){return g.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:g.jsx(ld,{remarkPlugins:[ad],components:Ap(),children:e.text})})}function IQ({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const l=r&&t>0;return g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.jsxs("div",{className:"relative",children:[g.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:[l?g.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:g.jsx(z6,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?g.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:g.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function mE({label:e,description:t}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-foreground text-sm",children:e}),t&&g.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function G5({selected:e,multiSelect:t,onClick:n}){return g.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&&g.jsx(lo,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function HQ({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const l="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",a=s?"":"border-b border-border";return r?g.jsx("button",{onClick:r,className:ye(l,a,"transition-all cursor-pointer"),children:g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("div",{className:"flex-1 min-w-0",children:g.jsx(mE,{label:e.label,description:e.description})}),g.jsx(G5,{selected:t,multiSelect:n})]})}):g.jsx("div",{className:ye(l,a),children:g.jsx(mE,{label:e.label,description:e.description})})}function FQ(e){return e==null?void 0:e.answers}function ei(e){return e.id||e.question}function UQ({message:e,onSubmit:t,isLatest:n}){var B,K;const r=e.input.questions,s=!!e.result,l=FQ(e.result),a=((B=e.result)==null?void 0:B.discarded)===!0,[u,h]=b.useState(0),[d,p]=b.useState({}),[m,_]=b.useState({}),[y,S]=b.useState(l??null),[w,C]=b.useState(s),k=(W,Z)=>{var ae;const N=(ae=m[W])==null?void 0:ae.trim(),I=d[W]||"",q=Z||r.find(fe=>ei(fe)===W);if(q!=null&&q.multiSelect)return[I,N].filter(Boolean).flatMap(fe=>fe.split(", ").filter(Boolean));const A=N||I;return A?[A]:[]},T=W=>{const Z=d[ei(W)]||"";return W.multiSelect?Z.split(", ").filter(Boolean):[Z]},R=(W,Z)=>{const N=ei(W);if(W.multiSelect){const I=d[N]?d[N].split(", ").filter(Boolean):[],q=I.includes(Z)?I.filter(A=>A!==Z):[...I,Z];p({...d,[N]:q.join(", ")})}else p({...d,[N]:Z}),_({...m,[N]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},M=(W,Z)=>{const N=ei(W);_({...m,[N]:Z}),Z&&!W.multiSelect&&p({...d,[N]:""})},L=W=>{const Z=ei(W);W.multiSelect&&m[Z]&&_({...m,[Z]:""})},D=r.every(W=>k(ei(W),W).length>0),j=r[u],F=u===r.length-1,Y=j&&k(ei(j),j).length>0,z=()=>{u<r.length-1&&h(u+1)},H=()=>{u>0&&h(u-1)},P=()=>{if(!D)return;const W={};for(const Z of r){const N=ei(Z);W[N]=k(N,Z)}S(W),C(!0),t(e.toolId,r,W)},U=W=>{if(W.key==="Enter"&&!(!j||!Y)){if(W.preventDefault(),F){P();return}z()}};if(w||s){const W=l||y||{};return g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.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:[g.jsxs("p",{children:["Question",r.length!==1?"s":""]}),g.jsx("p",{className:"",children:a?"Discarded":"Answers"})]}),r.map((Z,N)=>{const I=W[ei(Z)]||W[Z.question]||[],q=N===r.length-1;return g.jsxs("div",{className:ye("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!q&&"border-b border-border"),children:[g.jsx("div",{className:"text-sm text-pretty",children:Z.question}),I.length>0&&g.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:I.join(", ")}),I.length===0&&g.jsx("div",{className:"text-sm font-medium text-right italic",children:a?"Discarded":"No Response"})]},ei(Z))})]})})}if(!n)return g.jsx("div",{className:"w-full py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(JR,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!j)return null;const V=T(j),$=m[ei(j)]||"";return g.jsxs("div",{className:"w-full space-y-3",children:[g.jsxs(IQ,{question:j.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?H:void 0,children:[(K=j.options)==null?void 0:K.map(W=>g.jsx(HQ,{option:W,selected:V.includes(W.label),multiSelect:j.multiSelect,onClick:()=>R(j,W.label)},W.label)),g.jsx("div",{className:"transition-all bg-background",children:g.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[g.jsx("input",{type:"text",value:$,onChange:W=>M(j,W.target.value),onKeyDown:U,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"}),g.jsx(G5,{selected:!!$,multiSelect:j.multiSelect,onClick:j.multiSelect&&$?()=>L(j):void 0})]})})]}),g.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!F&&Y&&(j.multiSelect||!!$)&&g.jsx(rt,{size:"sm",onClick:z,children:"Next"}),F&&g.jsx(rt,{size:"sm",onClick:P,disabled:!D,className:ye(!D&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function $Q({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,l]=b.useState(!1),[a,u]=b.useState(!1),[h,d]=b.useState(!1),[p,m]=b.useState(""),_=b.useRef(null),y=e.input;b.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const S=async()=>{y!=null&&y.plan&&(await navigator.clipboard.writeText(y.plan),u(!0),setTimeout(()=>u(!1),2e3))},w=r?e.result:null,C=(w==null?void 0:w.discarded)===!0;return g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(y==null?void 0:y.plan)&&g.jsx(rt,{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",!a&&"hover:text-foreground",a&&"hover:!bg-transparent hover:!border-transparent"),onClick:S,children:a?g.jsx(lo,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})}),g.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",r&&!s?"max-h-[min(400px,40vh)] ":"",r?"hover:!pb-[32px]":""),children:[r&&g.jsxs(rt,{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(!s),children:[s?"Show Less":"Show More",g.jsx(ab,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),y!=null&&y.plan?g.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[g.jsx(ld,{remarkPlugins:[ad],components:Ap(),children:y.plan}),g.jsx("div",{className:"mt-5"})]}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),r?g.jsx("div",{className:"flex justify-end mx-2",children:g.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:[g.jsx("em",{children:C?"Discarded":w!=null&&w.clearContext?"Approved & Cleared Context":w!=null&&w.confirmed?"Approved":w!=null&&w.message?`Adjusted: "${w.message}"`:"Adjusted Plan"}),g.jsx(Q6,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?g.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&g.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[g.jsxs(rt,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[g.jsx(N6,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),g.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[g.jsxs(rt,{size:"sm",variant:"outline",onClick:()=>d(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[g.jsx(tT,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),g.jsxs(rt,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[g.jsx(lo,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),h&&g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx("textarea",{ref:_,value:p,onChange:k=>m(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&p.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,p.trim())),k.key==="Escape"&&(d(!1),m(""))},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"}),g.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[g.jsx(rt,{size:"sm",variant:"ghost",onClick:()=>{d(!1),m("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),g.jsxs(rt,{size:"sm",disabled:!p.trim(),onClick:()=>t(e.toolId,!1,void 0,p.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[g.jsx(PP,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):g.jsx("div",{className:"flex justify-end mx-2",children:g.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const WQ={completed:{Icon:lo,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Mi,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:$6,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function VQ({message:e}){const t=e.input.todos;return t.length?g.jsx("div",{className:"w-full",children:g.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[g.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:[g.jsx(mP,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),g.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:l,iconClass:a,textClass:u}=WQ[n.status];return g.jsxs("div",{className:ye("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[g.jsx(l,{className:ye("h-4 w-4 flex-shrink-0",a)}),g.jsx("span",{className:ye("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function qQ(e){const t=e.split(`
|
|
531
|
-
`),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 KQ(e){return e.replace(/<[^>]+>/g,"")}function GQ(e,t){const n=e.split(`
|
|
532
|
-
`),r=t.split(`
|
|
533
|
-
`),s=YQ(n,r),l=XQ(n,r,s);return ZQ(l)}function YQ(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let l=1;l<=n;l++)for(let a=1;a<=r;a++)s[l][a]=e[l-1]===t[a-1]?s[l-1][a-1]+1:Math.max(s[l-1][a],s[l][a-1]);return s}function XQ(e,t,n){const r=[];let s=e.length,l=t.length;for(;s>0||l>0;)s>0&&l>0&&e[s-1]===t[l-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:l}),s--,l--):l>0&&(s===0||n[s][l-1]>=n[s-1][l])?(r.push({type:"added",text:t[l-1],oldIdx:s,newIdx:l}),l--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:l}),s--);return r.reverse()}function ZQ(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function l_({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=b.useMemo(()=>t&&n!==void 0&&r!==void 0?GQ(n,r):[],[t,n,r]),l=b.useMemo(()=>t?[]:qQ(e),[e,t]),a=b.useMemo(()=>l.some(u=>u.lineNumber!==null),[l]);return t&&s.length>0?g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.jsx("tbody",{children:s.map((u,h)=>{const d=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 g.jsxs("tr",{className:d,children:[g.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"?"+":" "}),g.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${p}`,children:u.content.slice(1)})]},h)})})})})}):g.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:g.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:g.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:g.jsx("tbody",{children:l.map((u,h)=>g.jsxs("tr",{children:[a&&g.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:""}),g.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:KQ(u.content)})]},h))})})})})}function Y5({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,l=b.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?c8(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${Bv(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${Bv(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${Bv(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${S_(e.input.tool)} from ${S_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),a=b.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=b.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),h=e.toolKind==="bash",d=e.toolKind==="write_file",p=e.toolKind==="edit_file",m=e.toolKind==="read_file",_=b.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]),y=b.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 g.jsx(mo,{className:"w-full",children:g.jsxs(Mp,{expandedContent:g.jsx(Np,{className:"my-4 text-sm",children:g.jsxs("div",{className:"flex flex-col gap-2",children:[p?g.jsx(l_,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!m&&!d&&g.jsx(y2,{label:h?g.jsxs("span",{className:"flex items-center gap-2 w-full",children:[g.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&g.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&g.jsx("span",{className:"text-muted-foreground",children:"background"})]}):d?"Contents":"Input",copyText:y,children:y}),r&&m&&!e.isError&&g.jsx(l_,{content:_}),d&&!e.isError&&g.jsx(l_,{content:e.input.content}),r&&!m&&!(d&&!e.isError)&&!(p&&!e.isError)&&g.jsx(y2,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return g.jsx(La,{className:"size-4 text-destructive"});if(a)return g.jsx(pb,{className:"size-4 text-muted-icon"});const w=LA(e.toolName);return g.jsx(w,{className:"size-4 text-muted-icon"})})()}),g.jsx(uo,{className:"text-left transition-opacity duration-200 truncate",children:g.jsx(_p,{animate:s,shimmerWidth:Math.max(20,(((S=u||l)==null?void 0:S.length)??33)*3),children:u||l})})]})})}function QQ({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),l=Math.floor(r%3600/60),a=r%60;return s>0?`${s}h${l>0?` ${l}m`:""}`:l>0?`${l}m${a>0?` ${a}s`:""}`:`${a}s`};return e.success?g.jsxs(mo,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[g.jsx("div",{className:"w-full h-[1px] bg-border"}),g.jsxs(uo,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),g.jsx("div",{className:"w-full h-[1px] bg-border"})]}):g.jsx("div",{className:"px-4 py-3 mx-2 my-1 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm",children:e.result||"An unknown error occurred."})}function JQ({message:e}){return g.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:g.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:[g.jsx(F6,{className:"h-4 w-4 ml-1.5"}),g.jsx("em",{children:"Interrupted"})]})})}function Zf({size:e=4}){return g.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[g.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:g.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"}})}),g.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function eJ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Zf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),g.jsx(Zf,{})]})}function tJ(){return g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Zf,{}),g.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),g.jsx(Zf,{})]})}function nJ({message:e}){return g.jsx(mo,{children:g.jsxs(Mp,{expandedContent:g.jsx(Np,{className:"my-4 text-xs",children:g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:g.jsx(ld,{remarkPlugins:[ad],components:Ap(),children:e.summary})})}),children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(eT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(uo,{children:"Summarized"})]})})}const rJ={compacting:"Compacting..."};function iJ({message:e}){const t=rJ[e.status]||e.status;return g.jsxs(mo,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(eT,{className:"h-4.5 w-4.5 text-muted-foreground"})}),g.jsx(uo,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const sJ={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"}},oJ={key:"other",singular:"tool call",plural:"tool calls"};function lJ(e){return sJ[e]??oJ}function aJ(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,l=lJ(s),a=t.get(l.key);a?a.count++:(t.set(l.key,{category:l,count:1}),n.push(l.key))}return n.map(r=>{const{category:s,count:l}=t.get(r);return`${l} ${l===1?s.singular:s.plural}`}).join(", ")}function cJ({messages:e,isLoading:t,localPath:n}){const[r,s]=b.useState(!1),l=b.useMemo(()=>aJ(e),[e]),u=e.some(h=>h.result===void 0)&&t;return g.jsx(mo,{className:"w-full",children:g.jsxs("div",{className:"flex flex-col w-full",children:[g.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:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(ds,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),g.jsx(uo,{className:"text-left",children:g.jsx(_p,{animate:u,children:l})})]})}),r&&g.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>g.jsx(Y5,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&g.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:g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[g.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:g.jsx(ds,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),g.jsx(uo,{className:"text-left",children:"Collapse"})]})})]})]})})}const uJ=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function gE(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!uJ.has(t)}function dJ(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(gE(r)){const s=[r],l=n;for(n+=1;n<e.length&&gE(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:l}):t.push({type:"single",message:r,index:l});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function hJ({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:l,onExitPlanModeConfirm:a}){const u=b.useMemo(()=>dJ(e),[e]);function h(d,p){if(d.kind==="user_prompt")return g.jsx(NQ,{content:d.content},d.id);switch(d.kind){case"unknown":return g.jsx(AQ,{json:d.json},d.id);case"system_init":return e.findIndex(_=>_.kind==="system_init")===p?g.jsx(zQ,{message:d,rawJson:d.debugRaw},d.id):null;case"account_info":return e.findIndex(_=>_.kind==="account_info")===p?g.jsx(PQ,{message:d},d.id):null;case"assistant_text":return g.jsx(BQ,{message:d},d.id);case"tool":return d.toolKind==="ask_user_question"?g.jsx(UQ,{message:d,onSubmit:l,isLatest:d.id===r.AskUserQuestion},d.id):d.toolKind==="exit_plan_mode"?g.jsx($Q,{message:d,onConfirm:a,isLatest:d.id===r.ExitPlanMode},d.id):d.toolKind==="todo_write"?d.id!==r.TodoWrite?null:g.jsx(VQ,{message:d},d.id):g.jsx(Y5,{message:d,isLoading:t,localPath:n},d.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:g.jsx(QQ,{message:d},d.id)}case"interrupted":return g.jsx(JQ,{message:d},d.id);case"compact_boundary":return g.jsx(eJ,{},d.id);case"context_cleared":return g.jsx(tJ,{},d.id);case"compact_summary":return g.jsx(nJ,{message:d},d.id);case"status":return p===e.length-1?g.jsx(iJ,{message:d},d.id):null}}return g.jsx(AV,{onOpenLocalLink:s,children:u.map(d=>{if(d.type==="tool-group")return g.jsx("div",{className:"group relative",[Cf]:"",children:g.jsx(cJ,{messages:d.messages,isLoading:t,localPath:n})},`group-${d.startIndex}`);const p=h(d.message,d.index);return p?g.jsx("div",{id:`msg-${d.message.id}`,className:"group relative",[Cf]:"",children:p},d.message.id):null})})}function fJ({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){b.useEffect(()=>{if(!n)return;let s=0,l=null;const a=m=>{const _=m instanceof Element?m:null,y=e.current,S=t.current;if(CC({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:l,pointerEndTarget:_,root:y,fallback:S,hasActiveOverlay:wC(document),hasActiveSelection:lB(window.getSelection())})!=="restore"){l=null;return}S==null||S.focus({preventScroll:!0}),l=null},u=m=>{cancelAnimationFrame(s),l=m.target instanceof Element?m.target:null},h=m=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{a(m.target)})},d=()=>{l=null;const m=t.current;!m||m.disabled||m.focus({preventScroll:!0})},p=m=>{if(m.key!=="Escape")return;const _=t.current;CC({trigger:"escape",activeElement:document.activeElement,fallback:_,hasActiveOverlay:wC(document),canCancel:r,defaultPrevented:m.defaultPrevented})==="escape-focus"&&(m.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",p,!0),window.addEventListener(wf,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener(wf,d)}},[r,n,t,e])}const Yh="What are we building?",pJ=19,mJ=72,gJ=120;function vJ(){var ie,ce,we,Se,ke,Be;const e=Xy(),t=b.useRef(null),n=b.useRef(null),r=b.useRef(null),[s,l]=b.useState(""),[a,u]=b.useState(!1),[h,d]=b.useState(0),p=((ie=e.runtime)==null?void 0:ie.projectId)??null,_=Qs(Ce=>p?Ce.projects[p]:void 0)??qV,S=gf(Ce=>p?Ce.projects[p]:void 0)??FV,w=Qs(Ce=>Ce.addTerminal),C=Qs(Ce=>Ce.removeTerminal),k=Qs(Ce=>Ce.toggleVisibility),T=Qs(Ce=>Ce.resetMainSizes),R=Qs(Ce=>Ce.setMainSizes),M=Qs(Ce=>Ce.setTerminalSizes),L=gf(Ce=>Ce.toggleVisibility),D=gf(Ce=>Ce.setSize),j=Hr(Ce=>Ce.scrollbackLines),F=Hr(Ce=>Ce.minColumnWidth),Y=e.keybindings,z=b.useMemo(()=>BA(Y),[Y]),H=_.terminals.length>0,P=!!(p&&_.isVisible&&H),U=!!(p&&H),V=!!(p&&S.isVisible),$=!!p,{isAnimating:B,mainPanelGroupRef:K,terminalFocusRequestVersion:W,terminalPanelRef:Z,terminalVisualRef:N}=lq({showTerminalPane:P,shouldRenderTerminalLayout:U,projectId:p,terminalLayout:_,chatInputRef:r}),{isAnimating:I,panelGroupRef:q,sidebarPanelRef:A,sidebarVisualRef:ae}=iq({projectId:p,shouldRenderRightSidebarLayout:$,showRightSidebar:V,rightSidebarSize:S.size});fJ({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((ce=e.runtime)==null?void 0:ce.status)!=="waiting_for_user",canCancel:e.canCancel});const fe=()=>{if(p){if(H){k(p);return}w(p)}},oe=Ce=>{var xt;if(!p||!P||B.current)return;const Oe=Ce.chat,bt=Ce.terminal;if(!Number.isFinite(Oe)||!Number.isFinite(bt))return;const hn=((xt=t.current)==null?void 0:xt.getBoundingClientRect().height)??0;if(XV(hn,bt)){T(p),k(p);return}R(p,[Oe,bt])};b.useEffect(()=>{if(e.messages.length!==0)return;l(""),u(!1);let Ce=0;const Oe=window.setInterval(()=>{Ce+=1,l(Yh.slice(0,Ce)),Ce>=Yh.length&&(window.clearInterval(Oe),u(!0))},pJ);return()=>window.clearInterval(Oe)},[e.activeChatId,e.messages.length]),b.useEffect(()=>{function Ce(Oe){if(p){if(Yc(z,"toggleEmbeddedTerminal",Oe)){Oe.preventDefault(),fe();return}if(Yc(z,"toggleRightSidebar",Oe)){Oe.preventDefault(),L(p);return}if(Yc(z,"openInFinder",Oe)){Oe.preventDefault(),e.handleOpenExternal("open_finder");return}if(Yc(z,"openInEditor",Oe)){Oe.preventDefault(),e.handleOpenExternal("open_editor");return}Yc(z,"addSplitTerminal",Oe)&&(Oe.preventDefault(),w(p))}}return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[w,fe,p,z,L,k]),b.useEffect(()=>{const Ce=window.requestAnimationFrame(()=>{e.updateScrollState()}),Oe=window.setTimeout(()=>{e.updateScrollState()},fa);return()=>{window.cancelAnimationFrame(Ce),window.clearTimeout(Oe)}},[U,P,e.updateScrollState]),b.useEffect(()=>{function Ce(){e.updateScrollState()}return window.addEventListener("resize",Ce),()=>window.removeEventListener("resize",Ce)},[e.updateScrollState]),b.useEffect(()=>{const Ce=t.current;if(!Ce||!U)return;const Oe=()=>{const hn=Ce.getBoundingClientRect().height;if(hn<=0)return;const xt=hn*(_.mainSizes[1]/100);xt<=0||d(zt=>Math.abs(zt-xt)<1?zt:xt)},bt=new ResizeObserver(Oe);return bt.observe(Ce),Oe(),()=>bt.disconnect()},[p,U,_.mainSizes]);const J=Ce=>Number.isFinite(Ce)?Math.min(Sy,Math.max(Dp,Ce)):S.size,ge=g.jsxs(hN,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[g.jsxs(pN,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[g.jsx(bF,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:P,onToggleEmbeddedTerminal:p?fe:void 0,rightSidebarVisible:V,onToggleRightSidebar:p?()=>L(p):void 0,onOpenExternal:Ce=>{e.handleOpenExternal(Ce)},editorLabel:e.editorLabel,finderShortcut:z.bindings.openInFinder,editorShortcut:z.bindings.openInEditor,terminalShortcut:z.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:z.bindings.toggleRightSidebar}),g.jsxs(zA,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?g.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[g.jsx(hJ,{messages:e.messages,isLoading:e.isProcessing,localPath:(we=e.runtime)==null?void 0:we.localPath,latestToolIds:e.latestToolIds,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?g.jsx(jV,{status:(Se=e.runtime)==null?void 0:Se.status}):null,e.commandError?g.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),g.jsx("div",{style:{height:250},"aria-hidden":"true"})]}):null]}),e.messages.length===0?g.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:mJ,bottom:e.transcriptPaddingBottom},children:g.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:g.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[g.jsx(fu,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),g.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":Yh,children:g.jsxs("span",{className:"relative inline-grid place-items-start",children:[g.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:Yh}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),g.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[g.jsx("span",{children:s}),g.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:g.jsx("span",{className:"kanna-typewriter-cursor","data-typing-complete":a?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,g.jsx("div",{style:{bottom:gJ},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:g.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:g.jsx(_6,{className:"h-5 w-5"})})})]}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:g.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:g.jsx(gF,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((ke=e.runtime)==null?void 0:ke.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((Be=e.runtime)==null?void 0:Be.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return g.jsx("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:$&&p?g.jsxs(of,{groupRef:q,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:Ce=>{var bt;if(!V||I.current)return;const Oe=J(Ce.rightSidebar);Math.abs(Oe-Ce.rightSidebar)<.1||(bt=q.current)==null||bt.setLayout({workspace:100-Oe,rightSidebar:Oe})},onLayoutChanged:Ce=>{!V||I.current||D(p,J(Ce.rightSidebar))},children:[g.jsx(Uo,{id:"workspace",defaultSize:`${100-S.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:U?g.jsxs(of,{groupRef:K,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:oe,children:[g.jsx(Uo,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ge}),g.jsx(lf,{withHandle:!0,orientation:"vertical",disabled:!P,className:ye(!P&&"pointer-events-none opacity-0")}),g.jsx(Uo,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:g.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":P?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${fa}ms`},children:g.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g.jsx(v2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:j,minColumnWidth:F,splitTerminalShortcut:z.bindings.addSplitTerminal,focusRequestVersion:W,onRemoveTerminal:(Ce,Oe)=>{e.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),C(Ce,Oe)},onTerminalLayout:M})})})})]},p):ge}),g.jsx(lf,{withHandle:!0,orientation:"horizontal",disabled:!V,className:ye(!V&&"pointer-events-none opacity-0")}),g.jsx(Uo,{id:"rightSidebar",defaultSize:`${S.size}%`,maxSize:`${Sy}%`,className:"min-h-0 min-w-0",elementRef:A,children:g.jsx("div",{ref:ae,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":V?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${fa}ms`},children:g.jsx(xF,{onClose:()=>L(p)})})})]},`${p}-right-sidebar`):U&&p?g.jsxs(of,{groupRef:K,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:oe,children:[g.jsx(Uo,{id:"chat",defaultSize:`${_.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:ge}),g.jsx(lf,{withHandle:!0,orientation:"vertical",disabled:!P,className:ye(!P&&"pointer-events-none opacity-0")}),g.jsx(Uo,{id:"terminal",defaultSize:`${_.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:g.jsx("div",{ref:N,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":P?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${fa}ms`},children:g.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:g.jsx(v2,{projectId:p,layout:_,onAddTerminal:w,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:j,minColumnWidth:F,splitTerminalShortcut:z.bindings.addSplitTerminal,focusRequestVersion:W,onRemoveTerminal:(Ce,Oe)=>{e.socket.command({type:"terminal.close",terminalId:Oe}).catch(()=>{}),C(Ce,Oe)},onTerminalLayout:M})})})})]},p):ge})}function vE({narrow:e=!1,title:t,subtitle:n,icon:r=ub}){return g.jsxs("div",{className:ye("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[g.jsxs("div",{className:ye("flex items-center gap-1 mb-2",e&&"justify-center"),children:[g.jsx("div",{className:"p-2 pl-0 rounded-lg",children:g.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&g.jsx("p",{className:ye("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const _J={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function X5({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:l}){return g.jsx("div",{className:ye("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(a=>{const u=a.value===e,h=a.icon,d=h?b.isValidElement(h)?h:(()=>{const m=h;return g.jsx(m,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,p=g.jsxs("button",{type:"button",onClick:()=>t(a.value),disabled:a.disabled,"aria-pressed":u,className:ye("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",_J[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",a.disabled&&"opacity-50 pointer-events-none",l),children:[d,g.jsx("span",{children:a.label})]},a.value);return a.tooltip?g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:p}),g.jsx(Ru,{children:a.tooltip})]},a.value):p})})}function yJ(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function bJ({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=b.useState("new"),[l,a]=b.useState(""),[u,h]=b.useState(""),d=b.useRef(null),p=b.useRef(null);b.useEffect(()=>{e&&(s("new"),a(""),h(""),setTimeout(()=>{var C;return(C=d.current)==null?void 0:C.focus()},0))},[e]),b.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=d.current)==null||C.focus():(k=p.current)==null||k.focus()},0)},[r,e]);const m=yJ(l),_=m?`${r8}/${m}`:"",y=u.trim(),S=r==="new"?!!m:!!y,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:l.trim()});else{const C=y.split("/").pop()||y;n({mode:"existing",localPath:y,title:C})}t(!1)}};return g.jsx(iT,{open:e,onOpenChange:t,children:g.jsxs(gb,{size:"sm",children:[g.jsxs(lT,{className:"space-y-4",children:[g.jsx(oT,{children:"Add Project"}),g.jsx(X5,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),r==="new"?g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{ref:d,type:"text",value:l,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},placeholder:"Project name"}),_&&g.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{ref:p,type:"text",value:u,onChange:C=>h(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},placeholder:"~/Projects/my-app"}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),g.jsxs(aT,{children:[g.jsx(rt,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),g.jsx(rt,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function xJ({text:e}){const[t,n]=b.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return g.jsx(rt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?g.jsx(lo,{className:"h-4 w-4 text-green-400"}):g.jsx(lp,{className:"h-4 w-4"})})}function _E({children:e}){return g.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:[g.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[g.jsx(ds,{className:"inline h-4 w-4 opacity-40"}),g.jsx("code",{children:e})]}),g.jsx(xJ,{text:e})]})}function Xh({children:e}){return g.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function a_({children:e}){return g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function c_({icon:e,title:t,subtitle:n,iconClassName:r}){return g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:g.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),g.jsx("span",{className:"text-sm font-medium",children:t}),g.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function yE(){return g.jsx(b6,{className:"h-4 w-4 text-muted-foreground"})}function bE({number:e,title:t,children:n}){return g.jsx("div",{className:"flex gap-4",children:g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[g.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),g.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),g.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function SJ({localPath:e,loading:t,onClick:n}){return g.jsxs(Mf,{children:[g.jsx(Nf,{asChild:!0,children:g.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:[g.jsx(uP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:VT(e)}),t?g.jsx(Mi,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):g.jsx(hb,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),g.jsx(Ru,{children:g.jsx("p",{children:e})})]})}function wJ({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:l,onCreateProject:a}){const[u,h]=b.useState(!1),d=b.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),p=e==="connecting"||!t,m=e==="connected"&&t;return g.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[m?g.jsxs(g.Fragment,{children:[g.jsx(vE,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${$n} is connected, choose a project below to get started.`}),g.jsxs("div",{className:"w-full px-6 mb-10",children:[g.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[g.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),g.jsxs(rt,{variant:"default",size:"sm",onClick:()=>h(!0),children:[g.jsx(db,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),d.length>0?g.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:d.map(_=>g.jsx(SJ,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{l(_.localPath)}},_.localPath))}):g.jsx(Xh,{children:g.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?g.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]})]}):g.jsxs(g.Fragment,{children:[g.jsx(vE,{narrow:!0,icon:_C,title:p?`Connecting ${$n}`:`Connect ${$n}`,subtitle:p?`${$n} is starting up and loading your local projects.`:`Run ${$n} directly on your machine with full access to your local files and agent project history.`}),g.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[g.jsx(a_,{children:"Status"}),g.jsx("div",{className:"mb-8",children:g.jsx(Xh,{children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 text-muted-foreground animate-spin"}),g.jsx("span",{className:"text-sm text-muted-foreground",children:p?`Connecting to your local ${$n} server...`:g.jsxs(g.Fragment,{children:["Not connected. Run ",g.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:Ah()})," from any terminal on this machine."]})})]})})}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(a_,{children:"How it works"}),g.jsx(Xh,{children:g.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[g.jsx(c_,{icon:fb,title:`${$n} CLI`,subtitle:"On Your Machine"}),g.jsx(yE,{}),g.jsx(c_,{icon:ub,title:`${$n} Server`,subtitle:"Local WebSocket"}),g.jsx(yE,{}),g.jsx(c_,{icon:_C,title:`${$n} UI`,subtitle:"Project Chat"})]})})]}),p?null:g.jsxs("div",{className:"mb-10",children:[g.jsx(a_,{children:"Setup"}),g.jsx(Xh,{children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs(bE,{number:1,title:`Start ${$n}`,children:[g.jsx("p",{children:"Run this command in your terminal:"}),g.jsx(_E,{children:Ah()})]}),g.jsxs(bE,{number:2,title:"Open the local UI",children:[g.jsxs("p",{children:[$n," serves the app locally and opens the Local Projects page in an app-style browser window."]}),g.jsx(_E,{children:"http://localhost:3210/local"})]}),g.jsxs("div",{className:"mt-8",children:[g.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),g.jsxs("div",{className:"space-y-3 text-sm",children:[g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Ah("").trim()}),g.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),g.jsxs("div",{className:"flex gap-4",children:[g.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:Ah("--no-open")}),g.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),g.jsx(bJ,{open:u,onOpenChange:h,onConfirm:_=>{a(_)}}),g.jsx("div",{className:"py-4 text-center",children:g.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Tb.split("/")[1]]})})]})}function CJ(){const e=Xy();return g.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:g.jsx(wJ,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}function xE({children:e,className:t,icon:n,type:r="button",variant:s="outline",...l}){return g.jsxs("button",{type:r,className:ye(rb({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...l,children:[n,g.jsx("span",{children:e})]})}function SE(e,[t,n]){return Math.min(n,Math.max(t,e))}function kJ(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var EJ=[" ","Enter","ArrowUp","ArrowDown"],RJ=[" ","Enter"],sl="Select",[Bp,Ip,TJ]=Ib(sl),[qa]=ms(sl,[TJ,fo]),Hp=fo(),[MJ,vo]=qa(sl),[NJ,AJ]=qa(sl),Z5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:a,defaultValue:u,onValueChange:h,dir:d,name:p,autoComplete:m,disabled:_,required:y,form:S}=e,w=Hp(t),[C,k]=b.useState(null),[T,R]=b.useState(null),[M,L]=b.useState(!1),D=Hb(d),[j,F]=xa({prop:r,defaultProp:s??!1,onChange:l,caller:sl}),[Y,z]=xa({prop:a,defaultProp:u,onChange:h,caller:sl}),H=b.useRef(null),P=C?S||!!C.closest("form"):!0,[U,V]=b.useState(new Set),$=Array.from(U).map(B=>B.props.value).join(";");return g.jsx(hp,{...w,children:g.jsxs(MJ,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:M,onValueNodeHasChildrenChange:L,contentId:cs(),value:Y,onValueChange:z,open:j,onOpenChange:F,dir:D,triggerPointerDownPosRef:H,disabled:_,children:[g.jsx(Bp.Provider,{scope:t,children:g.jsx(NJ,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(B=>{V(K=>new Set(K).add(B))},[]),onNativeOptionRemove:b.useCallback(B=>{V(K=>{const W=new Set(K);return W.delete(B),W})},[]),children:n})}),P?g.jsxs(SD,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:m,value:Y,onChange:B=>z(B.target.value),disabled:_,form:S,children:[Y===void 0?g.jsx("option",{value:""}):null,Array.from(U)]},$):null]})})};Z5.displayName=sl;var Q5="SelectTrigger",J5=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=Hp(n),a=vo(Q5,n),u=a.disabled||r,h=ht(t,a.onTriggerChange),d=Ip(n),p=b.useRef("touch"),[m,_,y]=CD(w=>{const C=d().filter(R=>!R.disabled),k=C.find(R=>R.value===a.value),T=kD(C,w,k);T!==void 0&&a.onValueChange(T.value)}),S=w=>{u||(a.onOpenChange(!0),y()),w&&(a.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(Vu,{asChild:!0,...l,children:g.jsx(et.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":wD(a.value)?"":void 0,...s,ref:h,onClick:Re(s.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&S(w)}),onPointerDown:Re(s.onPointerDown,w=>{p.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:Re(s.onKeyDown,w=>{const C=m.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&_(w.key),!(C&&w.key===" ")&&EJ.includes(w.key)&&(S(),w.preventDefault())})})})});J5.displayName=Q5;var eD="SelectValue",tD=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:a="",...u}=e,h=vo(eD,n),{onValueNodeHasChildrenChange:d}=h,p=l!==void 0,m=ht(t,h.onValueNodeChange);return Pn(()=>{d(p)},[d,p]),g.jsx(et.span,{...u,ref:m,style:{pointerEvents:"none"},children:wD(h.value)?g.jsx(g.Fragment,{children:a}):l})});tD.displayName=eD;var DJ="SelectIcon",nD=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(et.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});nD.displayName=DJ;var OJ="SelectPortal",rD=e=>g.jsx(Oa,{asChild:!0,...e});rD.displayName=OJ;var ol="SelectContent",iD=b.forwardRef((e,t)=>{const n=vo(ol,e.__scopeSelect),[r,s]=b.useState();if(Pn(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?Si.createPortal(g.jsx(sD,{scope:e.__scopeSelect,children:g.jsx(Bp.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),l):null}return g.jsx(oD,{...e,ref:t})});iD.displayName=ol;var ri=10,[sD,_o]=qa(ol),LJ="SelectContentImpl",jJ=Xo("SelectContent.RemoveScroll"),oD=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:a,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:C,...k}=e,T=vo(ol,n),[R,M]=b.useState(null),[L,D]=b.useState(null),j=ht(t,J=>M(J)),[F,Y]=b.useState(null),[z,H]=b.useState(null),P=Ip(n),[U,V]=b.useState(!1),$=b.useRef(!1);b.useEffect(()=>{if(R)return sp(R)},[R]),rp();const B=b.useCallback(J=>{const[ge,...ie]=P().map(Se=>Se.ref.current),[ce]=ie.slice(-1),we=document.activeElement;for(const Se of J)if(Se===we||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&L&&(L.scrollTop=0),Se===ce&&L&&(L.scrollTop=L.scrollHeight),Se==null||Se.focus(),document.activeElement!==we))return},[P,L]),K=b.useCallback(()=>B([F,R]),[B,F,R]);b.useEffect(()=>{U&&K()},[U,K]);const{onOpenChange:W,triggerPointerDownPosRef:Z}=T;b.useEffect(()=>{if(R){let J={x:0,y:0};const ge=ce=>{var we,Se;J={x:Math.abs(Math.round(ce.pageX)-(((we=Z.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((Se=Z.current)==null?void 0:Se.y)??0))}},ie=ce=>{J.x<=10&&J.y<=10?ce.preventDefault():R.contains(ce.target)||W(!1),document.removeEventListener("pointermove",ge),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",ie,{capture:!0})}}},[R,W,Z]),b.useEffect(()=>{const J=()=>W(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[W]);const[N,I]=CD(J=>{const ge=P().filter(we=>!we.disabled),ie=ge.find(we=>we.ref.current===document.activeElement),ce=kD(ge,J,ie);ce&&setTimeout(()=>ce.ref.current.focus())}),q=b.useCallback((J,ge,ie)=>{const ce=!$.current&&!ie;(T.value!==void 0&&T.value===ge||ce)&&(Y(J),ce&&($.current=!0))},[T.value]),A=b.useCallback(()=>R==null?void 0:R.focus(),[R]),ae=b.useCallback((J,ge,ie)=>{const ce=!$.current&&!ie;(T.value!==void 0&&T.value===ge||ce)&&H(J)},[T.value]),fe=r==="popper"?Hy:lD,oe=fe===Hy?{side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:C}:{};return g.jsx(sD,{scope:n,content:R,viewport:L,onViewportChange:D,itemRefCallback:q,selectedItem:F,onItemLeave:A,itemTextRefCallback:ae,focusSelectedItem:K,selectedItemText:z,position:r,isPositioned:U,searchRef:N,children:g.jsx($u,{as:jJ,allowPinchZoom:!0,children:g.jsx(Uu,{asChild:!0,trapped:T.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Re(s,J=>{var ge;(ge=T.trigger)==null||ge.focus({preventScroll:!0}),J.preventDefault()}),children:g.jsx(Da,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:g.jsx(fe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:J=>J.preventDefault(),...k,...oe,onPlaced:()=>V(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,J=>{const ge=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ge&&J.key.length===1&&I(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ce=P().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const we=J.target,Se=ce.indexOf(we);ce=ce.slice(Se+1)}setTimeout(()=>B(ce)),J.preventDefault()}})})})})})})});oD.displayName=LJ;var zJ="SelectItemAlignedPosition",lD=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=vo(ol,n),a=_o(ol,n),[u,h]=b.useState(null),[d,p]=b.useState(null),m=ht(t,j=>p(j)),_=Ip(n),y=b.useRef(!1),S=b.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:T}=a,R=b.useCallback(()=>{if(l.trigger&&l.valueNode&&u&&d&&w&&C&&k){const j=l.trigger.getBoundingClientRect(),F=d.getBoundingClientRect(),Y=l.valueNode.getBoundingClientRect(),z=k.getBoundingClientRect();if(l.dir!=="rtl"){const we=z.left-F.left,Se=Y.left-we,ke=j.left-Se,Be=j.width+ke,Ce=Math.max(Be,F.width),Oe=window.innerWidth-ri,bt=SE(Se,[ri,Math.max(ri,Oe-Ce)]);u.style.minWidth=Be+"px",u.style.left=bt+"px"}else{const we=F.right-z.right,Se=window.innerWidth-Y.right-we,ke=window.innerWidth-j.right-Se,Be=j.width+ke,Ce=Math.max(Be,F.width),Oe=window.innerWidth-ri,bt=SE(Se,[ri,Math.max(ri,Oe-Ce)]);u.style.minWidth=Be+"px",u.style.right=bt+"px"}const H=_(),P=window.innerHeight-ri*2,U=w.scrollHeight,V=window.getComputedStyle(d),$=parseInt(V.borderTopWidth,10),B=parseInt(V.paddingTop,10),K=parseInt(V.borderBottomWidth,10),W=parseInt(V.paddingBottom,10),Z=$+B+U+W+K,N=Math.min(C.offsetHeight*5,Z),I=window.getComputedStyle(w),q=parseInt(I.paddingTop,10),A=parseInt(I.paddingBottom,10),ae=j.top+j.height/2-ri,fe=P-ae,oe=C.offsetHeight/2,J=C.offsetTop+oe,ge=$+B+J,ie=Z-ge;if(ge<=ae){const we=H.length>0&&C===H[H.length-1].ref.current;u.style.bottom="0px";const Se=d.clientHeight-w.offsetTop-w.offsetHeight,ke=Math.max(fe,oe+(we?A:0)+Se+K),Be=ge+ke;u.style.height=Be+"px"}else{const we=H.length>0&&C===H[0].ref.current;u.style.top="0px";const ke=Math.max(ae,$+w.offsetTop+(we?q:0)+oe)+ie;u.style.height=ke+"px",w.scrollTop=ge-ae+w.offsetTop}u.style.margin=`${ri}px 0`,u.style.minHeight=N+"px",u.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[_,l.trigger,l.valueNode,u,d,w,C,k,l.dir,r]);Pn(()=>R(),[R]);const[M,L]=b.useState();Pn(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const D=b.useCallback(j=>{j&&S.current===!0&&(R(),T==null||T(),S.current=!1)},[R,T]);return g.jsx(BJ,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:D,children:g.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:g.jsx(et.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});lD.displayName=zJ;var PJ="SelectPopperPosition",Hy=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ri,...l}=e,a=Hp(n);return g.jsx(fp,{...a,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hy.displayName=PJ;var[BJ,j0]=qa(ol,{}),Fy="SelectViewport",aD=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=_o(Fy,n),a=j0(Fy,n),u=ht(t,l.onViewportChange),h=b.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Bp.Slot,{scope:n,children:g.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=a;if(_!=null&&_.current&&m){const y=Math.abs(h.current-p.scrollTop);if(y>0){const S=window.innerHeight-ri*2,w=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),k=Math.max(w,C);if(k<S){const T=k+y,R=Math.min(S,T),M=T-R;m.style.height=R+"px",m.style.bottom==="0px"&&(p.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}h.current=p.scrollTop})})})]})});aD.displayName=Fy;var cD="SelectGroup",[IJ,HJ]=qa(cD),uD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=cs();return g.jsx(IJ,{scope:n,id:s,children:g.jsx(et.div,{role:"group","aria-labelledby":s,...r,ref:t})})});uD.displayName=cD;var dD="SelectLabel",hD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=HJ(dD,n);return g.jsx(et.div,{id:s.id,...r,ref:t})});hD.displayName=dD;var Qf="SelectItem",[FJ,fD]=qa(Qf),pD=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...a}=e,u=vo(Qf,n),h=_o(Qf,n),d=u.value===r,[p,m]=b.useState(l??""),[_,y]=b.useState(!1),S=ht(t,T=>{var R;return(R=h.itemRefCallback)==null?void 0:R.call(h,T,r,s)}),w=cs(),C=b.useRef("touch"),k=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(FJ,{scope:n,value:r,disabled:s,textId:w,isSelected:d,onItemTextChange:b.useCallback(T=>{m(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:g.jsx(Bp.ItemSlot,{scope:n,value:r,disabled:s,textValue:p,children:g.jsx(et.div,{role:"option","aria-labelledby":w,"data-highlighted":_?"":void 0,"aria-selected":d&&_,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:S,onFocus:Re(a.onFocus,()=>y(!0)),onBlur:Re(a.onBlur,()=>y(!1)),onClick:Re(a.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Re(a.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Re(a.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:Re(a.onPointerMove,T=>{var R;C.current=T.pointerType,s?(R=h.onItemLeave)==null||R.call(h):C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(a.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=h.onItemLeave)==null||R.call(h))}),onKeyDown:Re(a.onKeyDown,T=>{var M;((M=h.searchRef)==null?void 0:M.current)!==""&&T.key===" "||(RJ.includes(T.key)&&k(),T.key===" "&&T.preventDefault())})})})})});pD.displayName=Qf;var uu="SelectItemText",mD=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,a=vo(uu,n),u=_o(uu,n),h=fD(uu,n),d=AJ(uu,n),[p,m]=b.useState(null),_=ht(t,k=>m(k),h.onItemTextChange,k=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,k,h.value,h.disabled)}),y=p==null?void 0:p.textContent,S=b.useMemo(()=>g.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=d;return Pn(()=>(w(S),()=>C(S)),[w,C,S]),g.jsxs(g.Fragment,{children:[g.jsx(et.span,{id:h.textId,...l,ref:_}),h.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Si.createPortal(l.children,a.valueNode):null]})});mD.displayName=uu;var gD="SelectItemIndicator",vD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fD(gD,n).isSelected?g.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});vD.displayName=gD;var Uy="SelectScrollUpButton",_D=b.forwardRef((e,t)=>{const n=_o(Uy,e.__scopeSelect),r=j0(Uy,e.__scopeSelect),[s,l]=b.useState(!1),a=ht(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;l(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?g.jsx(bD,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});_D.displayName=Uy;var $y="SelectScrollDownButton",yD=b.forwardRef((e,t)=>{const n=_o($y,e.__scopeSelect),r=j0($y,e.__scopeSelect),[s,l]=b.useState(!1),a=ht(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,p=Math.ceil(h.scrollTop)<d;l(p)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?g.jsx(bD,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});yD.displayName=$y;var bD=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=_o("SelectScrollButton",n),a=b.useRef(null),u=Ip(n),h=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>h(),[h]),Pn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),g.jsx(et.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Re(s.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{h()})})}),UJ="SelectSeparator",xD=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});xD.displayName=UJ;var Wy="SelectArrow",$J=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hp(n),l=vo(Wy,n),a=_o(Wy,n);return l.open&&a.position==="popper"?g.jsx(pp,{...s,...r,ref:t}):null});$J.displayName=Wy;var WJ="SelectBubbleInput",SD=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),l=ht(r,s),a=kJ(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(h,"value").set;if(a!==t&&p){const m=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(m)}},[a,t]),g.jsx(et.select,{...n,style:{...AT,...n.style},ref:l,defaultValue:t})});SD.displayName=WJ;function wD(e){return e===""||e===void 0}function CD(e){const t=oi(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(a=>{const u=n.current+a;t(u),(function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(u)},[t]),l=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function kD(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=VJ(e,Math.max(l,0));s.length===1&&(a=a.filter(d=>d!==n));const h=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function VJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qJ=Z5,ED=J5,KJ=tD,GJ=nD,YJ=rD,RD=iD,XJ=aD,ZJ=uD,TD=hD,MD=pD,QJ=mD,JJ=vD,ND=_D,AD=yD,DD=xD;const wE=qJ,CE=ZJ,kE=KJ,Vy=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ED,{ref:r,className:ye("flex h-9 w-full items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors","placeholder:text-muted-foreground","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",e),...n,children:[t,g.jsx(GJ,{asChild:!0,children:g.jsx(ab,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));Vy.displayName=ED.displayName;const OD=b.forwardRef(({className:e,...t},n)=>g.jsx(ND,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(I6,{className:"h-4 w-4"})}));OD.displayName=ND.displayName;const LD=b.forwardRef(({className:e,...t},n)=>g.jsx(AD,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(ab,{className:"h-4 w-4"})}));LD.displayName=AD.displayName;const qy=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>g.jsx(YJ,{children:g.jsxs(RD,{ref:s,className:ye("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md","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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(OD,{}),g.jsx(XJ,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(LD,{})]})}));qy.displayName=RD.displayName;const eee=b.forwardRef(({className:e,...t},n)=>g.jsx(TD,{ref:n,className:ye("px-2 py-1.5 text-sm font-semibold",e),...t}));eee.displayName=TD.displayName;const _f=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(MD,{ref:r,className:ye("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(JJ,{children:g.jsx(lo,{className:"h-4 w-4"})})}),g.jsx(QJ,{children:t})]}));_f.displayName=MD.displayName;const tee=b.forwardRef(({className:e,...t},n)=>g.jsx(DD,{ref:n,className:ye("-mx-1 my-1 h-px bg-border",e),...t}));tee.displayName=DD.displayName;const du=[{id:"general",label:"General",icon:FP,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:wP,subtitle:"Manage the default chat provider and saved model defaults for Claude Code and Codex."},{id:"keybindings",label:"Keybindings",icon:Y6,subtitle:"Edit global app shortcuts stored in the active keybindings file."},{id:"changelog",label:"Changelog",icon:E6,subtitle:"Release notes pulled from the public GitHub releases feed."}];function EE(e){return e&&du.some(t=>t.id===e)?e:null}const nee=[{value:"light",label:"Light",icon:QP},{value:"dark",label:"Dark",icon:RP},{value:"system",label:"System",icon:ub}],ree=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],iee="https://api.github.com/repos/jakemor/kanna/releases",see=300*1e3;let pa=null;const RE=Object.keys(PA);function oee(e){return`Edit global app shortcuts stored in ${e}.`}function lee(e){const t=(e==null?void 0:e.status)==="checking",n=(e==null?void 0:e.status)==="updating"||(e==null?void 0:e.status)==="restart_pending";return e!=null&&e.updateAvailable?{disabled:n,kind:"update",label:"Update",variant:"default"}:{disabled:t||n,kind:"check",label:"Check for updates",spinning:t,variant:"outline"}}async function aee(e=fetch){const t=await e(iee,{headers:{Accept:"application/vnd.github+json"}});if(!t.ok)throw new Error(`GitHub releases request failed with status ${t.status}`);return(await t.json()).filter(r=>!r.draft)}function cee(){return pa?Date.now()>=pa.expiresAt?(pa=null,null):pa.releases:null}function uee(e){pa={releases:e,expiresAt:Date.now()+see}}async function TE(e){const t=e!=null&&e.force?null:cee();if(t)return t;const n=await aee(e==null?void 0:e.fetchImpl);return uee(n),n}function dee(e){if(!e)return"Unpublished";const t=new Date(e);return Number.isNaN(t.getTime())?"Unknown date":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)}function hee({status:e,releases:t,error:n,onRetry:r}){return g.jsxs("div",{className:"space-y-4",children:[e==="loading"||e==="idle"?g.jsx("div",{className:"flex min-h-[180px] items-center justify-center rounded-2xl border border-border bg-card/40 px-6 py-8 text-sm text-muted-foreground",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading release notes…"})]})}):null,e==="error"?g.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-6 py-5",children:g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Could not load changelog"}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:n??"Unable to load changelog."})]}),g.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted",children:"Retry"})]})}):null,e==="success"&&t.length===0?g.jsxs("div",{className:"rounded-2xl border border-border bg-card/30 px-6 py-8",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"No releases yet"}),g.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"GitHub did not return any published releases for this repository."})]}):null,e==="success"&&t.length>0?t.map(s=>{var l,a;return g.jsxs("article",{className:"rounded-xl border border-border bg-card/30 pl-6 pr-4 py-4",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:((l=s.name)==null?void 0:l.trim())||s.tag_name}),g.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[g.jsx("span",{children:dee(s.published_at)}),s.prerelease?g.jsx("span",{className:"rounded-full border border-border px-2.5 py-1 uppercase tracking-wide",children:"Prerelease"}):null]})]}),g.jsxs("div",{className:"flex flex-row items-center justify-end min-w-0 flex-1 gap-3 ",children:[g.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted-foreground",children:g.jsx("span",{className:"rounded-full bg-muted px-2.5 py-1 font-mono text-foreground/80",children:s.tag_name})}),g.jsx("a",{href:s.html_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View release on GitHub",className:ye(rb({variant:"ghost",size:"icon-sm"}),"h-8 w-8 shrink-0 rounded-md"),children:g.jsx(fee,{className:"h-4 w-4"})})]})]}),(a=s.body)!=null&&a.trim()?g.jsx("div",{className:"prose prose-sm mt-5 max-w-none text-foreground dark:prose-invert",children:g.jsx(ld,{remarkPlugins:[ad],components:m0,children:s.body})}):g.jsx("div",{className:"mt-5 text-sm text-muted-foreground",children:"No release notes were provided."})]},s.id)}):null]})}function fee({className:e}){return g.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:g.jsx("path",{d:"M12 .5C5.649.5.5 5.649.5 12A11.5 11.5 0 0 0 8.36 22.04c.575.106.785-.25.785-.556 0-.274-.01-1-.015-1.962-3.181.691-3.853-1.532-3.853-1.532-.52-1.322-1.27-1.674-1.27-1.674-1.038-.71.08-.695.08-.695 1.148.08 1.752 1.178 1.752 1.178 1.02 1.748 2.676 1.243 3.328.95.103-.738.399-1.243.725-1.53-2.54-.289-5.211-1.27-5.211-5.65 0-1.248.446-2.27 1.177-3.07-.118-.288-.51-1.45.112-3.024 0 0 .96-.307 3.145 1.173A10.91 10.91 0 0 1 12 6.03c.973.004 1.954.132 2.87.387 2.182-1.48 3.14-1.173 3.14-1.173.625 1.573.233 2.736.115 3.024.734.8 1.175 1.822 1.175 3.07 0 4.39-2.676 5.358-5.224 5.642.41.353.776 1.05.776 2.117 0 1.528-.014 2.761-.014 3.136 0 .309.207.668.79.555A11.502 11.502 0 0 0 23.5 12C23.5 5.649 18.351.5 12 .5Z"})})}function ss({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return g.jsx("div",{className:r?"border-t border-border":void 0,children:g.jsxs("div",{className:ye("flex flex-col gap-4 py-5 md:flex-row md:justify-between md:gap-8",s?"md:items-start":"md:items-center"),children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),g.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),g.jsx("div",{className:"flex items-center justify-start md:shrink-0 md:justify-end",children:n})]})})}function pee(){var cr,Gr;const e=Aa(),{sectionId:t}=YE(),n=Xy(),{theme:r,setTheme:s}=TA(),[l,a]=b.useState("idle"),[u,h]=b.useState([]),[d,p]=b.useState(null),m=EE(t)??"general",_=n.connectionStatus==="connecting"||!n.localProjectsReady,y=((cr=n.localProjects)==null?void 0:cr.machine.displayName)??"Unavailable",S=((Gr=n.localProjects)==null?void 0:Gr.projects.length)??0,w=Tb.split("/")[1]??"unknown",C=Hr(se=>se.scrollbackLines),k=Hr(se=>se.minColumnWidth),T=Hr(se=>se.editorPreset),R=Hr(se=>se.editorCommandTemplate),M=Hr(se=>se.setScrollbackLines),L=Hr(se=>se.setMinColumnWidth),D=Hr(se=>se.setEditorPreset),j=Hr(se=>se.setEditorCommandTemplate),F=n.keybindings,Y=ls(se=>se.defaultProvider),z=ls(se=>se.providerDefaults),H=ls(se=>se.setDefaultProvider),P=ls(se=>se.setProviderDefaultModel),U=ls(se=>se.setProviderDefaultModelOptions),V=ls(se=>se.setProviderDefaultPlanMode),$=b.useMemo(()=>BA(F),[F]),B=$.filePathDisplay||l8(),[K,W]=b.useState(String(C)),[Z,N]=b.useState(String(k)),[I,q]=b.useState(R),[A,ae]=b.useState({}),[fe,oe]=b.useState(null),J=n.updateSnapshot,ge=lee(J),ie=(J==null?void 0:J.status)==="checking"?"Checking for updates…":(J==null?void 0:J.status)==="updating"?"Installing update…":(J==null?void 0:J.status)==="restart_pending"?"Restarting Kanna…":(J==null?void 0:J.status)==="available"?`Update available${J.latestVersion?`: ${J.latestVersion}`:""}`:(J==null?void 0:J.status)==="up_to_date"?"Up to date":(J==null?void 0:J.status)==="error"?"Update check failed":"Not checked yet";b.useEffect(()=>{W(String(C))},[C]),b.useEffect(()=>{N(String(k))},[k]),b.useEffect(()=>{q(R)},[R]),b.useEffect(()=>{ae(Object.fromEntries(RE.map(se=>[se,Iv($.bindings[se])])))},[$]),b.useEffect(()=>{t&&(EE(t)||e("/settings/general",{replace:!0}))},[e,t]),b.useEffect(()=>{if(m!=="changelog"||_)return;let se=!1;return a("loading"),p(null),TE().then(Rt=>{se||(h(Rt),a("success"))}).catch(Rt=>{se||(p(Rt instanceof Error?Rt.message:"Unable to load changelog."),a("error"))}),()=>{se=!0}},[_,m]);function ce(){const se=Number(K);if(!Number.isFinite(se)){W(String(C));return}M(se)}function we(){const se=Number(Z);if(!Number.isFinite(se)){N(String(k));return}L(se)}function Se(se,Rt){se.key==="Enter"&&(Rt(),se.currentTarget.blur())}function ke(se,Rt){se.key==="Enter"&&(Rt(),se.currentTarget.blur())}function Be(){j(I)}async function Ce(){try{oe(null),await n.socket.command({type:"settings.writeKeybindings",bindings:ME(A)})}catch(se){oe(se instanceof Error?se.message:"Unable to save keybindings.")}}async function Oe(se){const Rt={...A,[se]:Iv(to[se])};ae(Rt);try{oe(null),await n.socket.command({type:"settings.writeKeybindings",bindings:ME(Rt)})}catch(ue){oe(ue instanceof Error?ue.message:"Unable to save keybindings.")}}function bt(){pa=null,a("loading"),p(null),TE({force:!0}).then(se=>{h(se),a("success")}).catch(se=>{p(se instanceof Error?se.message:"Unable to load changelog."),a("error")})}const hn=I.replaceAll("{path}","/Users/jake/Projects/kanna/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),xt=du.find(se=>se.id===m)??du[0],zt=m==="keybindings"?oee(B):xt.subtitle,In=!_;return g.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[g.jsxs("div",{className:"flex min-w-0 flex-1",children:[g.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${In?"pb-[89px]":""}`,children:g.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[g.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),du.map(se=>g.jsx("button",{type:"button",onClick:()=>e(`/settings/${se.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${se.id===m?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx(se.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{children:se.label})]})},se.label))]})}),g.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[g.jsx("div",{className:"border-b border-border py-2 md:hidden",children:g.jsx("div",{className:"overflow-x-auto pr-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:g.jsxs("div",{className:"flex min-w-max items-center gap-2",children:[g.jsx("div",{className:" sticky left-0 bg-gradient-to-r from-background via-background/80 to-transparent px-2 py-1",children:g.jsx("button",{type:"button",onClick:n.openSidebar,className:"flex shrink-0 items-center p-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground","aria-label":"Open sidebar",title:"Open sidebar",children:g.jsx(cb,{className:"h-4 w-4 shrink-0"})})}),du.map(se=>g.jsxs("button",{type:"button",onClick:()=>e(`/settings/${se.id}`),className:ye("flex shrink-0 items-center gap-2 rounded-full border px-3 py-2 text-sm transition-colors",se.id===m?"border-transparent bg-muted font-medium text-foreground":"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[g.jsx(se.icon,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{className:"whitespace-nowrap",children:se.label})]},se.label))]})})}),g.jsxs("div",{className:"w-full px-4 pb-32 pt-8 md:px-6 md:pt-16",children:[_?g.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:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Mi,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:"Loading machine settings…"})]})}):g.jsxs("div",{className:"mx-auto max-w-4xl",children:[g.jsxs("div",{className:"pb-6",children:[g.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[g.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:xt.label}),m==="keybindings"?g.jsxs(xE,{onClick:()=>{n.handleOpenExternalPath("open_editor",B)},icon:g.jsx(ZR,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):null,m==="general"?g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(xE,{variant:ge.variant,onClick:()=>{if(ge.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:ge.disabled,icon:ge.kind==="check"?g.jsx(LP,{className:ye("size-3.5",ge.spinning&&"animate-spin")}):ge.kind==="update"?g.jsx(V6,{className:ye("size-3.5")}):void 0,children:ge.label})}):null]}),g.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:zt})]}),m==="general"?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"border-b border-border",children:[g.jsx(ss,{title:"Application Update",description:g.jsxs(g.Fragment,{children:[g.jsxs("span",{children:[ie,"."]}),J!=null&&J.lastCheckedAt?g.jsxs("span",{children:[" Last checked ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(J.lastCheckedAt),"."]}):null,J!=null&&J.error?g.jsxs("span",{children:[" ",J.error]}):null]}),bordered:!1,children:g.jsxs("div",{className:"text-right text-sm text-foreground",children:[g.jsxs("div",{children:["Current: ",(J==null?void 0:J.currentVersion)??w]}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(J==null?void 0:J.latestVersion)??"Unknown"]})]})}),g.jsx(ss,{title:"Theme",description:"Choose between light, dark, or system appearance",children:g.jsx(X5,{value:r,onValueChange:s,options:nee,size:"sm"})}),g.jsx(ss,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:g.jsxs(wE,{value:T,onValueChange:se=>D(se),children:[g.jsx(Vy,{className:"min-w-[180px]",children:g.jsx(kE,{})}),g.jsx(qy,{children:g.jsx(CE,{children:ree.map(se=>g.jsx(_f,{value:se.value,children:se.label},se.value))})})]})}),T==="custom"?g.jsx("div",{className:"border-t border-border",children:g.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[g.jsxs("div",{className:"min-w-0 max-w-xl",children:[g.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),g.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and ","{column}"," in your command."]})]}),g.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[g.jsx(ro,{type:"text",value:I,onChange:se=>q(se.target.value),onBlur:Be,onKeyDown:se=>ke(se,Be),className:"font-mono"}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview: ",g.jsx("span",{className:"font-mono",children:hn})]})]})]})}):null,g.jsx(ss,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:g.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[g.jsx(ro,{type:"number",min:wy,max:Cy,step:100,value:K,onChange:se=>W(se.target.value),onBlur:ce,onKeyDown:se=>Se(se,ce),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),g.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[wy,"-",Cy," lines",C===Vf?" (default)":""]})]})}),g.jsx(ss,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:g.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[g.jsx(ro,{type:"number",min:ky,max:Ey,step:10,value:Z,onChange:se=>N(se.target.value),onBlur:we,onKeyDown:se=>Se(se,we),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),g.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[ky,"-",Ey," px",k===qf?" (default)":""]})]})})]})}):m==="providers"?g.jsxs("div",{className:"border-b border-border",children:[g.jsx(ss,{title:"Default Provider",description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:g.jsxs(wE,{value:Y,onValueChange:se=>H(se),children:[g.jsx(Vy,{className:"min-w-[180px]",children:g.jsx(kE,{})}),g.jsx(qy,{children:g.jsxs(CE,{children:[g.jsx(_f,{value:"last_used",children:"Last Used"}),vu.map(se=>g.jsx(_f,{value:se.id,children:se.label},se.id))]})})]})}),g.jsx(ss,{title:"Claude Code Defaults",description:"Saved defaults when using Claude Code.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(j_,{availableProviders:vu,selectedProvider:"claude",showProviderPicker:!1,providerLocked:!0,model:z.claude.model,modelOptions:z.claude.modelOptions,onModelChange:(se,Rt)=>{P("claude",Rt)},onModelOptionChange:se=>{se.type==="claudeReasoningEffort"?U("claude",{reasoningEffort:se.effort}):se.type==="contextWindow"&&U("claude",{contextWindow:se.contextWindow})},planMode:z.claude.planMode,onPlanModeChange:se=>V("claude",se),includePlanMode:!0,className:"justify-start flex-wrap"})})}),g.jsx(ss,{title:"Codex Defaults",description:"Saved defaults when using Codex.",alignStart:!0,children:g.jsx("div",{className:"max-w-[420px]",children:g.jsx(j_,{availableProviders:vu,selectedProvider:"codex",showProviderPicker:!1,providerLocked:!0,model:z.codex.model,modelOptions:z.codex.modelOptions,onModelChange:(se,Rt)=>{P("codex",Rt)},onModelOptionChange:se=>{se.type==="codexReasoningEffort"?U("codex",{reasoningEffort:se.effort}):se.type==="fastMode"&&U("codex",{fastMode:se.fastMode})},planMode:z.codex.planMode,onPlanModeChange:se=>V("codex",se),includePlanMode:!0,className:"justify-start flex-wrap"})})})]}):m==="keybindings"?g.jsxs("div",{className:"border-b border-border",children:[fe?g.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:fe}):null,$.warning?g.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:$.warning}):null,RE.map((se,Rt)=>{const ue=Iv(to[se]),ve=A[se]??"",Le=ve!==ue;return g.jsx(ss,{title:PA[se],description:g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"Comma-separated shortcuts."}),Le?g.jsxs(g.Fragment,{children:[g.jsx("span",{children:" "}),g.jsxs("button",{type:"button",onClick:()=>{Oe(se)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",ue]})]}):null]}),bordered:Rt!==0,children:g.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:g.jsx(ro,{type:"text",value:ve,onChange:Ie=>{const Xe=Ie.target.value;ae(Ct=>({...Ct,[se]:Xe}))},onBlur:()=>{Ce()},onKeyDown:Ie=>ke(Ie,()=>{Ce()}),className:"font-mono"})})},se)})]}):g.jsx(hee,{status:l,releases:u,error:d,onRetry:bt})]}),n.commandError?g.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:[g.jsx(fP,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),g.jsx("span",{children:n.commandError})]}):null]})]})]}),In?g.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:g.jsx("div",{className:"px-6 py-[14.25px]",children:g.jsxs("div",{className:"grid gap-3 text-xs text-muted-foreground grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Machine"}),g.jsx("div",{className:"text-foreground/80",children:y})]}),g.jsxs("div",{className:"hidden md:block",children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Connection"}),g.jsx("div",{className:"text-foreground/80",children:n.connectionStatus})]}),g.jsxs("div",{className:"hidden md:block",children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"Projects Indexed"}),g.jsx("div",{className:"text-foreground/80",children:S})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 uppercase tracking-wide text-[11px] text-muted-foreground/80",children:"App Version"}),g.jsx("div",{className:"text-foreground/80",children:w})]})]})})}):null]})}function ME(e){return{toggleEmbeddedTerminal:Gc(e.toggleEmbeddedTerminal??""),toggleRightSidebar:Gc(e.toggleRightSidebar??""),openInFinder:Gc(e.openInFinder??""),openInEditor:Gc(e.openInEditor??""),addSplitTerminal:Gc(e.addSplitTerminal??"")}}function Zh(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function mee(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function gee(e,t){const n=mee(t);switch(e.toolKind){case"ask_user_question":{const s=Zh(n),l=Zh(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(l).map(([a,u])=>Array.isArray(u)?[a,u.map(h=>String(h))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[a,u.answers.map(h=>String(h))]:u==null||u===""?[a,[]]:[a,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Zh(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=Zh(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function jD(e){return new Date(e).toISOString()}function ti(e){return{id:e._id,messageId:e.messageId,timestamp:jD(e.createdAt),hidden:e.hidden}}function vee(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:jD(e.createdAt)}}function _ee(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function yee(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...ti(r),kind:"user_prompt",content:r.content});break;case"system_init":n.push({...ti(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({...ti(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...ti(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=vee(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 l=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?_ee(r)??r.content:r.content;s.hydrated.result=gee(s.normalized,l),s.hydrated.rawResult=l,s.hydrated.isError=r.isError}break}case"result":n.push({...ti(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...ti(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...ti(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...ti(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...ti(r),kind:"context_cleared"});break;case"interrupted":n.push({...ti(r),kind:"interrupted"});break;default:n.push({...ti(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const bee=["AskUserQuestion","ExitPlanMode","TodoWrite"],xee=new Set(["TodoWrite"]);function See(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 wee(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 Cee(e){const t={};for(const n of bee)t[n]=xee.has(n)?wee(e,n):See(e,n);return t}function kee(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function Eee(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const Ree=25e3,Tee=15e3,Mee=4e3;class Nee{constructor(t){on(this,"url");on(this,"ws",null);on(this,"started",!1);on(this,"reconnectTimer",null);on(this,"reconnectDelayMs",750);on(this,"subscriptions",new Map);on(this,"pending",new Map);on(this,"outboundQueue",[]);on(this,"statusListeners",new Set);on(this,"heartbeatTimer",null);on(this,"pingTimeoutTimer",null);on(this,"pingPromise",null);on(this,"lastOpenAt",0);on(this,"lastMessageAt",0);on(this,"reconnectImmediatelyOnClose",!1);on(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});on(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});on(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,r){const s=ov();return this.subscriptions.set(s,{topic:t,listener:n,eventListener:r}),this.enqueue({v:1,type:"subscribe",id:s,topic:t}),()=>{this.subscriptions.delete(s),this.enqueue({v:1,type:"unsubscribe",id:s})}}subscribeTerminal(t,n){const r=ov(),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=ov(),r={v:1,type:"command",id:n,command:t};return new Promise((s,l)=>{this.pending.set(n,{resolve:s,reject:l}),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(n8,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>=Ree}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()},Mee),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()},Tee))}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 Aee(e,t){var r;const n=e.find(s=>s.chats.some(l=>l.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function Dee(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Oee(){const e=b.useRef(null);return e.current||(e.current=new Nee(Dee())),b.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function hu(e,t){if(t===void 0){console.info(`[useKannaState] ${e}`);return}console.info(`[useKannaState] ${e}`,t)}function Lee(e){return e<24}function jee(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"navigate_changelog":"none"}const zee=320,z0="kanna:ui-update-restart";function Pee(){return window.sessionStorage.getItem(z0)}function NE(e){window.sessionStorage.setItem(z0,e)}function u_(){window.sessionStorage.removeItem(z0)}function Bee(e){const t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:"project_id",projectId:t}:e.fallbackLocalProjectPath?{kind:"local_path",localPath:e.fallbackLocalProjectPath}:null}function Iee(e,t){return!e||!t?null:e.runtime.chatId!==t?(hu("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function Hee(e){var Li,At,Dt;const t=Aa(),n=Oee(),r=fB(),[s,l]=b.useState({projectGroups:[]}),[a,u]=b.useState(null),[h,d]=b.useState(null),[p,m]=b.useState(null),[_,y]=b.useState(null),[S,w]=b.useState("connecting"),[C,k]=b.useState(!1),[T,R]=b.useState(!1),[M,L]=b.useState(!1),[D,j]=b.useState(null),[F,Y]=b.useState(!1),[z,H]=b.useState(!1),[P,U]=b.useState(148),[V,$]=b.useState(!0),[B,K]=b.useState(null),[W,Z]=b.useState(null),[N,I]=b.useState(null),q=KV(Hr(re=>re.editorPreset)),A=b.useRef(null),ae=b.useRef(null),fe=b.useRef(!1),oe=b.useRef(null);b.useEffect(()=>n.onStatus(w),[n]),b.useEffect(()=>n.subscribe({type:"sidebar"},re=>{l(re),k(!0),K(null)}),[n]),b.useEffect(()=>n.subscribe({type:"local-projects"},re=>{u(re),R(!0),K(null)}),[n]),b.useEffect(()=>n.subscribe({type:"update"},re=>{d(re),K(null)}),[n]),b.useEffect(()=>{S==="connected"&&n.command({type:"update.check",force:!0}).catch(re=>{K(re instanceof Error?re.message:String(re))})},[S,n]),b.useEffect(()=>{const re=Pee(),_e=jee(re,S);if(_e==="awaiting_reconnect"){NE("awaiting_reconnect");return}_e==="navigate_changelog"&&(u_(),t("/settings/changelog",{replace:!0}))},[S,t]),b.useEffect(()=>{function re(){h!=null&&h.lastCheckedAt&&(Date.now()-h.lastCheckedAt<=3600*1e3||n.command({type:"update.check"}).catch(_e=>{K(_e instanceof Error?_e.message:String(_e))}))}return window.addEventListener("focus",re),()=>{window.removeEventListener("focus",re)}},[n,h==null?void 0:h.lastCheckedAt]),b.useEffect(()=>n.subscribe({type:"keybindings"},re=>{y(re),K(null)}),[n]),b.useEffect(()=>{if(!e){hu("clearing chat snapshot for non-chat route"),m(null),L(!0);return}return hu("subscribing to chat",{activeChatId:e}),m(null),L(!1),n.subscribe({type:"chat",chatId:e},re=>{hu("chat snapshot received",{activeChatId:e,snapshotChatId:(re==null?void 0:re.runtime.chatId)??null,snapshotProvider:(re==null?void 0:re.runtime.provider)??null,snapshotStatus:(re==null?void 0:re.runtime.status)??null}),m(re),L(!0),K(null)})},[e,n]),b.useEffect(()=>{if(D)return;const re=s.projectGroups[0];re&&j(re.groupKey)},[D,s.projectGroups]),b.useEffect(()=>{if(!e||!C||!M)return;if(s.projectGroups.some(_e=>_e.chats.some(Ue=>Ue.chatId===e))){N===e&&I(null);return}N!==e&&t("/")},[e,M,t,N,s.projectGroups,C]),b.useEffect(()=>{p&&(j(p.runtime.projectId),N===p.runtime.chatId&&I(null))},[p,N]),b.useEffect(()=>{fe.current=!1,oe.current!==null&&(window.cancelAnimationFrame(oe.current),oe.current=null),$(!0)},[e]),b.useEffect(()=>()=>{oe.current!==null&&window.cancelAnimationFrame(oe.current)},[]),b.useLayoutEffect(()=>{const re=ae.current;if(!re)return;const _e=new ResizeObserver(()=>{U(re.getBoundingClientRect().height)});return _e.observe(re),U(re.getBoundingClientRect().height),()=>_e.disconnect()},[]);const J=b.useMemo(()=>Iee(p,e),[e,p]);b.useEffect(()=>{hu("active snapshot resolved",{routeChatId:e,rawSnapshotChatId:(p==null?void 0:p.runtime.chatId)??null,rawSnapshotProvider:(p==null?void 0:p.runtime.provider)??null,activeSnapshotChatId:(J==null?void 0:J.runtime.chatId)??null,activeSnapshotProvider:(J==null?void 0:J.runtime.provider)??null,pendingChatId:N})},[e,J,p,N]);const ge=b.useMemo(()=>yee((J==null?void 0:J.messages)??[]),[J==null?void 0:J.messages]),ie=b.useMemo(()=>Cee(ge),[ge]),ce=(J==null?void 0:J.runtime)??null,we=(J==null?void 0:J.availableProviders)??vu,Se=Eee(ce==null?void 0:ce.status),ke=kee(ce==null?void 0:ce.status),Be=zee,Ce=!V&&ge.length>0,Oe=((Li=a==null?void 0:a.projects[0])==null?void 0:Li.localPath)??null,bt=(ce==null?void 0:ce.localPath)??Oe??((At=s.projectGroups[0])==null?void 0:At.localPath),hn=!!(D??(ce==null?void 0:ce.projectId)??((Dt=s.projectGroups[0])==null?void 0:Dt.groupKey)??Oe);b.useLayoutEffect(()=>{if(fe.current)return;const re=A.current;re&&(e&&!ce||(re.scrollTo({top:re.scrollHeight,behavior:"auto"}),oe.current!==null&&window.cancelAnimationFrame(oe.current),oe.current=window.requestAnimationFrame(()=>{const _e=A.current;_e&&(_e.scrollTo({top:_e.scrollHeight,behavior:"auto"}),oe.current=null)}),fe.current=!0))},[e,P,ge.length,ce]),b.useEffect(()=>{if(!fe.current||!V)return;const re=window.requestAnimationFrame(()=>{const _e=A.current;!_e||!V||_e.scrollTo({top:_e.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(re)},[e,P,V,ge.length,ce==null?void 0:ce.status]);function xt(){const re=A.current;if(!re)return;const _e=re.scrollHeight-re.scrollTop-re.clientHeight;$(Lee(_e))}function zt(re){const _e=A.current;$(!0),_e&&_e.scrollTo({top:_e.scrollHeight,behavior:re})}function In(){zt("smooth")}async function cr(re){ls.getState().initializeComposerForNewChat();const _e=await n.command({type:"chat.create",projectId:re});j(re),I(_e.chatId),t(`/chat/${_e.chatId}`),Y(!1),K(null)}async function Gr(re){return re.kind==="project_id"?{projectId:re.projectId}:re.kind==="local_path"?{projectId:(await n.command({type:"project.open",localPath:re.localPath})).projectId,localPath:re.localPath}:{projectId:(await n.command(re.project.mode==="new"?{type:"project.create",localPath:re.project.localPath,title:re.project.title}:{type:"project.open",localPath:re.project.localPath})).projectId,localPath:re.project.localPath}}async function se(re){try{const _e=re.kind==="project_id"?null:re.kind==="local_path"?re.localPath:re.project.localPath;_e&&Z(_e);const{projectId:Ue}=await Gr(re);await cr(Ue)}catch(_e){K(_e instanceof Error?_e.message:String(_e))}finally{Z(null)}}async function Rt(re){await se({kind:"project_id",projectId:re})}async function ue(re){await se({kind:"local_path",localPath:re})}async function ve(re){await se({kind:"project_request",project:re})}async function Le(re){try{await n.command({type:"update.check",force:re==null?void 0:re.force}),K(null)}catch(_e){K(_e instanceof Error?_e.message:String(_e))}}async function Ie(){try{const re=await n.command({type:"update.install"});if(!re.ok){u_(),K(null),await r.alert({title:re.userTitle??"Update failed",description:re.userMessage??"Kanna could not install the update. Try again later.",closeLabel:"OK"});return}if(re.ok&&re.action==="reload"){window.location.reload();return}re.ok&&re.action==="restart"&&NE("awaiting_disconnect"),K(null)}catch(re){u_(),K(re instanceof Error?re.message:String(re))}}async function Xe(re,_e){var Ue;try{let Ye=D??((Ue=s.projectGroups[0])==null?void 0:Ue.groupKey)??null;if(!e&&!Ye&&Oe&&(Ye=(await n.command({type:"project.open",localPath:Oe})).projectId,j(Ye)),!e&&!Ye)throw new Error("Open a project first");zt("auto");const lt=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Ye??void 0,provider:_e==null?void 0:_e.provider,content:re,model:_e==null?void 0:_e.model,modelOptions:_e==null?void 0:_e.modelOptions,planMode:_e==null?void 0:_e.planMode});!e&<.chatId&&(I(lt.chatId),t(`/chat/${lt.chatId}`)),K(null)}catch(Ye){throw K(Ye instanceof Error?Ye.message:String(Ye)),Ye}}async function Ct(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(re){K(re instanceof Error?re.message:String(re))}}async function Yn(re){if(await r.confirm({title:"Delete Chat",description:`Delete "${re.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:re.chatId}),re.chatId===e){const Ue=Aee(s.projectGroups,re.chatId);t(Ue?`/chat/${Ue}`:"/")}}catch(Ue){K(Ue instanceof Error?Ue.message:String(Ue))}}async function nn(re){const _e=s.projectGroups.find(lt=>lt.groupKey===re);if(!_e)return;const Ue=_e.localPath.split("/").filter(Boolean).pop()??_e.localPath;if(await r.confirm({title:"Remove",description:`Remove "${Ue}" from the sidebar? Existing chats will be removed from ${$n}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:re}),Qs.getState().clearProject(re),gf.getState().clearProject(re),(ce==null?void 0:ce.projectId)===re&&t("/"),K(null)}catch(lt){K(lt instanceof Error?lt.message:String(lt))}}async function Pt(re){var Ue,Ye;const _e=(ce==null?void 0:ce.localPath)??((Ue=a==null?void 0:a.projects[0])==null?void 0:Ue.localPath)??((Ye=s.projectGroups[0])==null?void 0:Ye.localPath);if(_e)try{await Xn({action:re,localPath:_e})}catch(lt){K(lt instanceof Error?lt.message:String(lt))}}async function Gt(re){try{await Xn({action:"open_editor",localPath:re.path,line:re.line,column:re.column})}catch(_e){K(_e instanceof Error?_e.message:String(_e))}}async function ot(re,_e){try{await Xn({action:re,localPath:_e})}catch(Ue){K(Ue instanceof Error?Ue.message:String(Ue))}}async function Xn(re){const _e=Hr.getState();K(null),await n.command({type:"system.openExternal",...re,editor:re.action==="open_editor"?{preset:_e.editorPreset,commandTemplate:_e.editorCommandTemplate}:void 0})}function Dn(){var _e;const re=Bee({selectedProjectId:D,sidebarProjectId:(_e=s.projectGroups[0])==null?void 0:_e.groupKey,fallbackLocalProjectPath:Oe});if(re){se(re);return}t("/")}async function Ka(re,_e,Ue){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{questions:_e,answers:Ue}})}catch(Ye){K(Ye instanceof Error?Ye.message:String(Ye))}}async function bs(re,_e,Ue,Ye){if(e){_e&&ls.getState().setComposerPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:re,result:{confirmed:_e,...Ue?{clearContext:!0}:{},...Ye?{message:Ye}:{}}})}catch(lt){K(lt instanceof Error?lt.message:String(lt))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:a,updateSnapshot:h,chatSnapshot:p,keybindings:_,connectionStatus:S,sidebarReady:C,localProjectsReady:T,commandError:B,startingLocalPath:W,sidebarOpen:F,sidebarCollapsed:z,scrollRef:A,inputRef:ae,messages:ge,latestToolIds:ie,runtime:ce,availableProviders:we,isProcessing:Se,canCancel:ke,transcriptPaddingBottom:Be,showScrollButton:Ce,navbarLocalPath:bt,editorLabel:q,hasSelectedProject:hn,openSidebar:()=>Y(!0),closeSidebar:()=>Y(!1),collapseSidebar:()=>H(!0),expandSidebar:()=>H(!1),updateScrollState:xt,scrollToBottom:In,handleCreateChat:Rt,handleOpenLocalProject:ue,handleCreateProject:ve,handleCheckForUpdates:Le,handleInstallUpdate:Ie,handleSend:Xe,handleCancel:Ct,handleDeleteChat:Yn,handleRemoveProject:nn,handleOpenExternal:Pt,handleOpenExternalPath:ot,handleOpenLocalLink:Gt,handleCompose:Dn,handleAskUserQuestion:Ka,handleExitPlanMode:bs}}const AE="kanna:last-seen-version";function Fee(e,t,n){return e==="/"&&!!t&&n!==t}function Uee(){const e=ui(),t=Aa(),n=YE(),r=Hee(n.chatId??null),s=e.pathname==="/",l=Tb.split("/")[1]??"unknown";return b.useEffect(()=>{const a=window.localStorage.getItem(AE),u=Fee(e.pathname,l,a);window.localStorage.setItem(AE,l),u&&t("/settings/changelog",{replace:!0})},[l,e.pathname,t]),g.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[g.jsx(IH,{data:r.sidebarData,activeChatId:r.activeChatId,connectionStatus:r.connectionStatus,ready:r.sidebarReady,open:r.sidebarOpen,collapsed:r.sidebarCollapsed,showMobileOpenButton:s,onOpen:r.openSidebar,onClose:r.closeSidebar,onCollapse:r.collapseSidebar,onExpand:r.expandSidebar,onCreateChat:a=>{r.handleCreateChat(a)},onDeleteChat:a=>{r.handleDeleteChat(a)},onRemoveProject:a=>{r.handleRemoveProject(a)},updateSnapshot:r.updateSnapshot,onInstallUpdate:()=>{r.handleInstallUpdate()}}),g.jsx(rL,{context:r})]})}function $ee(){return g.jsx(YI,{children:g.jsx(hB,{children:g.jsx(sL,{children:g.jsxs(aa,{element:g.jsx(Uee,{}),children:[g.jsx(aa,{path:"/",element:g.jsx(CJ,{})}),g.jsx(aa,{path:"/settings",element:g.jsx(nL,{to:"/settings/general",replace:!0})}),g.jsx(aa,{path:"/settings/:sectionId",element:g.jsx(pee,{})}),g.jsx(aa,{path:"/chat/:chatId",element:g.jsx(vJ,{})})]})})})})}const zD=document.getElementById("root");if(!zD)throw new Error("Missing #root");s4.createRoot(zD).render(g.jsx(b.StrictMode,{children:g.jsx(ML,{children:g.jsx(CV,{children:g.jsx($ee,{})})})}));
|